Advertisement
Guest User

old p

a guest
Jul 16th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.31 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include "MiscDefinitions.h"
  4. #include "ClientRecvProps.h"
  5. #include "offsets.h"
  6. #include "Vector.h"
  7. #include "MiscClasses.h"
  8. #include "Vector2D.h"
  9.  
  10. struct Vertex_t
  11. {
  12. Vector2D m_Position;
  13. Vector2D m_TexCoord;
  14.  
  15. Vertex_t() {}
  16. Vertex_t(const Vector2D &pos, const Vector2D &coord = Vector2D(0, 0))
  17. {
  18. m_Position = pos;
  19. m_TexCoord = coord;
  20. }
  21. void Init(const Vector2D &pos, const Vector2D &coord = Vector2D(0, 0))
  22. {
  23. m_Position = pos;
  24. m_TexCoord = coord;
  25. }
  26. };
  27.  
  28. typedef Vertex_t FontVertex_t;
  29.  
  30. class ISurface
  31. {
  32. public:
  33. void DrawSetColor(Color col)
  34. {
  35. typedef void(__thiscall* oDrawSetColor)(PVOID, Color);
  36. return call_vfunc< oDrawSetColor >(this, Offsets::VMT::Surface_DrawSetColorA)(this, col);
  37. }
  38.  
  39. void DrawSetColor(int r, int g, int b, int a)
  40. {
  41. typedef void(__thiscall* OriginalFn)(PVOID, int, int, int, int);
  42. call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_DrawSetColorB)(this, r, g, b, a);
  43. }
  44.  
  45. void DrawFilledRect(int x0, int y0, int x1, int y1)
  46. {
  47. typedef void(__thiscall* OriginalFn)(PVOID, int, int, int, int);
  48. call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_DrawFilledRect)(this, x0, y0, x1, y1);
  49. }
  50.  
  51. void DrawOutlinedRect(int x0, int y0, int x1, int y1)
  52. {
  53. typedef void(__thiscall* OriginalFn)(PVOID, int, int, int, int);
  54. call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_DrawOutlinedRect)(this, x0, y0, x1, y1);
  55. }
  56.  
  57. void DrawLine(int x0, int y0, int x1, int y1)
  58. {
  59. typedef void(__thiscall* OriginalFn)(PVOID, int, int, int, int);
  60. call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_DrawLine)(this, x0, y0, x1, y1);
  61. }
  62.  
  63. void DrawPolyLine(int *x, int *y, int count)
  64. {
  65. typedef void(__thiscall* OriginalFn)(PVOID, int *, int *, int);
  66. call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_DrawLine + 1)(this, x, y, count);
  67. }
  68.  
  69. void DrawSetTextFont(unsigned long font)
  70. {
  71. typedef void(__thiscall* OriginalFn)(PVOID, unsigned long);
  72. call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_DrawSetTextFont)(this, font);
  73. }
  74.  
  75. void DrawSetTextColor(int r, int g, int b, int a)
  76. {
  77. typedef void(__thiscall* OriginalFn)(PVOID, int, int, int, int);
  78. call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_DrawSetTextColorB)(this, r, g, b, a);
  79. }
  80.  
  81. void DrawSetTextColor(Color col)
  82. {
  83. typedef void(__thiscall* oDrawSetTextColor)(PVOID, Color);
  84. return call_vfunc< oDrawSetTextColor >(this, Offsets::VMT::Surface_DrawSetTextColorA)(this, col);
  85. }
  86.  
  87. void DrawSetTextPos(int x, int y)
  88. {
  89. typedef void(__thiscall* OriginalFn)(PVOID, int, int);
  90. call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_DrawSetTextPos)(this, x, y);
  91. }
  92.  
  93. void DrawPrintText(const wchar_t* text, int textLen)
  94. {
  95. typedef void(__thiscall* OriginalFn)(PVOID, const wchar_t*, int, int);
  96. call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_DrawPrintText)(this, text, textLen, 0);
  97. }
  98.  
  99. void DrawSetTexture(int textureID)
  100. {
  101. typedef void(__thiscall* oDrawSetTextColor)(PVOID, int);
  102. return call_vfunc< oDrawSetTextColor >(this, 38)(this, textureID);
  103. }
  104.  
  105. void DrawSetTextureRGBA(int textureID, unsigned char const* colors, int w, int h)
  106. {
  107. typedef void(__thiscall* oDrawSetTextColor)(PVOID, int, unsigned char const*, int, int);
  108. return call_vfunc< oDrawSetTextColor >(this, 37)(this, textureID, colors, w, h);
  109. }
  110.  
  111.  
  112. inline void DrawTexturedRect(int x, int y, int w, int h) {
  113. typedef void(__thiscall *OrigFn)(void *, int, int, int, int);
  114. call_vfunc<OrigFn>(this, 41)(this, x, y, w, h);
  115. }
  116.  
  117. int CreateNewTextureID(bool procedural)
  118. {
  119. typedef int(__thiscall* oDrawSetTextColor)(PVOID, bool);
  120. return call_vfunc< oDrawSetTextColor >(this, Offsets::VMT::Surface_CreateNewTextureID)(this, procedural);
  121. }
  122.  
  123. void DrawTexturedPolygon(int vtxCount, FontVertex_t *vtx, bool bClipVertices = true)
  124. {
  125. typedef void(__thiscall* oDrawSetTextColor)(PVOID, int, FontVertex_t*, bool);
  126. return call_vfunc< oDrawSetTextColor >(this, Offsets::VMT::Surface_DrawTexturedPolygon)(this, vtxCount, vtx, bClipVertices);
  127. }
  128.  
  129. unsigned long FontCreate()
  130. {
  131. typedef unsigned int(__thiscall* OriginalFn)(PVOID);
  132. return call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_FontCreate)(this);
  133. }
  134.  
  135. void SetFontGlyphSet(unsigned long font, const char* windowsFontName, int tall, int weight, int blur, int scanlines, int flags)
  136. {
  137. typedef void(__thiscall* OriginalFn)(PVOID, unsigned long, const char*, int, int, int, int, int, int, int);
  138. call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_SetFontGlyphSet)(this, font, windowsFontName, tall, weight, blur, scanlines, flags, 0, 0);
  139. }
  140.  
  141. void GetTextSize(unsigned long font, const wchar_t* text, int& wide, int& tall)
  142. {
  143. typedef void(__thiscall* OriginalFn)(PVOID, unsigned long, const wchar_t*, int&, int&);
  144. call_vfunc< OriginalFn >(this, Offsets::VMT::Surface_GetTextSize)(this, font, text, wide, tall);
  145. }
  146.  
  147. void DrawOutlinedCircle(int x, int y, int r, int seg)
  148. {
  149. typedef void(__thiscall* oDrawOutlinedCircle)(PVOID, int, int, int, int);
  150. return call_vfunc< oDrawOutlinedCircle >(this, Offsets::VMT::Surface_DrawOutlinedCircle)(this, x, y, r, seg);
  151. }
  152.  
  153. void SurfaceGetCursorPos(int &x, int &y)
  154. {
  155. typedef void(__thiscall* oSurfaceGetCursorPos)(PVOID, int&, int&);
  156. return call_vfunc< oSurfaceGetCursorPos >(this, Offsets::VMT::Surface_SurfaceGetCursorPos)(this, x, y);
  157. }
  158.  
  159. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement