Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef SDK_H
- #define SDK_H
- #pragma once
- #include "API.h"
- #include "Math.h"
- #include "Import.h"
- #include "CRC32.h"
- #include "checksum_md5.h"
- #include "dt_recv.h"
- #ifdef DrawText
- #undef DrawText
- #endif
- #ifdef CreateFont
- #undef CreateFont
- #endif
- #define TICK_INTERVAL (HL2::m_pGlobals->interval_per_tick)
- #define TIME_TO_TICKS( dt ) ( (int)( 0.5f + (float)(dt) / TICK_INTERVAL ) )
- #define TICKS_TO_TIME( t ) ( TICK_INTERVAL *( t ) )
- #define ROUND_TO_TICKS( t ) ( TICK_INTERVAL * TIME_TO_TICKS( t ) )
- #define TICK_NEVER_THINK (-1)
- enum
- {
- CHAR_TEX_ANTLION = 'A',
- CHAR_TEX_BLOODYFLESH = 'B',
- CHAR_TEX_CONCRETE = 'C',
- CHAR_TEX_DIRT = 'D',
- CHAR_TEX_EGGSHELL = 'E',
- CHAR_TEX_FLESH = 'F',
- CHAR_TEX_GRATE = 'G',
- CHAR_TEX_ALIENFLESH = 'H',
- CHAR_TEX_CLIP = 'I',
- CHAR_TEX_PLASTIC = 'L',
- CHAR_TEX_METAL = 'M',
- CHAR_TEX_SAND = 'N',
- CHAR_TEX_FOLIAGE = 'O',
- CHAR_TEX_COMPUTER = 'P',
- CHAR_TEX_SLOSH = 'S',
- CHAR_TEX_TILE = 'T',
- CHAR_TEX_VENT = 'V',
- CHAR_TEX_WOOD = 'W',
- CHAR_TEX_GLASS = 'Y',
- CHAR_TEX_WARPSHIELD = 'Z'
- };
- enum
- {
- LIFE_ALIVE = 0,
- LIFE_DYING,
- LIFE_DEAD
- };
- enum MoveType_t
- {
- MOVETYPE_NONE = 0,
- MOVETYPE_ISOMETRIC,
- MOVETYPE_WALK,
- MOVETYPE_STEP,
- MOVETYPE_FLY,
- MOVETYPE_FLYGRAVITY,
- MOVETYPE_VPHYSICS,
- MOVETYPE_PUSH,
- MOVETYPE_NOCLIP,
- MOVETYPE_LADDER,
- MOVETYPE_OBSERVER,
- MOVETYPE_CUSTOM,
- MOVETYPE_LAST = MOVETYPE_CUSTOM,
- MOVETYPE_MAX_BITS = 4
- };
- enum
- {
- FL_ONGROUND = (1 << 0),
- FL_DUCKING = (1 << 1)
- };
- enum
- {
- IN_ATTACK = (1 << 0),
- IN_JUMP = (1 << 1),
- IN_DUCK = (1 << 2),
- IN_FORWARD = (1 << 3),
- IN_BACK = (1 << 4),
- IN_USE = (1 << 5),
- IN_CANCEL = (1 << 6),
- IN_LEFT = (1 << 7),
- IN_RIGHT = (1 << 8),
- IN_MOVELEFT = (1 << 9),
- IN_MOVERIGHT = (1 << 10),
- IN_ATTACK2 = (1 << 11),
- IN_RUN = (1 << 12),
- IN_RELOAD = (1 << 13),
- IN_ALT1 = (1 << 14),
- IN_ALT2 = (1 << 15),
- IN_SCORE = (1 << 16),
- IN_SPEED = (1 << 17),
- IN_WALK = (1 << 18),
- IN_ZOOM = (1 << 19),
- IN_WEAPON1 = (1 << 20),
- IN_WEAPON2 = (1 << 21),
- IN_BULLRUSH = (1 << 22),
- IN_GRENADE1 = (1 << 23),
- IN_GRENADE2 = (1 << 24)
- };
- enum
- {
- MULTIPLAYER_BACKUP = 90
- };
- enum CSWeaponType
- {
- WEAPONTYPE_KNIFE = 0,
- WEAPONTYPE_PISTOL,
- WEAPONTYPE_SUBMACHINEGUN,
- WEAPONTYPE_RIFLE,
- WEAPONTYPE_SHOTGUN,
- WEAPONTYPE_SNIPER_RIFLE,
- WEAPONTYPE_MACHINEGUN,
- WEAPONTYPE_C4,
- WEAPONTYPE_GRENADE,
- WEAPONTYPE_UNKNOWN
- };
- enum CSWeaponID
- {
- WEAPON_NONE = 0,
- WEAPON_P228,
- WEAPON_GLOCK,
- WEAPON_SCOUT,
- WEAPON_HEGRENADE,
- WEAPON_XM1014,
- WEAPON_C4,
- WEAPON_MAC10,
- WEAPON_AUG,
- WEAPON_SMOKEGRENADE,
- WEAPON_ELITE,
- WEAPON_FIVESEVEN,
- WEAPON_UMP45,
- WEAPON_SG550,
- WEAPON_GALIL,
- WEAPON_FAMAS,
- WEAPON_USP,
- WEAPON_AWP,
- WEAPON_MP5NAVY,
- WEAPON_M249,
- WEAPON_M3,
- WEAPON_M4A1,
- WEAPON_TMP,
- WEAPON_G3SG1,
- WEAPON_FLASHBANG,
- WEAPON_DEAGLE,
- WEAPON_SG552,
- WEAPON_AK47,
- WEAPON_KNIFE,
- WEAPON_P90,
- WEAPON_MAX
- };
- enum
- {
- FLOW_OUTGOING = 0,
- FLOW_INCOMING,
- MAX_FLOWS
- };
- enum TraceType_t
- {
- TRACE_EVERYTHING = 0,
- TRACE_WORLD_ONLY,
- TRACE_ENTITIES_ONLY,
- TRACE_EVERYTHING_FILTER_PROPS
- };
- enum
- {
- MAXSTUDIOSKINS = 32,
- MAXSTUDIOBONES = 128
- };
- enum
- {
- BONE_USED_BY_HITBOX = 256
- };
- 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)
- };
- enum ClientFrameStage_t
- {
- 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
- };
- struct player_info_t;
- struct Ray_t;
- struct cplane_t;
- struct csurface_t;
- struct mstudiobone_t;
- struct mstudiobbox_t;
- struct mstudiohitboxset_t;
- struct studiohdr_t;
- struct model_t;
- struct surfacephysicsparams_t;
- struct surfaceaudioparams_t;
- struct surfacesoundnames_t;
- struct surfacesoundhandles_t;
- struct surfacegameprops_t;
- struct surfacedata_t;
- struct ModelRenderInfo_t;
- class IHandleEntity;
- class ICollideable;
- class IClientNetworkable;
- class IClientRenderable;
- class C_BaseEntity;
- class C_BaseAnimating;
- class C_BaseCombatCharacter;
- class C_BasePlayer;
- class C_CSPlayer;
- class C_BaseCombatWeapon;
- class C_WeaponCSBase;
- class CGlobalVarsBase;
- class ClientClass;
- class IBaseClientDLL;
- class CUserCmd;
- class CInput;
- class IClientEntityList;
- class IMoveHelper;
- class CMoveData;
- class IPrediction;
- class IGameMovement;
- class INetChannelInfo;
- class IVEngineClient;
- class ConVar;
- class ICvar;
- class CBaseTrace;
- class CGameTrace;
- class ITraceFilter;
- class CTraceFilter;
- class CTraceFilterSimple;
- class CTraceFilterSkipTwoEntities;
- class IEngineTrace;
- class IVModelInfoClient;
- class IPhysicsSurfaceProps;
- class IVRenderView;
- class IMaterial;
- class IMaterialSystem;
- class IVModelRender;
- class IPanel;
- class ISurface;
- class IGameEvent;
- class IGameEventListener2;
- class IGameEventManager2;
- typedef unsigned long CBaseHandle;
- typedef CGameTrace trace_t;
- typedef unsigned short MaterialHandle_t;
- typedef unsigned short ModelInstanceHandle_t;
- typedef unsigned int VPANEL;
- typedef unsigned long HFont;
- typedef void* (*CreateInterfaceFn)(const char*, int*);
- typedef void (__thiscall* CreateMoveFn)(void*, int, float, bool);
- typedef void (__thiscall* FrameStageNotifyFn)(void*, ClientFrameStage_t);
- typedef void (__thiscall* ResetMouseFn)(void*);
- typedef bool (__thiscall* InPredictionFn)(void*);
- typedef void (__thiscall* RunCommandFn)(void*, C_BasePlayer*, CUserCmd*, IMoveHelper*);
- typedef void (__thiscall* _UpdateFn)(void*, bool, bool, int, int);
- typedef int (__thiscall* DrawModelExFn)(void*, ModelRenderInfo_t&);
- typedef void (__thiscall* PaintTraverseFn)(void*, VPANEL, bool, bool);
- enum
- {
- INDEX_GETUSERCMD = 8,
- INDEX_CREATEMOVE = 18,
- INDEX_INPREDICTION = 16,
- INDEX_RUNCOMMAND = 19,
- INDEX__UPDATE = 23,
- INDEX_RESETMOUSE = 23,
- INDEX_FRAMESTAGENOTIFY = 32,
- INDEX_DRAWMODELEX = 19,
- INDEX_PAINTTRAVERSE = 40
- };
- class CGlobalVarsBase
- {
- public:
- float realtime;
- int framecount;
- float absoluteframetime;
- float curtime;
- float frametime;
- int maxClients;
- int tickcount;
- float interval_per_tick;
- float interpolation_amount;
- };
- class ClientClass
- {
- public:
- void* m_pCreateFn;
- void* m_pCreateEventFn;
- const char* m_pNetworkName;
- RecvTable* m_pRecvTable;
- ClientClass* m_pNext;
- int m_ClassID;
- };
- class IBaseClientDLL
- {
- public:
- ClientClass* GetAllClasses()
- {
- typedef ClientClass* (__thiscall* GetAllClassesFn)(void*);
- return GetMethod<GetAllClassesFn>(this, 5)(this);
- }
- };
- class CUserCmd
- {
- public:
- virtual ~CUserCmd() {};
- int command_number;
- int tick_count;
- Vector3 viewangles;
- float forwardmove;
- float sidemove;
- float upmove;
- int buttons;
- byte impulse;
- int weaponselect;
- int weaponsubtype;
- int random_seed;
- short mousedx;
- short mousedy;
- bool hasbeenpredicted;
- };
- class CInput
- {
- public:
- unsigned char __pad0[0xC4];
- CUserCmd* m_pCommands;
- };
- class IClientEntityList
- {
- public:
- C_BaseEntity* GetClientEntity(int entnum)
- {
- typedef C_BaseEntity* (__thiscall* GetClientEntityFn)(void*, int);
- return GetMethod<GetClientEntityFn>(this, 3)(this, entnum);
- }
- C_BaseEntity* GetClientEntityFromHandle(CBaseHandle hEnt)
- {
- typedef C_BaseEntity* (__thiscall* GetClientEntityFromHandleFn)(void*, CBaseHandle);
- return GetMethod<GetClientEntityFromHandleFn>(this, 4)(this, hEnt);
- }
- int GetHighestEntityIndex()
- {
- typedef int(__thiscall* GetHighestEntityIndexFn)(void*);
- return GetMethod<GetHighestEntityIndexFn>(this, 6)(this);
- }
- };
- class CMoveData
- {
- public:
- unsigned char __pad0[0xFF];
- };
- class IPrediction
- {
- public:
- void SetupMove(C_BasePlayer* player, CUserCmd* ucmd, IMoveHelper* pHelper, CMoveData* move)
- {
- typedef void(__thiscall* SetupMoveFn)(void*, C_BasePlayer*, CUserCmd*, IMoveHelper*, CMoveData*);
- GetMethod<SetupMoveFn>(this, 20)(this, player, ucmd, pHelper, move);
- }
- void FinishMove(C_BasePlayer* player, CUserCmd* ucmd, CMoveData* move)
- {
- typedef void(__thiscall* FinishMoveFn)(void*, C_BasePlayer*, CUserCmd*, CMoveData*);
- GetMethod<FinishMoveFn>(this, 21)(this, player, ucmd, move);
- }
- };
- class IGameMovement
- {
- public:
- void ProcessMovement(C_BasePlayer* pPlayer, CMoveData* pMove)
- {
- typedef void(__thiscall* ProcessMovementFn)(void*, C_BasePlayer*, CMoveData*);
- GetMethod<ProcessMovementFn>(this, 1)(this, pPlayer, pMove);
- }
- };
- struct player_info_t
- {
- char name[32];
- int userID;
- char guid[33];
- unsigned int friendsID;
- char friendsName[32];
- bool fakeplayer;
- bool ishltv;
- unsigned long customFiles[4];
- unsigned char filesDownloaded;
- };
- class INetChannelInfo
- {
- public:
- float GetLatency(int flow)
- {
- typedef float(__thiscall* GetLatencyFn)(void*, int);
- return GetMethod<GetLatencyFn>(this, 9)(this, flow);
- }
- float GetAvgLatency(int flow)
- {
- typedef float(__thiscall* GetAvgLatencyFn)(void*, int);
- return GetMethod< GetAvgLatencyFn >(this, 10)(this, flow);
- }
- };
- class IVEngineClient
- {
- public:
- void GetScreenSize(int& width, int& height)
- {
- typedef void(__thiscall* GetScreenSizeFn)(void*, int&, int&);
- GetMethod<GetScreenSizeFn>(this, 5)(this, width, height);
- }
- void ClientCmd(const char* szCmdString)
- {
- typedef void(__thiscall* ClientCmdFn)(void*, const char*);
- GetMethod<ClientCmdFn>(this, 7)(this, szCmdString);
- }
- bool GetPlayerInfo(int ent_num, player_info_t* pinfo)
- {
- typedef bool(__thiscall* GetPlayerInfoFn)(void*, int, player_info_t*);
- return GetMethod<GetPlayerInfoFn>(this, 8)(this, ent_num, pinfo);
- }
- int GetPlayerForUserID(int userID)
- {
- typedef int(__thiscall* GetPlayerForUserIDFn)(void*, int);
- return GetMethod<GetPlayerForUserIDFn>(this, 9)(this, userID);
- }
- bool Con_IsVisible()
- {
- typedef bool(__thiscall* Con_IsVisibleFn)(void*);
- return GetMethod<Con_IsVisibleFn>(this, 11)(this);
- }
- int GetLocalPlayer()
- {
- typedef int(__thiscall* GetLocalPlayerFn)(void*);
- return GetMethod<GetLocalPlayerFn>(this, 12)(this);
- }
- void GetViewAngles(Vector3& va)
- {
- typedef void(__thiscall* GetViewAnglesFn)(void*, Vector3&);
- GetMethod<GetViewAnglesFn>(this, 19)(this, va);
- }
- void SetViewAngles(Vector3& va)
- {
- typedef void(__thiscall* SetViewAnglesFn)(void*, Vector3&);
- GetMethod<SetViewAnglesFn>(this, 20)(this, va);
- }
- int GetMaxClients()
- {
- typedef int(__thiscall* GetMaxClientsFn)(void*);
- return GetMethod<GetMaxClientsFn>(this, 21)(this);
- }
- bool IsInGame()
- {
- typedef bool(__thiscall* IsInGameFn)(void*);
- return GetMethod<IsInGameFn>(this, 26)(this);
- }
- bool IsConnected()
- {
- typedef bool(__thiscall* IsConnectedFn)(void*);
- return GetMethod<IsConnectedFn>(this, 27)(this);
- }
- bool IsDrawingLoadingImage()
- {
- typedef bool(__thiscall* IsDrawingLoadingImageFn)(void*);
- return GetMethod<IsDrawingLoadingImageFn>(this, 28)(this);
- }
- const VMatrix& WorldToScreenMatrix()
- {
- typedef const VMatrix& (__thiscall* WorldToScreenMatrixFn)(void*);
- return GetMethod<WorldToScreenMatrixFn>(this, 38)(this);
- }
- INetChannelInfo* GetNetChannelInfo()
- {
- typedef INetChannelInfo* (__thiscall* GetNetChannelInfoFn)(void*);
- return GetMethod<GetNetChannelInfoFn>(this, 72)(this);
- }
- bool IsTakingScreenshot()
- {
- typedef bool(__thiscall* IsTakingScreenshotFn)(void*);
- return GetMethod<IsTakingScreenshotFn>(this, 80)(this);
- }
- };
- class ConVar
- {
- public:
- float GetFloat()
- {
- return m_fValue;
- }
- int GetInt()
- {
- return m_nValue;
- }
- bool GetBool()
- {
- return !!GetInt();
- }
- void SetValue(const char* value)
- {
- typedef void(__thiscall* SetValueFn)(void*, const char*);
- GetMethod<SetValueFn>(this, 11)(this, value);
- }
- void SetValue(float value)
- {
- typedef void(__thiscall* SetValueFn)(void*, float);
- GetMethod<SetValueFn>(this, 10)(this, value);
- }
- void SetValue(int value)
- {
- typedef void(__thiscall* SetValueFn)(void*, int);
- GetMethod<SetValueFn>(this, 9)(this, value);
- }
- private:
- unsigned char __pad0[0x28];
- float m_fValue;
- int m_nValue;
- };
- class ICvar
- {
- public:
- ConVar* FindVar(const char* var_name)
- {
- typedef ConVar* (__thiscall* FindVarFn)(void*, const char*);
- return GetMethod<FindVarFn>(this, 7)(this, var_name);
- }
- };
- struct Ray_t
- {
- Vector3 m_Start;
- Vector3 m_Delta;
- Vector3 m_StartOffset;
- Vector3 m_Extents;
- bool m_IsRay;
- bool m_IsSwept;
- void Init(Vector3 const& start, Vector3 const& end)
- {
- m_Delta = end - start;
- m_IsSwept = (m_Delta.LengthSqr() != 0);
- m_Extents.x = m_Extents.y = m_Extents.z = 0.0f;
- m_IsRay = true;
- m_StartOffset.x = m_StartOffset.y = m_StartOffset.z = 0.0f;
- m_Start = start;
- }
- void Init(Vector3 const& start, Vector3 const& end, Vector3 const& mins, Vector3 const& maxs)
- {
- m_Delta = end - start;
- m_IsSwept = (m_Delta.LengthSqr() != 0);
- m_Extents = maxs - mins;
- m_Extents *= 0.5f;
- m_IsRay = (m_Extents.LengthSqr() < 1e-6);
- m_StartOffset = mins + maxs;
- m_StartOffset *= 0.5f;
- m_Start = start + m_StartOffset;
- m_StartOffset *= -1.0f;
- }
- };
- struct cplane_t
- {
- Vector3 normal;
- float dist;
- byte type;
- byte signbits;
- byte pad[2];
- };
- class CBaseTrace
- {
- public:
- Vector3 startpos;
- Vector3 endpos;
- cplane_t plane;
- float fraction;
- int contents;
- unsigned short dispFlags;
- bool allsolid;
- bool startsolid;
- };
- struct csurface_t
- {
- const char* name;
- short surfaceProps;
- unsigned short flags;
- };
- class CGameTrace : public CBaseTrace
- {
- public:
- float fractionleftsolid;
- csurface_t surface;
- int hitgroup;
- short physicsbone;
- C_BaseEntity* m_pEnt;
- int hitbox;
- };
- class ITraceFilter
- {
- public:
- virtual bool ShouldHitEntity(IHandleEntity* pEntity, int contentsMask) = 0;
- virtual TraceType_t GetTraceType() const = 0;
- };
- class CTraceFilter : public ITraceFilter
- {
- public:
- virtual TraceType_t GetTraceType() const
- {
- return TRACE_EVERYTHING;
- }
- };
- class CTraceFilterSimple : public CTraceFilter
- {
- public:
- CTraceFilterSimple(const IHandleEntity* passentity, int collisionGroup)
- {
- m_pPassEnt = passentity;
- }
- virtual bool ShouldHitEntity(IHandleEntity* pHandleEntity, int contentsMask)
- {
- return !(pHandleEntity == m_pPassEnt);
- }
- private:
- const IHandleEntity* m_pPassEnt;
- };
- class CTraceFilterSkipTwoEntities : public CTraceFilter
- {
- public:
- CTraceFilterSkipTwoEntities(const IHandleEntity* passentity, const IHandleEntity* passentity2, int collisionGroup)
- {
- m_pPassEnt = passentity;
- m_pPassEnt2 = passentity2;
- }
- virtual bool ShouldHitEntity(IHandleEntity* pHandleEntity, int contentsMask)
- {
- return !(pHandleEntity == m_pPassEnt || pHandleEntity == m_pPassEnt2);
- }
- private:
- const IHandleEntity* m_pPassEnt;
- const IHandleEntity* m_pPassEnt2;
- };
- class IEngineTrace
- {
- public:
- int GetPointContents(const Vector3& vecAbsPosition, IHandleEntity** ppEntity = NULL)
- {
- typedef int(__thiscall* GetPointContentsFn)(void*, const Vector3&, IHandleEntity**);
- return GetMethod<GetPointContentsFn>(this, 0)(this, vecAbsPosition, ppEntity);
- }
- void TraceRay(const Ray_t& ray, unsigned int fMask, ITraceFilter* pTraceFilter, trace_t* pTrace)
- {
- typedef void(__thiscall* TraceRayFn)(void*, const Ray_t&, unsigned int, ITraceFilter*, trace_t*);
- GetMethod<TraceRayFn>(this, 4)(this, ray, fMask, pTraceFilter, pTrace);
- }
- };
- struct mstudiobone_t
- {
- int sznameindex;
- inline char* const pszName() const { return ((char*)this) + sznameindex; }
- int parent;
- int bonecontroller[6];
- Vector3 pos;
- float quat[4];
- Vector3 rot;
- Vector3 posscale;
- Vector3 rotscale;
- matrix3x4_t poseToBone;
- float qAlignment[4];
- int flags;
- int proctype;
- int procindex;
- mutable int physicsbone;
- inline void* pProcedure() const { if (procindex == 0) return NULL; else return (void*)(((byte*)this) + procindex); };
- int surfacepropidx;
- inline char* const pszSurfaceProp() const { return ((char*)this) + surfacepropidx; }
- int contents;
- int unused[8];
- };
- struct mstudiobbox_t
- {
- int bone;
- int group;
- Vector3 bbmin;
- Vector3 bbmax;
- int szhitboxnameindex;
- int unused[8];
- char* pszHitboxName()
- {
- if (szhitboxnameindex == 0)
- return "";
- return ((char*)this) + szhitboxnameindex;
- }
- };
- struct mstudiohitboxset_t
- {
- int sznameindex;
- inline char* const pszName() const { return ((char*)this) + sznameindex; }
- int numhitboxes;
- int hitboxindex;
- inline mstudiobbox_t* pHitbox(int i) const { return (mstudiobbox_t*)(((byte*)this) + hitboxindex) + i; };
- };
- struct studiohdr_t
- {
- int id;
- int version;
- long checksum;
- inline const char* pszName() const { return name; }
- char name[64];
- int length;
- Vector3 eyeposition;
- Vector3 illumposition;
- Vector3 hull_min;
- Vector3 hull_max;
- Vector3 view_bbmin;
- Vector3 view_bbmax;
- int flags;
- int numbones;
- int boneindex;
- inline mstudiobone_t* pBone(int i) const { return (mstudiobone_t*)(((byte*)this) + boneindex) + i; };
- int numbonecontrollers;
- int bonecontrollerindex;
- int numhitboxsets;
- int hitboxsetindex;
- mstudiohitboxset_t* pHitboxSet(int i) const
- {
- return (mstudiohitboxset_t*)(((byte*)this) + hitboxsetindex) + i;
- };
- inline mstudiobbox_t* pHitbox(int i, int set) const
- {
- mstudiohitboxset_t const* s = pHitboxSet(set);
- if (!s)
- return NULL;
- return s->pHitbox(i);
- };
- inline int iHitboxCount(int set) const
- {
- mstudiohitboxset_t const* s = pHitboxSet(set);
- if (!s)
- return 0;
- return s->numhitboxes;
- };
- int numlocalanim;
- int localanimindex;
- int numlocalseq;
- int localseqindex;
- mutable int activitylistversion;
- mutable int eventsindexed;
- int numtextures;
- int textureindex;
- };
- class IVModelInfoClient
- {
- public:
- const char* GetModelName(const model_t* model)
- {
- typedef const char* (__thiscall* GetModelNameFn)(void*, const model_t*);
- return GetMethod<GetModelNameFn>(this, 3)(this, model);
- }
- void GetModelMaterials(const model_t* model, int count, IMaterial** ppMaterial)
- {
- typedef void(__thiscall* GetModelMaterialsFn)(void*, const model_t*, int, IMaterial**);
- GetMethod<GetModelMaterialsFn>(this, 16)(this, model, count, ppMaterial);
- }
- studiohdr_t* GetStudiomodel(const model_t* mod)
- {
- typedef studiohdr_t* (__thiscall* GetStudiomodelFn)(void*, const model_t*);
- return GetMethod<GetStudiomodelFn>(this, 27)(this, mod);
- }
- };
- struct surfacephysicsparams_t
- {
- float friction;
- float elasticity;
- float density;
- float thickness;
- float dampening;
- };
- struct surfaceaudioparams_t
- {
- float reflectivity;
- float hardnessFactor;
- float roughnessFactor;
- float roughThreshold;
- float hardThreshold;
- float hardVelocityThreshold;
- };
- struct surfacesoundnames_t
- {
- unsigned short stepleft;
- unsigned short stepright;
- unsigned short impactSoft;
- unsigned short impactHard;
- unsigned short scrapeSmooth;
- unsigned short scrapeRough;
- unsigned short bulletImpact;
- unsigned short rolling;
- unsigned short breakSound;
- unsigned short strainSound;
- };
- struct surfacesoundhandles_t
- {
- short stepleft;
- short stepright;
- short impactSoft;
- short impactHard;
- short scrapeSmooth;
- short scrapeRough;
- short bulletImpact;
- short rolling;
- short breakSound;
- short strainSound;
- };
- struct surfacegameprops_t
- {
- float maxSpeedFactor;
- float jumpFactor;
- unsigned short material;
- unsigned char climbable;
- unsigned char pad;
- };
- struct surfacedata_t
- {
- surfacephysicsparams_t physics;
- surfaceaudioparams_t audio;
- surfacesoundnames_t sounds;
- surfacegameprops_t game;
- surfacesoundhandles_t soundhandles;
- };
- class IPhysicsSurfaceProps
- {
- public:
- surfacedata_t* GetSurfaceData(int surfaceDataIndex)
- {
- typedef surfacedata_t* (__thiscall* GetSurfaceDataFn)(void*, int);
- return GetMethod<GetSurfaceDataFn>(this, 5)(this, surfaceDataIndex);
- }
- };
- class IVRenderView
- {
- public:
- void SetBlend(float blend)
- {
- typedef void(__thiscall* SetBlendFn)(void*, float);
- GetMethod< SetBlendFn >(this, 4)(this, blend);
- }
- void SetColorModulation(float const* blend)
- {
- typedef void(__thiscall* SetColorModulationFn)(void*, float const*);
- GetMethod< SetColorModulationFn >(this, 6)(this, blend);
- }
- };
- class IMaterial
- {
- public:
- const char* GetName()
- {
- typedef const char* (__thiscall* GetNameFn)(void*);
- return GetMethod< GetNameFn >(this, 0)(this);
- }
- const char* GetTextureGroupName()
- {
- typedef const char* (__thiscall* GetTextureGroupNameFn)(void*);
- return GetMethod< GetTextureGroupNameFn >(this, 1)(this);
- }
- void IncrementReferenceCount()
- {
- typedef void(__thiscall* IncrementReferenceCountFn)(void*);
- GetMethod< IncrementReferenceCountFn >(this, 12)(this);
- }
- void AlphaModulate(float alpha)
- {
- typedef void(__thiscall* AlphaModulateFn)(void*, float);
- GetMethod< AlphaModulateFn >(this, 29)(this, alpha);
- }
- void ColorModulate(float r, float g, float b)
- {
- typedef void(__thiscall* ColorModulateFn)(void*, float, float, float);
- GetMethod< ColorModulateFn >(this, 30)(this, r, g, b);
- }
- void SetMaterialVarFlag(MaterialVarFlags_t flag, bool on)
- {
- typedef void(__thiscall* SetMaterialVarFlagFn)(void*, MaterialVarFlags_t, bool);
- GetMethod< SetMaterialVarFlagFn >(this, 31)(this, flag, on);
- }
- };
- class IMaterialSystem
- {
- public:
- MaterialHandle_t FirstMaterial()
- {
- typedef MaterialHandle_t(__thiscall* FirstMaterialFn)(void*);
- return GetMethod< FirstMaterialFn >(this, 23)(this);
- }
- MaterialHandle_t NextMaterial(MaterialHandle_t h)
- {
- typedef MaterialHandle_t(__thiscall* NextMaterialFn)(void*, MaterialHandle_t);
- return GetMethod< NextMaterialFn >(this, 24)(this, h);
- }
- MaterialHandle_t InvalidMaterial()
- {
- typedef MaterialHandle_t(__thiscall* InvalidMaterialFn)(void*);
- return GetMethod< InvalidMaterialFn >(this, 25)(this);
- }
- IMaterial* GetMaterial(MaterialHandle_t h)
- {
- typedef IMaterial* (__thiscall* GetMaterialFn)(void*, MaterialHandle_t);
- return GetMethod< GetMaterialFn >(this, 26)(this, h);
- }
- IMaterial* FindMaterial(const char* pMaterialName, const char* pTextureGroupName, bool complain = true, const char* pComplainPrefix = NULL)
- {
- typedef IMaterial* (__thiscall* FindMaterialFn)(void*, const char*, const char*, bool, const char*);
- return GetMethod< FindMaterialFn >(this, 27)(this, pMaterialName, pTextureGroupName, complain, pComplainPrefix);
- }
- };
- struct ModelRenderInfo_t
- {
- int flags;
- IClientRenderable* pRenderable;
- ModelInstanceHandle_t instance;
- int entity_index;
- const model_t* pModel;
- Vector3 origin;
- Vector3 angles;
- int skin;
- int body;
- int hitboxset;
- const matrix3x4_t* pModelToWorld;
- const matrix3x4_t* pLightingOffset;
- const Vector3* pLightingOrigin;
- ModelRenderInfo_t()
- {
- pModelToWorld = NULL;
- pLightingOffset = NULL;
- pLightingOrigin = NULL;
- }
- };
- class IVModelRender
- {
- public:
- void ForcedMaterialOverride(IMaterial* newMaterial)
- {
- typedef void(__thiscall* ForcedMaterialOverrideFn)(void*, IMaterial*);
- GetMethod< ForcedMaterialOverrideFn >(this, 1)(this, newMaterial);
- }
- };
- class IPanel
- {
- public:
- const char* GetName(VPANEL vguiPanel)
- {
- typedef const char* (__thiscall* GetNameFn)(void*, VPANEL);
- return GetMethod<GetNameFn>(this, 35)(this, vguiPanel);
- }
- };
- class ISurface
- {
- public:
- void DrawSetColor(int r, int g, int b, int a)
- {
- typedef void (__thiscall* DrawSetColorFn)(void*, int, int, int, int);
- GetMethod<DrawSetColorFn>(this, 11)(this, r, g, b, a);
- }
- void DrawFilledRect(int x0, int y0, int x1, int y1)
- {
- typedef void (__thiscall* DrawFilledRectFn)(void*, int, int, int, int);
- GetMethod<DrawFilledRectFn>(this, 12)(this, x0, y0, x1, y1);
- }
- void DrawLine(int x0, int y0, int x1, int y1)
- {
- typedef void (__thiscall* DrawLineFn)(void*, int, int, int, int);
- GetMethod<DrawLineFn>(this, 15)(this, x0, y0, x1, y1);
- }
- void DrawSetTextFont(HFont font)
- {
- typedef void (__thiscall* DrawSetTextFontFn)(void*, HFont);
- GetMethod<DrawSetTextFontFn>(this, 17)(this, font);
- }
- void DrawSetTextColor(int r, int g, int b, int a)
- {
- typedef void (__thiscall* DrawSetTextColorFn)(void*, int, int, int, int);
- GetMethod<DrawSetTextColorFn>(this, 19)(this, r, g, b, a);
- }
- void DrawSetTextPos(int x, int y)
- {
- typedef void (__thiscall* DrawSetTextPosFn)(void*, int, int);
- GetMethod<DrawSetTextPosFn>(this, 20)(this, x, y);
- }
- void DrawPrintText(const wchar_t* text, int textLen)
- {
- typedef void (__thiscall* DrawPrintTextFn)(void*, const wchar_t*, int, int);
- GetMethod<DrawPrintTextFn>(this, 22)(this, text, textLen, 0);
- }
- HFont CreateFont()
- {
- typedef HFont (__thiscall* CreateFontFn)(void*);
- return GetMethod<CreateFontFn>(this, 64)(this);
- }
- void SetFontGlyphSet(HFont font, const char* windowsFontName, int tall, int weight, int blur, int scanlines, int flags)
- {
- typedef void (__thiscall* SetFontGlyphSetFn)(void*, HFont, const char*, int, int, int, int, int);
- GetMethod<SetFontGlyphSetFn>(this, 65)(this, font, windowsFontName, tall, weight, blur, scanlines, flags);
- }
- void GetTextSize(HFont font, const wchar_t* text, int& wide, int& tall)
- {
- typedef void (__thiscall* GetTextSizeFn)(void*, HFont, const wchar_t*, int&, int&);
- GetMethod<GetTextSizeFn>(this, 72)(this, font, text, wide, tall);
- }
- };
- class IGameEvent
- {
- public:
- const char* GetName()
- {
- typedef const char* (__thiscall* GetNameFn)(void*);
- return GetMethod<GetNameFn>(this, 1)(this);
- }
- bool GetBool(const char* keyName = NULL, bool defaultValue = false)
- {
- typedef bool(__thiscall* GetBoolFn)(void*, const char*, bool);
- return GetMethod<GetBoolFn>(this, 5)(this, keyName, defaultValue);
- }
- int GetInt(const char* keyName = NULL, int defaultValue = 0)
- {
- typedef int(__thiscall* GetIntFn)(void*, const char*, int);
- return GetMethod<GetIntFn>(this, 6)(this, keyName, defaultValue);
- }
- float GetFloat(const char* keyName = NULL, float defaultValue = 0.0f)
- {
- typedef float(__thiscall* GetFloatFn)(void*, const char*, float);
- return GetMethod<GetFloatFn>(this, 7)(this, keyName, defaultValue);
- }
- const char* GetString(const char* keyName = NULL, const char* defaultValue = "")
- {
- typedef const char* (__thiscall* GetStringFn)(void*, const char*, const char*);
- return GetMethod<GetStringFn>(this, 8)(this, keyName, defaultValue);
- }
- };
- class IGameEventListener2
- {
- public:
- virtual ~IGameEventListener2() {};
- virtual void FireGameEvent(IGameEvent* event) = 0;
- };
- class IGameEventManager2
- {
- public:
- bool AddListener(IGameEventListener2* listener, const char* name, bool bServerSide)
- {
- typedef bool(__thiscall* AddListenerFn)(void*, IGameEventListener2*, const char*, bool);
- return GetMethod<AddListenerFn>(this, 3)(this, listener, name, bServerSide);
- }
- };
- #endif // SDK_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement