commit 5d3e60ddd39e9a4cf12b812184472c60a1e95085 Author: aixxe Date: Mon Dec 19 16:52:02 2016 +0000 Initial commit. * Beginning reconstruction of Source SDK. Signed-off-by: aixxe diff --git a/include/cstrike/Classes/CGlobalVarsBase.h b/include/cstrike/Classes/CGlobalVarsBase.h new file mode 100644 index 0000000..744705d --- /dev/null +++ b/include/cstrike/Classes/CGlobalVarsBase.h @@ -0,0 +1,23 @@ +#pragma once + +class CSaveRestoreData; + +class CGlobalVarsBase { + public: + float realtime; + int framecount; + float absoluteframetime; + float curtime; + float frametime; + int maxClients; + int tickcount; + float interval_per_tick; + float interpolation_amount; + int simTicksThisFrame; + int network_protocol; + CSaveRestoreData* pSaveData; + private: + bool m_bClient; + int nTimestampNetworkingBase; + int nTimestampRandomizeWindow; +}; \ No newline at end of file diff --git a/include/cstrike/Classes/CInput.h b/include/cstrike/Classes/CInput.h new file mode 100644 index 0000000..b2049b4 --- /dev/null +++ b/include/cstrike/Classes/CInput.h @@ -0,0 +1,10 @@ +#pragma once + +class CUserCmd; + +class CInput { + public: + CUserCmd* GetUserCmd(int index) { + return GetVirtualFunction(this, 8)(this, index); + } +}; \ No newline at end of file diff --git a/include/cstrike/Classes/CUserCmd.h b/include/cstrike/Classes/CUserCmd.h new file mode 100644 index 0000000..69e76c8 --- /dev/null +++ b/include/cstrike/Classes/CUserCmd.h @@ -0,0 +1,21 @@ +#pragma once + +class CUserCmd { + virtual ~CUserCmd() {}; + + public: + int command_number; + int tick_count; + QAngle viewangles; + float forwardmove; + float sidemove; + float upmove; + int buttons; + unsigned char impulse; + int weaponselect; + int weaponsubtype; + int random_seed; + short mousedx; + short mousedy; + bool hasbeenpredicted; +}; \ No newline at end of file diff --git a/include/cstrike/Classes/ClientClass.h b/include/cstrike/Classes/ClientClass.h new file mode 100644 index 0000000..1d376a8 --- /dev/null +++ b/include/cstrike/Classes/ClientClass.h @@ -0,0 +1,20 @@ +#pragma once + +class IClientNetworkable; +class RecvTable; + +typedef IClientNetworkable* (*CreateClientClassFn) (int, int); +typedef IClientNetworkable* (*CreateEventFn) (void); + +class ClientClass { + public: + CreateClientClassFn m_pCreateFn; + CreateEventFn m_pCreateEventFn; + + char* m_pNetworkName; + + RecvTable* m_pRecvTable; + ClientClass* m_pNext; + + int m_nClassID; +}; diff --git a/include/cstrike/Classes/Interface.h b/include/cstrike/Classes/Interface.h new file mode 100644 index 0000000..f1d4ecf --- /dev/null +++ b/include/cstrike/Classes/Interface.h @@ -0,0 +1,11 @@ +#pragma once + +typedef void* (*CreateInterfaceFn) (const char*, int*); +typedef void* (*InstantiateInterfaceFn) (); + +class InterfaceReg { + public: + InstantiateInterfaceFn m_CreateFn; + const char* m_pName; + InterfaceReg* m_pNext; +}; \ No newline at end of file diff --git a/include/cstrike/Classes/RecvTable.h b/include/cstrike/Classes/RecvTable.h new file mode 100644 index 0000000..c04d43d --- /dev/null +++ b/include/cstrike/Classes/RecvTable.h @@ -0,0 +1,67 @@ +#pragma once + +class RecvTable; +struct CRecvProxyData; + +typedef void (*RecvVarProxyFn) (const CRecvProxyData*, void*, void*); + +enum SendPropType: int { + DPT_Int = 0, + DPT_Float, + DPT_Vector, + DPT_VectorXY, + DPT_String, + DPT_Array, + DPT_DataTable, + DPT_Int64, + DPT_NUMSendPropTypes +}; + +class RecvProp { + public: + char* m_pVarName; + SendPropType m_RecvType; + int m_Flags; + int m_StringBufferSize; + bool m_bInsideArray; + const void* m_pExtraData; + RecvProp* m_pArrayProp; + void* m_ArrayLengthProxy; + void* m_ProxyFn; + void* m_DataTableProxyFn; + RecvTable* m_pDataTable; + int m_Offset; + int m_ElementStride; + int m_nElements; + const char* m_pParentArrayPropName; +}; + +class RecvTable { + public: + RecvProp* m_pProps; + int m_nProps; + void* m_pDecoder; + char* m_pNetTableName; + bool m_bInitialized; + bool m_bInMainList; +}; + +struct DVariant { + union { + float m_Float; + long m_Int; + char* m_pString; + void* m_pData; + float m_Vector[3]; + int64_t m_Int64; + }; + + int m_Type; +}; + +struct CRecvProxyData { + const RecvProp* m_pRecvProp; + DVariant m_Value; + int m_iElement; + int m_ObjectID; +}; \ No newline at end of file diff --git a/include/cstrike/Definitions/Buttons.h b/include/cstrike/Definitions/Buttons.h new file mode 100644 index 0000000..0e6408a --- /dev/null +++ b/include/cstrike/Definitions/Buttons.h @@ -0,0 +1,28 @@ +#pragma once + +#define IN_ATTACK (1 << 0) +#define IN_JUMP (1 << 1) +#define IN_DUCK (1 << 2) +#define IN_FORWARD (1 << 3) +#define IN_BACK (1 << 4) +#define IN_USE (1 << 5) +#define IN_CANCEL (1 << 6) +#define IN_LEFT (1 << 7) +#define IN_RIGHT (1 << 8) +#define IN_MOVELEFT (1 << 9) +#define IN_MOVERIGHT (1 << 10) +#define IN_ATTACK2 (1 << 11) +#define IN_RUN (1 << 12) +#define IN_RELOAD (1 << 13) +#define IN_ALT1 (1 << 14) +#define IN_ALT2 (1 << 15) +#define IN_SCORE (1 << 16) +#define IN_SPEED (1 << 17) +#define IN_WALK (1 << 18) +#define IN_ZOOM (1 << 19) +#define IN_WEAPON1 (1 << 20) +#define IN_WEAPON2 (1 << 21) +#define IN_BULLRUSH (1 << 22) +#define IN_GRENADE1 (1 << 23) +#define IN_GRENADE2 (1 << 24) +#define IN_ATTACK3 (1 << 25) \ No newline at end of file diff --git a/include/cstrike/Definitions/Flags.h b/include/cstrike/Definitions/Flags.h new file mode 100644 index 0000000..ef5f7e0 --- /dev/null +++ b/include/cstrike/Definitions/Flags.h @@ -0,0 +1,33 @@ +#pragma once + +#define FL_ONGROUND (1 << 0) +#define FL_DUCKING (1 << 1) +#define FL_WATERJUMP (1 << 3) +#define FL_ONTRAIN (1 << 4) +#define FL_INRAIN (1 << 5) +#define FL_FROZEN (1 << 6) +#define FL_ATCONTROLS (1 << 7) +#define FL_CLIENT (1 << 8) +#define FL_FAKECLIENT (1 << 9) +#define FL_INWATER (1 << 10) +#define FL_FLY (1 << 11) +#define FL_SWIM (1 << 12) +#define FL_CONVEYOR (1 << 13) +#define FL_NPC (1 << 14) +#define FL_GODMODE (1 << 15) +#define FL_NOTARGET (1 << 16) +#define FL_AIMTARGET (1 << 17) +#define FL_PARTIALGROUND (1 << 18) +#define FL_STATICPROP (1 << 19) +#define FL_GRAPHED (1 << 20) +#define FL_GRENADE (1 << 21) +#define FL_STEPMOVEMENT (1 << 22) +#define FL_DONTTOUCH (1 << 23) +#define FL_BASEVELOCITY (1 << 24) +#define FL_WORLDBRUSH (1 << 25) +#define FL_OBJECT (1 << 26) +#define FL_KILLME (1 << 27) +#define FL_ONFIRE (1 << 28) +#define FL_DISSOLVING (1 << 29) +#define FL_TRANSRAGDOLL (1 << 30) +#define FL_UNBLOCKABLE_BY_PLAYER (1 << 31) \ No newline at end of file diff --git a/include/cstrike/Interfaces/IBaseClientDLL.h b/include/cstrike/Interfaces/IBaseClientDLL.h new file mode 100644 index 0000000..b7c38e7 --- /dev/null +++ b/include/cstrike/Interfaces/IBaseClientDLL.h @@ -0,0 +1,29 @@ +#pragma once + +class ClientClass; + +enum ClientFrameStage_t: int { + FRAME_UNDEFINED = -1, + FRAME_START, + FRAME_NET_UPDATE_START, + FRAME_NET_UPDATE_POSTDATAUPDATE_START, + FRAME_NET_UPDATE_POSTDATAUPDATE_END, + FRAME_NET_UPDATE_END, + FRAME_RENDER_START, + FRAME_RENDER_END +}; + +class IBaseClientDLL { + public: + ClientClass* GetAllClasses() { + return GetVirtualFunction(this, 8)(this); + } + + void CreateMove(int sequence, float frametime, bool active) { + return GetVirtualFunction(this, 21)(this, sequence, frametime, active); + } + + void FrameStageNotify(ClientFrameStage_t stage) { + return GetVirtualFunction(this, 35)(this, stage); + } +}; \ No newline at end of file diff --git a/include/cstrike/Interfaces/IClientEntityList.h b/include/cstrike/Interfaces/IClientEntityList.h new file mode 100644 index 0000000..471b99b --- /dev/null +++ b/include/cstrike/Interfaces/IClientEntityList.h @@ -0,0 +1,19 @@ +#pragma once + +class CBaseHandle; +class IClientEntity; +class IClientNetworkable; +class IClientUnknown; + +class IClientEntityList { + public: + virtual IClientNetworkable* GetClientNetworkable(int entindex) = 0; + virtual IClientNetworkable* GetClientNetworkableFromHandle(CBaseHandle handle) = 0; + virtual IClientUnknown* GetClientUnknownFromHandle(CBaseHandle handle) = 0; + virtual IClientEntity* GetClientEntity(int entindex) = 0; + virtual IClientEntity* GetClientEntityFromHandle(CBaseHandle handle) = 0; + virtual int NumberOfEntities(bool include_non_networkable) = 0; + virtual int GetHighestEntityIndex(void) = 0; + virtual void SetMaxEntities(int max_entities) = 0; + virtual int GetMaxEntities() = 0; +}; \ No newline at end of file diff --git a/include/cstrike/Interfaces/ICvar.h b/include/cstrike/Interfaces/ICvar.h new file mode 100644 index 0000000..6f0ad5b --- /dev/null +++ b/include/cstrike/Interfaces/ICvar.h @@ -0,0 +1,12 @@ +#pragma once + +class ICvar { + public: + template void ConsoleColorPrintf(const Color& MsgColor, const char* Format, Values... Parameters) { + return GetVirtualFunction(this, 23)(this, MsgColor, Format, Parameters...); + } + + template void ConsoleDPrintf(const char* Format, Values... Parameters) { + return GetVirtualFunction(this, 24)(this, Format, Parameters...); + } +}; \ No newline at end of file diff --git a/include/cstrike/Interfaces/IGameEventManager2.h b/include/cstrike/Interfaces/IGameEventManager2.h new file mode 100644 index 0000000..0c00130 --- /dev/null +++ b/include/cstrike/Interfaces/IGameEventManager2.h @@ -0,0 +1,48 @@ +#pragma once + +#define EVENT_DEBUG_ID_INIT 42 +#define EVENT_DEBUG_ID_SHUTDOWN 13 + +class bf_read; +class bf_write; + +class IGameEvent { + public: + virtual ~IGameEvent() {}; + virtual const char* GetName() const = 0; + virtual bool IsReliable() const = 0; + virtual bool IsLocal() const = 0; + virtual bool IsEmpty(const char* key = 0) = 0; + virtual bool GetBool(const char* key = 0, bool default_value = false) = 0; + virtual int GetInt(const char* key = 0, int default_value = 0) = 0; + virtual float GetFloat(const char* key = 0, float default_value = 0.0f) = 0; + virtual const char* GetString(const char* key = 0, const char* default_value = "") = 0; + virtual void SetBool(const char* key, bool value) = 0; + virtual void SetInt(const char* key, int value) = 0; + virtual void SetFloat(const char* key, float value) = 0; + virtual void SetString(const char* key, const char* value) = 0; +}; + +class IGameEventListener2 { + public: + virtual ~IGameEventListener2() {}; + virtual void FireGameEvent(IGameEvent* event) = 0; + virtual int GetEventDebugID(void) = 0; +}; + +class IGameEventManager2 { + public: + virtual ~IGameEventManager2() {}; + virtual int LoadEventsFromFile(const char* filename) = 0; + virtual void Reset() = 0; + virtual bool AddListener(IGameEventListener2* listener, const char* name, bool serverside) = 0; + virtual bool FindListener(IGameEventListener2* listener, const char* name) = 0; + virtual void RemoveListener(IGameEventListener2* listener) = 0; + virtual IGameEvent* CreateEvent(const char* name, bool force = false) = 0; + virtual bool FireEvent(IGameEvent* event, bool dont_broadcast = false) = 0; + virtual bool FireEventClientSide(IGameEvent* event) = 0; + virtual IGameEvent* DuplicateEvent(IGameEvent* event) = 0; + virtual void FreeEvent(IGameEvent* event) = 0; + virtual bool SerializeEvent(IGameEvent* event, bf_write* buf) = 0; + virtual IGameEvent* UnserializeEvent(bf_read* buf) = 0; +}; \ No newline at end of file diff --git a/include/cstrike/Interfaces/ILauncherMgr.h b/include/cstrike/Interfaces/ILauncherMgr.h new file mode 100644 index 0000000..7c2eb38 --- /dev/null +++ b/include/cstrike/Interfaces/ILauncherMgr.h @@ -0,0 +1,36 @@ +#pragma once + +class CShowPixelsParams; + +typedef void* PseudoGLContextPtr; + +class ILauncherMgr { + public: + void PumpWindowsMessageLoop() { + return GetVirtualFunction(this, 15)(this); + } + + PseudoGLContextPtr GetMainContext() { + return GetVirtualFunction(this, 22)(this); + } + + PseudoGLContextPtr CreateExtraContext() { + return GetVirtualFunction(this, 24)(this); + } + + void DeleteContext(PseudoGLContextPtr context) { + return GetVirtualFunction(this, 27)(this, context); + } + + bool MakeContextCurrent(PseudoGLContextPtr context) { + return GetVirtualFunction(this, 26)(this, context); + } + + void PumpWindowsMessageLoop(CShowPixelsParams* params) { + return GetVirtualFunction(this, 29)(this, params); + } + + void* GetWindowRef() { + return GetVirtualFunction(this, 32)(this); + } +}; \ No newline at end of file diff --git a/include/cstrike/Interfaces/IMaterialSystem.h b/include/cstrike/Interfaces/IMaterialSystem.h new file mode 100644 index 0000000..22cb514 --- /dev/null +++ b/include/cstrike/Interfaces/IMaterialSystem.h @@ -0,0 +1,139 @@ +#pragma once + +#define TEXTURE_GROUP_LIGHTMAP "Lightmaps" +#define TEXTURE_GROUP_WORLD "World textures" +#define TEXTURE_GROUP_MODEL "Model textures" +#define TEXTURE_GROUP_VGUI "VGUI textures" +#define TEXTURE_GROUP_PARTICLE "Particle textures" +#define TEXTURE_GROUP_DECAL "Decal textures" +#define TEXTURE_GROUP_SKYBOX "SkyBox textures" +#define TEXTURE_GROUP_CLIENT_EFFECTS "ClientEffect textures" +#define TEXTURE_GROUP_OTHER "Other textures" +#define TEXTURE_GROUP_PRECACHED "Precached" +#define TEXTURE_GROUP_CUBE_MAP "CubeMap textures" +#define TEXTURE_GROUP_RENDER_TARGET "RenderTargets" +#define TEXTURE_GROUP_RUNTIME_COMPOSITE "Runtime Composite" +#define TEXTURE_GROUP_UNACCOUNTED "Unaccounted textures" +#define TEXTURE_GROUP_STATIC_VERTEX_BUFFER "Static Vertex" +#define TEXTURE_GROUP_STATIC_INDEX_BUFFER "Static Indices" +#define TEXTURE_GROUP_STATIC_VERTEX_BUFFER_DISP "Displacement Verts" +#define TEXTURE_GROUP_STATIC_VERTEX_BUFFER_COLOR "Lighting Verts" +#define TEXTURE_GROUP_STATIC_VERTEX_BUFFER_WORLD "World Verts" +#define TEXTURE_GROUP_STATIC_VERTEX_BUFFER_MODELS "Model Verts" +#define TEXTURE_GROUP_STATIC_VERTEX_BUFFER_OTHER "Other Verts" +#define TEXTURE_GROUP_DYNAMIC_INDEX_BUFFER "Dynamic Indices" +#define TEXTURE_GROUP_DYNAMIC_VERTEX_BUFFER "Dynamic Verts" +#define TEXTURE_GROUP_DEPTH_BUFFER "DepthBuffer" +#define TEXTURE_GROUP_VIEW_MODEL "ViewModel" +#define TEXTURE_GROUP_PIXEL_SHADERS "Pixel Shaders" +#define TEXTURE_GROUP_VERTEX_SHADERS "Vertex Shaders" +#define TEXTURE_GROUP_RENDER_TARGET_SURFACE "RenderTarget Surfaces" +#define TEXTURE_GROUP_MORPH_TARGETS "Morph Targets" + +enum MaterialVarFlags_t { + MATERIAL_VAR_DEBUG = (1 << 0), + MATERIAL_VAR_NO_DEBUG_OVERRIDE = (1 << 1), + MATERIAL_VAR_NO_DRAW = (1 << 2), + MATERIAL_VAR_USE_IN_FILLRATE_MODE = (1 << 3), + MATERIAL_VAR_VERTEXCOLOR = (1 << 4), + MATERIAL_VAR_VERTEXALPHA = (1 << 5), + MATERIAL_VAR_SELFILLUM = (1 << 6), + MATERIAL_VAR_ADDITIVE = (1 << 7), + MATERIAL_VAR_ALPHATEST = (1 << 8), + MATERIAL_VAR_MULTIPASS = (1 << 9), + MATERIAL_VAR_ZNEARER = (1 << 10), + MATERIAL_VAR_MODEL = (1 << 11), + MATERIAL_VAR_FLAT = (1 << 12), + MATERIAL_VAR_NOCULL = (1 << 13), + MATERIAL_VAR_NOFOG = (1 << 14), + MATERIAL_VAR_IGNOREZ = (1 << 15), + MATERIAL_VAR_DECAL = (1 << 16), + MATERIAL_VAR_ENVMAPSPHERE = (1 << 17), + MATERIAL_VAR_NOALPHAMOD = (1 << 18), + MATERIAL_VAR_ENVMAPCAMERASPACE = (1 << 19), + MATERIAL_VAR_BASEALPHAENVMAPMASK = (1 << 20), + MATERIAL_VAR_TRANSLUCENT = (1 << 21), + MATERIAL_VAR_NORMALMAPALPHAENVMAPMASK = (1 << 22), + MATERIAL_VAR_NEEDS_SOFTWARE_SKINNING = (1 << 23), + MATERIAL_VAR_OPAQUETEXTURE = (1 << 24), + MATERIAL_VAR_ENVMAPMODE = (1 << 25), + MATERIAL_VAR_SUPPRESS_DECALS = (1 << 26), + MATERIAL_VAR_HALFLAMBERT = (1 << 27), + MATERIAL_VAR_WIREFRAME = (1 << 28), + MATERIAL_VAR_ALLOWALPHATOCOVERAGE = (1 << 29), + MATERIAL_VAR_IGNORE_ALPHA_MODULATION = (1 << 30) +}; + +typedef unsigned short MaterialHandle_t; + +class KeyValues; + +class IMaterial { + public: + const char* GetName() { + return GetVirtualFunction(this, 0)(this); + } + + const char* GetTextureGroupName() { + return GetVirtualFunction(this, 1)(this); + } + + void IncrementReferenceCount() { + return GetVirtualFunction(this, 12)(this); + } + + void DecrementReferenceCount() { + return GetVirtualFunction(this, 13)(this); + } + + void AlphaModulate(float alpha) { + return GetVirtualFunction(this, 27)(this, alpha); + } + + void ColorModulate(float red, float green, float blue) { + return GetVirtualFunction(this, 28)(this, red, green, blue); + } + + void SetMaterialVarFlag(MaterialVarFlags_t flags, bool state) { + return GetVirtualFunction(this, 29)(this, flags, state); + } + + bool GetMaterialVarFlag(MaterialVarFlags_t flags) { + return GetVirtualFunction(this, 30)(this, flags); + } + + bool IsErrorMaterial() { + return GetVirtualFunction(this, 42)(this); + } +}; + +class IMaterialSystem { + public: + IMaterial* CreateMaterial(const char* name, KeyValues* keyvalues) { + return GetVirtualFunction(this, 70)(this, name, keyvalues); + } + + IMaterial* FindMaterial(char const* name, const char* group, bool complain = true, const char* complain_prefix = NULL) { + return GetVirtualFunction(this, 71)(this, name, group, complain, complain_prefix); + } + + bool IsMaterialLoaded(char const* name) { + return GetVirtualFunction(this, 72)(this, name); + } + + MaterialHandle_t FirstMaterial() { + return GetVirtualFunction(this, 73)(this); + } + + MaterialHandle_t NextMaterial(MaterialHandle_t material) { + return GetVirtualFunction(this, 74)(this, material); + } + + MaterialHandle_t InvalidMaterial() { + return GetVirtualFunction(this, 75)(this); + } + + IMaterial* GetMaterial(MaterialHandle_t material) { + return GetVirtualFunction(this, 76)(this, material); + } +}; \ No newline at end of file diff --git a/include/cstrike/Interfaces/IPanel.h b/include/cstrike/Interfaces/IPanel.h new file mode 100644 index 0000000..458fa8f --- /dev/null +++ b/include/cstrike/Interfaces/IPanel.h @@ -0,0 +1,14 @@ +#pragma once + +typedef unsigned long VPANEL; + +class IPanel { + public: + const char* GetName(VPANEL vpanel) { + return GetVirtualFunction(this, 37)(this, vpanel); + } + + void PaintTraverse(VPANEL vpanel, bool force_repaint, bool allow_force) { + GetVirtualFunction(this, 37)(this, vpanel, force_repaint, allow_force); + } +}; \ No newline at end of file diff --git a/include/cstrike/Interfaces/IVModelInfo.h b/include/cstrike/Interfaces/IVModelInfo.h new file mode 100644 index 0000000..a8cce2c --- /dev/null +++ b/include/cstrike/Interfaces/IVModelInfo.h @@ -0,0 +1,10 @@ +#pragma once + +class model_t; + +class IVModelInfoClient { + public: + const char* GetModelName(const model_t* model) { + return GetVirtualFunction(this, 4)(this, model); + } +}; \ No newline at end of file diff --git a/include/cstrike/Structures/Color.h b/include/cstrike/Structures/Color.h new file mode 100644 index 0000000..08cd2ba --- /dev/null +++ b/include/cstrike/Structures/Color.h @@ -0,0 +1,12 @@ +#pragma once + +struct Color { + Color(int r, int g, int b, int a = 255) { + value[0] = static_cast(r); + value[1] = static_cast(g); + value[2] = static_cast(b); + value[3] = static_cast(a); + } + + unsigned char value[4]; +}; \ No newline at end of file diff --git a/include/cstrike/Structures/Matrix.h b/include/cstrike/Structures/Matrix.h new file mode 100644 index 0000000..6d7cc00 --- /dev/null +++ b/include/cstrike/Structures/Matrix.h @@ -0,0 +1,23 @@ +#pragma once + +typedef float VMatrix[4][4]; + +class matrix3x4_t { + public: + matrix3x4_t() {}; + matrix3x4_t(float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23) { + m_flMatVal[0][0] = m00; m_flMatVal[0][1] = m01; m_flMatVal[0][2] = m02; m_flMatVal[0][3] = m03; + m_flMatVal[1][0] = m10; m_flMatVal[1][1] = m11; m_flMatVal[1][2] = m12; m_flMatVal[1][3] = m13; + m_flMatVal[2][0] = m20; m_flMatVal[2][1] = m21; m_flMatVal[2][2] = m22; m_flMatVal[2][3] = m23; + }; + + float* operator[](int i) { + return m_flMatVal[i]; + } + + const float* operator[](int i) const { + return m_flMatVal[i]; + } + + float m_flMatVal[3][4]; +}; \ No newline at end of file diff --git a/include/cstrike/Utilities/Virtuals.h b/include/cstrike/Utilities/Virtuals.h new file mode 100644 index 0000000..5736bc8 --- /dev/null +++ b/include/cstrike/Utilities/Virtuals.h @@ -0,0 +1,13 @@ +#pragma once + +inline void**& GetVirtualTable(void* baseclass) { + return *reinterpret_cast(baseclass); +} + +inline void* GetVirtualFunction(void* vftable, size_t index) { + return reinterpret_cast(GetVirtualTable(vftable)[index]); +} + +template inline Fn GetVirtualFunction(void* vftable, size_t index) { + return reinterpret_cast(GetVirtualTable(vftable)[index]); +} \ No newline at end of file