Add files via upload

This commit is contained in:
0TheSpy
2021-06-16 18:46:33 +03:00
committed by GitHub
parent d431a8007d
commit eca863c879
99 changed files with 18760 additions and 0 deletions

View File

@ -0,0 +1,84 @@
#ifndef IAPPSYSTEM_H
#define IAPPSYSTEM_H
#ifdef COMPILER_MSVC
#pragma once
#endif
#include "interface.h"
struct AppSystemInfo_t
{
const char* m_pModuleName;
const char* m_pInterfaceName;
};
enum InitReturnVal_t
{
INIT_FAILED = 0,
INIT_OK,
INIT_LAST_VAL,
};
enum AppSystemTier_t
{
APP_SYSTEM_TIER0 = 0,
APP_SYSTEM_TIER1,
APP_SYSTEM_TIER2,
APP_SYSTEM_TIER3,
APP_SYSTEM_TIER_OTHER,
};
abstract_class IAppSystem
{
public:
virtual bool Connect(CreateInterfaceFn factory) = 0;
virtual void Disconnect() = 0;
virtual void* QueryInterface(const char* pInterfaceName) = 0;
virtual InitReturnVal_t Init() = 0;
virtual void Shutdown() = 0;
virtual const AppSystemInfo_t* GetDependencies() { return NULL; }
virtual AppSystemTier_t GetTier() { return APP_SYSTEM_TIER_OTHER; }
virtual void Reconnect(CreateInterfaceFn factory, const char* pInterfaceName) {}
virtual bool IsSingleton() { return true; }
};
template< class IInterface >
class CBaseAppSystem : public IInterface
{
public:
virtual bool Connect(CreateInterfaceFn factory) { return true; }
virtual void Disconnect() {}
virtual void* QueryInterface(const char* pInterfaceName) { return NULL; }
virtual InitReturnVal_t Init() { return INIT_OK; }
virtual void Shutdown() {}
virtual const AppSystemInfo_t* GetDependencies() { return NULL; }
virtual AppSystemTier_t GetTier() { return APP_SYSTEM_TIER_OTHER; }
virtual void Reconnect(CreateInterfaceFn factory, const char* pInterfaceName);
};
template< class IInterface >
class CTier0AppSystem : public CBaseAppSystem< IInterface >
{
};
#endif

54
SpyCustom/sdk/IBorder.h Normal file
View File

@ -0,0 +1,54 @@
#ifndef IBORDER_H
#define IBORDER_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
class KeyValues;
namespace vgui
{
class IScheme;
class IBorder
{
public:
IBorder() {}
virtual ~IBorder() {}
virtual void Paint(VPANEL panel) = 0;
virtual void Paint(int x0, int y0, int x1, int y1) = 0;
virtual void Paint(int x0, int y0, int x1, int y1, int breakSide, int breakStart, int breakStop) = 0;
virtual void SetInset(int left, int top, int right, int bottom) = 0;
virtual void GetInset(int& left, int& top, int& right, int& bottom) = 0;
virtual void ApplySchemeSettings(IScheme* pScheme, KeyValues* inResourceData) = 0;
virtual const char* GetName() = 0;
virtual void SetName(const char* name) = 0;
enum backgroundtype_e
{
BACKGROUND_FILLED,
BACKGROUND_TEXTURED,
BACKGROUND_ROUNDEDCORNERS,
};
virtual backgroundtype_e GetBackgroundType() = 0;
enum sides_e
{
SIDE_LEFT = 0,
SIDE_TOP = 1,
SIDE_RIGHT = 2,
SIDE_BOTTOM = 3
};
virtual bool PaintFirst(void) = 0;
};
}
#endif

View File

@ -0,0 +1,52 @@
#if !defined( ICLIENTLEAFSYSTEM_H )
#define ICLIENTLEAFSYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include "platform.h"
#include "client_render_handle.h"
#include "ivmodelinfo.h"
#define CLIENTLEAFSYSTEM_INTERFACE_VERSION "ClientLeafSystem002"
enum RenderableModelType_t
{
RENDERABLE_MODEL_UNKNOWN_TYPE = -1,
RENDERABLE_MODEL_ENTITY = 0,
RENDERABLE_MODEL_STUDIOMDL,
RENDERABLE_MODEL_STATIC_PROP,
RENDERABLE_MODEL_BRUSH,
};
enum RenderGroup_t
{
RENDER_GROUP_OPAQUE = 0,
RENDER_GROUP_TRANSLUCENT,
RENDER_GROUP_TRANSLUCENT_IGNOREZ,
RENDER_GROUP_COUNT,
};
abstract_class IClientLeafSystemEngine
{
public:
virtual void CreateRenderableHandle(IClientRenderable* pRenderable, bool bRenderWithViewModels, RenderableTranslucencyType_t nType, RenderableModelType_t nModelType, UINT32 nSplitscreenEnabled = 0xFFFFFFFF) = 0;
virtual void RemoveRenderable(ClientRenderHandle_t handle) = 0;
virtual void AddRenderableToLeaves(ClientRenderHandle_t renderable, int nLeafCount, unsigned short* pLeaves) = 0;
virtual void SetTranslucencyType(ClientRenderHandle_t handle, RenderableTranslucencyType_t nType) = 0;
};
#endif

View File

@ -0,0 +1,71 @@
#ifndef ICLIENTPANEL_H
#define ICLIENTPANEL_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#ifdef GetClassName
#undef GetClassName
#endif
class KeyValues;
namespace vgui
{
class Panel;
class SurfaceBase;
enum EInterfaceID
{
ICLIENTPANEL_STANDARD_INTERFACE = 0,
};
class IClientPanel
{
public:
virtual VPANEL GetVPanel() = 0;
virtual void Think() = 0;
virtual void PerformApplySchemeSettings() = 0;
virtual void PaintTraverse(bool forceRepaint, bool allowForce) = 0;
virtual void Repaint() = 0;
virtual VPANEL IsWithinTraverse(int x, int y, bool traversePopups) = 0;
virtual void GetInset(int& top, int& left, int& right, int& bottom) = 0;
virtual void GetClipRect(int& x0, int& y0, int& x1, int& y1) = 0;
virtual void OnChildAdded(VPANEL child) = 0;
virtual void OnSizeChanged(int newWide, int newTall) = 0;
virtual void InternalFocusChanged(bool lost) = 0;
virtual bool RequestInfo(KeyValues* outputData) = 0;
virtual void RequestFocus(int direction) = 0;
virtual bool RequestFocusPrev(VPANEL existingPanel) = 0;
virtual bool RequestFocusNext(VPANEL existingPanel) = 0;
virtual void OnMessage(const KeyValues* params, VPANEL ifromPanel) = 0;
virtual VPANEL GetCurrentKeyFocus() = 0;
virtual int GetTabPosition() = 0;
virtual const char* GetName() = 0;
virtual const char* GetClassName() = 0;
virtual HScheme GetScheme() = 0;
virtual bool IsProportional() = 0;
virtual bool IsAutoDeleteSet() = 0;
virtual void DeletePanel() = 0;
virtual void* QueryInterface(EInterfaceID id) = 0;
virtual Panel* GetPanel() = 0;
virtual const char* GetModuleName() = 0;
virtual void OnTick() = 0;
};
}
#endif

View File

@ -0,0 +1,58 @@
#ifndef ENGINE_ICOLLIDEABLE_H
#define ENGINE_ICOLLIDEABLE_H
#ifdef _WIN32
#pragma once
#endif
enum SolidType_t;
class IHandleEntity;
struct Ray_t;
struct model_t;
class Vector;
class QAngle;
class CGameTrace;
typedef CGameTrace trace_t;
class IClientUnknown;
abstract_class ICollideable
{
public:
virtual IHandleEntity * GetEntityHandle() = 0;
virtual const Vector& OBBMinsPreScaled() const = 0;
virtual const Vector& OBBMaxsPreScaled() const = 0;
virtual const Vector& OBBMins() const = 0;
virtual const Vector& OBBMaxs() const = 0;
virtual void WorldSpaceTriggerBounds(Vector* pVecWorldMins, Vector* pVecWorldMaxs) const = 0;
virtual bool TestCollision(const Ray_t& ray, unsigned int fContentsMask, trace_t& tr) = 0;
virtual bool TestHitboxes(const Ray_t& ray, unsigned int fContentsMask, trace_t& tr) = 0;
virtual int GetCollisionModelIndex() = 0;
virtual const model_t* GetCollisionModel() = 0;
virtual const Vector& GetCollisionOrigin() const = 0;
virtual const QAngle& GetCollisionAngles() const = 0;
virtual const matrix3x4_t& CollisionToWorldTransform() const = 0;
virtual SolidType_t GetSolid() const = 0;
virtual int GetSolidFlags() const = 0;
virtual IClientUnknown* GetIClientUnknown() = 0;
virtual int GetCollisionGroup() const = 0;
virtual void WorldSpaceSurroundingBounds(Vector* pVecMins, Vector* pVecMaxs) = 0;
virtual bool ShouldTouchTrigger(int triggerSolidFlags) const = 0;
virtual const matrix3x4_t* GetRootParentToWorldTransform() const = 0;
};
#endif

View File

@ -0,0 +1,66 @@
#ifndef ICOLORCORRECTION_H
#define ICOLORCORRECTION_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "imageformat.h"
typedef unsigned int ColorCorrectionHandle_t;
struct ShaderColorCorrectionInfo_t;
#define COLORCORRECTION_INTERFACE_VERSION "COLORCORRECTION_VERSION_1"
abstract_class IColorCorrectionSystem
{
public:
virtual void Init() = 0;
virtual void Shutdown() = 0;
virtual ColorCorrectionHandle_t AddLookup(const char* pName) = 0;
virtual bool RemoveLookup(ColorCorrectionHandle_t handle) = 0;
virtual void SetLookupWeight(ColorCorrectionHandle_t handle, float flWeight) = 0;
virtual float GetLookupWeight(ColorCorrectionHandle_t handle) = 0;
virtual float GetLookupWeight(int i) = 0;
virtual void LockLookup() = 0;
virtual void LockLookup(ColorCorrectionHandle_t handle) = 0;
virtual void UnlockLookup() = 0;
virtual void UnlockLookup(ColorCorrectionHandle_t handle) = 0;
virtual void SetLookup(RGBX5551_t inColor, color24 outColor) = 0;
virtual void SetLookup(ColorCorrectionHandle_t handle, RGBX5551_t inColor, color24 outColor) = 0;
virtual color24 GetLookup(RGBX5551_t inColor) = 0;
virtual color24 GetLookup(ColorCorrectionHandle_t handle, RGBX5551_t inColor) = 0;
virtual void LoadLookup(const char* pLookupName) = 0;
virtual void LoadLookup(ColorCorrectionHandle_t handle, const char* pLookupName) = 0;
virtual void CopyLookup(const color24* pSrcColorCorrection) = 0;
virtual void CopyLookup(ColorCorrectionHandle_t handle, const color24* pSrcColorCorrection) = 0;
virtual void ResetLookup(ColorCorrectionHandle_t handle) = 0;
virtual void ResetLookup() = 0;
virtual void ReleaseTextures() = 0;
virtual void RestoreTextures() = 0;
virtual void ResetLookupWeights() = 0;
virtual int GetNumLookups() = 0;
virtual color24 ConvertToColor24(RGBX5551_t inColor) = 0;
virtual void SetResetable(ColorCorrectionHandle_t handle, bool bResetable) = 0;
virtual void EnableColorCorrection(bool bEnable) = 0;
virtual void GetCurrentColorCorrection(ShaderColorCorrectionInfo_t* pInfo) = 0;
};
#endif

52
SpyCustom/sdk/IEffects.h Normal file
View File

@ -0,0 +1,52 @@
#ifndef IEFFECTS_H
#define IEFFECTS_H
#ifdef _WIN32
#pragma once
#endif
#include "basetypes.h"
#include "vector.h"
#include "interface.h"
#include "ipredictionsystem.h"
enum ShakeCommand_t;
class Vector;
class CGameTrace;
typedef CGameTrace trace_t;
#define IEFFECTS_INTERFACE_VERSION "IEffects001"
abstract_class IEffects : public IPredictionSystem
{
public:
virtual ~IEffects() {};
virtual void Beam(const Vector & Start, const Vector & End, int nModelIndex,
int nHaloIndex, unsigned char frameStart, unsigned char frameRate,
float flLife, unsigned char width, unsigned char endWidth, unsigned char fadeLength,
unsigned char noise, unsigned char red, unsigned char green,
unsigned char blue, unsigned char brightness, unsigned char speed) = 0;
virtual void Smoke(const Vector& origin, int modelIndex, float scale, float framerate) = 0;
virtual void Sparks(const Vector& position, int nMagnitude = 1, int nTrailLength = 1, const Vector* pvecDir = NULL) = 0;
virtual void Dust(const Vector& pos, const Vector& dir, float size, float speed) = 0;
virtual void MuzzleFlash(const Vector& vecOrigin, const Vector& vecAngles, float flScale, int iType) = 0;
virtual void MetalSparks(const Vector& position, const Vector& direction) = 0;
virtual void EnergySplash(const Vector& position, const Vector& direction, bool bExplosive = false) = 0;
virtual void Ricochet(const Vector& position, const Vector& direction) = 0;
virtual float Time() = 0;
virtual bool IsServer() = 0;
virtual void SuppressEffectsSounds(bool bSuppress) = 0;
};
#endif

View File

@ -0,0 +1,123 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Client-server neutral sound interface
//
// $NoKeywords: $
//=============================================================================//
#ifndef IENGINESOUND_H
#define IENGINESOUND_H
#ifdef _WIN32
#pragma once
#endif
#include "basetypes.h"
#include "interface.h"
#include "soundflags.h"
#include "irecipientfilter.h"
#include "utlvector.h"
#include "SndInfo.h"
//-----------------------------------------------------------------------------
// forward declaration
//-----------------------------------------------------------------------------
class Vector;
// Handy defines for EmitSound
#define SOUND_FROM_UI_PANEL -2 // Sound being played inside a UI panel on the client
#define SOUND_FROM_LOCAL_PLAYER -1
#define SOUND_FROM_WORLD 0
// These are used to feed a soundlevel to the sound system and have it use
// goldsrc-type attenuation. We should use this as little as possible and
// phase it out as soon as possible.
// Take a regular sndlevel and convert it to compatibility mode.
#define SNDLEVEL_TO_COMPATIBILITY_MODE( x ) ((soundlevel_t)(int)( (x) + 256 ))
// Take a compatibility-mode sndlevel and get the REAL sndlevel out of it.
#define SNDLEVEL_FROM_COMPATIBILITY_MODE( x ) ((soundlevel_t)(int)( (x) - 256 ))
// Tells if the given sndlevel is marked as compatibility mode.
#define SNDLEVEL_IS_COMPATIBILITY_MODE( x ) ( (x) >= soundlevel_t(256) )
//-----------------------------------------------------------------------------
// Client-server neutral effects interface
//-----------------------------------------------------------------------------
#define IENGINESOUND_CLIENT_INTERFACE_VERSION "IEngineSoundClient003"
#define IENGINESOUND_SERVER_INTERFACE_VERSION "IEngineSoundServer003"
abstract_class IEngineSound
{
public:
// Precache a particular sample
virtual bool PrecacheSound(const char* pSample, bool bPreload = false, bool bIsUISound = false) = 0;
virtual bool IsSoundPrecached(const char* pSample) = 0;
virtual void PrefetchSound(const char* pSample) = 0;
// Just loads the file header and checks for duration (not hooked up for .mp3's yet)
// Is accessible to server and client though
virtual float GetSoundDuration(const char* pSample) = 0;
// Pitch of 100 is no pitch shift. Pitch > 100 up to 255 is a higher pitch, pitch < 100
// down to 1 is a lower pitch. 150 to 70 is the realistic range.
// EmitSound with pitch != 100 should be used sparingly, as it's not quite as
// fast (the pitchshift mixer is not native coded).
// NOTE: setting iEntIndex to -1 will cause the sound to be emitted from the local
// player (client-side only)
virtual void EmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char* pSample,
float flVolume, float flAttenuation, int iFlags = 0, int iPitch = PITCH_NORM, int iSpecialDSP = 0,
const Vector* pOrigin = NULL, const Vector* pDirection = NULL, CUtlVector< Vector >* pUtlVecOrigins = NULL, bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1) = 0;
virtual void EmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char* pSample,
float flVolume, soundlevel_t iSoundlevel, int iFlags = 0, int iPitch = PITCH_NORM, int iSpecialDSP = 0,
const Vector* pOrigin = NULL, const Vector* pDirection = NULL, CUtlVector< Vector >* pUtlVecOrigins = NULL, bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1) = 0;
virtual void EmitSentenceByIndex(IRecipientFilter& filter, int iEntIndex, int iChannel, int iSentenceIndex,
float flVolume, soundlevel_t iSoundlevel, int iFlags = 0, int iPitch = PITCH_NORM,int iSpecialDSP = 0,
const Vector* pOrigin = NULL, const Vector* pDirection = NULL, CUtlVector< Vector >* pUtlVecOrigins = NULL, bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1) = 0;
virtual void StopSound(int iEntIndex, int iChannel, const char* pSample) = 0;
// stop all active sounds (client only)
virtual void StopAllSounds(bool bClearBuffers) = 0;
// Set the room type for a player (client only)
virtual void SetRoomType(IRecipientFilter& filter, int roomType) = 0;
// Set the dsp preset for a player (client only)
virtual void SetPlayerDSP(IRecipientFilter& filter, int dspType, bool fastReset) = 0;
// emit an "ambient" sound that isn't spatialized
// only available on the client, assert on server
virtual void EmitAmbientSound(const char* pSample, float flVolume, int iPitch = PITCH_NORM, int flags = 0, float soundtime = 0.0f) = 0;
// virtual EntChannel_t CreateEntChannel() = 0;
virtual float GetDistGainFromSoundLevel(soundlevel_t soundlevel, float dist) = 0;
// Client .dll only functions
virtual int GetGuidForLastSoundEmitted() = 0;
virtual bool IsSoundStillPlaying(int guid) = 0;
virtual void StopSoundByGuid(int guid) = 0;
// Set's master volume (0.0->1.0)
virtual void SetVolumeByGuid(int guid, float fvol) = 0;
// Retrieves list of all active sounds
virtual void GetActiveSounds(CUtlVector< SndInfo_t >& sndlist) = 0;
virtual void PrecacheSentenceGroup(const char* pGroupName) = 0;
virtual void NotifyBeginMoviePlayback() = 0;
virtual void NotifyEndMoviePlayback() = 0;
};
#endif // IENGINESOUND_H

View File

@ -0,0 +1,55 @@
#if !defined( IENGINEVGUI_H )
#define IENGINEVGUI_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "VGUI.h"
namespace vgui
{
class Panel;
};
enum VGuiPanel_t
{
PANEL_ROOT = 0,
PANEL_GAMEUIDLL,
PANEL_CLIENTDLL,
PANEL_TOOLS,
PANEL_INGAMESCREENS,
PANEL_GAMEDLL,
PANEL_CLIENTDLL_TOOLS
};
enum PaintMode_t
{
PAINT_UIPANELS = (1 << 0),
PAINT_INGAMEPANELS = (1 << 1),
PAINT_CURSOR = (1 << 2),
};
abstract_class IEngineVGui
{
public:
virtual ~IEngineVGui(void) { }
virtual vgui::VPANEL GetPanel(VGuiPanel_t type) = 0;
virtual bool IsGameUIVisible() = 0;
};
#define VENGINE_VGUI_VERSION "VEngineVGui001"
#if defined(_STATIC_LINKED) && defined(CLIENT_DLL)
namespace Client
{
extern IEngineVGui* enginevgui;
}
#else
extern IEngineVGui* g_pEnginevgui;
#endif
#endif

186
SpyCustom/sdk/IGameSystem.h Normal file
View File

@ -0,0 +1,186 @@
#ifndef IGAMESYSTEM_H
#define IGAMESYSTEM_H
#ifdef _WIN32
#pragma once
#endif
class IGameSystem
{
public:
virtual char const* Name() = 0;
virtual bool Init() = 0;
virtual void PostInit() = 0;
virtual void Shutdown() = 0;
virtual void LevelInitPreEntity() = 0;
virtual void LevelInitPostEntity() = 0;
virtual void LevelShutdownPreClearSteamAPIContext() {};
virtual void LevelShutdownPreEntity() = 0;
virtual void LevelShutdownPostEntity() = 0;
virtual void OnSave() = 0;
virtual void OnRestore() = 0;
virtual void SafeRemoveIfDesired() = 0;
virtual bool IsPerFrame() = 0;
virtual ~IGameSystem();
static char const* MapName();
static void Add(IGameSystem* pSys);
static void Remove(IGameSystem* pSys);
static void RemoveAll();
static bool InitAllSystems();
static void PostInitAllSystems();
static void ShutdownAllSystems();
static void LevelInitPreEntityAllSystems(char const* pMapName);
static void LevelInitPostEntityAllSystems();
static void LevelShutdownPreClearSteamAPIContextAllSystems();
static void LevelShutdownPreEntityAllSystems();
static void LevelShutdownPostEntityAllSystems();
static void OnSaveAllSystems();
static void OnRestoreAllSystems();
static void SafeRemoveIfDesiredAllSystems();
#ifdef CLIENT_DLL
static void PreRenderAllSystems();
static void UpdateAllSystems(float frametime);
static void PostRenderAllSystems();
#else
static void FrameUpdatePreEntityThinkAllSystems();
static void FrameUpdatePostEntityThinkAllSystems();
static void PreClientUpdateAllSystems();
static CBasePlayer* RunCommandPlayer();
static CUserCmd* RunCommandUserCmd();
#endif
};
class IGameSystemPerFrame : public IGameSystem
{
public:
virtual ~IGameSystemPerFrame();
#ifdef CLIENT_DLL
virtual void PreRender() = 0;
virtual void Update(float frametime) = 0;
virtual void PostRender() = 0;
#else
virtual void FrameUpdatePreEntityThink() = 0;
virtual void FrameUpdatePostEntityThink() = 0;
virtual void PreClientUpdate() = 0;
#endif
};
class CBaseGameSystem : public IGameSystem
{
public:
virtual char const* Name() { return "unnamed"; }
virtual bool Init() { return true; }
virtual void PostInit() {}
virtual void Shutdown() {}
virtual void LevelInitPreEntity() {}
virtual void LevelInitPostEntity() {}
virtual void LevelShutdownPreClearSteamAPIContext() {}
virtual void LevelShutdownPreEntity() {}
virtual void LevelShutdownPostEntity() {}
virtual void OnSave() {}
virtual void OnRestore() {}
virtual void SafeRemoveIfDesired() {}
virtual bool IsPerFrame() { return false; }
private:
#ifdef CLIENT_DLL
virtual void PreRender() {}
virtual void Update(float frametime) {}
virtual void PostRender() {}
#else
virtual void FrameUpdatePreEntityThink() {}
virtual void FrameUpdatePostEntityThink() {}
virtual void PreClientUpdate() {}
#endif
};
class CBaseGameSystemPerFrame : public IGameSystemPerFrame
{
public:
virtual char const* Name() { return "unnamed"; }
virtual bool Init() { return true; }
virtual void PostInit() {}
virtual void Shutdown() {}
virtual void LevelInitPreEntity() {}
virtual void LevelInitPostEntity() {}
virtual void LevelShutdownPreClearSteamAPIContext() {}
virtual void LevelShutdownPreEntity() {}
virtual void LevelShutdownPostEntity() {}
virtual void OnSave() {}
virtual void OnRestore() {}
virtual void SafeRemoveIfDesired() {}
virtual bool IsPerFrame() { return true; }
#ifdef CLIENT_DLL
virtual void PreRender() { }
virtual void Update(float frametime) { }
virtual void PostRender() { }
#else
virtual void FrameUpdatePreEntityThink() { }
virtual void FrameUpdatePostEntityThink() { }
virtual void PreClientUpdate() { }
#endif
};
class CAutoGameSystem : public CBaseGameSystem
{
public:
CAutoGameSystem(char const* name = NULL);
CAutoGameSystem* m_pNext;
virtual char const* Name() { return m_pszName ? m_pszName : "unnamed"; }
private:
char const* m_pszName;
};
class CAutoGameSystemPerFrame : public CBaseGameSystemPerFrame
{
public:
CAutoGameSystemPerFrame(char const* name = NULL);
CAutoGameSystemPerFrame* m_pNext;
virtual char const* Name() { return m_pszName ? m_pszName : "unnamed"; }
private:
char const* m_pszName;
};
class IToolFrameworkServer
{
public:
virtual void PreSetupVisibility() = 0;
};
#endif

94
SpyCustom/sdk/IGameUI.h Normal file
View File

@ -0,0 +1,94 @@
#ifndef IGAMEUI_H
#define IGAMEUI_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "IPanel.h"
#if !defined( _X360 )
#include "xboxstubs.h"
#endif
enum ESteamLoginFailure
{
STEAMLOGINFAILURE_NONE,
STEAMLOGINFAILURE_BADTICKET,
STEAMLOGINFAILURE_NOSTEAMLOGIN,
STEAMLOGINFAILURE_VACBANNED,
STEAMLOGINFAILURE_LOGGED_IN_ELSEWHERE
};
enum ESystemNotify
{
SYSTEMNOTIFY_STORAGEDEVICES_CHANGED,
SYSTEMNOTIFY_USER_SIGNEDIN,
SYSTEMNOTIFY_USER_SIGNEDOUT,
SYSTEMNOTIFY_XUIOPENING,
SYSTEMNOTIFY_XUICLOSED,
SYSTEMNOTIFY_INVITE_SHUTDOWN,
};
abstract_class IGameUI
{
public:
virtual void Initialize(CreateInterfaceFn appFactory) = 0;
virtual void PostInit() = 0;
virtual void Connect(CreateInterfaceFn gameFactory) = 0;
virtual void Start() = 0;
virtual void Shutdown() = 0;
virtual void RunFrame() = 0;
virtual void OnGameUIActivated() = 0;
virtual void OnGameUIHidden() = 0;
virtual void OLD_OnConnectToServer(const char* game, int IP, int port) = 0;
virtual void OnDisconnectFromServer_OLD(uint8 eSteamLoginFailure, const char* username) = 0;
virtual void OnLevelLoadingStarted(bool bShowProgressDialog) = 0;
virtual void OnLevelLoadingFinished(bool bError, const char* failureReason, const char* extendedReason) = 0;
virtual bool UpdateProgressBar(float progress, const char* statusText) = 0;
virtual bool SetShowProgressText(bool show) = 0;
virtual void ShowNewGameDialog(int chapter) = 0;
virtual void SessionNotification(const int notification, const int param = 0) = 0;
virtual void SystemNotification(const int notification) = 0;
virtual void ShowMessageDialog(const uint nType, vgui::Panel* pOwner) = 0;
virtual void UpdatePlayerInfo(uint64 nPlayerId, const char* pName, int nTeam, byte cVoiceState, int nPlayersNeeded, bool bHost) = 0;
virtual void SessionSearchResult(int searchIdx, void* pHostData, XSESSION_SEARCHRESULT* pResult, int ping) = 0;
virtual void OnCreditsFinished(void) = 0;
virtual void SetLoadingBackgroundDialog(vgui::VPANEL panel) = 0;
virtual void BonusMapUnlock(const char* pchFileName = NULL, const char* pchMapName = NULL) = 0;
virtual void BonusMapComplete(const char* pchFileName = NULL, const char* pchMapName = NULL) = 0;
virtual void BonusMapChallengeUpdate(const char* pchFileName, const char* pchMapName, const char* pchChallengeName, int iBest) = 0;
virtual void BonusMapChallengeNames(char* pchFileName, char* pchMapName, char* pchChallengeName) = 0;
virtual void BonusMapChallengeObjectives(int& iBronze, int& iSilver, int& iGold) = 0;
virtual void BonusMapDatabaseSave(void) = 0;
virtual int BonusMapNumAdvancedCompleted(void) = 0;
virtual void BonusMapNumMedals(int piNumMedals[3]) = 0;
virtual void OnConnectToServer2(const char* game, int IP, int connectionPort, int queryPort) = 0;
virtual bool ValidateStorageDevice(int* pStorageDeviceValidated) = 0;
virtual void SetProgressOnStart() = 0;
virtual void OnDisconnectFromServer(uint8 eSteamLoginFailure) = 0;
virtual void OnConfirmQuit(void) = 0;
virtual bool IsMainMenuVisible(void) = 0;
virtual void SetMainMenuOverride(vgui::VPANEL panel) = 0;
virtual void SendMainMenuCommand(const char* pszCommand) = 0;
};
#define GAMEUI_INTERFACE_VERSION "GameUI011"
#endif

151
SpyCustom/sdk/IHTML.h Normal file
View File

@ -0,0 +1,151 @@
#ifndef IHTML_H
#define IHTML_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "MouseCode.h"
#include "KeyCode.h"
#include "Cursor.h"
#include "IImage.h"
namespace vgui
{
class IHTML
{
public:
virtual void OpenURL(const char*) = 0;
virtual bool StopLoading() = 0;
virtual bool Refresh() = 0;
virtual bool Show(bool shown) = 0;
virtual const char* GetOpenedPage() = 0;
virtual void Obsolete_OnSize(int x, int y, int w, int h) = 0;
virtual void GetHTMLSize(int& wide, int& tall) = 0;
virtual void Clear() = 0;
virtual void AddText(const char* text) = 0;
enum MOUSE_STATE { UP, DOWN, MOVE, DBLCLICK };
virtual void Obsolete_OnMouse(MouseCode code, MOUSE_STATE s, int x, int y) = 0;
virtual void Obsolete_OnChar(wchar_t unichar) = 0;
virtual void Obsolete_OnKeyDown(KeyCode code) = 0;
virtual vgui::IImage* GetBitmap() = 0;
virtual void SetVisible(bool state) = 0;
virtual void SetSize(int wide, int tall) = 0;
virtual void OnMouse(MouseCode code, MOUSE_STATE s, int x, int y, bool bPopupMenuMenu) = 0;
virtual void OnChar(wchar_t unichar, bool bPopupMenu) = 0;
virtual void OnKeyDown(KeyCode code, bool bPopupMenu) = 0;
virtual void ScrollV(int nPixels) = 0;
virtual void ScrollH(int nPixels) = 0;
virtual void OnMouseWheeled(int delta, bool bPopupMenu) = 0;
virtual void OnKeyUp(KeyCode code, bool bPopupMenu) = 0;
virtual void PostURL(const char* pchURL, const char* pchPostData) = 0;
virtual void RunJavascript(const char* pchScript) = 0;
virtual void SetMousePosition(int x, int y, bool bPopupMenu) = 0;
virtual void SetUserAgentInfo(const wchar_t* pwchUserAgent) = 0;
virtual void AddHeader(const char* pchHeader, const char* pchValue) = 0;
virtual void SetFileDialogChoice(const char* pchFileName) = 0;
virtual void HidePopup() = 0;
virtual void SetHTMLFocus() = 0;
virtual void KillHTMLFocus() = 0;
virtual void HorizontalScrollBarSize(int& x, int& y, int& wide, int& tall) = 0;
virtual void VerticalScrollBarSize(int& x, int& y, int& wide, int& tall) = 0;
virtual int HorizontalScroll() = 0;
virtual int VerticalScroll() = 0;
virtual int HorizontalScrollMax() = 0;
virtual int VerticalScrollMax() = 0;
virtual bool IsHorizontalScrollBarVisible() = 0;
virtual bool IsVeritcalScrollBarVisible() = 0;
virtual void SetHorizontalScroll(int scroll) = 0;
virtual void SetVerticalScroll(int scroll) = 0;
virtual void ViewSource() = 0;
virtual void Copy() = 0;
virtual void Paste() = 0;
virtual bool IsIERender() = 0;
virtual void GetIDispatchPtr(void** pIDispatch) = 0;
virtual void GetHTMLScroll(int& top, int& left) = 0;
};
enum EWebPageLoadError
{
eLoadErrorNone = 0,
eMimeTypeNotSupported,
eCacheMiss,
eBadURL,
eConnectionProblem,
eProxyConnectionProblem,
eLoadErrorUnknown,
};
class IHTMLEvents
{
public:
virtual bool Obsolete_OnStartURL(const char* url, const char* target, bool first) = 0;
virtual void Obsolete_OnFinishURL(const char* url) = 0;
virtual void Obsolete_OnProgressURL(long current, long maximum) = 0;
virtual void Obsolete_OnSetStatusText(const char* text) = 0;
virtual void Obsolete_OnUpdate() = 0;
virtual void Obsolete_OnLink() = 0;
virtual void Obsolete_OffLink() = 0;
virtual void OnURLChanged(const char* url, const char* pchPostData, bool bIsRedirect) = 0;
virtual void OnFinishRequest(const char* url, const char* pageTitle) = 0;
virtual bool OnStartRequestInternal(const char* url, const char* target, const char* pchPostData, bool bIsRedirect) = 0;
virtual void ShowPopup(int x, int y, int wide, int tall) = 0;
virtual void HidePopup() = 0;
virtual bool OnPopupHTMLWindow(const char* pchURL, int x, int y, int wide, int tall) = 0;
virtual void SetHTMLTitle(const char* pchTitle) = 0;
virtual void OnLoadingResource(const char* pchURL) = 0;
virtual void OnSetStatusText(const char* text) = 0;
virtual void OnSetCursor(vgui::CursorCode cursor) = 0;
virtual void OnFileLoadDialog(const char* pchTitle, const char* pchInitialFile) = 0;
virtual void OnShowToolTip(const char* pchText) = 0;
virtual void OnUpdateToolTip(const char* pchText) = 0;
virtual void OnHideToolTip() = 0;
virtual bool BOnCreateNewWindow(void** ppDispatch) = 0;
virtual void OnLink() = 0;
virtual void OffLink() = 0;
virtual void OnCloseWindow() = 0;
virtual void OnUpdate() = 0;
virtual void OnProgressRequest(long current, long maximum) = 0;
virtual bool OnOpenNewTab(const char* pchURL, bool bForeground) = 0;
};
}
#endif

54
SpyCustom/sdk/IImage.h Normal file
View File

@ -0,0 +1,54 @@
#ifndef IIMAGE_H
#define IIMAGE_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
class Color;
namespace vgui
{
typedef unsigned long HTexture;
enum iimage_rotation_t
{
ROTATED_UNROTATED = 0,
ROTATED_CLOCKWISE_90,
ROTATED_ANTICLOCKWISE_90,
ROTATED_FLIPPED,
};
class IImage
{
public:
virtual void Paint() = 0;
virtual void SetPos(int x, int y) = 0;
virtual void GetContentSize(int& wide, int& tall) = 0;
virtual void GetSize(int& wide, int& tall) = 0;
virtual void SetSize(int wide, int tall) = 0;
virtual void SetColor(Color col) = 0;
virtual ~IImage() {}
virtual bool Evict() = 0;
virtual int GetNumFrames() = 0;
virtual void SetFrame(int nFrame) = 0;
virtual HTexture GetID() = 0;
virtual void SetRotation(int iRotation) = 0;
};
}
#endif

156
SpyCustom/sdk/IInput.h Normal file
View File

@ -0,0 +1,156 @@
#ifndef VGUI_IINPUT_H
#define VGUI_IINPUT_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "interface.h"
#include "MouseCode.h"
#include "KeyCode.h"
namespace vgui
{
class Cursor;
typedef unsigned long HCursor;
#define VGUI_GCS_COMPREADSTR 0x0001
#define VGUI_GCS_COMPREADATTR 0x0002
#define VGUI_GCS_COMPREADCLAUSE 0x0004
#define VGUI_GCS_COMPSTR 0x0008
#define VGUI_GCS_COMPATTR 0x0010
#define VGUI_GCS_COMPCLAUSE 0x0020
#define VGUI_GCS_CURSORPOS 0x0080
#define VGUI_GCS_DELTASTART 0x0100
#define VGUI_GCS_RESULTREADSTR 0x0200
#define VGUI_GCS_RESULTREADCLAUSE 0x0400
#define VGUI_GCS_RESULTSTR 0x0800
#define VGUI_GCS_RESULTCLAUSE 0x1000
#define VGUI_CS_INSERTCHAR 0x2000
#define VGUI_CS_NOMOVECARET 0x4000
#define MESSAGE_CURSOR_POS -1
#define MESSAGE_CURRENT_KEYFOCUS -2
class IInput : public IBaseInterface
{
public:
virtual void SetMouseFocus(VPANEL newMouseFocus) = 0;
virtual void SetMouseCapture(VPANEL panel) = 0;
virtual void GetKeyCodeText(KeyCode code, OUT_Z_BYTECAP(buflen) char* buf, int buflen) = 0;
virtual VPANEL GetFocus() = 0;
virtual VPANEL GetCalculatedFocus() = 0;
virtual VPANEL GetMouseOver() = 0;
virtual void SetCursorPos(int x, int y) = 0;
virtual void GetCursorPos(int& x, int& y) = 0;
virtual bool WasMousePressed(MouseCode code) = 0;
virtual bool WasMouseDoublePressed(MouseCode code) = 0;
virtual bool IsMouseDown(MouseCode code) = 0;
virtual void SetCursorOveride(HCursor cursor) = 0;
virtual HCursor GetCursorOveride() = 0;
virtual bool WasMouseReleased(MouseCode code) = 0;
virtual bool WasKeyPressed(KeyCode code) = 0;
virtual bool IsKeyDown(KeyCode code) = 0;
virtual bool WasKeyTyped(KeyCode code) = 0;
virtual bool WasKeyReleased(KeyCode code) = 0;
virtual VPANEL GetAppModalSurface() = 0;
virtual void SetAppModalSurface(VPANEL panel) = 0;
virtual void ReleaseAppModalSurface() = 0;
virtual void GetCursorPosition(int& x, int& y) = 0;
virtual void SetIMEWindow(void* hwnd) = 0;
virtual void* GetIMEWindow() = 0;
virtual void OnChangeIME(bool forward) = 0;
virtual int GetCurrentIMEHandle() = 0;
virtual int GetEnglishIMEHandle() = 0;
virtual void GetIMELanguageName(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* buf, int unicodeBufferSizeInBytes) = 0;
virtual void GetIMELanguageShortCode(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* buf, int unicodeBufferSizeInBytes) = 0;
struct LanguageItem
{
wchar_t shortname[4];
wchar_t menuname[128];
int handleValue;
bool active;
};
struct ConversionModeItem
{
wchar_t menuname[128];
int handleValue;
bool active;
};
struct SentenceModeItem
{
wchar_t menuname[128];
int handleValue;
bool active;
};
virtual int GetIMELanguageList(LanguageItem* dest, int destcount) = 0;
virtual int GetIMEConversionModes(ConversionModeItem* dest, int destcount) = 0;
virtual int GetIMESentenceModes(SentenceModeItem* dest, int destcount) = 0;
virtual void OnChangeIMEByHandle(int handleValue) = 0;
virtual void OnChangeIMEConversionModeByHandle(int handleValue) = 0;
virtual void OnChangeIMESentenceModeByHandle(int handleValue) = 0;
virtual void OnInputLanguageChanged() = 0;
virtual void OnIMEStartComposition() = 0;
virtual void OnIMEComposition(int flags) = 0;
virtual void OnIMEEndComposition() = 0;
virtual void OnIMEShowCandidates() = 0;
virtual void OnIMEChangeCandidates() = 0;
virtual void OnIMECloseCandidates() = 0;
virtual void OnIMERecomputeModes() = 0;
virtual int GetCandidateListCount() = 0;
virtual void GetCandidate(int num, OUT_Z_BYTECAP(destSizeBytes) wchar_t* dest, int destSizeBytes) = 0;
virtual int GetCandidateListSelectedItem() = 0;
virtual int GetCandidateListPageSize() = 0;
virtual int GetCandidateListPageStart() = 0;
virtual void SetCandidateWindowPos(int x, int y) = 0;
virtual bool GetShouldInvertCompositionString() = 0;
virtual bool CandidateListStartsAtOne() = 0;
virtual void SetCandidateListPageStart(int start) = 0;
virtual void SetMouseCaptureEx(VPANEL panel, MouseCode captureStartMouseCode) = 0;
virtual void RegisterKeyCodeUnhandledListener(VPANEL panel) = 0;
virtual void UnregisterKeyCodeUnhandledListener(VPANEL panel) = 0;
virtual void OnKeyCodeUnhandled(int keyCode) = 0;
virtual void SetModalSubTree(VPANEL subTree, VPANEL unhandledMouseClickListener, bool restrictMessagesToSubTree = true) = 0;
virtual void ReleaseModalSubTree() = 0;
virtual VPANEL GetModalSubTree() = 0;
virtual void SetModalSubTreeReceiveMessages(bool state) = 0;
virtual bool ShouldModalSubTreeReceiveMessages() const = 0;
virtual VPANEL GetMouseCapture() = 0;
};
#define VGUI_INPUT_INTERFACE_VERSION "VGUI_Input005"
}
#endif

View File

@ -0,0 +1,34 @@
#ifndef VSTDLIB_IKEYVALUESSYSTEM_H
#define VSTDLIB_IKEYVALUESSYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include "vstdlib.h"
typedef int HKeySymbol;
#define INVALID_KEY_SYMBOL (-1)
class IKeyValuesSystem
{
public:
virtual void RegisterSizeofKeyValues(int size) = 0;
virtual void* AllocKeyValuesMemory(int size) = 0;
virtual void FreeKeyValuesMemory(void* pMem) = 0;
virtual HKeySymbol GetSymbolForString(const char* name, bool bCreate = true) = 0;
virtual const char* GetStringForSymbol(HKeySymbol symbol) = 0;
virtual void AddKeyValuesToMemoryLeakList(void* pMem, HKeySymbol name) = 0;
virtual void RemoveKeyValuesFromMemoryLeakList(void* pMem) = 0;
virtual void SetKeyValuesExpressionSymbol(const char* name, bool bValue) = 0;
virtual bool GetKeyValuesExpressionSymbol(const char* name) = 0;
virtual HKeySymbol GetSymbolForStringCaseSensitive(HKeySymbol& hCaseInsensitiveSymbol, const char* name, bool bCreate = true) = 0;
};
VSTDLIB_INTERFACE IKeyValuesSystem* KeyValuesSystem();
#endif

371
SpyCustom/sdk/ILocalize.h Normal file
View File

@ -0,0 +1,371 @@
#ifndef ILOCALIZE_H
#define ILOCALIZE_H
#ifdef _WIN32
#pragma once
#endif
#include "IAppSystem.h"
#include "KeyValues.h"
#if !defined(_WCHAR_T_DEFINED) && !defined(GNUC)
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif
typedef unsigned long StringIndex_t;
const unsigned long INVALID_LOCALIZE_STRING_INDEX = (StringIndex_t)-1;
abstract_class ILocalize
{
public:
virtual bool AddFile(const char* fileName, const char* pPathID = NULL, bool bIncludeFallbackSearchPaths = false) = 0;
virtual void RemoveAll() = 0;
virtual wchar_t* Find(char const* tokenName) = 0;
virtual StringIndex_t FindIndex(const char* tokenName) = 0;
virtual const char* GetNameByIndex(StringIndex_t index) = 0;
virtual wchar_t* GetValueByIndex(StringIndex_t index) = 0;
virtual StringIndex_t GetFirstStringIndex() = 0;
virtual StringIndex_t GetNextStringIndex(StringIndex_t index) = 0;
virtual void AddString(const char* tokenName, wchar_t* unicodeString, const char* fileName) = 0;
virtual void SetValueByIndex(StringIndex_t index, wchar_t* newValue) = 0;
virtual bool SaveToFile(const char* fileName) = 0;
virtual int GetLocalizationFileCount() = 0;
virtual const char* GetLocalizationFileName(int index) = 0;
virtual const char* GetFileNameByIndex(StringIndex_t index) = 0;
virtual void ReloadLocalizationFiles() = 0;
virtual const char* FindAsUTF8(const char* pchTokenName) = 0;
virtual void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* unicodeOutput, int unicodeBufferSizeInBytes, const char* tokenName, KeyValues* localizationVariables) = 0;
virtual void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* unicodeOutput, int unicodeBufferSizeInBytes, StringIndex_t unlocalizedTextSymbol, KeyValues* localizationVariables) = 0;
static int ConvertANSIToUnicode(const char* ansi, OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* unicode, int unicodeBufferSizeInBytes);
static int ConvertUnicodeToANSI(const wchar_t* unicode, OUT_Z_BYTECAP(ansiBufferSize) char* ansi, int ansiBufferSize);
template < typename T >
static void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) T* unicodeOuput, int unicodeBufferSizeInBytes, const T* formatString, int numFormatParameters, ...)
{
va_list argList;
va_start(argList, numFormatParameters);
ConstructStringVArgsInternal(unicodeOuput, unicodeBufferSizeInBytes, formatString, numFormatParameters, argList);
va_end(argList);
}
template < typename T >
static void ConstructStringVArgs(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) T* unicodeOuput, int unicodeBufferSizeInBytes, const T* formatString, int numFormatParameters, va_list argList)
{
ConstructStringVArgsInternal(unicodeOuput, unicodeBufferSizeInBytes, formatString, numFormatParameters, argList);
}
template < typename T >
static void ConstructString(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) T* unicodeOutput, int unicodeBufferSizeInBytes, const T* formatString, KeyValues* localizationVariables)
{
ConstructStringKeyValuesInternal(unicodeOutput, unicodeBufferSizeInBytes, formatString, localizationVariables);
}
private:
static void ConstructStringVArgsInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) char* unicodeOutput, int unicodeBufferSizeInBytes, const char* formatString, int numFormatParameters, va_list argList);
static void ConstructStringVArgsInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* unicodeOutput, int unicodeBufferSizeInBytes, const wchar_t* formatString, int numFormatParameters, va_list argList);
static void ConstructStringKeyValuesInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) char* unicodeOutput, int unicodeBufferSizeInBytes, const char* formatString, KeyValues* localizationVariables);
static void ConstructStringKeyValuesInternal(OUT_Z_BYTECAP(unicodeBufferSizeInBytes) wchar_t* unicodeOutput, int unicodeBufferSizeInBytes, const wchar_t* formatString, KeyValues* localizationVariables);
};
#ifdef GC
typedef char locchar_t;
#define loc_snprintf Q_snprintf
#define loc_sprintf_safe V_sprintf_safe
#define loc_sncat Q_strncat
#define loc_scat_safe V_strcat_safe
#define loc_sncpy Q_strncpy
#define loc_scpy_safe V_strcpy_safe
#define loc_strlen Q_strlen
#define LOCCHAR( x ) x
#else
typedef wchar_t locchar_t;
#define loc_snprintf V_snwprintf
#define loc_sprintf_safe V_swprintf_safe
#define loc_sncat V_wcsncat
#define loc_scat_safe V_wcscat_safe
#define loc_sncpy Q_wcsncpy
#define loc_scpy_safe V_wcscpy_safe
#define loc_strlen Q_wcslen
#define LOCCHAR(x) L ## x
#endif
template < typename T >
class TypedKeyValuesStringHelper
{
public:
static const T* Read(KeyValues* pKeyValues, const char* pKeyName, const T* pDefaultValue);
static void Write(KeyValues* pKeyValues, const char* pKeyName, const T* pValue);
};
template < >
class TypedKeyValuesStringHelper<char>
{
public:
static const char* Read(KeyValues* pKeyValues, const char* pKeyName, const char* pDefaultValue) { return pKeyValues->GetString(pKeyName, pDefaultValue); }
static void Write(KeyValues* pKeyValues, const char* pKeyName, const char* pValue) { pKeyValues->SetString(pKeyName, pValue); }
};
template < >
class TypedKeyValuesStringHelper<wchar_t>
{
public:
static const wchar_t* Read(KeyValues* pKeyValues, const char* pKeyName, const wchar_t* pDefaultValue) { return pKeyValues->GetWString(pKeyName, pDefaultValue); }
static void Write(KeyValues* pKeyValues, const char* pKeyName, const wchar_t* pValue) { pKeyValues->SetWString(pKeyName, pValue); }
};
template < typename T >
class CLocalizedStringArg;
template < typename T >
class CLocalizedStringArgStringImpl
{
public:
enum { kIsValid = true };
CLocalizedStringArgStringImpl(const locchar_t* pStr) : m_pStr(pStr) { }
const locchar_t* GetLocArg() const { Assert(m_pStr); return m_pStr; }
private:
const locchar_t* m_pStr;
};
template < typename T >
class CLocalizedStringArg<T*> : public CLocalizedStringArgStringImpl<T>
{
public:
CLocalizedStringArg(const locchar_t* pStr) : CLocalizedStringArgStringImpl<T>(pStr) { }
};
template < typename T >
class CLocalizedStringArgPrintfImpl
{
public:
enum { kIsValid = true };
CLocalizedStringArgPrintfImpl(T value, const locchar_t* loc_Format) { loc_snprintf(m_cBuffer, kBufferSize, loc_Format, value); }
const locchar_t* GetLocArg() const { return m_cBuffer; }
private:
enum { kBufferSize = 128, };
locchar_t m_cBuffer[kBufferSize];
};
template < >
class CLocalizedStringArg<uint16> : public CLocalizedStringArgPrintfImpl<uint16>
{
public:
CLocalizedStringArg(uint16 unValue) : CLocalizedStringArgPrintfImpl<uint16>(unValue, LOCCHAR("%u")) { }
};
template < >
class CLocalizedStringArg<uint32> : public CLocalizedStringArgPrintfImpl<uint32>
{
public:
CLocalizedStringArg(uint32 unValue) : CLocalizedStringArgPrintfImpl<uint32>(unValue, LOCCHAR("%u")) { }
};
template < >
class CLocalizedStringArg<uint64> : public CLocalizedStringArgPrintfImpl<uint64>
{
public:
CLocalizedStringArg(uint64 unValue) : CLocalizedStringArgPrintfImpl<uint64>(unValue, LOCCHAR("%llu")) { }
};
template < >
class CLocalizedStringArg<float> : public CLocalizedStringArgPrintfImpl<float>
{
public:
CLocalizedStringArg(float fValue)
: CLocalizedStringArgPrintfImpl<float>(fValue,
fabsf(fValue) <= FLT_EPSILON || fabsf(fValue) >= 1.0f ? LOCCHAR("%.0f") : LOCCHAR("%.1f"))
{
}
};
class CConstructLocalizedString
{
public:
template < typename T >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer, sizeof(m_loc_Buffer), loc_Format, 1, CLocalizedStringArg<T>(arg0).GetLocArg());
}
}
template < typename T, typename U >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0, U arg1)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<U>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer, sizeof(m_loc_Buffer), loc_Format, 2, CLocalizedStringArg<T>(arg0).GetLocArg(), CLocalizedStringArg<U>(arg1).GetLocArg());
}
}
template < typename T, typename U, typename V >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0, U arg1, V arg2)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<U>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<V>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer,
sizeof(m_loc_Buffer),
loc_Format,
3,
CLocalizedStringArg<T>(arg0).GetLocArg(),
CLocalizedStringArg<U>(arg1).GetLocArg(),
CLocalizedStringArg<V>(arg2).GetLocArg());
}
}
template < typename T, typename U, typename V, typename W >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0, U arg1, V arg2, W arg3)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<U>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<V>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<W>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer,
sizeof(m_loc_Buffer),
loc_Format,
4,
CLocalizedStringArg<T>(arg0).GetLocArg(),
CLocalizedStringArg<U>(arg1).GetLocArg(),
CLocalizedStringArg<V>(arg2).GetLocArg(),
CLocalizedStringArg<W>(arg3).GetLocArg());
}
}
template < typename T, typename U, typename V, typename W, typename X, typename Y >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0, U arg1, V arg2, W arg3, X arg4, Y arg5)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<U>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<V>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<W>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<X>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<Y>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer,
sizeof(m_loc_Buffer),
loc_Format,
6,
CLocalizedStringArg<T>(arg0).GetLocArg(),
CLocalizedStringArg<U>(arg1).GetLocArg(),
CLocalizedStringArg<V>(arg2).GetLocArg(),
CLocalizedStringArg<W>(arg3).GetLocArg(),
CLocalizedStringArg<X>(arg4).GetLocArg(),
CLocalizedStringArg<Y>(arg5).GetLocArg());
}
}
template < typename T, typename U, typename V, typename W, typename X, typename Y, typename Z >
CConstructLocalizedString(const locchar_t* loc_Format, T arg0, U arg1, V arg2, W arg3, X arg4, Y arg5, Z arg6)
{
COMPILE_TIME_ASSERT(CLocalizedStringArg<T>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<U>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<V>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<W>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<X>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<Y>::kIsValid);
COMPILE_TIME_ASSERT(CLocalizedStringArg<Z>::kIsValid);
m_loc_Buffer[0] = '\0';
if (loc_Format)
{
::ILocalize::ConstructString(m_loc_Buffer,
sizeof(m_loc_Buffer),
loc_Format,
7,
CLocalizedStringArg<T>(arg0).GetLocArg(),
CLocalizedStringArg<U>(arg1).GetLocArg(),
CLocalizedStringArg<V>(arg2).GetLocArg(),
CLocalizedStringArg<W>(arg3).GetLocArg(),
CLocalizedStringArg<X>(arg4).GetLocArg(),
CLocalizedStringArg<Y>(arg5).GetLocArg(),
CLocalizedStringArg<Z>(arg6).GetLocArg());
}
}
CConstructLocalizedString(const locchar_t* loc_Format, KeyValues* pKeyValues)
{
m_loc_Buffer[0] = '\0';
if (loc_Format && pKeyValues)
{
::ILocalize::ConstructString(m_loc_Buffer, sizeof(m_loc_Buffer), loc_Format, pKeyValues);
}
}
operator const locchar_t* () const
{
return m_loc_Buffer;
}
private:
enum { kBufferSize = 512, };
locchar_t m_loc_Buffer[kBufferSize];
};
namespace vgui
{
class ILocalize : public ::ILocalize { };
}
#define VGUI_LOCALIZE_INTERFACE_VERSION "VGUI_Localize005"
#endif

3353
SpyCustom/sdk/IMesh.h Normal file

File diff suppressed because it is too large Load Diff

118
SpyCustom/sdk/IPanel.h Normal file
View File

@ -0,0 +1,118 @@
#ifndef IPANEL_H
#define IPANEL_H
#ifdef _WIN32
#pragma once
#endif
#include "vgui.h"
#include "interface.h"
#include "utlvector.h"
#ifdef SendMessage
#undef SendMessage
#endif
class KeyValues;
struct DmxElementUnpackStructure_t;
class CDmxElement;
namespace vgui
{
class SurfacePlat;
class IClientPanel;
class Panel;
class IPanel : public IBaseInterface
{
public:
virtual void Init(VPANEL vguiPanel, IClientPanel* panel) = 0;
virtual void SetPos(VPANEL vguiPanel, int x, int y) = 0;
virtual void GetPos(VPANEL vguiPanel, int& x, int& y) = 0;
virtual void SetSize(VPANEL vguiPanel, int wide, int tall) = 0;
virtual void GetSize(VPANEL vguiPanel, int& wide, int& tall) = 0;
virtual void SetMinimumSize(VPANEL vguiPanel, int wide, int tall) = 0;
virtual void GetMinimumSize(VPANEL vguiPanel, int& wide, int& tall) = 0;
virtual void SetZPos(VPANEL vguiPanel, int z) = 0;
virtual int GetZPos(VPANEL vguiPanel) = 0;
virtual void GetAbsPos(VPANEL vguiPanel, int& x, int& y) = 0;
virtual void GetClipRect(VPANEL vguiPanel, int& x0, int& y0, int& x1, int& y1) = 0;
virtual void SetInset(VPANEL vguiPanel, int left, int top, int right, int bottom) = 0;
virtual void GetInset(VPANEL vguiPanel, int& left, int& top, int& right, int& bottom) = 0;
virtual void SetVisible(VPANEL vguiPanel, bool state) = 0;
virtual bool IsVisible(VPANEL vguiPanel) = 0;
virtual void SetParent(VPANEL vguiPanel, VPANEL newParent) = 0;
virtual int GetChildCount(VPANEL vguiPanel) = 0;
virtual VPANEL GetChild(VPANEL vguiPanel, int index) = 0;
virtual CUtlVector< VPANEL >& GetChildren(VPANEL vguiPanel) = 0;
virtual VPANEL GetParent(VPANEL vguiPanel) = 0;
virtual void MoveToFront(VPANEL vguiPanel) = 0;
virtual void MoveToBack(VPANEL vguiPanel) = 0;
virtual bool HasParent(VPANEL vguiPanel, VPANEL potentialParent) = 0;
virtual bool IsPopup(VPANEL vguiPanel) = 0;
virtual void SetPopup(VPANEL vguiPanel, bool state) = 0;
virtual bool IsFullyVisible(VPANEL vguiPanel) = 0;
virtual HScheme GetScheme(VPANEL vguiPanel) = 0;
virtual bool IsProportional(VPANEL vguiPanel) = 0;
virtual bool IsAutoDeleteSet(VPANEL vguiPanel) = 0;
virtual void DeletePanel(VPANEL vguiPanel) = 0;
virtual void SetKeyBoardInputEnabled(VPANEL vguiPanel, bool state) = 0;
virtual void SetMouseInputEnabled(VPANEL vguiPanel, bool state) = 0;
virtual bool IsKeyBoardInputEnabled(VPANEL vguiPanel) = 0;
virtual bool IsMouseInputEnabled(VPANEL vguiPanel) = 0;
virtual void Solve(VPANEL vguiPanel) = 0;
virtual const char* GetName(VPANEL vguiPanel) = 0;
virtual const char* GetClassName(VPANEL vguiPanel) = 0;
virtual void SendMessage(VPANEL vguiPanel, KeyValues* params, VPANEL ifromPanel) = 0;
virtual void Think(VPANEL vguiPanel) = 0;
virtual void PerformApplySchemeSettings(VPANEL vguiPanel) = 0;
virtual void PaintTraverse(VPANEL vguiPanel, bool forceRepaint, bool allowForce = true) = 0;
virtual void Repaint(VPANEL vguiPanel) = 0;
virtual VPANEL IsWithinTraverse(VPANEL vguiPanel, int x, int y, bool traversePopups) = 0;
virtual void OnChildAdded(VPANEL vguiPanel, VPANEL child) = 0;
virtual void OnSizeChanged(VPANEL vguiPanel, int newWide, int newTall) = 0;
virtual void InternalFocusChanged(VPANEL vguiPanel, bool lost) = 0;
virtual bool RequestInfo(VPANEL vguiPanel, KeyValues* outputData) = 0;
virtual void RequestFocus(VPANEL vguiPanel, int direction = 0) = 0;
virtual bool RequestFocusPrev(VPANEL vguiPanel, VPANEL existingPanel) = 0;
virtual bool RequestFocusNext(VPANEL vguiPanel, VPANEL existingPanel) = 0;
virtual VPANEL GetCurrentKeyFocus(VPANEL vguiPanel) = 0;
virtual int GetTabPosition(VPANEL vguiPanel) = 0;
virtual SurfacePlat* Plat(VPANEL vguiPanel) = 0;
virtual void SetPlat(VPANEL vguiPanel, SurfacePlat* Plat) = 0;
virtual Panel* GetPanel(VPANEL vguiPanel, const char* destinationModule) = 0;
virtual bool IsEnabled(VPANEL vguiPanel) = 0;
virtual void SetEnabled(VPANEL vguiPanel, bool state) = 0;
virtual bool IsTopmostPopup(VPANEL vguiPanel) = 0;
virtual void SetTopmostPopup(VPANEL vguiPanel, bool state) = 0;
virtual void SetMessageContextId(VPANEL vguiPanel, int nContextId) = 0;
virtual int GetMessageContextId(VPANEL vguiPanel) = 0;
virtual const DmxElementUnpackStructure_t* GetUnpackStructure(VPANEL vguiPanel) const = 0;
virtual void OnUnserialized(VPANEL vguiPanel, CDmxElement* pElement) = 0;
virtual void SetSiblingPin(VPANEL vguiPanel, VPANEL newSibling, byte iMyCornerToPin = 0, byte iSiblingCornerToPinTo = 0) = 0;
};
}
#endif

85
SpyCustom/sdk/IScheme.h Normal file
View File

@ -0,0 +1,85 @@
#ifndef ISCHEME_H
#define ISCHEME_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "interface.h"
class Color;
class KeyValues;
namespace vgui
{
typedef unsigned long HScheme;
typedef unsigned long HTexture;
class IBorder;
class IImage;
class IScheme : public IBaseInterface
{
public:
virtual const char* GetResourceString(const char* stringName) = 0;
virtual IBorder* GetBorder(const char* borderName) = 0;
virtual HFont GetFont(const char* fontName, bool proportional = false) = 0;
virtual char const* GetFontName(const HFont& font) = 0;
virtual Color GetColor(const char* colorName, Color defaultColor) = 0;
virtual int GetBorderCount() const = 0;
virtual IBorder* GetBorderAtIndex(int iIndex) = 0;
virtual int GetFontCount() const = 0;
virtual HFont GetFontAtIndex(int iIndex) = 0;
virtual const KeyValues* GetColorData() const = 0;
};
class ISchemeManager : public IBaseInterface
{
public:
virtual HScheme LoadSchemeFromFile(const char* fileName, const char* tag) = 0;
virtual void ReloadSchemes() = 0;
virtual void ReloadFonts() = 0;
virtual HScheme GetDefaultScheme() = 0;
virtual HScheme GetScheme(const char* tag) = 0;
virtual IImage* GetImage(const char* imageName, bool hardwareFiltered) = 0;
virtual HTexture GetImageID(const char* imageName, bool hardwareFiltered) = 0;
virtual IScheme* GetIScheme(HScheme scheme) = 0;
virtual void Shutdown(bool full = true) = 0;
virtual int GetProportionalScaledValue(int normalizedValue) = 0;
virtual int GetProportionalNormalizedValue(int scaledValue) = 0;
virtual HScheme LoadSchemeFromFileEx(VPANEL sizingPanel, const char* fileName, const char* tag) = 0;
virtual int GetProportionalScaledValueEx(HScheme scheme, int normalizedValue) = 0;
virtual int GetProportionalNormalizedValueEx(HScheme scheme, int scaledValue) = 0;
virtual bool DeleteImage(const char* pImageName) = 0;
};
#define VGUI_SCHEME_INTERFACE_VERSION "VGUI_Scheme010"
}
#endif

378
SpyCustom/sdk/ISurface.h Normal file
View File

@ -0,0 +1,378 @@
#ifndef ISURFACE_H
#define ISURFACE_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "IHTML.h"
#include "interface.h"
#include "imageformat.h"
#include "IAppSystem.h"
#include "vector2d.h"
#include "ichromehtmlwrapper.h"
#include "IVguiMatInfo.h"
#ifdef CreateFont
#undef CreateFont
#endif
#ifdef PlaySound
#undef PlaySound
#endif
class Color;
class ITexture;
namespace vgui
{
class IImage;
class Image;
class Point;
typedef unsigned long HCursor;
typedef unsigned long HTexture;
typedef unsigned long HFont;
struct Vertex_t
{
Vertex_t() {}
Vertex_t(const Vector2D& pos, const Vector2D& coord = Vector2D(0, 0))
{
m_Position = pos;
m_TexCoord = coord;
}
void Init(const Vector2D& pos, const Vector2D& coord = Vector2D(0, 0))
{
m_Position = pos;
m_TexCoord = coord;
}
Vector2D m_Position;
Vector2D m_TexCoord;
};
enum FontDrawType_t
{
FONT_DRAW_DEFAULT = 0,
FONT_DRAW_NONADDITIVE,
FONT_DRAW_ADDITIVE,
FONT_DRAW_TYPE_COUNT = 2,
};
struct CharRenderInfo
{
int x, y;
Vertex_t* verts;
int textureId;
int abcA;
int abcB;
int abcC;
int fontTall;
HFont currentFont;
FontDrawType_t drawType;
wchar_t ch;
bool valid;
bool shouldclip;
};
struct IntRect
{
int x0;
int y0;
int x1;
int y1;
};
struct DrawTexturedRectParms_t
{
DrawTexturedRectParms_t()
{
s0 = t0 = 0;
s1 = t1 = 1.0f;
alpha_ul = alpha_ur = alpha_lr = alpha_ll = 255;
angle = 0;
}
int x0;
int y0;
int x1;
int y1;
float s0;
float t0;
float s1;
float t1;
unsigned char alpha_ul;
unsigned char alpha_ur;
unsigned char alpha_lr;
unsigned char alpha_ll;
float angle;
};
class ISurface : public IAppSystem
{
public:
virtual void Shutdown() = 0;
virtual void RunFrame() = 0;
virtual VPANEL GetEmbeddedPanel() = 0;
virtual void SetEmbeddedPanel(VPANEL pPanel) = 0;
virtual void PushMakeCurrent(VPANEL panel, bool useInsets) = 0;
virtual void PopMakeCurrent(VPANEL panel) = 0;
virtual void DrawSetColor(int r, int g, int b, int a) = 0;
virtual void DrawSetColor(Color col) = 0;
virtual void DrawFilledRect(int x0, int y0, int x1, int y1) = 0;
virtual void DrawFilledRectArray(IntRect* pRects, int numRects) = 0;
virtual void DrawOutlinedRect(int x0, int y0, int x1, int y1) = 0;
virtual void DrawLine(int x0, int y0, int x1, int y1) = 0;
virtual void DrawPolyLine(int* px, int* py, int numPoints) = 0;
virtual void DrawSetApparentDepth(float depth) = 0;
virtual void DrawClearApparentDepth() = 0;
virtual void DrawSetTextFont(HFont font) = 0;
virtual void DrawSetTextColor(int r, int g, int b, int a) = 0;
virtual void DrawSetTextColor(Color col) = 0;
virtual void DrawSetTextPos(int x, int y) = 0;
virtual void DrawGetTextPos(int& x, int& y) = 0;
virtual void DrawPrintText(const wchar_t* text, int textLen, FontDrawType_t drawType = FONT_DRAW_DEFAULT) = 0;
virtual void DrawUnicodeChar(wchar_t wch, FontDrawType_t drawType = FONT_DRAW_DEFAULT) = 0;
virtual void DrawFlushText() = 0;
virtual IHTML* CreateHTMLWindow(vgui::IHTMLEvents* events, VPANEL context) = 0;
virtual void PaintHTMLWindow(vgui::IHTML* htmlwin) = 0;
virtual void DeleteHTMLWindow(IHTML* htmlwin) = 0;
enum ETextureFormat
{
eTextureFormat_RGBA,
eTextureFormat_BGRA,
eTextureFormat_BGRA_Opaque,
};
virtual int DrawGetTextureId(char const* filename) = 0;
virtual bool DrawGetTextureFile(int id, char* filename, int maxlen) = 0;
virtual void DrawSetTextureFile(int id, const char* filename, int hardwareFilter, bool forceReload) = 0;
virtual void DrawSetTextureRGBA(int id, const unsigned char* rgba, int wide, int tall, int hardwareFilter, bool forceReload) = 0;
virtual void DrawSetTexture(int id) = 0;
virtual bool DeleteTextureByID(int id) = 0;
virtual void DrawGetTextureSize(int id, int& wide, int& tall) = 0;
virtual void DrawTexturedRect(int x0, int y0, int x1, int y1) = 0;
virtual bool IsTextureIDValid(int id) = 0;
virtual int CreateNewTextureID(bool procedural = false) = 0;
virtual void GetScreenSize(int& wide, int& tall) = 0;
virtual void SetAsTopMost(VPANEL panel, bool state) = 0;
virtual void BringToFront(VPANEL panel) = 0;
virtual void SetForegroundWindow(VPANEL panel) = 0;
virtual void SetPanelVisible(VPANEL panel, bool state) = 0;
virtual void SetMinimized(VPANEL panel, bool state) = 0;
virtual bool IsMinimized(VPANEL panel) = 0;
virtual void FlashWindow(VPANEL panel, bool state) = 0;
virtual void SetTitle(VPANEL panel, const wchar_t* title) = 0;
virtual void SetAsToolBar(VPANEL panel, bool state) = 0;
virtual void CreatePopup(VPANEL panel, bool minimised, bool showTaskbarIcon = true, bool disabled = false, bool mouseInput = true, bool kbInput = true) = 0;
virtual void SwapBuffers(VPANEL panel) = 0;
virtual void Invalidate(VPANEL panel) = 0;
virtual void SetCursor(HCursor cursor) = 0;
virtual bool IsCursorVisible() = 0;
virtual void ApplyChanges() = 0;
virtual bool IsWithin(int x, int y) = 0;
virtual bool HasFocus() = 0;
enum SurfaceFeature_e
{
ANTIALIASED_FONTS = 1,
DROPSHADOW_FONTS = 2,
ESCAPE_KEY = 3,
OPENING_NEW_HTML_WINDOWS = 4,
FRAME_MINIMIZE_MAXIMIZE = 5,
OUTLINE_FONTS = 6,
DIRECT_HWND_RENDER = 7,
};
virtual bool SupportsFeature(SurfaceFeature_e feature) = 0;
virtual void RestrictPaintToSinglePanel(VPANEL panel) = 0;
virtual void SetModalPanel(VPANEL) = 0;
virtual VPANEL GetModalPanel() = 0;
virtual void UnlockCursor() = 0;
virtual void LockCursor() = 0;
virtual void SetTranslateExtendedKeys(bool state) = 0;
virtual VPANEL GetTopmostPopup() = 0;
virtual void SetTopLevelFocus(VPANEL panel) = 0;
virtual HFont CreateFont() = 0;
enum EFontFlags
{
FONTFLAG_NONE,
FONTFLAG_ITALIC = 0x001,
FONTFLAG_UNDERLINE = 0x002,
FONTFLAG_STRIKEOUT = 0x004,
FONTFLAG_SYMBOL = 0x008,
FONTFLAG_ANTIALIAS = 0x010,
FONTFLAG_GAUSSIANBLUR = 0x020,
FONTFLAG_ROTARY = 0x040,
FONTFLAG_DROPSHADOW = 0x080,
FONTFLAG_ADDITIVE = 0x100,
FONTFLAG_OUTLINE = 0x200,
FONTFLAG_CUSTOM = 0x400,
FONTFLAG_BITMAP = 0x800,
};
virtual bool SetFontGlyphSet(HFont font, const char* windowsFontName, int tall, int weight, int blur, int scanlines, int flags, int nRangeMin = 0, int nRangeMax = 0) = 0;
virtual bool AddCustomFontFile(const char* fontName, const char* fontFileName) = 0;
virtual int GetFontTall(HFont font) = 0;
virtual int GetFontAscent(HFont font, wchar_t wch) = 0;
virtual bool IsFontAdditive(HFont font) = 0;
virtual void GetCharABCwide(HFont font, int ch, int& a, int& b, int& c) = 0;
virtual int GetCharacterWidth(HFont font, int ch) = 0;
virtual void GetTextSize(HFont font, const wchar_t* text, int& wide, int& tall) = 0;
virtual VPANEL GetNotifyPanel() = 0;
virtual void SetNotifyIcon(VPANEL context, HTexture icon, VPANEL panelToReceiveMessages, const char* text) = 0;
virtual void PlaySound(const char* fileName) = 0;
virtual int GetPopupCount() = 0;
virtual VPANEL GetPopup(int index) = 0;
virtual bool ShouldPaintChildPanel(VPANEL childPanel) = 0;
virtual bool RecreateContext(VPANEL panel) = 0;
virtual void AddPanel(VPANEL panel) = 0;
virtual void ReleasePanel(VPANEL panel) = 0;
virtual void MovePopupToFront(VPANEL panel) = 0;
virtual void MovePopupToBack(VPANEL panel) = 0;
virtual void SolveTraverse(VPANEL panel, bool forceApplySchemeSettings = false) = 0;
virtual void PaintTraverse(VPANEL panel) = 0;
virtual void EnableMouseCapture(VPANEL panel, bool state) = 0;
virtual void GetWorkspaceBounds(int& x, int& y, int& wide, int& tall) = 0;
virtual void GetAbsoluteWindowBounds(int& x, int& y, int& wide, int& tall) = 0;
virtual void GetProportionalBase(int& width, int& height) = 0;
virtual void CalculateMouseVisible() = 0;
virtual bool NeedKBInput() = 0;
virtual bool HasCursorPosFunctions() = 0;
virtual void SurfaceGetCursorPos(int& x, int& y) = 0;
virtual void SurfaceSetCursorPos(int x, int y) = 0;
virtual void DrawTexturedLine(const Vertex_t& a, const Vertex_t& b) = 0;
virtual void DrawOutlinedCircle(int x, int y, int radius, int segments) = 0;
virtual void DrawTexturedPolyLine(const Vertex_t* p, int n) = 0;
virtual void DrawTexturedSubRect(int x0, int y0, int x1, int y1, float texs0, float text0, float texs1, float text1) = 0;
virtual void DrawTexturedPolygon(int n, Vertex_t* pVertice, bool bClipVertices = true) = 0;
virtual const wchar_t* GetTitle(VPANEL panel) = 0;
virtual bool IsCursorLocked(void) const = 0;
virtual void SetWorkspaceInsets(int left, int top, int right, int bottom) = 0;
virtual void DrawWordBubble(int x0, int y0, int x1, int y1, int nBorderThickness, Color rgbaBackground, Color rgbaBorder,
bool bPointer = false, int nPointerX = 0, int nPointerY = 0, int nPointerBaseThickness = 16) = 0;
virtual bool DrawGetUnicodeCharRenderInfo(wchar_t ch, CharRenderInfo& info) = 0;
virtual void DrawRenderCharFromInfo(const CharRenderInfo& info) = 0;
virtual void DrawSetAlphaMultiplier(float alpha ) = 0;
virtual float DrawGetAlphaMultiplier() = 0;
virtual void SetAllowHTMLJavaScript(bool state) = 0;
virtual void OnScreenSizeChanged(int nOldWidth, int nOldHeight) = 0;
virtual vgui::HCursor CreateCursorFromFile(char const* curOrAniFile, char const* pPathID = 0) = 0;
virtual IVguiMatInfo* DrawGetTextureMatInfoFactory(int id) = 0;
virtual void PaintTraverseEx(VPANEL panel, bool paintPopups = false) = 0;
virtual float GetZPos() const = 0;
virtual void SetPanelForInput(VPANEL vpanel) = 0;
virtual void DrawFilledRectFastFade(int x0, int y0, int x1, int y1, int fadeStartPt, int fadeEndPt, unsigned int alpha0, unsigned int alpha1, bool bHorizontal) = 0;
virtual void DrawFilledRectFade(int x0, int y0, int x1, int y1, unsigned int alpha0, unsigned int alpha1, bool bHorizontal) = 0;
virtual void DrawSetTextureRGBAEx(int id, const unsigned char* rgba, int wide, int tall, ImageFormat imageFormat) = 0;
virtual void DrawSetTextScale(float sx, float sy) = 0;
virtual bool SetBitmapFontGlyphSet(HFont font, const char* windowsFontName, float scalex, float scaley, int flags) = 0;
virtual bool AddBitmapFontFile(const char* fontFileName) = 0;
virtual void SetBitmapFontName(const char* pName, const char* pFontFilename) = 0;
virtual const char* GetBitmapFontName(const char* pName) = 0;
virtual void ClearTemporaryFontCache(void) = 0;
virtual IImage* GetIconImageForFullPath(char const* pFullPath) = 0;
virtual void DrawUnicodeString(const wchar_t* pwString, FontDrawType_t drawType = FONT_DRAW_DEFAULT) = 0;
virtual void PrecacheFontCharacters(HFont font, const wchar_t* pCharacters) = 0;
virtual const char* GetFontName(HFont font) = 0;
virtual bool ForceScreenSizeOverride(bool bState, int wide, int tall) = 0;
virtual bool ForceScreenPosOffset(bool bState, int x, int y) = 0;
virtual void OffsetAbsPos(int& x, int& y) = 0;
virtual void SetAbsPosForContext(int id, int x, int y) = 0;
virtual void GetAbsPosForContext(int id, int& x, int& y) = 0;
virtual void ResetFontCaches() = 0;
virtual bool IsScreenSizeOverrideActive(void) = 0;
virtual bool IsScreenPosOverrideActive(void) = 0;
virtual void DestroyTextureID(int id) = 0;
virtual int GetTextureNumFrames(int id) = 0;
virtual void DrawSetTextureFrame(int id, int nFrame, unsigned int* pFrameCache) = 0;
virtual void GetClipRect(int& x0, int& y0, int& x1, int& y1) = 0;
virtual void SetClipRect(int x0, int y0, int x1, int y1) = 0;
virtual void DrawTexturedRectEx(DrawTexturedRectParms_t* pDrawParms) = 0;
virtual void GetKernedCharWidth(HFont font, wchar_t ch, wchar_t chBefore, wchar_t chAfter, float& wide, float& abcA, float& abcC) = 0;
virtual void DrawUpdateRegionTextureRGBA(int nTextureID, int x, int y, const unsigned char* pchData, int wide, int tall, ImageFormat imageFormat) = 0;
virtual bool BHTMLWindowNeedsPaint(IHTML* htmlwin) = 0;
virtual void DrawSetTextureRGBALinear(int id, const unsigned char* rgba, int wide, int tall) = 0;
virtual const char* GetWebkitHTMLUserAgentString() = 0;
virtual void* Deprecated_AccessChromeHTMLController() = 0;
};
}
#define VGUI_SURFACE_INTERFACE_VERSION "VGUI_Surface030"
#endif

86
SpyCustom/sdk/ISystem.h Normal file
View File

@ -0,0 +1,86 @@
#ifndef ISYSTEM_H
#define ISYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "VGUI.h"
#include "KeyCode.h"
#ifdef PlaySound
#undef PlaySound
#endif
class KeyValues;
namespace vgui
{
class ISystem : public IBaseInterface
{
public:
virtual void Shutdown() = 0;
virtual void RunFrame() = 0;
virtual void ShellExecute(const char* command, const char* file) = 0;
virtual double GetFrameTime() = 0;
virtual double GetCurrentTime() = 0;
virtual long GetTimeMillis() = 0;
virtual int GetClipboardTextCount() = 0;
virtual void SetClipboardText(const char* text, int textLen) = 0;
virtual void SetClipboardText(const wchar_t* text, int textLen) = 0;
virtual int GetClipboardText(int offset, char* buf, int bufLen) = 0;
virtual int GetClipboardText(int offset, wchar_t* buf, int bufLen) = 0;
virtual bool SetRegistryString(const char* key, const char* value) = 0;
virtual bool GetRegistryString(const char* key, char* value, int valueLen) = 0;
virtual bool SetRegistryInteger(const char* key, int value) = 0;
virtual bool GetRegistryInteger(const char* key, int& value) = 0;
virtual KeyValues* GetUserConfigFileData(const char* dialogName, int dialogID) = 0;
virtual void SetUserConfigFile(const char* fileName, const char* pathName) = 0;
virtual void SaveUserConfigFile() = 0;
virtual bool SetWatchForComputerUse(bool state) = 0;
virtual double GetTimeSinceLastUse() = 0;
virtual int GetAvailableDrives(char* buf, int bufLen) = 0;
virtual bool CommandLineParamExists(const char* paramName) = 0;
virtual const char* GetFullCommandLine() = 0;
virtual KeyCode KeyCode_VirtualKeyToVGUI(int keyCode) = 0;
virtual bool GetCurrentTimeAndDate(int* year, int* month, int* dayOfWeek, int* day, int* hour, int* minute, int* second) = 0;
virtual double GetFreeDiskSpace(const char* path) = 0;
virtual bool CreateShortcut(const char* linkFileName, const char* targetPath, const char* arguments, const char* workingDirectory, const char* iconFile) = 0;
virtual bool GetShortcutTarget(const char* linkFileName, char* targetPath, char* arguments, int destBufferSizes) = 0;
virtual bool ModifyShortcutTarget(const char* linkFileName, const char* targetPath, const char* arguments, const char* workingDirectory) = 0;
virtual bool GetCommandLineParamValue(const char* paramName, char* value, int valueBufferSize) = 0;
virtual bool DeleteRegistryKey(const char* keyName) = 0;
virtual const char* GetDesktopFolderPath() = 0;
virtual void ShellExecuteEx(const char* command, const char* file, const char* pParams) = 0;
virtual void SetClipboardImage(void* pWnd, int x1, int y1, int x2, int y2) = 0;
};
}
#define VGUI_SYSTEM_INTERFACE_VERSION "VGUI_System010"
#endif

79
SpyCustom/sdk/IVGUI.h Normal file
View File

@ -0,0 +1,79 @@
#ifndef IVGUI_H
#define IVGUI_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "VGUI.h"
#include "IAppSystem.h"
class KeyValues;
namespace vgui
{
typedef unsigned long HPanel;
typedef int HContext;
enum
{
DEFAULT_VGUI_CONTEXT = ((vgui::HContext)~0)
};
typedef unsigned long HPanel;
class IVGui : public IAppSystem
{
public:
virtual void Start() = 0;
virtual void Stop() = 0;
virtual bool IsRunning() = 0;
virtual void RunFrame() = 0;
virtual void ShutdownMessage(unsigned int shutdownID) = 0;
virtual VPANEL AllocPanel() = 0;
virtual void FreePanel(VPANEL panel) = 0;
virtual void DPrintf(PRINTF_FORMAT_STRING const char* format, ...) = 0;
virtual void DPrintf2(PRINTF_FORMAT_STRING const char* format, ...) = 0;
virtual void SpewAllActivePanelNames() = 0;
virtual HPanel PanelToHandle(VPANEL panel) = 0;
virtual VPANEL HandleToPanel(HPanel index) = 0;
virtual void MarkPanelForDeletion(VPANEL panel) = 0;
virtual void AddTickSignal(VPANEL panel, int intervalMilliseconds = 0) = 0;
virtual void RemoveTickSignal(VPANEL panel) = 0;
virtual void PostMessage(VPANEL target, KeyValues* params, VPANEL from, float delaySeconds = 0.0f) = 0;
virtual HContext CreateContext() = 0;
virtual void DestroyContext(HContext context) = 0;
virtual void AssociatePanelWithContext(HContext context, VPANEL pRoot) = 0;
virtual void ActivateContext(HContext context) = 0;
virtual void SetSleep(bool state) = 0;
virtual bool GetShouldVGuiControlSleep() = 0;
virtual void SetVRMode(bool bVRMode) = 0;
virtual bool GetVRMode() = 0;
virtual void AddTickSignalToHead(VPANEL panel, int intervalMilliseconds = 0) = 0;
};
#define VGUI_IVGUI_INTERFACE_VERSION "VGUI_ivgui008"
};
#endif

View File

@ -0,0 +1,17 @@
#ifndef IVGUIMATINFO_H
#define IVGUIMATINFO_H
#include "IVguiMatInfoVar.h"
class IVguiMatInfo
{
public:
virtual ~IVguiMatInfo() {}
virtual IVguiMatInfoVar* FindVarFactory(const char* varName, bool* found) = 0;
virtual int GetNumAnimationFrames() = 0;
};
#endif

View File

@ -0,0 +1,15 @@
#ifndef IVGUIMATINFOVAR_H
#define IVGUIMATINFOVAR_H
class IVguiMatInfoVar
{
public:
virtual ~IVguiMatInfoVar() {}
virtual int GetIntValue(void) const = 0;
virtual void SetIntValue(int val) = 0;
};
#endif

64
SpyCustom/sdk/Image.h Normal file
View File

@ -0,0 +1,64 @@
#ifndef IMAGE_H
#define IMAGE_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "Color.h"
#include "IImage.h"
namespace vgui
{
class Panel;
class Image : public IImage
{
public:
Image();
virtual ~Image();
virtual void SetPos(int x, int y);
virtual void GetPos(int& x, int& y);
virtual void GetSize(int& wide, int& tall);
virtual void GetContentSize(int& wide, int& tall);
virtual void SetColor(Color color);
virtual void SetBkColor(Color color) { DrawSetColor(color); }
virtual Color GetColor();
virtual bool Evict();
virtual int GetNumFrames();
virtual void SetFrame(int nFrame);
virtual HTexture GetID();
virtual void SetRotation(int iRotation) { return; };
protected:
virtual void SetSize(int wide, int tall);
virtual void DrawSetColor(Color color);
virtual void DrawSetColor(int r, int g, int b, int a);
virtual void DrawFilledRect(int x0, int y0, int x1, int y1);
virtual void DrawOutlinedRect(int x0, int y0, int x1, int y1);
virtual void DrawLine(int x0, int y0, int x1, int y1);
virtual void DrawPolyLine(int* px, int* py, int numPoints);
virtual void DrawSetTextFont(HFont font);
virtual void DrawSetTextColor(Color color);
virtual void DrawSetTextColor(int r, int g, int b, int a);
virtual void DrawSetTextPos(int x, int y);
virtual void DrawPrintText(const wchar_t* str, int strlen);
virtual void DrawPrintText(int x, int y, const wchar_t* str, int strlen);
virtual void DrawPrintChar(wchar_t ch);
virtual void DrawPrintChar(int x, int y, wchar_t ch);
virtual void DrawSetTexture(int id);
virtual void DrawTexturedRect(int x0, int y0, int x1, int y1);
virtual void Paint() = 0;
private:
int _pos[2];
int _size[2];
Color _color;
};
}
#endif

View File

@ -0,0 +1,82 @@
#ifndef INPUTENUMS_H
#define INPUTENUMS_H
#ifdef _WIN32
#pragma once
#endif
#define MAX_BUTTONSAMPLE 32768
#if !defined( _X360 )
#define INVALID_USER_ID -1
#else
#define INVALID_USER_ID XBX_INVALID_USER_ID
#endif
enum
{
MAX_JOYSTICKS = 1,
MOUSE_BUTTON_COUNT = 5,
MAX_NOVINT_DEVICES = 2,
};
#if defined( LINUX )
enum JoystickAxis_t
{
JOY_AXIS_X = 0,
JOY_AXIS_Y,
JOY_AXIS_Z,
JOY_AXIS_U,
JOY_AXIS_R,
JOY_AXIS_V,
MAX_JOYSTICK_AXES,
};
#else
enum JoystickAxis_t
{
JOY_AXIS_X = 0,
JOY_AXIS_Y,
JOY_AXIS_Z,
JOY_AXIS_R,
JOY_AXIS_U,
JOY_AXIS_V,
MAX_JOYSTICK_AXES,
};
#endif
enum
{
MS_WM_XBUTTONDOWN = 0x020B,
MS_WM_XBUTTONUP = 0x020C,
MS_WM_XBUTTONDBLCLK = 0x020D,
MS_MK_BUTTON4 = 0x0020,
MS_MK_BUTTON5 = 0x0040,
};
enum InputEventType_t
{
IE_ButtonPressed = 0,
IE_ButtonReleased,
IE_ButtonDoubleClicked,
IE_AnalogValueChanged,
IE_FirstSystemEvent = 100,
IE_Quit = IE_FirstSystemEvent,
IE_ControllerInserted,
IE_ControllerUnplugged,
IE_FirstVguiEvent = 1000,
IE_FirstAppEvent = 2000,
};
struct InputEvent_t
{
int m_nType;
int m_nTick;
int m_nData;
int m_nData2;
int m_nData3;
};
#endif

View File

@ -0,0 +1,206 @@
#ifndef KEYBINDINGMAP_H
#define KEYBINDINGMAP_H
#ifdef _WIN32
#pragma once
#endif
#include "utlvector.h"
namespace vgui
{
class Panel;
enum
{
MODIFIER_SHIFT = (1 << 0),
MODIFIER_CONTROL = (1 << 1),
MODIFIER_ALT = (1 << 2),
};
struct BoundKey_t
{
BoundKey_t();
BoundKey_t(const BoundKey_t& src);
~BoundKey_t();
BoundKey_t& operator =(const BoundKey_t& src);
bool isbuiltin;
char const* bindingname;
int keycode;
int modifiers;
};
struct KeyBindingMap_t
{
KeyBindingMap_t();
KeyBindingMap_t(const KeyBindingMap_t& src);
~KeyBindingMap_t();
char const* bindingname;
ALIGN16 MessageFunc_t func;
char const* helpstring;
char const* docstring;
bool passive;
};
#define DECLARE_KEYBINDINGMAP( className ) \
static void KB_AddToMap \
( \
char const *bindingname, \
vgui::KeyCode defaultcode, \
int default_modifiers, \
vgui::MessageFunc_t function, \
char const *helpstring, \
char const *docstring, \
bool passive \
) \
{ \
vgui::PanelKeyBindingMap *map = vgui::FindOrAddPanelKeyBindingMap( GetPanelClassName() ); \
\
vgui::KeyBindingMap_t entry; \
entry.bindingname = bindingname; \
\
entry.func = function; \
\
entry.helpstring = helpstring; \
entry.docstring = docstring; \
\
entry.passive = passive; \
\
map->entries.AddToTail( entry ); \
\
vgui::BoundKey_t kb; \
kb.isbuiltin = true; \
kb.bindingname = bindingname; \
kb.keycode = defaultcode; \
kb.modifiers = default_modifiers; \
map->defaultkeys.AddToTail( kb ); \
map->boundkeys.AddToTail( kb ); \
} \
\
static void KB_ChainToMap( void ) \
{ \
static bool chained = false; \
if ( chained ) \
return; \
chained = true; \
vgui::PanelKeyBindingMap *map = vgui::FindOrAddPanelKeyBindingMap( GetPanelClassName() ); \
map->pfnClassName = &GetPanelClassName; \
if ( map && GetPanelBaseClassName() && GetPanelBaseClassName()[0] ) \
{ \
map->baseMap = vgui::FindOrAddPanelKeyBindingMap( GetPanelBaseClassName() ); \
} \
} \
\
static void KB_AddBoundKey \
( \
char const *bindingname, \
int keycode, \
int modifiers \
) \
{ \
vgui::PanelKeyBindingMap *map = vgui::FindOrAddPanelKeyBindingMap( GetPanelClassName() ); \
vgui::BoundKey_t kb; \
kb.isbuiltin = true; \
kb.bindingname = bindingname; \
kb.keycode = keycode; \
kb.modifiers = modifiers; \
map->defaultkeys.AddToTail( kb ); \
map->boundkeys.AddToTail( kb ); \
} \
\
class className##_RegisterKBMap; \
friend class className##_RegisterKBMap; \
class className##_RegisterKBMap \
{ \
public: \
className##_RegisterKBMap() \
{ \
className::KB_ChainToMap(); \
} \
}; \
className##_RegisterKBMap m_RegisterClassKB; \
\
virtual vgui::PanelKeyBindingMap *GetKBMap() \
{ \
static vgui::PanelKeyBindingMap *s_pMap = vgui::FindOrAddPanelKeyBindingMap( GetPanelClassName() ); \
return s_pMap; \
}
#define _KBMapFuncCommonFunc( name, keycode, modifiers, function, help, doc, passive ) \
class PanelKBMapFunc_##name; \
friend class PanelKBMapFunc_##name; \
class PanelKBMapFunc_##name \
{ \
public: \
static void InitVar() \
{ \
static bool bAdded = false; \
if ( !bAdded ) \
{ \
bAdded = true; \
KB_AddToMap( #name, keycode, modifiers, (vgui::MessageFunc_t)&ThisClass::function, help, doc, passive ); \
} \
} \
PanelKBMapFunc_##name() \
{ \
PanelKBMapFunc_##name::InitVar(); \
} \
}; \
PanelKBMapFunc_##name m_##name##_register;
#define _KBBindKeyCommon( name, keycode, modifiers, _classname ) \
class PanelKBBindFunc_##_classname; \
friend class PanelKBBindFunc_##_classname; \
class PanelKBBindFunc_##_classname \
{ \
public: \
static void InitVar() \
{ \
static bool bAdded = false; \
if ( !bAdded ) \
{ \
bAdded = true; \
KB_AddBoundKey( #name, keycode, modifiers ); \
} \
} \
PanelKBBindFunc_##_classname() \
{ \
PanelKBBindFunc_##_classname::InitVar(); \
} \
}; \
PanelKBBindFunc_##_classname m_##_classname##_bindkey_register;
#define KEYBINDING_FUNC( name, keycode, modifiers, function, help, doc ) _KBMapFuncCommonFunc( name, keycode, modifiers, function, help, doc, false ); virtual void function()
#define KEYBINDING_FUNC_NODECLARE( name, keycode, modifiers, function, help, doc ) _KBMapFuncCommonFunc( name, keycode, modifiers, function, help, doc, false );
#define KEYBINDING_FUNC_PASSIVE( name, keycode, modifiers, function, help, doc ) _KBMapFuncCommonFunc( name, keycode, modifiers, function, help, doc, true ); virtual void function()
#define KEYBINDING_FUNC_PASSIVE_NODECLARE( name, keycode, modifiers, function, help, doc ) _KBMapFuncCommonFunc( name, keycode, modifiers, function, help, doc, true );
#define KEYBINDING_ADDBINDING( name, keycode, modifiers ) _KBBindKeyCommon( name, keycode, modifiers, name );
#define KEYBINDING_ADDBINDING_MULTIPLE( name, keycode, modifiers, _classname ) _KBBindKeyCommon( name, keycode, modifiers, _classname );
struct PanelKeyBindingMap
{
PanelKeyBindingMap()
{
baseMap = NULL;
pfnClassName = NULL;
processed = false;
}
CUtlVector< KeyBindingMap_t > entries;
bool processed;
PanelKeyBindingMap* baseMap;
CUtlVector< BoundKey_t > defaultkeys;
CUtlVector< BoundKey_t > boundkeys;
char const* (*pfnClassName)(void);
};
PanelKeyBindingMap* FindPanelKeyBindingMap(char const* className);
PanelKeyBindingMap* FindOrAddPanelKeyBindingMap(char const* className);
}
#endif

15
SpyCustom/sdk/KeyCode.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef KEYCODE_H
#define KEYCODE_H
#ifdef _WIN32
#pragma once
#endif
#include "ButtonCode.h"
namespace vgui
{
typedef ButtonCode_t KeyCode;
}
#endif

167
SpyCustom/sdk/Label.h Normal file
View File

@ -0,0 +1,167 @@
#ifndef LABEL_H
#define LABEL_H
#ifdef _WIN32
#pragma once
#endif
#include "utlvector.h"
#include "VGUI.h"
#include "Panel.h"
#include "PHandle.h"
namespace vgui
{
class Label : public Panel
{
DECLARE_CLASS_SIMPLE(Label, Panel);
public:
Label(Panel* parent, const char* panelName, const char* text);
Label(Panel* parent, const char* panelName, const wchar_t* wszText);
~Label();
public:
virtual void SetText(const char* tokenName);
virtual void SetText(const wchar_t* unicodeString, bool bClearUnlocalizedSymbol = false);
virtual void GetText(OUT_Z_BYTECAP(bufferLen) char* textOut, int bufferLen);
virtual void GetText(OUT_Z_BYTECAP(bufLenInBytes) wchar_t* textOut, int bufLenInBytes);
virtual void GetContentSize(int& wide, int& tall);
enum Alignment
{
a_northwest = 0,
a_north,
a_northeast,
a_west,
a_center,
a_east,
a_southwest,
a_south,
a_southeast,
};
virtual void SetContentAlignment(Alignment alignment);
virtual void SetEnabled(bool state);
virtual void SetTextInset(int xInset, int yInset);
virtual void GetTextInset(int* xInset, int* yInset);
virtual void SetFgColor(Color color);
virtual Color GetFgColor();
virtual void SetDisabledFgColor1(Color color);
virtual void SetDisabledFgColor2(Color color);
virtual Color GetDisabledFgColor1();
virtual Color GetDisabledFgColor2();
enum EColorState
{
CS_NORMAL,
CS_DULL,
CS_BRIGHT,
};
virtual void SetTextColorState(EColorState state);
virtual void SetFont(HFont font);
virtual HFont GetFont();
virtual Panel* HasHotkey(wchar_t key);
virtual void SetHotkey(wchar_t key);
virtual wchar_t GetHotKey();
virtual void SetAssociatedControl(Panel* control);
virtual int AddImage(IImage* image, int preOffset);
virtual void SetImageAtIndex(int index, IImage* image, int preOffset);
virtual void SetImagePreOffset(int index, int preOffset);
virtual IImage* GetImageAtIndex(int index);
virtual int GetImageCount();
virtual void ClearImages();
virtual void ResetToSimpleTextImage();
virtual void SetImageBounds(int index, int x, int width);
virtual TextImage* GetTextImage();
virtual int SetTextImageIndex(int newIndex);
virtual bool RequestInfo(KeyValues* outputData);
virtual void SizeToContents();
enum Padding
{
Content = 8,
};
void SetWrap(bool bWrap);
void SetCenterWrap(bool bWrap);
void SetAllCaps(bool bAllCaps);
protected:
virtual void PerformLayout();
virtual wchar_t CalculateHotkey(const char* text);
virtual wchar_t CalculateHotkey(const wchar_t* text);
virtual void ComputeAlignment(int& tx0, int& ty0, int& tx1, int& ty1);
virtual void Paint();
MESSAGE_FUNC_PARAMS(OnSetText, "SetText", params);
virtual void DrawDashedLine(int x0, int y0, int x1, int y1, int dashLen, int gapLen);
virtual void OnRequestFocus(VPANEL subFocus, VPANEL defaultPanel);
MESSAGE_FUNC(OnHotkeyPressed, "Hotkey");
virtual void OnMousePressed(MouseCode code);
virtual void OnSizeChanged(int wide, int tall);
virtual void EnsureImageCapacity(int maxIndex);
virtual void ApplySchemeSettings(IScheme* pScheme);
virtual void GetSettings(KeyValues* outResourceData);
virtual void ApplySettings(KeyValues* inResourceData);
virtual const char* GetDescription(void);
MESSAGE_FUNC_PARAMS(OnDialogVariablesChanged, "DialogVariables", dialogVariables);
void HandleAutoSizing(void);
private:
void Init();
Alignment _contentAlignment;
TextImage* _textImage;
struct TImageInfo
{
IImage* image;
short offset;
short xpos;
short width;
};
CUtlVector<TImageInfo> _imageDar;
int _textInset[2];
Color _disabledFgColor1;
Color _disabledFgColor2;
Color _associateColor;
int _textImageIndex;
EColorState _textColorState;
PHandle _associate;
char* _associateName;
char* _fontOverrideName;
wchar_t _hotkey;
bool m_bWrap;
bool m_bCenterWrap;
bool m_bAllCaps;
bool m_bAutoWideToContents;
bool m_bAutoWideDirty;
bool m_bUseProportionalInsets;
};
}
#endif

147
SpyCustom/sdk/gametrace.h Normal file
View File

@ -0,0 +1,147 @@
#ifndef GAMETRACE_H
#define GAMETRACE_H
#ifdef _WIN32
#pragma once
#endif
#include "cmodel.h"
#include "utlvector.h"
#include "ihandleentity.h"
#include "ispatialpartition.h"
#if defined( CLIENT_DLL )
class C_BaseEntity;
#else
class CBaseEntity;
#endif
class CGameTrace : public CBaseTrace
{
public:
bool DidHitWorld() const;
bool DidHitNonWorldEntity() const;
int GetEntityIndex() const;
bool DidHit() const;
bool isVisible() const;
#if defined( ENGINE_DLL )
void SetEdict(edict_t* pEdict);
edict_t* GetEdict() const;
#endif
public:
float fractionleftsolid;
csurface_t surface;
int hitgroup;
short physicsbone;
#if defined( CLIENT_DLL )
C_BaseEntity* m_pEnt;
#else
IClientEntity* m_pEnt;
#endif
int hitbox;
CGameTrace() {}
private:
CGameTrace(const CGameTrace& vOther);
};
inline bool CGameTrace::DidHit() const
{
return fraction < 1 || allsolid || startsolid;
}
typedef CGameTrace trace_t;
#define TLD_DEF_LEAF_MAX 256
#define TLD_DEF_ENTITY_MAX 1024
class CTraceListData : public IPartitionEnumerator
{
public:
CTraceListData(int nLeafMax = TLD_DEF_LEAF_MAX, int nEntityMax = TLD_DEF_ENTITY_MAX)
{
MEM_ALLOC_CREDIT();
m_nLeafCount = 0;
m_aLeafList.SetSize(nLeafMax);
m_nEntityCount = 0;
m_aEntityList.SetSize(nEntityMax);
}
~CTraceListData()
{
m_nLeafCount = 0;
m_aLeafList.RemoveAll();
m_nEntityCount = 0;
m_aEntityList.RemoveAll();
}
void Reset(void)
{
m_nLeafCount = 0;
m_nEntityCount = 0;
}
bool IsEmpty(void) const { return (m_nLeafCount == 0 && m_nEntityCount == 0); }
int LeafCount(void) const { return m_nLeafCount; }
int LeafCountMax(void) const { return m_aLeafList.Count(); }
void LeafCountReset(void) { m_nLeafCount = 0; }
int EntityCount(void) const { return m_nEntityCount; }
int EntityCountMax(void) const { return m_aEntityList.Count(); }
void EntityCountReset(void) { m_nEntityCount = 0; }
void AddLeaf(int iLeaf)
{
if (m_nLeafCount >= m_aLeafList.Count())
{
DevMsg("CTraceListData: Max leaf count along ray exceeded!\n");
m_aLeafList.AddMultipleToTail(m_aLeafList.Count());
}
m_aLeafList[m_nLeafCount] = iLeaf;
m_nLeafCount++;
}
IterationRetval_t EnumElement(IHandleEntity* pHandleEntity)
{
if (m_nEntityCount >= m_aEntityList.Count())
{
DevMsg("CTraceListData: Max entity count along ray exceeded!\n");
m_aEntityList.AddMultipleToTail(m_aEntityList.Count());
}
m_aEntityList[m_nEntityCount] = pHandleEntity;
m_nEntityCount++;
return ITERATION_CONTINUE;
}
public:
int m_nLeafCount;
CUtlVector<int> m_aLeafList;
int m_nEntityCount;
CUtlVector<IHandleEntity*> m_aEntityList;
};
#endif

View File

@ -0,0 +1,84 @@
#ifndef GENERICHASH_H
#define GENERICHASH_H
#if defined(_WIN32)
#pragma once
#endif
unsigned FASTCALL HashString(const char* pszKey);
unsigned FASTCALL HashStringCaseless(const char* pszKey);
unsigned FASTCALL HashStringCaselessConventional(const char* pszKey);
unsigned FASTCALL Hash4(const void* pKey);
unsigned FASTCALL Hash8(const void* pKey);
unsigned FASTCALL Hash12(const void* pKey);
unsigned FASTCALL Hash16(const void* pKey);
unsigned FASTCALL HashBlock(const void* pKey, unsigned size);
unsigned FASTCALL HashInt(const int key);
FORCEINLINE uint32 HashIntAlternate(uint32 n)
{
n = (n + 0x7ed55d16) + (n << 12);
n = (n ^ 0xc761c23c) ^ (n >> 19);
n = (n + 0x165667b1) + (n << 5);
n = (n + 0xd3a2646c) ^ (n << 9);
n = (n + 0xfd7046c5) + (n << 3);
n = (n ^ 0xb55a4f09) ^ (n >> 16);
return n;
}
inline unsigned HashIntConventional(const int n)
{
unsigned hash = 0xAAAAAAAA + (n & 0xFF);
hash = (hash << 5) + hash + ((n >> 8) & 0xFF);
hash = (hash << 5) + hash + ((n >> 16) & 0xFF);
hash = (hash << 5) + hash + ((n >> 24) & 0xFF);
return hash;
}
template <typename T>
inline unsigned HashItem(const T& item)
{
if (sizeof(item) == 4)
return Hash4(&item);
else if (sizeof(item) == 8)
return Hash8(&item);
else if (sizeof(item) == 12)
return Hash12(&item);
else if (sizeof(item) == 16)
return Hash16(&item);
else
return HashBlock(&item, sizeof(item));
}
template <> inline unsigned HashItem<int>(const int& key)
{
return HashInt(key);
}
template <> inline unsigned HashItem<unsigned>(const unsigned& key)
{
return HashInt((int)key);
}
template<> inline unsigned HashItem<const char*>(const char* const& pszKey)
{
return HashString(pszKey);
}
template<> inline unsigned HashItem<char*>(char* const& pszKey)
{
return HashString(pszKey);
}
uint32 MurmurHash2(const void* key, int len, uint32 seed);
uint32 MurmurHash2LowerCase(char const* pString, uint32 nSeed);
uint64 MurmurHash64(const void* key, int len, uint32 seed);
#endif

View File

@ -0,0 +1,73 @@
#ifndef GLOBALVARS_BASE_H
#define GLOBALVARS_BASE_H
#ifdef _WIN32
#pragma once
#endif
class CSaveRestoreData;
class CGlobalVarsBase
{
public:
CGlobalVarsBase(bool bIsClient);
bool IsClient() const;
int GetNetworkBase(int nTick, int nEntity);
public:
float realtime;
int framecount;
float absoluteframetime;
float absoluteframestarttimestddev;
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;
bool m_bRemoteClient;
int nTimestampNetworkingBase;
int nTimestampRandomizeWindow;
};
inline int CGlobalVarsBase::GetNetworkBase(int nTick, int nEntity)
{
int nEntityMod = nEntity % nTimestampRandomizeWindow;
int nBaseTick = nTimestampNetworkingBase * (int)((nTick - nEntityMod) / nTimestampNetworkingBase);
return nBaseTick;
}
inline CGlobalVarsBase::CGlobalVarsBase(bool bIsClient) :
m_bClient(bIsClient),
nTimestampNetworkingBase(100),
nTimestampRandomizeWindow(32)
{
}
inline bool CGlobalVarsBase::IsClient() const
{
return m_bClient;
}
#endif

View File

@ -0,0 +1,14 @@
#ifndef GROUNDLINK_H
#define GROUNDLINK_H
#ifdef _WIN32
#pragma once
#endif
struct groundlink_t
{
EHANDLE entity;
groundlink_t* nextLink;
groundlink_t* prevLink;
};
#endif

View File

@ -0,0 +1,105 @@
#ifndef HTMLMESSAGES_H
#define HTMLMESSAGES_H
#ifdef _WIN32
#pragma once
#endif
enum EHTMLCommands
{
eHTMLCommands_KeyUp,
eHTMLCommands_KeyDown,
eHTMLCommands_KeyChar,
eHTMLCommands_MouseDown,
eHTMLCommands_MouseUp,
eHTMLCommands_MouseDblClick,
eHTMLCommands_MouseWheel,
eHTMLCommands_MouseMove,
eHTMLCommands_MouseLeave,
eHTMLCommands_BrowserCreate,
eHTMLCommands_BrowserRemove,
eHTMLCommands_BrowserErrorStrings,
eHTMLCommands_BrowserSize,
eHTMLCommands_BrowserPosition,
eHTMLCommands_PostURL,
eHTMLCommands_StopLoad,
eHTMLCommands_Reload,
eHTMLCommands_GoForward,
eHTMLCommands_GoBack,
eHTMLCommands_Copy,
eHTMLCommands_Paste,
eHTMLCommands_ExecuteJavaScript,
eHTMLCommands_SetFocus,
eHTMLCommands_HorizontalScrollBarSize,
eHTMLCommands_VerticalScrollBarSize,
eHTMLCommands_Find,
eHTMLCommands_StopFind,
eHTMLCommands_SetHorizontalScroll,
eHTMLCommands_SetVerticalScroll,
eHTMLCommands_SetZoomLevel,
eHTMLCommands_ViewSource,
eHTMLCommands_NeedsPaintResponse,
eHTMLCommands_AddHeader,
eHTMLCommands_GetZoom,
eHTMLCommands_FileLoadDialogResponse,
eHTMLCommands_LinkAtPosition,
eHTMLCommands_ZoomToElementAtPosition,
eHTMLCommands_SavePageToJPEG,
eHTMLCommands_JSAlert,
eHTMLCommands_JSConfirm,
eHTMLCommands_CanGoBackandForward,
eHTMLCommands_OpenSteamURL,
eHTMLCommands_SizePopup,
eHTMLCommands_SetCookie,
eHTMLCommands_SetTargetFrameRate,
eHTMLCommands_FullRepaint,
eHTMLCommands_SetPageScale,
eHTMLCommands_RequestFullScreen,
eHTMLCommands_ExitFullScreen,
eHTMLCommands_GetCookiesForURL,
eHTMLCommands_ZoomToCurrentlyFocusedNode,
eHTMLCommands_CloseFullScreenFlashIfOpen,
eHTMLCommands_PauseFullScreenFlashMovieIfOpen,
eHTMLCommands_GetFocusedNodeValue,
eHTMLCommands_BrowserCreateResponse,
eHTMLCommands_BrowserReady,
eHTMLCommands_URLChanged,
eHTMLCommands_FinishedRequest,
eHTMLCommands_StartRequest,
eHTMLCommands_ShowPopup,
eHTMLCommands_HidePopup,
eHTMLCommands_OpenNewTab,
eHTMLCommands_PopupHTMLWindow,
eHTMLCommands_PopupHTMLWindowResponse,
eHTMLCommands_SetHTMLTitle,
eHTMLCommands_LoadingResource,
eHTMLCommands_StatusText,
eHTMLCommands_SetCursor,
eHTMLCommands_FileLoadDialog,
eHTMLCommands_ShowToolTip,
eHTMLCommands_UpdateToolTip,
eHTMLCommands_HideToolTip,
eHTMLCommands_SearchResults,
eHTMLCommands_Close,
eHTMLCommands_VerticalScrollBarSizeResponse,
eHTMLCommands_HorizontalScrollBarSizeResponse,
eHTMLCommands_GetZoomResponse,
eHTMLCommands_StartRequestResponse,
eHTMLCommands_NeedsPaint,
eHTMLCommands_LinkAtPositionResponse,
eHTMLCommands_ZoomToElementAtPositionResponse,
eHTMLCommands_JSDialogResponse,
eHTMLCommands_ScaleToValueResponse,
eHTMLCommands_RequestFullScreenResponse,
eHTMLCommands_GetCookiesForURLResponse,
eHTMLCommands_NodeGotFocus,
eHTMLCommands_SavePageToJPEGResponse,
eHTMLCommands_GetFocusedNodeValueResponse,
eHTMLCommands_None,
};
#endif

171
SpyCustom/sdk/hud.h Normal file
View File

@ -0,0 +1,171 @@
#ifndef HUD_H
#define HUD_H
#ifdef _WIN32
#pragma once
#endif
#include "utlvector.h"
#include "utldict.h"
#include "convar.h"
#include "VGUI.h"
#include "Color.h"
#include "bitbuf.h"
namespace vgui
{
class IScheme;
}
typedef struct wrect_s
{
int left;
int right;
int top;
int bottom;
} wrect_t;
class CHudTexture
{
public:
CHudTexture();
CHudTexture& operator =(const CHudTexture& src);
virtual ~CHudTexture();
int Width() const
{
return rc.right - rc.left;
}
int Height() const
{
return rc.bottom - rc.top;
}
void Precache(void);
int EffectiveWidth(float flScale) const;
int EffectiveHeight(float flScale) const;
void DrawSelf(int x, int y, const Color& clr) const;
void DrawSelf(int x, int y, int w, int h, const Color& clr) const;
void DrawSelfCropped(int x, int y, int cropx, int cropy, int cropw, int croph, Color clr) const;
void DrawSelfCropped(int x, int y, int cropx, int cropy, int cropw, int croph, int finalWidth, int finalHeight, Color clr) const;
char szShortName[64];
char szTextureFile[64];
bool bRenderUsingFont;
bool bPrecached;
char cCharacterInFont;
vgui::HFont hFont;
int textureId;
float texCoords[4];
wrect_t rc;
};
#include "hudtexturehandle.h"
class CHudElement;
class CHudRenderGroup;
class CHud
{
public:
static const int HUDPB_HORIZONTAL;
static const int HUDPB_VERTICAL;
static const int HUDPB_HORIZONTAL_INV;
public:
CHud();
~CHud();
void Init(void);
void VidInit(void);
void Shutdown(void);
void LevelInit(void);
void LevelShutdown(void);
void ResetHUD(void);
void OnRestore();
void Think();
void ProcessInput(bool bActive);
void UpdateHud(bool bActive);
void InitColors(vgui::IScheme* pScheme);
void AddHudElement(CHudElement* pHudElement);
void RemoveHudElement(CHudElement* pHudElement);
CHudElement* FindElement(const char* pName);
bool IsHidden(int iHudFlags);
float GetSensitivity();
float GetFOVSensitivityAdjust();
void DrawProgressBar(int x, int y, int width, int height, float percentage, Color& clr, unsigned char type);
void DrawIconProgressBar(int x, int y, CHudTexture* icon, CHudTexture* icon2, float percentage, Color& clr, int type);
CHudTexture* GetIcon(const char* szIcon);
CHudTexture* AddUnsearchableHudIconToList(CHudTexture& texture);
CHudTexture* AddSearchableHudIconToList(CHudTexture& texture);
void RefreshHudTextures();
void MsgFunc_ResetHUD(bf_read& msg);
void MsgFunc_SendAudio(bf_read& msg);
int LookupRenderGroupIndexByName(const char* pszGroupName);
bool LockRenderGroup(int iGroupIndex, CHudElement* pLocker = NULL);
bool UnlockRenderGroup(int iGroupIndex, CHudElement* pLocker = NULL);
bool IsRenderGroupLockedFor(CHudElement* pHudElement, int iGroupIndex);
int RegisterForRenderGroup(const char* pszGroupName);
int AddHudRenderGroup(const char* pszGroupName);
bool DoesRenderGroupExist(int iGroupIndex);
void SetScreenShotTime(float flTime) { m_flScreenShotTime = flTime; }
public:
int m_iKeyBits;
#ifndef _XBOX
float m_flMouseSensitivity;
float m_flMouseSensitivityFactor;
#endif
float m_flFOVSensitivityAdjust;
Color m_clrNormal;
Color m_clrCaution;
Color m_clrYellowish;
CUtlVector< CHudElement* > m_HudList;
private:
void InitFonts();
void SetupNewHudTexture(CHudTexture* t);
bool m_bHudTexturesLoaded;
CUtlDict< CHudTexture*, int > m_Icons;
CUtlVector< const char* > m_RenderGroupNames;
CUtlMap< int, CHudRenderGroup* > m_RenderGroups;
float m_flScreenShotTime;
};
extern CHud gHUD;
extern vgui::HFont g_hFontTrebuchet24;
void LoadHudTextures(CUtlDict< CHudTexture*, int >& list, const char* szFilenameWithoutExtension, const unsigned char* pICEKey);
void GetHudSize(int& w, int& h);
#endif

View File

@ -0,0 +1,405 @@
#ifndef HUD_BASECHAT_H
#define HUD_BASECHAT_H
#ifdef _WIN32
#pragma once
#endif
#include "hudelement.h"
#include "Panel.h"
#include "vgui_basepanel.h"
#include "Frame.h"
#include "TextEntry.h"
#include "RichText.h"
#include "Button.h"
#include "CheckButton.h"
class CBaseHudChatInputLine;
class CBaseHudChatEntry;
class CHudChatFilterPanel;
namespace vgui
{
class IScheme;
};
#define CHATLINE_NUM_FLASHES 8.0f
#define CHATLINE_FLASH_TIME 5.0f
#define CHATLINE_FADE_TIME 1.0f
#define CHAT_HISTORY_FADE_TIME 0.25f
#define CHAT_HISTORY_IDLE_TIME 15.0f
#define CHAT_HISTORY_IDLE_FADE_TIME 2.5f
#define CHAT_HISTORY_ALPHA 127
extern Color g_ColorBlue;
extern Color g_ColorRed;
extern Color g_ColorGreen;
extern Color g_ColorDarkGreen;
extern Color g_ColorYellow;
extern Color g_ColorGrey;
extern ConVar cl_showtextmsg;
enum ChatFilters
{
CHAT_FILTER_NONE = 0,
CHAT_FILTER_JOINLEAVE = 0x000001,
CHAT_FILTER_NAMECHANGE = 0x000002,
CHAT_FILTER_PUBLICCHAT = 0x000004,
CHAT_FILTER_SERVERMSG = 0x000008,
CHAT_FILTER_TEAMCHANGE = 0x000010,
CHAT_FILTER_ACHIEVEMENT = 0x000020,
};
enum TextColor
{
COLOR_NORMAL = 1,
COLOR_USEOLDCOLORS = 2,
COLOR_PLAYERNAME = 3,
COLOR_LOCATION = 4,
COLOR_ACHIEVEMENT = 5,
COLOR_CUSTOM = 6,
COLOR_HEXCODE = 7,
COLOR_HEXCODE_ALPHA = 8,
COLOR_MAX
};
struct TextRange
{
TextRange() { preserveAlpha = false; }
int start;
int end;
Color color;
bool preserveAlpha;
};
void StripEndNewlineFromString(char* str);
void StripEndNewlineFromString(wchar_t* str);
char* ConvertCRtoNL(char* str);
wchar_t* ConvertCRtoNL(wchar_t* str);
wchar_t* ReadLocalizedString(bf_read& msg, OUT_Z_BYTECAP(outSizeInBytes) wchar_t* pOut, int outSizeInBytes, bool bStripNewline, OUT_Z_CAP(originalSize) char* originalString = NULL, int originalSize = 0);
wchar_t* ReadChatTextString(bf_read& msg, OUT_Z_BYTECAP(outSizeInBytes) wchar_t* pOut, int outSizeInBytes);
char* RemoveColorMarkup(char* str);
inline wchar_t* CloneWString(const wchar_t* str)
{
const int nLen = V_wcslen(str) + 1;
wchar_t* cloneStr = new wchar_t[nLen];
const int nSize = nLen * sizeof(wchar_t);
V_wcsncpy(cloneStr, str, nSize);
return cloneStr;
}
class CBaseHudChatLine : public vgui::RichText
{
typedef vgui::RichText BaseClass;
public:
CBaseHudChatLine(vgui::Panel* parent, const char* panelName);
~CBaseHudChatLine();
void SetExpireTime(void);
bool IsReadyToExpire(void);
void Expire(void);
float GetStartTime(void);
int GetCount(void);
virtual void ApplySchemeSettings(vgui::IScheme* pScheme);
vgui::HFont GetFont() { return m_hFont; }
Color GetTextColor(void) { return m_clrText; }
void SetNameLength(int iLength) { m_iNameLength = iLength; }
void SetNameColor(Color cColor) { m_clrNameColor = cColor; }
virtual void PerformFadeout(void);
virtual void InsertAndColorizeText(wchar_t* buf, int clientIndex);
virtual void Colorize(int alpha = 255);
void SetNameStart(int iStart) { m_iNameStart = iStart; }
protected:
int m_iNameLength;
vgui::HFont m_hFont;
Color m_clrText;
Color m_clrNameColor;
float m_flExpireTime;
CUtlVector< TextRange > m_textRanges;
wchar_t* m_text;
int m_iNameStart;
private:
float m_flStartTime;
int m_nCount;
vgui::HFont m_hFontMarlett;
private:
CBaseHudChatLine(const CBaseHudChatLine&);
};
class CHudChatHistory : public vgui::RichText
{
DECLARE_CLASS_SIMPLE(CHudChatHistory, vgui::RichText);
public:
CHudChatHistory(vgui::Panel* pParent, const char* panelName);
virtual void ApplySchemeSettings(vgui::IScheme* pScheme);
};
class CHudChatFilterButton : public vgui::Button
{
DECLARE_CLASS_SIMPLE(CHudChatFilterButton, vgui::Button);
public:
CHudChatFilterButton(vgui::Panel* pParent, const char* pName, const char* pText);
virtual void DoClick(void);
};
class CHudChatFilterCheckButton : public vgui::CheckButton
{
DECLARE_CLASS_SIMPLE(CHudChatFilterCheckButton, vgui::CheckButton);
public:
CHudChatFilterCheckButton(vgui::Panel* pParent, const char* pName, const char* pText, int iFlag);
int GetFilterFlag(void) { return m_iFlag; }
private:
int m_iFlag;
};
class CBaseHudChat : public CHudElement, public vgui::EditablePanel
{
DECLARE_CLASS_SIMPLE(CBaseHudChat, vgui::EditablePanel);
public:
DECLARE_MULTIPLY_INHERITED();
enum
{
CHAT_INTERFACE_LINES = 6,
MAX_CHARS_PER_LINE = 128
};
CBaseHudChat(const char* pElementName);
virtual void CreateChatInputLine(void);
virtual void CreateChatLines(void);
virtual void Init(void);
void LevelInit(const char* newmap);
void LevelShutdown(void);
void MsgFunc_TextMsg(const char* pszName, int iSize, void* pbuf);
virtual void Printf(int iFilter, PRINTF_FORMAT_STRING const char* fmt, ...);
virtual void ChatPrintf(int iPlayerIndex, int iFilter, PRINTF_FORMAT_STRING const char* fmt, ...) FMTFUNCTION(4, 5);
virtual void StartMessageMode(int iMessageModeType);
virtual void StopMessageMode(void);
void Send(void);
MESSAGE_FUNC(OnChatEntrySend, "ChatEntrySend");
MESSAGE_FUNC(OnChatEntryStopMessageMode, "ChatEntryStopMessageMode");
virtual void ApplySchemeSettings(vgui::IScheme* pScheme);
virtual void Paint(void);
virtual void OnTick(void);
virtual void Reset();
#ifdef _XBOX
virtual bool ShouldDraw();
#endif
vgui::Panel* GetInputPanel(void);
static int m_nLineCounter;
virtual int GetChatInputOffset(void);
virtual void FireGameEvent(IGameEvent* event);
CHudChatHistory* GetChatHistory();
void FadeChatHistory();
float m_flHistoryFadeTime;
float m_flHistoryIdleTime;
virtual void MsgFunc_SayText(bf_read& msg);
virtual void MsgFunc_SayText2(bf_read& msg);
virtual void MsgFunc_TextMsg(bf_read& msg);
virtual void MsgFunc_VoiceSubtitle(bf_read& msg);
CBaseHudChatInputLine* GetChatInput(void) { return m_pChatInput; }
CHudChatFilterPanel* GetChatFilterPanel(void);
virtual int GetFilterFlags(void) { return m_iFilterFlags; }
void SetFilterFlag(int iFilter);
virtual Color GetDefaultTextColor(void);
virtual Color GetTextColorForClient(TextColor colorNum, int clientIndex);
virtual Color GetClientColor(int clientIndex);
virtual int GetFilterForString(const char* pString);
virtual const char* GetDisplayedSubtitlePlayerName(int clientIndex);
bool IsVoiceSubtitle(void) { return m_bEnteringVoice; }
void SetVoiceSubtitleState(bool bState) { m_bEnteringVoice = bState; }
int GetMessageMode(void) { return m_nMessageMode; }
void SetCustomColor(Color colNew) { m_ColorCustom = colNew; }
void SetCustomColor(const char* pszColorName);
protected:
CBaseHudChatLine* FindUnusedChatLine(void);
CBaseHudChatInputLine* m_pChatInput;
CBaseHudChatLine* m_ChatLine;
int m_iFontHeight;
CHudChatHistory* m_pChatHistory;
CHudChatFilterButton* m_pFiltersButton;
CHudChatFilterPanel* m_pFilterPanel;
Color m_ColorCustom;
private:
void Clear(void);
int ComputeBreakChar(int width, const char* text, int textlen);
int m_nMessageMode;
int m_nVisibleHeight;
vgui::HFont m_hChatFont;
int m_iFilterFlags;
bool m_bEnteringVoice;
};
class CBaseHudChatEntry : public vgui::TextEntry
{
typedef vgui::TextEntry BaseClass;
public:
CBaseHudChatEntry(vgui::Panel* parent, char const* panelName, vgui::Panel* pChat)
: BaseClass(parent, panelName)
{
SetCatchEnterKey(true);
SetAllowNonAsciiCharacters(true);
SetDrawLanguageIDAtLeft(true);
m_pHudChat = pChat;
}
virtual void ApplySchemeSettings(vgui::IScheme* pScheme)
{
BaseClass::ApplySchemeSettings(pScheme);
SetPaintBorderEnabled(false);
}
virtual void OnKeyCodeTyped(vgui::KeyCode code)
{
if (code == KEY_ENTER || code == KEY_PAD_ENTER || code == KEY_ESCAPE)
{
if (code != KEY_ESCAPE)
{
if (m_pHudChat)
{
PostMessage(m_pHudChat, new KeyValues("ChatEntrySend"));
}
}
if (m_pHudChat)
{
PostMessage(m_pHudChat, new KeyValues("ChatEntryStopMessageMode"));
}
}
else if (code == KEY_TAB)
{
return;
}
else
{
BaseClass::OnKeyCodeTyped(code);
}
}
private:
vgui::Panel* m_pHudChat;
};
class CBaseHudChatInputLine : public vgui::Panel
{
typedef vgui::Panel BaseClass;
public:
CBaseHudChatInputLine(vgui::Panel* parent, char const* panelName);
void SetPrompt(const wchar_t* prompt);
void ClearEntry(void);
void SetEntry(const wchar_t* entry);
void GetMessageText(OUT_Z_BYTECAP(buffersizebytes) wchar_t* buffer, int buffersizebytes);
virtual void PerformLayout();
virtual void ApplySchemeSettings(vgui::IScheme* pScheme);
vgui::Panel* GetInputPanel(void);
virtual vgui::VPANEL GetCurrentKeyFocus() { return m_pInput->GetVPanel(); }
virtual void Paint()
{
BaseClass::Paint();
}
vgui::Label* GetPrompt(void) { return m_pPrompt; }
protected:
vgui::Label* m_pPrompt;
CBaseHudChatEntry* m_pInput;
};
class CHudChatFilterPanel : public vgui::EditablePanel
{
DECLARE_CLASS_SIMPLE(CHudChatFilterPanel, vgui::EditablePanel);
public:
CHudChatFilterPanel(vgui::Panel* pParent, const char* pName);
virtual void ApplySchemeSettings(vgui::IScheme* pScheme);
MESSAGE_FUNC_PTR(OnFilterButtonChecked, "CheckButtonChecked", panel);
CBaseHudChat* GetChatParent(void) { return dynamic_cast <CBaseHudChat*> (GetParent()); }
virtual void SetVisible(bool state);
private:
};
#endif

View File

@ -0,0 +1,75 @@
#ifndef HUD_ELEMENT_HELPER_H
#define HUD_ELEMENT_HELPER_H
#ifdef _WIN32
#pragma once
#endif
class CHudElement;
class CHudElementHelper
{
public:
static CHudElementHelper* m_sHelpers;
static void CreateAllElements(void);
public:
CHudElementHelper(CHudElement* (*pfnCreate)(void), int depth);
CHudElementHelper* GetNext(void);
private:
CHudElementHelper* m_pNext;
CHudElement* (*m_pfnCreate)(void);
int m_iDepth;
};
#define DECLARE_HUDELEMENT( className ) \
static CHudElement *Create_##className( void ) \
{ \
return new className( #className ); \
}; \
static CHudElementHelper g_##className##_Helper( Create_##className, 50 );
#define DECLARE_HUDELEMENT_DEPTH( className, depth ) \
static CHudElement *Create_##className( void ) \
{ \
return new className( #className ); \
}; \
static CHudElementHelper g_##className##_Helper( Create_##className, depth );
#define DECLARE_NAMED_HUDELEMENT( className, panelName ) \
static CHudElement *Create_##panelName( void ) \
{ \
return new className( #panelName ); \
}; \
static CHudElementHelper g_##panelName##_Helper( Create_##panelName, 50 );
#define GET_HUDELEMENT( className ) \
( className *)gHUD.FindElement( #className )
#define GET_NAMED_HUDELEMENT( className, panelName ) \
( className *)gHUD.FindElement( #panelName )
#define DECLARE_MULTIPLY_INHERITED() \
void *operator new( size_t stAllocateBlock ) \
{ \
return CHudElement::operator new ( stAllocateBlock ); \
} \
void* operator new( size_t stAllocateBlock, int nBlockUse, const char *pFileName, int nLine ) \
{ \
return CHudElement::operator new ( stAllocateBlock, nBlockUse, pFileName, nLine ); \
} \
void operator delete( void *pMem ) \
{ \
CHudElement::operator delete ( pMem ); \
} \
void operator delete( void *pMem, int nBlockUse, const char *pFileName, int nLine ) \
{ \
CHudElement::operator delete ( pMem, nBlockUse, pFileName, nLine ); \
}
#define IMPLEMENT_OPERATORS_NEW_AND_DELETE DECLARE_MULTIPLY_INHERITED
#endif

124
SpyCustom/sdk/hudelement.h Normal file
View File

@ -0,0 +1,124 @@
#if !defined( HUDELEMENT_H )
#define HUDELEMENT_H
#ifdef _WIN32
#pragma once
#endif
#include "hud.h"
#include "hud_element_helper.h"
#include "networkvar.h"
#include "GameEventListener.h"
#include "memdbgon.h"
#undef new
class CHudElement : public CGameEventListener
{
public:
DECLARE_CLASS_NOBASE(CHudElement);
CHudElement(const char* pElementName);
virtual ~CHudElement();
virtual void Init(void) { return; }
virtual void VidInit(void) { return; }
virtual void LevelInit(void) { return; };
virtual void LevelShutdown(void) { return; };
virtual void Reset(void) { return; }
virtual void ProcessInput(void) { return; }
virtual const char* GetName(void) const { return m_pElementName; };
virtual bool ShouldDraw(void);
virtual bool IsActive(void) { return m_bActive; };
virtual void SetActive(bool bActive);
virtual void SetHiddenBits(int iBits);
bool IsParentedToClientDLLRootPanel() const;
void SetParentedToClientDLLRootPanel(bool parented);
void* operator new(size_t stAllocateBlock)
{
Assert(stAllocateBlock != 0);
void* pMem = malloc(stAllocateBlock);
memset(pMem, 0, stAllocateBlock);
return pMem;
}
void* operator new(size_t stAllocateBlock, int nBlockUse, const char* pFileName, int nLine)
{
Assert(stAllocateBlock != 0);
void* pMem = MemAlloc_Alloc(stAllocateBlock, pFileName, nLine);
memset(pMem, 0, stAllocateBlock);
return pMem;
}
void operator delete(void* pMem)
{
#if defined( _DEBUG )
int size = _msize(pMem);
memset(pMem, 0xcd, size);
#endif
free(pMem);
}
void operator delete(void* pMem, int nBlockUse, const char* pFileName, int nLine)
{
operator delete(pMem);
}
void SetNeedsRemove(bool needsremove);
void RegisterForRenderGroup(const char* pszName);
void UnregisterForRenderGroup(const char* pszGroupName);
void HideLowerPriorityHudElementsInGroup(const char* pszGroupName);
void UnhideLowerPriorityHudElementsInGroup(const char* pszGroupName);
virtual int GetRenderGroupPriority();
public:
virtual void FireGameEvent(IGameEvent* event) {}
public:
bool m_bActive;
protected:
int m_iHiddenBits;
private:
const char* m_pElementName;
bool m_bNeedsRemove;
bool m_bIsParentedToClientDLLRootPanel;
CUtlVector< int > m_HudRenderGroups;
};
#include "utlpriorityqueue.h"
inline bool RenderGroupLessFunc(CHudElement* const& lhs, CHudElement* const& rhs)
{
return (lhs->GetRenderGroupPriority() < rhs->GetRenderGroupPriority());
}
class CHudRenderGroup
{
public:
CHudRenderGroup()
{
m_pLockingElements.SetLessFunc(RenderGroupLessFunc);
bHidden = false;
}
bool bHidden;
CUtlPriorityQueue< CHudElement* > m_pLockingElements;
};
#include "memdbgoff.h"
#endif

View File

@ -0,0 +1,52 @@
#ifndef HUDTEXTUREHANDLE_H
#define HUDTEXTUREHANDLE_H
#ifdef _WIN32
#pragma once
#endif
class CHudTexture;
class CHudTextureHandle
{
public:
CHudTextureHandle()
{
m_pValue = NULL;
}
const CHudTextureHandle& operator=(const CHudTexture* t)
{
m_pValue = (CHudTexture*)t;
return *this;
}
void Set(CHudTexture* t)
{
m_pValue = t;
}
CHudTexture* Get()
{
return m_pValue;
}
operator CHudTexture* ()
{
return m_pValue;
}
operator CHudTexture* () const
{
return m_pValue;
}
CHudTexture* operator->() const
{
return m_pValue;
}
private:
CHudTexture* m_pValue;
};
#endif

View File

@ -0,0 +1,52 @@
#ifndef ICHROMEHTMLWRAPPER_H
#define ICHROMEHTMLWRAPPER_H
#ifdef _WIN32
#pragma once
#endif
#include "htmlmessages.h"
class CUtlString;
class IHTMLResponses;
struct HTMLCommandBuffer_t;
class IHTMLChromeController
{
public:
virtual ~IHTMLChromeController() {}
virtual bool Init(const char* pchHTMLCacheDir, const char* pchCookiePath) = 0;
virtual void Shutdown() = 0;
virtual bool RunFrame() = 0;
virtual void SetWebCookie(const char* pchHostname, const char* pchKey, const char* pchValue, const char* pchPath, RTime32 nExpires = 0) = 0;
virtual void GetWebCookiesForURL(CUtlString* pstrValue, const char* pchURL, const char* pchName) = 0;
virtual void SetClientBuildID(uint64 ulBuildID) = 0;
virtual bool BHasPendingMessages() = 0;
virtual void CreateBrowser(IHTMLResponses* pBrowser, bool bPopupWindow, const char* pchUserAgentIdentifier) = 0;
virtual void RemoveBrowser(IHTMLResponses* pBrowser) = 0;
virtual void WakeThread() = 0;
virtual HTMLCommandBuffer_t* GetFreeCommandBuffer(EHTMLCommands eCmd, int iBrowser) = 0;
virtual void PushCommand(HTMLCommandBuffer_t*) = 0;
#ifdef DBGFLAG_VALIDATE
virtual void Validate(CValidator& validator, const char* pchName) = 0;
virtual bool ChromePrepareForValidate() = 0;
virtual bool ChromeResumeFromValidate() = 0;
#endif
virtual void SetCefThreadTargetFrameRate(uint32 nFPS) = 0;
};
#define CHROMEHTML_CONTROLLER_INTERFACE_VERSION "ChromeHTML_Controller_001"
#endif

24
SpyCustom/sdk/iclassmap.h Normal file
View File

@ -0,0 +1,24 @@
#ifndef ICLASSMAP_H
#define ICLASSMAP_H
#ifdef _WIN32
#pragma once
#endif
class C_BaseEntity;
typedef C_BaseEntity* (*DISPATCHFUNCTION)(void);
class IClassMap
{
public:
virtual ~IClassMap() {}
virtual void Add(const char* mapname, const char* classname, int size, DISPATCHFUNCTION factory = 0) = 0;
virtual char const* Lookup(const char* classname) = 0;
virtual C_BaseEntity* CreateEntity(const char* mapname) = 0;
virtual int GetClassSize(const char* classname) = 0;
};
extern IClassMap& GetClassMap();
#endif

141
SpyCustom/sdk/iclient.h Normal file
View File

@ -0,0 +1,141 @@
#ifndef ICLIENT_H
#define ICLIENT_H
#ifdef _WIN32
#pragma once
#endif
#include "inetmsghandler.h"
#include "platform.h"
#include "userid.h"
#include "utlvector.h"
class IServer;
class INetMessage;
struct NetMessageCvar_t;
class CMsg_CVars;
enum CrossPlayPlatform_t
{
CROSSPLAYPLATFORM_UNKNOWN = 0,
CROSSPLAYPLATFORM_PC,
CROSSPLAYPLATFORM_X360,
CROSSPLAYPLATFORM_PS3,
CROSSPLAYPLATFORM_LAST = CROSSPLAYPLATFORM_PS3,
};
inline bool IsCrossPlayPlatformAConsole(CrossPlayPlatform_t platform)
{
return (platform == CROSSPLAYPLATFORM_X360) || (platform == CROSSPLAYPLATFORM_PS3);
}
#if defined( _GAMECONSOLE )
# if defined( PLATFORM_X360 )
# define CROSSPLAYPLATFORM_THISPLATFORM CROSSPLAYPLATFORM_X360
# elif defined( PLATFORM_PS3 )
# define CROSSPLAYPLATFORM_THISPLATFORM CROSSPLAYPLATFORM_PS3
# else
#pragma message( "Unknown console, please update this platform definition" )
# define CROSSPLAYPLATFORM_THISPLATFORM CROSSPLAYPLATFORM_UNKNOWN
# endif
#else
# define CROSSPLAYPLATFORM_THISPLATFORM CROSSPLAYPLATFORM_PC
#endif
struct HltvReplayParams_t
{
HltvReplayParams_t()
{
m_nPrimaryTargetEntIndex = 0;
m_flPlaybackSpeed = 1.0f;
m_flDelay = 10.0f;
m_flStopAt = 0.0f;
m_flSlowdownBeginAt = 0;
m_flSlowdownEndAt = 0;
m_flSlowdownRate = 1.0f;
m_bAbortCurrentReplay = false;
}
int m_nPrimaryTargetEntIndex;
float m_flDelay;
float m_flStopAt;
float m_flPlaybackSpeed;
float m_flSlowdownBeginAt;
float m_flSlowdownEndAt;
float m_flSlowdownRate;
bool m_bAbortCurrentReplay;
};
abstract_class IClient : public INetChannelHandler
{
public:
virtual ~IClient() {}
virtual void Connect(const char* szName, int nUserID, INetChannel * pNetChannel, bool bFakePlayer, CrossPlayPlatform_t clientPlatform, const CMsg_CVars * pVecCvars = NULL) = 0;
virtual void Inactivate(void) = 0;
virtual void Reconnect(void) = 0;
virtual void Disconnect(const char* reason) = 0;
virtual bool ChangeSplitscreenUser(int nSplitScreenUserSlot) = 0;
virtual int GetPlayerSlot() const = 0;
virtual int GetUserID() const = 0;
virtual const USERID_t GetNetworkID() const = 0;
virtual const char* GetClientName() const = 0;
virtual INetChannel* GetNetChannel() = 0;
virtual IServer* GetServer() = 0;
virtual const char* GetUserSetting(const char* cvar) const = 0;
virtual const char* GetNetworkIDString() const = 0;
virtual void SetRate(int nRate, bool bForce) = 0;
virtual int GetRate(void) const = 0;
virtual void SetUpdateRate(float fUpdateRate, bool bForce) = 0;
virtual float GetUpdateRate(void) const = 0;
virtual void Clear(void) = 0;
virtual int GetMaxAckTickCount() const = 0;
virtual bool ExecuteStringCommand(const char* s) = 0;
virtual bool SendNetMsg(INetMessage& msg, bool bForceReliable = false, bool bVoice = false) = 0;
virtual void ClientPrintf(const char* fmt, ...) = 0;
virtual bool IsConnected(void) const = 0;
virtual bool IsSpawned(void) const = 0;
virtual bool IsActive(void) const = 0;
virtual bool IsFakeClient(void) const = 0;
virtual bool IsHLTV(void) const = 0;
#if defined( REPLAY_ENABLED )
virtual bool IsReplay(void) const = 0;
#endif
virtual bool IsHearingClient(int index) const = 0;
virtual bool IsProximityHearingClient(int index) const = 0;
virtual void SetMaxRoutablePayloadSize(int nMaxRoutablePayloadSize) = 0;
virtual bool IsSplitScreenUser(void) const = 0;
virtual bool CheckConnect(void) = 0;
virtual bool IsLowViolenceClient(void) const = 0;
virtual IClient* GetSplitScreenOwner() = 0;
virtual int GetNumPlayers() = 0;
virtual bool IsHumanPlayer() const = 0;
virtual CrossPlayPlatform_t GetClientPlatform() const = 0;
virtual bool StartHltvReplay(const HltvReplayParams_t& params) = 0;
virtual void StopHltvReplay() = 0;
virtual int GetHltvReplayDelay() = 0;
virtual const char* GetHltvReplayStatus()const { return ""; }
virtual bool CanStartHltvReplay() = 0;
virtual void ResetReplayRequestTime() = 0;
};
#endif

View File

@ -0,0 +1,73 @@
#ifndef ICLIENTENTITY_H
#define ICLIENTENTITY_H
#ifdef _WIN32
#pragma once
#endif
#include "iclientrenderable.h"
#include "iclientnetworkable.h"
#include "iclientthinkable.h"
#include "string_t.h"
struct Ray_t;
class CGameTrace;
typedef CGameTrace trace_t;
class CMouthInfo;
class IClientEntityInternal;
struct SpatializationInfo_t;
abstract_class IClientEntity : public IClientUnknown, public IClientRenderable, public IClientNetworkable, public IClientThinkable
{
public:
virtual void Release(void) = 0;
virtual void Unknown000(void) = 0;
const Vector& GetAbsOrigin()
{
typedef Vector& (__thiscall* GetAbsOriginFn)(void*);
return getvfunc<GetAbsOriginFn>(this, 10)(this);
}
const Vector& GetAbsAngles(void)
{
typedef Vector& (__thiscall* GetAbsAnglesFn)(void*);
return getvfunc<GetAbsAnglesFn>(this, 11)(this);
}
const void SetModelIndex(int index)
{
typedef void (__thiscall* SetModelIndexFn)(void*, int);
return getvfunc<SetModelIndexFn>(this, 75)(this, index);
}
void preDataUpdate(int updateType)
{
typedef void(__thiscall* SetModelIndexFn)(void*, int);
return getvfunc<SetModelIndexFn>(this, 2)(this + sizeof(uintptr_t) * 2, updateType);
}
virtual CMouthInfo* GetMouth(void) = 0;
virtual bool GetSoundSpatialization(SpatializationInfo_t& info) = 0;
virtual bool IsBlurred(void) = 0;
#if 0
virtual string_t GetModelName(void) const = 0;
#endif
int GetIndex()
{
return *(int*)((uintptr_t)this + 0x64);
}
};
#endif

View File

@ -0,0 +1,18 @@
#ifndef ICLIENTENTITYINTERNAL_H
#define ICLIENTENTITYINTERNAL_H
#ifdef _WIN32
#pragma once
#endif
#include "icliententity.h"
#include "clientleafsystem.h"
class ClientClass;
typedef CBaseHandle ClientEntityHandle_t;
typedef unsigned short SpatialPartitionHandle_t;
#endif

View File

@ -0,0 +1,37 @@
#if !defined( ICLIENTENTITYLIST_H )
#define ICLIENTENTITYLIST_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
class IClientEntity;
class ClientClass;
class IClientNetworkable;
class CBaseHandle;
class IClientUnknown;
class IClientEntityList
{
public:
virtual IClientNetworkable * GetClientNetworkable(int entnum) = 0;
virtual IClientNetworkable* GetClientNetworkableFromHandle(CBaseHandle hEnt) = 0;
virtual IClientUnknown* GetClientUnknownFromHandle(CBaseHandle hEnt) = 0;
virtual IClientEntity* GetClientEntity(int entnum) = 0;
virtual IClientEntity* GetClientEntityFromHandle(CBaseHandle hEnt) = 0;
virtual int NumberOfEntities(bool bIncludeNonNetworkable) = 0;
virtual int GetHighestEntityIndex(void) = 0;
virtual void SetMaxEntities(int maxents) = 0;
virtual int GetMaxEntities() = 0;
};
#define VCLIENTENTITYLIST_INTERFACE_VERSION "VClientEntityList003"
#endif

112
SpyCustom/sdk/iclientmode.h Normal file
View File

@ -0,0 +1,112 @@
#ifndef ICLIENTMODE_H
#define ICLIENTMODE_H
#include "VGUI.h"
#include "client_virtualreality.h"
class CViewSetup;
class C_BaseEntity;
class C_BasePlayer;
class CUserCmd;
namespace vgui
{
class Panel;
class AnimationController;
}
enum
{
MM_NONE = 0,
MM_SAY,
MM_SAY_TEAM,
};
abstract_class IClientMode
{
public:
virtual ~IClientMode() {}
virtual void InitViewport() = 0;
virtual void Init() = 0;
virtual void VGui_Shutdown() = 0;
virtual void Shutdown() = 0;
virtual void Enable() = 0;
virtual void Disable() = 0;
virtual void Layout() = 0;
virtual vgui::Panel* GetViewport() = 0;
virtual vgui::AnimationController* GetViewportAnimationController() = 0;
virtual void ProcessInput(bool bActive) = 0;
virtual bool ShouldDrawDetailObjects() = 0;
virtual bool ShouldDrawEntity(C_BaseEntity* pEnt) = 0;
virtual bool ShouldDrawLocalPlayer(C_BasePlayer* pPlayer) = 0;
virtual bool ShouldDrawParticles() = 0;
virtual bool ShouldDrawFog(void) = 0;
virtual void OverrideView(CViewSetup* pSetup) = 0;
virtual int KeyInput(int down, ButtonCode_t keynum, const char* pszCurrentBinding) = 0;
virtual void StartMessageMode(int iMessageModeType) = 0;
virtual vgui::Panel* GetMessagePanel() = 0;
virtual void OverrideMouseInput(float* x, float* y) = 0;
virtual bool CreateMove(float flInputSampleTime, CUserCmd* cmd) = 0;
virtual void LevelInit(const char* newmap) = 0;
virtual void LevelShutdown(void) = 0;
virtual bool ShouldDrawViewModel(void) = 0;
virtual bool ShouldDrawCrosshair(void) = 0;
virtual void AdjustEngineViewport(int& x, int& y, int& width, int& height) = 0;
virtual void PreRender(CViewSetup* pSetup) = 0;
virtual void PostRender(void) = 0;
virtual void PostRenderVGui() = 0;
virtual void ActivateInGameVGuiContext(vgui::Panel* pPanel) = 0;
virtual void DeactivateInGameVGuiContext() = 0;
virtual float GetViewModelFOV(void) = 0;
virtual bool CanRecordDemo(char* errorMsg, int length) const = 0;
virtual void ComputeVguiResConditions(KeyValues* pkvConditions) = 0;
virtual wchar_t* GetServerName() = 0;
virtual void SetServerName(wchar_t* name) = 0;
virtual wchar_t* GetMapName() = 0;
virtual void SetMapName(wchar_t* name) = 0;
virtual bool DoPostScreenSpaceEffects(const CViewSetup* pSetup) = 0;
virtual void DisplayReplayMessage(const char* pLocalizeName, float flDuration, bool bUrgent,
const char* pSound, bool bDlg) = 0;
public:
virtual void Update() = 0;
virtual bool ShouldBlackoutAroundHUD() = 0;
virtual HeadtrackMovementMode_t ShouldOverrideHeadtrackControl() = 0;
virtual bool IsInfoPanelAllowed() = 0;
virtual void InfoPanelDisplayed() = 0;
virtual bool IsHTMLInfoPanelAllowed() = 0;
};
extern IClientMode* g_pClientMode;
#endif

View File

@ -0,0 +1,63 @@
#ifndef ICLIENTNETWORKABLE_H
#define ICLIENTNETWORKABLE_H
#ifdef _WIN32
#pragma once
#endif
#include "iclientunknown.h"
#include "bitbuf.h"
class IClientEntity;
class ClientClass;
enum ShouldTransmitState_t
{
SHOULDTRANSMIT_START = 0,
SHOULDTRANSMIT_END
};
enum DataUpdateType_t
{
DATA_UPDATE_CREATED = 0,
DATA_UPDATE_DATATABLE_CHANGED,
};
abstract_class IClientNetworkable
{
public:
virtual IClientUnknown * GetIClientUnknown() = 0;
virtual void Release() = 0;
virtual ClientClass* GetClientClass() = 0;
virtual void NotifyShouldTransmit(ShouldTransmitState_t state) = 0;
virtual void OnPreDataChanged(DataUpdateType_t updateType) = 0;
virtual void OnDataChanged(DataUpdateType_t updateType) = 0;
virtual void PreDataUpdate(DataUpdateType_t updateType) = 0;
virtual void PostDataUpdate(DataUpdateType_t updateType) = 0;
virtual void __unkn(void) = 0;
virtual bool IsDormant(void) = 0;
virtual int entindex(void) const = 0;
virtual void ReceiveMessage(int classID, bf_read& msg) = 0;
virtual void* GetDataTableBasePtr() = 0;
virtual void SetDestroyedOnRecreateEntities(void) = 0;
virtual void OnDataUnchangedInPVS() = 0;
};
#endif

View File

@ -0,0 +1,223 @@
#ifndef ICLIENTRENDERABLE_H
#define ICLIENTRENDERABLE_H
#ifdef _WIN32
#pragma once
#endif
#include "mathlib.h"
#include "interface.h"
#include "iclientunknown.h"
#include "client_render_handle.h"
#include "ivmodelrender.h"
struct model_t;
struct matrix3x4_t;
extern void DefaultRenderBoundsWorldspace(IClientRenderable* pRenderable, Vector& absMins, Vector& absMaxs);
typedef unsigned short ClientShadowHandle_t;
enum
{
CLIENTSHADOW_INVALID_HANDLE = (ClientShadowHandle_t)~0
};
enum ShadowType_t
{
SHADOWS_NONE = 0,
SHADOWS_SIMPLE,
SHADOWS_RENDER_TO_TEXTURE,
SHADOWS_RENDER_TO_TEXTURE_DYNAMIC,
SHADOWS_RENDER_TO_DEPTH_TEXTURE,
};
abstract_class IPVSNotify
{
public:
virtual void OnPVSStatusChanged(bool bInPVS) = 0;
};
struct RenderableInstance_t
{
uint8 m_nAlpha;
};
abstract_class IClientRenderable
{
public:
virtual IClientUnknown * GetIClientUnknown() = 0;
virtual Vector const& GetRenderOrigin(void) = 0;
virtual QAngle const& GetRenderAngles(void) = 0;
virtual bool ShouldDraw(void) = 0;
virtual bool IsTransparent(void) = 0;
virtual bool UsesPowerOfTwoFrameBufferTexture() = 0;
virtual bool UsesFullFrameBufferTexture() = 0;
virtual ClientShadowHandle_t GetShadowHandle() const = 0;
virtual ClientRenderHandle_t& RenderHandle() = 0;
virtual const model_t* GetModel() const = 0;
virtual int DrawModel(int flags) = 0;
virtual int GetBody() = 0;
virtual void ComputeFxBlend() = 0;
virtual int GetFxBlend(void) = 0;
virtual void GetColorModulation(float* color) = 0;
virtual bool LODTest() = 0;
virtual bool SetupBones(matrix3x4_t* pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime) = 0;
virtual void SetupWeights(const matrix3x4_t* pBoneToWorld, int nFlexWeightCount, float* pFlexWeights, float* pFlexDelayedWeights) = 0;
virtual void DoAnimationEvents(void) = 0;
virtual IPVSNotify* GetPVSNotifyInterface() = 0;
virtual void GetRenderBounds(Vector& mins, Vector& maxs) = 0;
virtual void GetRenderBoundsWorldspace(Vector& mins, Vector& maxs) = 0;
virtual void GetShadowRenderBounds(Vector& mins, Vector& maxs, ShadowType_t shadowType) = 0;
virtual bool ShouldReceiveProjectedTextures(int flags) = 0;
virtual bool GetShadowCastDistance(float* pDist, ShadowType_t shadowType) const = 0;
virtual bool GetShadowCastDirection(Vector* pDirection, ShadowType_t shadowType) const = 0;
virtual bool IsShadowDirty() = 0;
virtual void MarkShadowDirty(bool bDirty) = 0;
virtual IClientRenderable* GetShadowParent() = 0;
virtual IClientRenderable* FirstShadowChild() = 0;
virtual IClientRenderable* NextShadowPeer() = 0;
virtual ShadowType_t ShadowCastType() = 0;
virtual void CreateModelInstance() = 0;
virtual ModelInstanceHandle_t GetModelInstance() = 0;
virtual const matrix3x4_t& RenderableToWorldTransform() = 0;
virtual int LookupAttachment(const char* pAttachmentName) = 0;
virtual bool GetAttachment(int number, Vector& origin, QAngle& angles) = 0;
virtual bool GetAttachment(int number, matrix3x4_t& matrix) = 0;
virtual float* GetRenderClipPlane(void) = 0;
virtual int GetSkin() = 0;
virtual bool IsTwoPass(void) = 0;
virtual void OnThreadedDrawSetup() = 0;
virtual bool UsesFlexDelayedWeights() = 0;
virtual void RecordToolMessage() = 0;
virtual bool IgnoresZBuffer(void) const = 0;
};
abstract_class CDefaultClientRenderable : public IClientUnknown, public IClientRenderable
{
public:
CDefaultClientRenderable()
{
m_hRenderHandle = INVALID_CLIENT_RENDER_HANDLE;
}
virtual const Vector & GetRenderOrigin(void) = 0;
virtual const QAngle& GetRenderAngles(void) = 0;
virtual const matrix3x4_t& RenderableToWorldTransform() = 0;
virtual bool ShouldDraw(void) = 0;
virtual void OnThreadedDrawSetup() {}
virtual int GetRenderFlags(void) { return 0; }
virtual ClientShadowHandle_t GetShadowHandle() const
{
return CLIENTSHADOW_INVALID_HANDLE;
}
virtual ClientRenderHandle_t& RenderHandle()
{
return m_hRenderHandle;
}
virtual int GetBody() { return 0; }
virtual int GetSkin() { return 0; }
virtual bool UsesFlexDelayedWeights() { return false; }
virtual const model_t* GetModel() const { return NULL; }
virtual int DrawModel(int flags) { return 0; }
virtual bool LODTest() { return true; }
virtual bool SetupBones(matrix3x4_t* pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime) { return true; }
virtual void SetupWeights(const matrix3x4_t* pBoneToWorld, int nFlexWeightCount, float* pFlexWeights, float* pFlexDelayedWeights) {}
virtual void DoAnimationEvents(void) {}
virtual IPVSNotify* GetPVSNotifyInterface() { return NULL; }
virtual void GetRenderBoundsWorldspace(Vector& absMins, Vector& absMaxs) { DefaultRenderBoundsWorldspace(this, absMins, absMaxs); }
virtual void GetColorModulation(float* color)
{
Assert(color);
color[0] = color[1] = color[2] = 1.0f;
}
virtual bool ShouldReceiveProjectedTextures(int flags)
{
return false;
}
virtual bool GetShadowCastDistance(float* pDist, ShadowType_t shadowType) const { return false; }
virtual bool GetShadowCastDirection(Vector* pDirection, ShadowType_t shadowType) const { return false; }
virtual void GetShadowRenderBounds(Vector& mins, Vector& maxs, ShadowType_t shadowType)
{
GetRenderBounds(mins, maxs);
}
virtual bool IsShadowDirty() { return false; }
virtual void MarkShadowDirty(bool bDirty) {}
virtual IClientRenderable* GetShadowParent() { return NULL; }
virtual IClientRenderable* FirstShadowChild() { return NULL; }
virtual IClientRenderable* NextShadowPeer() { return NULL; }
virtual ShadowType_t ShadowCastType() { return SHADOWS_NONE; }
virtual void CreateModelInstance() {}
virtual ModelInstanceHandle_t GetModelInstance() { return MODEL_INSTANCE_INVALID; }
virtual int LookupAttachment(const char* pAttachmentName) { return -1; }
virtual bool GetAttachment(int number, Vector& origin, QAngle& angles) { return false; }
virtual bool GetAttachment(int number, matrix3x4_t& matrix) { return false; }
virtual bool ComputeLightingOrigin(int nAttachmentIndex, Vector modelLightingCenter, const matrix3x4_t& matrix, Vector& transformedLightingCenter) { return false; }
virtual float* GetRenderClipPlane() { return NULL; }
virtual void RecordToolMessage() {}
virtual bool ShouldDrawForSplitScreenUser(int nSlot) { return true; }
virtual uint8 OverrideAlphaModulation(uint8 nAlpha) { return nAlpha; }
virtual uint8 OverrideShadowAlphaModulation(uint8 nAlpha) { return nAlpha; }
virtual void* GetClientModelRenderable() { return 0; }
public:
virtual void SetRefEHandle(const CBaseHandle& handle) { Assert(false); }
virtual const CBaseHandle& GetRefEHandle() const { Assert(false); return *((CBaseHandle*)0); }
virtual IClientUnknown* GetIClientUnknown() { return this; }
virtual ICollideable* GetCollideable() { return 0; }
virtual IClientRenderable* GetClientRenderable() { return this; }
virtual IClientNetworkable* GetClientNetworkable() { return 0; }
virtual IClientEntity* GetIClientEntity() { return 0; }
virtual C_BaseEntity* GetBaseEntity() { return 0; }
virtual IClientThinkable* GetClientThinkable() { return 0; }
virtual void* GetClientAlphaProperty() { return 0; }
public:
ClientRenderHandle_t m_hRenderHandle;
};
#endif

View File

@ -0,0 +1,99 @@
#ifndef ICLIENTSHADOWMGR_H
#define ICLIENTSHADOWMGR_H
#ifdef _WIN32
#pragma once
#endif
#include "igamesystem.h"
#include "icliententityinternal.h"
#include "ishadowmgr.h"
#include "ivrenderview.h"
#include "itoolentity.h"
#include "IGameSystem.h"
struct FlashlightState_t;
enum ShadowReceiver_t
{
SHADOW_RECEIVER_BRUSH_MODEL = 0,
SHADOW_RECEIVER_STATIC_PROP,
SHADOW_RECEIVER_STUDIO_MODEL,
};
class IClientShadowMgr : public IGameSystemPerFrame
{
public:
virtual ClientShadowHandle_t CreateShadow(ClientEntityHandle_t entity, int nEntIndex, int flags, void* pSplitScreenBits = 0) = 0;
virtual void DestroyShadow(ClientShadowHandle_t handle) = 0;
virtual ClientShadowHandle_t CreateFlashlight(const FlashlightState_t& lightState) = 0;
virtual void UpdateFlashlightState(ClientShadowHandle_t shadowHandle, const FlashlightState_t& lightState) = 0;
virtual void DestroyFlashlight(ClientShadowHandle_t handle) = 0;
virtual ClientShadowHandle_t CreateProjection(const FlashlightState_t& lightState) = 0;
virtual void UpdateProjectionState(ClientShadowHandle_t shadowHandle, const FlashlightState_t& lightState) = 0;
virtual void DestroyProjection(ClientShadowHandle_t handle) = 0;
virtual void UpdateProjectedTexture(ClientShadowHandle_t handle, bool force = false) = 0;
virtual void AddToDirtyShadowList(ClientShadowHandle_t handle, bool force = false) = 0;
virtual void AddToDirtyShadowList(IClientRenderable* pRenderable, bool force = false) = 0;
virtual void AddShadowToReceiver(ClientShadowHandle_t handle,
IClientRenderable* pRenderable, ShadowReceiver_t type) = 0;
virtual void RemoveAllShadowsFromReceiver(
IClientRenderable* pRenderable, ShadowReceiver_t type) = 0;
virtual void ComputeShadowTextures(const CViewSetup& view, int leafCount, WorldListLeafData_t* pLeafList) = 0;
virtual void UnlockAllShadowDepthTextures() = 0;
virtual void RenderShadowTexture(int w, int h) = 0;
virtual void SetShadowDirection(const Vector& dir) = 0;
virtual const Vector& GetShadowDirection() const = 0;
virtual void SetShadowColor(unsigned char r, unsigned char g, unsigned char b) = 0;
virtual void SetShadowDistance(float flMaxDistance) = 0;
virtual void SetShadowBlobbyCutoffArea(float flMinArea) = 0;
virtual void SetFalloffBias(ClientShadowHandle_t handle, unsigned char ucBias) = 0;
virtual void MarkRenderToTextureShadowDirty(ClientShadowHandle_t handle) = 0;
virtual void AdvanceFrame() = 0;
virtual void SetFlashlightTarget(ClientShadowHandle_t shadowHandle, EHANDLE targetEntity) = 0;
virtual void SetFlashlightLightWorld(ClientShadowHandle_t shadowHandle, bool bLightWorld) = 0;
virtual void SetShadowsDisabled(bool bDisabled) = 0;
virtual void ComputeShadowDepthTextures(const CViewSetup& pView, bool bSetup = false) = 0;
virtual void DrawVolumetrics(const CViewSetup& view) = 0;
virtual void SetShadowFromWorldLightsEnabled(bool bEnable) = 0;
virtual void DrawDeferredShadows(const CViewSetup& view, int leafCount, WorldListLeafData_t* pLeafList) = 0;
virtual void InitRenderTargets() = 0;
virtual void ReprojectShadows() = 0;
virtual void UpdateSplitscreenLocalPlayerShadowSkip() = 0;
virtual void GetFrustumExtents(ClientShadowHandle_t handle, Vector& vecMin, Vector& vecMax) = 0;
virtual void ShutdownRenderTargets(void) = 0;
};
extern IClientShadowMgr* g_pClientShadowMgr;
#endif

View File

@ -0,0 +1,29 @@
#ifndef ICLIENTTHINKABLE_H
#define ICLIENTTHINKABLE_H
#ifdef _WIN32
#pragma once
#endif
#include "iclientunknown.h"
class CClientThinkHandlePtr;
typedef CClientThinkHandlePtr* ClientThinkHandle_t;
abstract_class IClientThinkable
{
public:
virtual IClientUnknown * GetIClientUnknown() = 0;
virtual void ClientThink() = 0;
virtual ClientThinkHandle_t GetThinkHandle() = 0;
virtual void SetThinkHandle(ClientThinkHandle_t hThink) = 0;
virtual void Release() = 0;
};
#endif

View File

@ -0,0 +1,32 @@
#ifndef ICLIENTUNKNOWN_H
#define ICLIENTUNKNOWN_H
#ifdef _WIN32
#pragma once
#endif
#include "platform.h"
#include "ihandleentity.h"
class IClientNetworkable;
class C_BaseEntity;
class IClientRenderable;
class ICollideable;
class IClientEntity;
class IClientThinkable;
abstract_class IClientUnknown : public IHandleEntity
{
public:
virtual ICollideable * GetCollideable() = 0;
virtual IClientNetworkable* GetClientNetworkable() = 0;
virtual IClientRenderable* GetClientRenderable() = 0;
virtual IClientEntity* GetIClientEntity() = 0;
virtual C_BaseEntity* GetBaseEntity() = 0;
virtual IClientThinkable* GetClientThinkable() = 0;
};
#endif

View File

@ -0,0 +1,35 @@
#ifndef ICLIENTVIRTUALREALITY_H
#define ICLIENTVIRTUALREALITY_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "refcount.h"
#include "IAppSystem.h"
#define CLIENTVIRTUALREALITY_INTERFACE_VERSION "ClientVirtualReality001"
abstract_class IClientVirtualReality : public IAppSystem
{
public:
virtual ~IClientVirtualReality() {}
virtual bool Connect(CreateInterfaceFn factory) = 0;
virtual void Disconnect() = 0;
virtual void* QueryInterface(const char* pInterfaceName) = 0;
virtual InitReturnVal_t Init() = 0;
virtual void Shutdown() = 0;
virtual void DrawMainMenu() = 0;
};
extern IClientVirtualReality* g_pClientVR;
#endif

View File

@ -0,0 +1,45 @@
#ifndef TIER0_ICOMMANDLINE_H
#define TIER0_ICOMMANDLINE_H
#ifdef _WIN32
#pragma once
#endif
#include "platform.h"
abstract_class ICommandLine
{
public:
virtual void CreateCmdLine(const char* commandline) = 0;
virtual void CreateCmdLine(int argc, char** argv) = 0;
virtual const char* GetCmdLine(void) const = 0;
virtual const char* CheckParm(const char* psz, const char** ppszValue = 0) const = 0;
virtual bool HasParm(const char* psz) const = 0;
virtual void RemoveParm(const char* parm) = 0;
virtual void AppendParm(const char* pszParm, const char* pszValues) = 0;
virtual const char* ParmValue(const char* psz, const char* pDefaultVal = 0) const = 0;
virtual int ParmValue(const char* psz, int nDefaultVal) const = 0;
virtual float ParmValue(const char* psz, float flDefaultVal) const = 0;
virtual int ParmCount() const = 0;
virtual int FindParm(const char* psz) const = 0;
virtual const char* GetParm(int nIndex) const = 0;
virtual void SetParm(int nIndex, char const* pNewParm) = 0;
virtual const char** GetParms() const = 0;
};
PLATFORM_INTERFACE ICommandLine* CommandLine();
PLATFORM_INTERFACE const tchar* Plat_GetCommandLine();
#ifndef _WIN32
PLATFORM_INTERFACE void Plat_SetCommandLine(const char* cmdLine);
#endif
PLATFORM_INTERFACE const char* Plat_GetCommandLineA();
#endif

71
SpyCustom/sdk/iconvar.h Normal file
View File

@ -0,0 +1,71 @@
#ifndef ICONVAR_H
#define ICONVAR_H
#if _WIN32
#pragma once
#endif
#include "dbg.h"
#include "platform.h"
#include "strtools.h"
class IConVar;
class CCommand;
#define FCVAR_NONE 0
#define FCVAR_UNREGISTERED (1<<0)
#define FCVAR_DEVELOPMENTONLY (1<<1)
#define FCVAR_GAMEDLL (1<<2)
#define FCVAR_CLIENTDLL (1<<3)
#define FCVAR_HIDDEN (1<<4)
#define FCVAR_PROTECTED (1<<5)
#define FCVAR_SPONLY (1<<6)
#define FCVAR_ARCHIVE (1<<7)
#define FCVAR_NOTIFY (1<<8)
#define FCVAR_USERINFO (1<<9)
#define FCVAR_CHEAT (1<<14)
#define FCVAR_PRINTABLEONLY (1<<10)
#define FCVAR_UNLOGGED (1<<11)
#define FCVAR_NEVER_AS_STRING (1<<12)
#define FCVAR_REPLICATED (1<<13)
#define FCVAR_DEMO (1<<16)
#define FCVAR_DONTRECORD (1<<17)
#define FCVAR_RELOAD_MATERIALS (1<<20)
#define FCVAR_RELOAD_TEXTURES (1<<21)
#define FCVAR_NOT_CONNECTED (1<<22)
#define FCVAR_MATERIAL_SYSTEM_THREAD (1<<23)
#define FCVAR_ARCHIVE_XBOX (1<<24)
#define FCVAR_ACCESSIBLE_FROM_THREADS (1<<25)
#define FCVAR_SERVER_CAN_EXECUTE (1<<28)
#define FCVAR_SERVER_CANNOT_QUERY (1<<29)
#define FCVAR_CLIENTCMD_CAN_EXECUTE (1<<30)
#define FCVAR_MATERIAL_THREAD_MASK ( FCVAR_RELOAD_MATERIALS | FCVAR_RELOAD_TEXTURES | FCVAR_MATERIAL_SYSTEM_THREAD )
typedef void (*FnChangeCallback_t)(IConVar* var, const char* pOldValue, float flOldValue);
abstract_class IConVar
{
public:
virtual void SetValue(const char* pValue) = 0;
virtual void SetValue(float flValue) = 0;
virtual void SetValue(int nValue) = 0;
virtual void SetValue(Color value) = 0;
virtual const char* GetName(void) const = 0;
virtual const char* GetBaseName(void) const = 0;
virtual bool IsFlagSet(int nFlag) const = 0;
virtual int GetSplitScreenPlayerSlot() const = 0;
};
#endif

67
SpyCustom/sdk/icvar.h Normal file
View File

@ -0,0 +1,67 @@
#ifndef ICVAR_H
#define ICVAR_H
#ifdef _WIN32
#pragma once
#endif
#include "IAppSystem.h"
#include "iconvar.h"
class ConCommandBase;
class ConCommand;
class ConVar;
class Color;
typedef int CVarDLLIdentifier_t;
abstract_class IConsoleDisplayFunc
{
public:
virtual void ColorPrint(const Color & clr, const char* pMessage) = 0;
virtual void Print(const char* pMessage) = 0;
virtual void DPrint(const char* pMessage) = 0;
};
#define CVAR_QUERY_INTERFACE_VERSION "VCvarQuery001"
abstract_class ICvarQuery : public IAppSystem
{
public:
virtual bool AreConVarsLinkable(const ConVar * child, const ConVar * parent) = 0;
};
class ICvar : public IAppSystem
{
public:
virtual CVarDLLIdentifier_t AllocateDLLIdentifier() = 0;
virtual void RegisterConCommand(ConCommandBase* pCommandBase) = 0;
virtual void UnregisterConCommand(ConCommandBase* pCommandBase) = 0;
virtual void UnregisterConCommands(CVarDLLIdentifier_t id) = 0;
virtual const char* GetCommandLineValue(const char* pVariableName) = 0;
virtual ConCommandBase* FindCommandBase(const char* name) = 0;
virtual const ConCommandBase* FindCommandBase(const char* name) const = 0;
virtual ConVar* FindVar(const char* var_name) = 0;
virtual const ConVar* FindVar(const char* var_name) const = 0;
virtual ConCommand* FindCommand(const char* name) = 0;
virtual const ConCommand* FindCommand(const char* name) const = 0;
virtual void InstallGlobalChangeCallback(FnChangeCallback_t callback) = 0;
virtual void RemoveGlobalChangeCallback(FnChangeCallback_t callback) = 0;
virtual void CallGlobalChangeCallbacks(ConVar* var, const char* pOldString, float flOldValue) = 0;
virtual void InstallConsoleDisplayFunc(IConsoleDisplayFunc* pDisplayFunc) = 0;
virtual void RemoveConsoleDisplayFunc(IConsoleDisplayFunc* pDisplayFunc) = 0;
virtual void ConsoleColorPrintf(const Color& clr, const char* pFormat, ...) const = 0;
virtual void ConsolePrintf(const char* pFormat, ...) const = 0;
virtual void ConsoleDPrintf(const char* pFormat, ...) const = 0;
virtual void RevertFlaggedConVars(int nFlag) = 0;
};
#define CVAR_INTERFACE_VERSION "VEngineCvar004"
extern ICvar* g_pCVar;
#endif

363
SpyCustom/sdk/idatacache.h Normal file
View File

@ -0,0 +1,363 @@
#ifndef IDATACACHE_H
#define IDATACACHE_H
#ifdef _WIN32
#pragma once
#endif
#include "dbg.h"
#include "IAppSystem.h"
class IDataCache;
#define DATACACHE_INTERFACE_VERSION "VDataCache003"
typedef uint32 DataCacheClientID_t;
FORWARD_DECLARE_HANDLE(memhandle_t);
typedef memhandle_t DataCacheHandle_t;
#define DC_INVALID_HANDLE ((DataCacheHandle_t)0)
struct DataCacheLimits_t
{
DataCacheLimits_t(unsigned _nMaxBytes = (unsigned)-1, unsigned _nMaxItems = (unsigned)-1, unsigned _nMinBytes = 0, unsigned _nMinItems = 0)
: nMaxBytes(_nMaxBytes),
nMaxItems(_nMaxItems),
nMinBytes(_nMinBytes),
nMinItems(_nMinItems)
{
}
unsigned nMaxBytes;
unsigned nMaxItems;
unsigned nMinBytes;
unsigned nMinItems;
};
struct DataCacheStatus_t
{
unsigned nBytes;
unsigned nItems;
unsigned nBytesLocked;
unsigned nItemsLocked;
unsigned nFindRequests;
unsigned nFindHits;
};
enum DataCacheOptions_t
{
DC_TRACE_ACTIVITY = (1 << 0),
DC_FORCE_RELOCATE = (1 << 1),
DC_ALWAYS_MISS = (1 << 2),
DC_VALIDATE = (1 << 3),
};
enum DataCacheReportType_t
{
DC_SUMMARY_REPORT,
DC_DETAIL_REPORT,
DC_DETAIL_REPORT_LRU,
};
enum DataCacheNotificationType_t
{
DC_NONE,
DC_AGE_DISCARD,
DC_FLUSH_DISCARD,
DC_REMOVED,
DC_RELOCATE,
DC_PRINT_INF0,
};
struct DataCacheNotification_t
{
DataCacheNotificationType_t type;
const char* pszSectionName;
DataCacheClientID_t clientId;
const void* pItemData;
unsigned nItemSize;
};
const int DC_MAX_CLIENT_NAME = 15;
const int DC_MAX_ITEM_NAME = 511;
enum DataCacheRemoveResult_t
{
DC_OK,
DC_NOT_FOUND,
DC_LOCKED,
};
enum DataCacheAddFlags_t
{
DCAF_LOCK = (1 << 0),
DCAF_DEFAULT = 0,
};
abstract_class IDataCacheSection
{
public:
virtual IDataCache * GetSharedCache() = 0;
virtual const char* GetName() = 0;
virtual void SetLimits(const DataCacheLimits_t& limits) = 0;
virtual void SetOptions(unsigned options) = 0;
virtual void GetStatus(DataCacheStatus_t* pStatus, DataCacheLimits_t* pLimits = NULL) = 0;
virtual void EnsureCapacity(unsigned nBytes, unsigned nItems = 1) = 0;
virtual bool Add(DataCacheClientID_t clientId, const void* pItemData, unsigned size, DataCacheHandle_t* pHandle) = 0;
virtual DataCacheHandle_t Find(DataCacheClientID_t clientId) = 0;
virtual DataCacheRemoveResult_t Remove(DataCacheHandle_t handle, const void** ppItemData, unsigned* pItemSize = NULL, bool bNotify = false) = 0;
DataCacheRemoveResult_t Remove(DataCacheHandle_t handle, bool bNotify = false) { return Remove(handle, NULL, NULL, bNotify); }
virtual bool IsPresent(DataCacheHandle_t handle) = 0;
virtual void* Lock(DataCacheHandle_t handle) = 0;
virtual int Unlock(DataCacheHandle_t handle) = 0;
virtual void* Get(DataCacheHandle_t handle, bool bFrameLock = false) = 0;
virtual void* GetNoTouch(DataCacheHandle_t handle, bool bFrameLock = false) = 0;
virtual int BeginFrameLocking() = 0;
virtual bool IsFrameLocking() = 0;
virtual void* FrameLock(DataCacheHandle_t handle) = 0;
virtual int EndFrameLocking() = 0;
virtual int* GetFrameUnlockCounterPtr() = 0;
virtual int GetLockCount(DataCacheHandle_t handle) = 0;
virtual int BreakLock(DataCacheHandle_t handle) = 0;
virtual bool Touch(DataCacheHandle_t handle) = 0;
virtual bool Age(DataCacheHandle_t handle) = 0;
virtual unsigned Flush(bool bUnlockedOnly = true, bool bNotify = true) = 0;
virtual unsigned Purge(unsigned nBytes) = 0;
virtual void OutputReport(DataCacheReportType_t reportType = DC_SUMMARY_REPORT) = 0;
virtual void UpdateSize(DataCacheHandle_t handle, unsigned int nNewSize) = 0;
virtual void LockMutex() = 0;
virtual void UnlockMutex() = 0;
virtual bool AddEx(DataCacheClientID_t clientId, const void* pItemData, unsigned size, unsigned flags, DataCacheHandle_t* pHandle) = 0;
};
abstract_class IDataCacheClient
{
public:
virtual bool HandleCacheNotification(const DataCacheNotification_t & notification) = 0;
virtual bool GetItemName(DataCacheClientID_t clientId, const void* pItem, char* pDest, unsigned nMaxLen) = 0;
};
class CDefaultDataCacheClient : public IDataCacheClient
{
public:
virtual bool HandleCacheNotification(const DataCacheNotification_t& notification)
{
switch (notification.type)
{
case DC_AGE_DISCARD:
case DC_FLUSH_DISCARD:
case DC_REMOVED:
default:
Assert(0);
return false;
}
return false;
}
virtual bool GetItemName(DataCacheClientID_t clientId, const void* pItem, char* pDest, unsigned nMaxLen)
{
return false;
}
};
abstract_class IDataCache : public IAppSystem
{
public:
virtual void SetSize(int nMaxBytes) = 0;
virtual void SetOptions(unsigned options) = 0;
virtual void SetSectionLimits(const char* pszSectionName, const DataCacheLimits_t& limits) = 0;
virtual void GetStatus(DataCacheStatus_t* pStatus, DataCacheLimits_t* pLimits = NULL) = 0;
virtual IDataCacheSection* AddSection(IDataCacheClient* pClient, const char* pszSectionName, const DataCacheLimits_t& limits = DataCacheLimits_t(), bool bSupportFastFind = false) = 0;
virtual void RemoveSection(const char* pszClientName, bool bCallFlush = true) = 0;
void RemoveSection(IDataCacheSection* pSection, bool bCallFlush = true) { if (pSection) RemoveSection(pSection->GetName()); }
virtual IDataCacheSection* FindSection(const char* pszClientName) = 0;
virtual unsigned Purge(unsigned nBytes) = 0;
virtual unsigned Flush(bool bUnlockedOnly = true, bool bNotify = true) = 0;
virtual void OutputReport(DataCacheReportType_t reportType = DC_SUMMARY_REPORT, const char* pszSection = NULL) = 0;
};
template< class STORAGE_TYPE, class CREATE_PARAMS, class LOCK_TYPE = STORAGE_TYPE* >
class CManagedDataCacheClient : public CDefaultDataCacheClient
{
public:
typedef CManagedDataCacheClient<STORAGE_TYPE, CREATE_PARAMS, LOCK_TYPE> CCacheClientBaseClass;
CManagedDataCacheClient()
: m_pCache(NULL)
{
}
void Init(IDataCache* pSharedCache, const char* pszSectionName, const DataCacheLimits_t& limits = DataCacheLimits_t(), bool bSupportFastFind = false)
{
if (!m_pCache)
{
m_pCache = pSharedCache->AddSection(this, pszSectionName, limits, bSupportFastFind);
}
}
void Shutdown()
{
if (m_pCache)
{
m_pCache->GetSharedCache()->RemoveSection(m_pCache);
m_pCache = NULL;
}
}
LOCK_TYPE CacheGet(DataCacheHandle_t handle, bool bFrameLock = true)
{
return (LOCK_TYPE)(((STORAGE_TYPE*)m_pCache->Get(handle, bFrameLock))->GetData());
}
LOCK_TYPE CacheGetNoTouch(DataCacheHandle_t handle)
{
return (LOCK_TYPE)(((STORAGE_TYPE*)m_pCache->GetNoTouch(handle))->GetData());
}
LOCK_TYPE CacheLock(DataCacheHandle_t handle)
{
return (LOCK_TYPE)(((STORAGE_TYPE*)m_pCache->Lock(handle))->GetData());
}
int CacheUnlock(DataCacheHandle_t handle)
{
return m_pCache->Unlock(handle);
}
void CacheTouch(DataCacheHandle_t handle)
{
m_pCache->Touch(handle);
}
void CacheRemove(DataCacheHandle_t handle, bool bNotify = true)
{
m_pCache->Remove(handle, bNotify);
}
void CacheFlush()
{
m_pCache->Flush();
}
DataCacheHandle_t CacheCreate(const CREATE_PARAMS& createParams, unsigned flags = DCAF_DEFAULT)
{
m_pCache->EnsureCapacity(STORAGE_TYPE::EstimatedSize(createParams));
STORAGE_TYPE* pStore = STORAGE_TYPE::CreateResource(createParams);
DataCacheHandle_t handle;
m_pCache->AddEx((DataCacheClientID_t)pStore, pStore, pStore->Size(), flags, &handle);
return handle;
}
void CacheLockMutex()
{
m_pCache->LockMutex();
}
void CacheUnlockMutex()
{
m_pCache->UnlockMutex();
}
bool HandleCacheNotification(const DataCacheNotification_t& notification)
{
switch (notification.type)
{
case DC_AGE_DISCARD:
case DC_FLUSH_DISCARD:
case DC_REMOVED:
{
STORAGE_TYPE* p = (STORAGE_TYPE*)notification.clientId;
p->DestroyResource();
}
return true;
default:
return CDefaultDataCacheClient::HandleCacheNotification(notification);
}
}
protected:
~CManagedDataCacheClient()
{
Shutdown();
}
IDataCacheSection* GetCacheSection()
{
return m_pCache;
}
private:
IDataCacheSection* m_pCache;
};
#endif

49
SpyCustom/sdk/iefx.h Normal file
View File

@ -0,0 +1,49 @@
#if !defined( IEFX_H )
#define IEFX_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "vector.h"
#include "dlight.h"
struct model_t;
struct dlight_t;
class IMaterial;
#define MAX_DLIGHTS 32
abstract_class IVEfx
{
public:
virtual int Draw_DecalIndexFromName(char* name) = 0;
virtual void DecalShoot(int textureIndex, int entity,
const model_t* model, const Vector& model_origin, const QAngle& model_angles,
const Vector& position, const Vector* saxis, int flags) = 0;
virtual void DecalColorShoot(int textureIndex, int entity,
const model_t* model, const Vector& model_origin, const QAngle& model_angles,
const Vector& position, const Vector* saxis, int flags, const color32& rgbaColor) = 0;
virtual void PlayerDecalShoot(IMaterial* material, void* userdata, int entity, const model_t* model,
const Vector& model_origin, const Vector& model_angles,
const Vector& position, const Vector* saxis, int flags, const color32& rgbaColor) = 0;
virtual dlight_t* CL_AllocDlight(int key) = 0;
virtual dlight_t* CL_AllocElight(int key) = 0;
virtual int CL_GetActiveDLights(dlight_t* pList[MAX_DLIGHTS]) = 0;
virtual const char* Draw_DecalNameFromIndex(int nIndex) = 0;
virtual dlight_t* GetElightByKey(int key) = 0;
};
#define VENGINE_EFFECTS_INTERFACE_VERSION "VEngineEffects001"
extern IVEfx* effects;
#endif

View File

@ -0,0 +1,152 @@
#ifndef ENGINE_IENGINETRACE_H
#define ENGINE_IENGINETRACE_H
#ifdef _WIN32
#pragma once
#endif
#include "basehandle.h"
#include "utlvector.h"
#include "vector4d.h"
#include "bspflags.h"
class Vector;
class IHandleEntity;
struct Ray_t;
class CGameTrace;
typedef CGameTrace trace_t;
class ICollideable;
class QAngle;
class CTraceListData;
class CPhysCollide;
struct cplane_t;
enum TraceType_t
{
TRACE_EVERYTHING = 0,
TRACE_WORLD_ONLY,
TRACE_ENTITIES_ONLY,
TRACE_EVERYTHING_FILTER_PROPS,
};
abstract_class ITraceFilter
{
public:
virtual bool ShouldHitEntity(IHandleEntity * pEntity, int contentsMask) = 0;
virtual TraceType_t GetTraceType() const = 0;
};
class CTraceFilter : public ITraceFilter
{
public:
bool ShouldHitEntity(IHandleEntity* pEntityHandle, int )
{
return !(pEntityHandle == pSkip);
}
virtual TraceType_t GetTraceType() const
{
return TRACE_EVERYTHING;
}
void* pSkip;
};
class CTraceFilterEntitiesOnly : public ITraceFilter
{
public:
virtual TraceType_t GetTraceType() const
{
return TRACE_ENTITIES_ONLY;
}
};
class CTraceFilterWorldOnly : public ITraceFilter
{
public:
bool ShouldHitEntity(IHandleEntity* pServerEntity, int contentsMask)
{
return false;
}
virtual TraceType_t GetTraceType() const
{
return TRACE_WORLD_ONLY;
}
};
class CTraceFilterWorldAndPropsOnly : public ITraceFilter
{
public:
bool ShouldHitEntity(IHandleEntity* pServerEntity, int contentsMask)
{
return false;
}
virtual TraceType_t GetTraceType() const
{
return TRACE_EVERYTHING;
}
};
class CTraceFilterHitAll : public CTraceFilter
{
public:
virtual bool ShouldHitEntity(IHandleEntity* pServerEntity, int contentsMask)
{
return true;
}
};
abstract_class IEntityEnumerator
{
public:
virtual bool EnumEntity(IHandleEntity * pHandleEntity) = 0;
};
#define INTERFACEVERSION_ENGINETRACE_SERVER "EngineTraceServer003"
#define INTERFACEVERSION_ENGINETRACE_CLIENT "EngineTraceClient003"
abstract_class IEngineTrace
{
public:
virtual int GetPointContents(const Vector& vecAbsPosition, int contentsMask = MASK_ALL, IHandleEntity** ppEntity = nullptr) = 0;
virtual int GetPointContents_WorldOnly(const Vector& vecAbsPosition, int contentsMask = MASK_ALL) = 0;
virtual int GetPointContents_Collideable(ICollideable* pCollide, const Vector& vecAbsPosition) = 0;
virtual void ClipRayToEntity(const Ray_t& ray, unsigned int fMask, IHandleEntity* pEnt, trace_t* pTrace) = 0;
virtual void ClipRayToCollideable(const Ray_t& ray, unsigned int fMask, ICollideable* pCollide, trace_t* pTrace) = 0;
virtual void TraceRay(const Ray_t& ray, unsigned int fMask, ITraceFilter* pTraceFilter, CGameTrace* pTrace) = 0;
virtual void SetupLeafAndEntityListRay(const Ray_t& ray, CTraceListData& traceData) = 0;
virtual void SetupLeafAndEntityListBox(const Vector& vecBoxMin, const Vector& vecBoxMax, CTraceListData& traceData) = 0;
virtual void TraceRayAgainstLeafAndEntityList(const Ray_t& ray, CTraceListData& traceData, unsigned int fMask, ITraceFilter* pTraceFilter, trace_t* pTrace) = 0;
virtual void SweepCollideable(ICollideable* pCollide, const Vector& vecAbsStart, const Vector& vecAbsEnd,
const QAngle& vecAngles, unsigned int fMask, ITraceFilter* pTraceFilter, trace_t* pTrace) = 0;
virtual void EnumerateEntities(const Ray_t& ray, bool triggers, IEntityEnumerator* pEnumerator) = 0;
virtual void EnumerateEntities(const Vector& vecAbsMins, const Vector& vecAbsMaxs, IEntityEnumerator* pEnumerator) = 0;
virtual ICollideable* GetCollideable(IHandleEntity* pEntity) = 0;
virtual int GetStatByIndex(int index, bool bClear) = 0;
virtual void GetBrushesInAABB(const Vector& vMins, const Vector& vMaxs, CUtlVector<int>* pOutput, int iContentsMask = 0xFFFFFFFF) = 0;
virtual CPhysCollide* GetCollidableFromDisplacementsInAABB(const Vector& vMins, const Vector& vMaxs) = 0;
virtual bool GetBrushInfo(int iBrush, CUtlVector<Vector4D>* pPlanesOut, int* pContentsOut) = 0;
virtual bool PointOutsideWorld(const Vector& ptTest) = 0;
virtual int GetLeafContainingPoint(const Vector& ptTest) = 0;
};
#endif

15
SpyCustom/sdk/ifilelist.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef IFILELIST_H
#define IFILELIST_H
#ifdef _WIN32
#endif
class IFileList
{
public:
virtual bool IsFileInList(const char* pFilename) = 0;
virtual void Release() = 0;
};
#endif

View File

@ -0,0 +1,28 @@
#ifndef IGAMECONSOLE_H
#define IGAMECONSOLE_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
class IGameConsole : public IBaseInterface
{
public:
virtual void Activate() = 0;
virtual void Initialize() = 0;
virtual void Hide() = 0;
virtual void Clear() = 0;
virtual bool IsConsoleVisible() = 0;
virtual void SetParent(int parent) = 0;
};
#define GAMECONSOLE_INTERFACE_VERSION "GameConsole004"
#endif

131
SpyCustom/sdk/igameevents.h Normal file
View File

@ -0,0 +1,131 @@
#if !defined( IGAMEEVENTS_H )
#define IGAMEEVENTS_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#define INTERFACEVERSION_GAMEEVENTSMANAGER "GAMEEVENTSMANAGER001"
#define INTERFACEVERSION_GAMEEVENTSMANAGER2 "GAMEEVENTSMANAGER002"
#include "bitbuf.h"
#define NULL 0x0
#define EVENT_DEBUG_ID_INIT 42
#define EVENT_DEBUG_ID_SHUTDOWN 13
#define MAX_EVENT_NAME_LENGTH 32
#define MAX_EVENT_BITS 9
#define MAX_EVENT_NUMBER (1<<MAX_EVENT_BITS)
#define MAX_EVENT_BYTES 1024
class KeyValues;
class CGameEvent;
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* keyName = NULL) = 0;
virtual bool GetBool(const char* keyName = NULL, bool defaultValue = false) = 0;
virtual int GetInt(const char* keyName = NULL, int defaultValue = 0) = 0;
virtual uint64_t GetUint64(const char* keyName = nullptr, unsigned long defaultValue = 0) = 0;
virtual float GetFloat(const char* keyName = NULL, float defaultValue = 0.0f) = 0;
virtual const char* GetString(const char* keyName = NULL, const char* defaultValue = "") = 0;
virtual const wchar_t* GetWString(char const* keyName = NULL, const wchar_t* defaultValue = L"") = 0;
virtual void SetBool(const char* keyName, bool value) = 0;
virtual void SetInt(const char* keyName, int value) = 0;
virtual void SetUint64(const char* keyName, unsigned long value) = 0;
virtual void SetFloat(const char* keyName, float value) = 0;
virtual void test() = 0;
virtual void SetString(const char* keyName, const char* value) = 0;
virtual void SetWString(const char* keyName, const wchar_t* value) = 0;
};
class IGameEventListener2
{
public:
virtual ~IGameEventListener2(void) {};
virtual void FireGameEvent(IGameEvent* event) = 0;
virtual int GetEventDebugID(void) = 0;
};
class IGameEventManager2 : public IBaseInterface
{
public:
virtual ~IGameEventManager2(void) {};
virtual int LoadEventsFromFile(const char* filename) = 0;
virtual void Reset() = 0;
virtual bool AddListener(IGameEventListener2* listener, const char* name, bool bServerSide) = 0;
virtual bool FindListener(IGameEventListener2* listener, const char* name) = 0;
virtual void RemoveListener(IGameEventListener2* listener) = 0;
virtual IGameEvent* CreateEvent(const char* name, bool bForce = false) = 0;
virtual bool FireEvent(IGameEvent* event, bool bDontBroadcast = 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;
virtual KeyValues* GetEventDataTypes(IGameEvent* event) = 0;
};
class IGameEventListener
{
public:
virtual ~IGameEventListener(void) {};
virtual void FireGameEvent(KeyValues* event) = 0;
};
class IGameEventManager : public IBaseInterface
{
public:
virtual ~IGameEventManager(void) {};
virtual int LoadEventsFromFile(const char* filename) = 0;
virtual void Reset() = 0;
virtual KeyValues* GetEvent(const char* name) = 0;
virtual bool AddListener(IGameEventListener* listener, const char* event, bool bIsServerSide) = 0;
virtual bool AddListener(IGameEventListener* listener, bool bIsServerSide) = 0;
virtual void RemoveListener(IGameEventListener* listener) = 0;
virtual bool FireEvent(KeyValues* event) = 0;
virtual bool FireEventServerOnly(KeyValues* event) = 0;
virtual bool FireEventClientOnly(KeyValues* event) = 0;
virtual bool SerializeKeyValues(KeyValues* event, bf_write* buf, CGameEvent* eventtype = NULL) = 0;
virtual KeyValues* UnserializeKeyValue(bf_read* msg) = 0;
};
#endif

View File

@ -0,0 +1,20 @@
#ifndef IHANDLEENTITY_H
#define IHANDLEENTITY_H
#ifdef _WIN32
#pragma once
#endif
class CBaseHandle;
class IHandleEntity
{
public:
virtual ~IHandleEntity() {}
virtual void SetRefEHandle(const CBaseHandle& handle) = 0;
virtual const CBaseHandle& GetRefEHandle() const = 0;
};
#endif

View File

@ -0,0 +1,83 @@
#ifndef IINPUTSYSTEM_H
#define IINPUTSYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include "platform.h"
#include "IAppSystem.h"
#include "InputEnums.h"
#include "ButtonCode.h"
#include "AnalogCode.h"
#define INPUTSYSTEM_INTERFACE_VERSION "InputSystemVersion001"
abstract_class IInputSystem : public IAppSystem
{
public:
virtual void AttachToWindow(void* hWnd) = 0;
virtual void DetachFromWindow() = 0;
virtual void EnableInput(bool bEnable) = 0;
virtual void EnableMessagePump(bool bEnable) = 0;
virtual void PollInputState() = 0;
virtual int GetPollTick() const = 0;
virtual bool IsButtonDown(ButtonCode_t code) const = 0;
virtual int GetButtonPressedTick(ButtonCode_t code) const = 0;
virtual int GetButtonReleasedTick(ButtonCode_t code) const = 0;
virtual int GetAnalogValue(AnalogCode_t code) const = 0;
virtual int GetAnalogDelta(AnalogCode_t code) const = 0;
virtual int GetEventCount() const = 0;
virtual const InputEvent_t* GetEventData() const = 0;
virtual void PostUserEvent(const InputEvent_t& event) = 0;
virtual int GetJoystickCount() const = 0;
virtual void EnableJoystickInput(int nJoystick, bool bEnable) = 0;
virtual void EnableJoystickDiagonalPOV(int nJoystick, bool bEnable) = 0;
virtual void SampleDevices(void) = 0;
virtual void SetRumble(float fLeftMotor, float fRightMotor, int userId = INVALID_USER_ID) = 0;
virtual void StopRumble(void) = 0;
virtual void ResetInputState() = 0;
virtual void SetPrimaryUserId(int userId) = 0;
virtual const char* ButtonCodeToString(ButtonCode_t code) const = 0;
virtual const char* AnalogCodeToString(AnalogCode_t code) const = 0;
virtual ButtonCode_t StringToButtonCode(const char* pString) const = 0;
virtual AnalogCode_t StringToAnalogCode(const char* pString) const = 0;
virtual void SleepUntilInput(int nMaxSleepTimeMS = -1) = 0;
virtual ButtonCode_t VirtualKeyToButtonCode(int nVirtualKey) const = 0;
virtual int ButtonCodeToVirtualKey(ButtonCode_t code) const = 0;
virtual ButtonCode_t ScanCodeToButtonCode(int lParam) const = 0;
virtual int GetPollCount() const = 0;
virtual void SetCursorPosition(int x, int y) = 0;
virtual void* GetHapticsInterfaceAddress() const = 0;
virtual void SetNovintPure(bool bPure) = 0;
virtual bool GetRawMouseAccumulators(int& accumX, int& accumY) = 0;
virtual void SetConsoleTextMode(bool bConsoleTextMode) = 0;
};
#endif

439
SpyCustom/sdk/imageformat.h Normal file
View File

@ -0,0 +1,439 @@
#ifndef IMAGEFORMAT_H
#define IMAGEFORMAT_H
#ifdef _WIN32
#pragma once
#endif
#include <stdio.h>
enum NormalDecodeMode_t
{
NORMAL_DECODE_NONE = 0,
NORMAL_DECODE_ATI2N = 1,
NORMAL_DECODE_ATI2N_ALPHA = 2
};
#ifdef _WIN32
typedef enum _D3DFORMAT D3DFORMAT;
#endif
#pragma warning(disable : 4514)
enum ImageFormat
{
IMAGE_FORMAT_UNKNOWN = -1,
IMAGE_FORMAT_RGBA8888 = 0,
IMAGE_FORMAT_ABGR8888,
IMAGE_FORMAT_RGB888,
IMAGE_FORMAT_BGR888,
IMAGE_FORMAT_RGB565,
IMAGE_FORMAT_I8,
IMAGE_FORMAT_IA88,
IMAGE_FORMAT_P8,
IMAGE_FORMAT_A8,
IMAGE_FORMAT_RGB888_BLUESCREEN,
IMAGE_FORMAT_BGR888_BLUESCREEN,
IMAGE_FORMAT_ARGB8888,
IMAGE_FORMAT_BGRA8888,
IMAGE_FORMAT_DXT1,
IMAGE_FORMAT_DXT3,
IMAGE_FORMAT_DXT5,
IMAGE_FORMAT_BGRX8888,
IMAGE_FORMAT_BGR565,
IMAGE_FORMAT_BGRX5551,
IMAGE_FORMAT_BGRA4444,
IMAGE_FORMAT_DXT1_ONEBITALPHA,
IMAGE_FORMAT_BGRA5551,
IMAGE_FORMAT_UV88,
IMAGE_FORMAT_UVWQ8888,
IMAGE_FORMAT_RGBA16161616F,
IMAGE_FORMAT_RGBA16161616,
IMAGE_FORMAT_UVLX8888,
IMAGE_FORMAT_R32F,
IMAGE_FORMAT_RGB323232F,
IMAGE_FORMAT_RGBA32323232F,
IMAGE_FORMAT_NV_DST16,
IMAGE_FORMAT_NV_DST24,
IMAGE_FORMAT_NV_INTZ,
IMAGE_FORMAT_NV_RAWZ,
IMAGE_FORMAT_ATI_DST16,
IMAGE_FORMAT_ATI_DST24,
IMAGE_FORMAT_NV_NULL,
IMAGE_FORMAT_ATI2N,
IMAGE_FORMAT_ATI1N,
#if defined( _X360 )
IMAGE_FORMAT_X360_DST16,
IMAGE_FORMAT_X360_DST24,
IMAGE_FORMAT_X360_DST24F,
IMAGE_FORMAT_LINEAR_BGRX8888,
IMAGE_FORMAT_LINEAR_RGBA8888,
IMAGE_FORMAT_LINEAR_ABGR8888,
IMAGE_FORMAT_LINEAR_ARGB8888,
IMAGE_FORMAT_LINEAR_BGRA8888,
IMAGE_FORMAT_LINEAR_RGB888,
IMAGE_FORMAT_LINEAR_BGR888,
IMAGE_FORMAT_LINEAR_BGRX5551,
IMAGE_FORMAT_LINEAR_I8,
IMAGE_FORMAT_LINEAR_RGBA16161616,
IMAGE_FORMAT_LE_BGRX8888,
IMAGE_FORMAT_LE_BGRA8888,
#endif
NUM_IMAGE_FORMATS
};
#if defined( POSIX ) || defined( DX_TO_GL_ABSTRACTION )
typedef enum _D3DFORMAT
{
D3DFMT_INDEX16,
D3DFMT_D16,
D3DFMT_D24S8,
D3DFMT_A8R8G8B8,
D3DFMT_A4R4G4B4,
D3DFMT_X8R8G8B8,
D3DFMT_R5G6R5,
D3DFMT_X1R5G5B5,
D3DFMT_A1R5G5B5,
D3DFMT_L8,
D3DFMT_A8L8,
D3DFMT_A,
D3DFMT_DXT1,
D3DFMT_DXT3,
D3DFMT_DXT5,
D3DFMT_V8U8,
D3DFMT_Q8W8V8U8,
D3DFMT_X8L8V8U8,
D3DFMT_A16B16G16R16F,
D3DFMT_A16B16G16R16,
D3DFMT_R32F,
D3DFMT_A32B32G32R32F,
D3DFMT_R8G8B8,
D3DFMT_D24X4S4,
D3DFMT_A8,
D3DFMT_R5G6B5,
D3DFMT_D15S1,
D3DFMT_D24X8,
D3DFMT_VERTEXDATA,
D3DFMT_INDEX32,
D3DFMT_NV_INTZ = 0x5a544e49,
D3DFMT_NV_RAWZ = 0x5a574152,
D3DFMT_NV_NULL = 0x4c4c554e,
D3DFMT_ATI_D16 = 0x36314644,
D3DFMT_ATI_D24S8 = 0x34324644,
D3DFMT_ATI_2N = 0x32495441,
D3DFMT_ATI_1N = 0x31495441,
D3DFMT_UNKNOWN
} D3DFORMAT;
#endif
struct BGRA8888_t
{
unsigned char b;
unsigned char g;
unsigned char r;
unsigned char a;
inline BGRA8888_t& operator=(const BGRA8888_t& in)
{
*(unsigned int*)this = *(unsigned int*)&in;
return *this;
}
};
struct RGBA8888_t
{
unsigned char r;
unsigned char g;
unsigned char b;
unsigned char a;
inline RGBA8888_t& operator=(const BGRA8888_t& in)
{
r = in.r;
g = in.g;
b = in.b;
a = in.a;
return *this;
}
};
struct RGB888_t
{
unsigned char r;
unsigned char g;
unsigned char b;
inline RGB888_t& operator=(const BGRA8888_t& in)
{
r = in.r;
g = in.g;
b = in.b;
return *this;
}
inline bool operator==(const RGB888_t& in) const
{
return (r == in.r) && (g == in.g) && (b == in.b);
}
inline bool operator!=(const RGB888_t& in) const
{
return (r != in.r) || (g != in.g) || (b != in.b);
}
};
struct BGR888_t
{
unsigned char b;
unsigned char g;
unsigned char r;
inline BGR888_t& operator=(const BGRA8888_t& in)
{
r = in.r;
g = in.g;
b = in.b;
return *this;
}
};
#if defined( _X360 )
#pragma bitfield_order( push, lsb_to_msb )
#endif
struct BGR565_t
{
unsigned short b : 5;
unsigned short g : 6;
unsigned short r : 5;
inline BGR565_t& operator=(const BGRA8888_t& in)
{
r = in.r >> 3;
g = in.g >> 2;
b = in.b >> 3;
return *this;
}
inline BGR565_t& Set(int red, int green, int blue)
{
r = red >> 3;
g = green >> 2;
b = blue >> 3;
return *this;
}
};
#if defined( _X360 )
#pragma bitfield_order( pop )
#endif
struct BGRA5551_t
{
unsigned short b : 5;
unsigned short g : 5;
unsigned short r : 5;
unsigned short a : 1;
inline BGRA5551_t& operator=(const BGRA8888_t& in)
{
r = in.r >> 3;
g = in.g >> 3;
b = in.b >> 3;
a = in.a >> 7;
return *this;
}
};
struct BGRA4444_t
{
unsigned short b : 4;
unsigned short g : 4;
unsigned short r : 4;
unsigned short a : 4;
inline BGRA4444_t& operator=(const BGRA8888_t& in)
{
r = in.r >> 4;
g = in.g >> 4;
b = in.b >> 4;
a = in.a >> 4;
return *this;
}
};
struct RGBX5551_t
{
unsigned short r : 5;
unsigned short g : 5;
unsigned short b : 5;
unsigned short x : 1;
inline RGBX5551_t& operator=(const BGRA8888_t& in)
{
r = in.r >> 3;
g = in.g >> 3;
b = in.b >> 3;
return *this;
}
};
#define ARTWORK_GAMMA ( 2.2f )
#define IMAGE_MAX_DIM ( 2048 )
struct ImageFormatInfo_t
{
const char* m_pName;
int m_NumBytes;
int m_NumRedBits;
int m_NumGreeBits;
int m_NumBlueBits;
int m_NumAlphaBits;
bool m_IsCompressed;
};
namespace ImageLoader
{
bool GetInfo(const char* fileName, int* width, int* height, enum ImageFormat* imageFormat, float* sourceGamma);
int GetMemRequired(int width, int height, int depth, ImageFormat imageFormat, bool mipmap);
int GetMipMapLevelByteOffset(int width, int height, enum ImageFormat imageFormat, int skipMipLevels);
void GetMipMapLevelDimensions(int* width, int* height, int skipMipLevels);
int GetNumMipMapLevels(int width, int height, int depth = 1);
bool Load(unsigned char* imageData, const char* fileName, int width, int height, enum ImageFormat imageFormat, float targetGamma, bool mipmap);
bool Load(unsigned char* imageData, FILE* fp, int width, int height,
enum ImageFormat imageFormat, float targetGamma, bool mipmap);
bool ConvertImageFormat(const unsigned char* src, enum ImageFormat srcImageFormat,
unsigned char* dst, enum ImageFormat dstImageFormat,
int width, int height, int srcStride = 0, int dstStride = 0);
void PreConvertSwapImageData(unsigned char* pImageData, int nImageSize, ImageFormat imageFormat, int width = 0, int stride = 0);
void PostConvertSwapImageData(unsigned char* pImageData, int nImageSize, ImageFormat imageFormat, int width = 0, int stride = 0);
void ByteSwapImageData(unsigned char* pImageData, int nImageSize, ImageFormat imageFormat, int width = 0, int stride = 0);
bool IsFormatValidForConversion(ImageFormat fmt);
ImageFormat D3DFormatToImageFormat(D3DFORMAT format);
D3DFORMAT ImageFormatToD3DFormat(ImageFormat format);
enum
{
RESAMPLE_NORMALMAP = 0x1,
RESAMPLE_ALPHATEST = 0x2,
RESAMPLE_NICE_FILTER = 0x4,
RESAMPLE_CLAMPS = 0x8,
RESAMPLE_CLAMPT = 0x10,
RESAMPLE_CLAMPU = 0x20,
};
struct ResampleInfo_t
{
ResampleInfo_t() : m_nFlags(0), m_flAlphaThreshhold(0.4f), m_flAlphaHiFreqThreshhold(0.4f), m_nSrcDepth(1), m_nDestDepth(1)
{
m_flColorScale[0] = 1.0f, m_flColorScale[1] = 1.0f, m_flColorScale[2] = 1.0f, m_flColorScale[3] = 1.0f;
m_flColorGoal[0] = 0.0f, m_flColorGoal[1] = 0.0f, m_flColorGoal[2] = 0.0f, m_flColorGoal[3] = 0.0f;
}
unsigned char* m_pSrc;
unsigned char* m_pDest;
int m_nSrcWidth;
int m_nSrcHeight;
int m_nSrcDepth;
int m_nDestWidth;
int m_nDestHeight;
int m_nDestDepth;
float m_flSrcGamma;
float m_flDestGamma;
float m_flColorScale[4];
float m_flColorGoal[4];
float m_flAlphaThreshhold;
float m_flAlphaHiFreqThreshhold;
int m_nFlags;
};
bool ResampleRGBA8888(const ResampleInfo_t& info);
bool ResampleRGBA16161616(const ResampleInfo_t& info);
bool ResampleRGB323232F(const ResampleInfo_t& info);
void ConvertNormalMapRGBA8888ToDUDVMapUVLX8888(const unsigned char* src, int width, int height,
unsigned char* dst_);
void ConvertNormalMapRGBA8888ToDUDVMapUVWQ8888(const unsigned char* src, int width, int height,
unsigned char* dst_);
void ConvertNormalMapRGBA8888ToDUDVMapUV88(const unsigned char* src, int width, int height,
unsigned char* dst_);
void ConvertIA88ImageToNormalMapRGBA8888(const unsigned char* src, int width,
int height, unsigned char* dst,
float bumpScale);
void NormalizeNormalMapRGBA8888(unsigned char* src, int numTexels);
void GammaCorrectRGBA8888(unsigned char* src, unsigned char* dst,
int width, int height, int depth, float srcGamma, float dstGamma);
void ConstructGammaTable(unsigned char* pTable, float srcGamma, float dstGamma);
void GammaCorrectRGBA8888(unsigned char* pSrc, unsigned char* pDst,
int width, int height, int depth, unsigned char* pGammaTable);
void GenerateMipmapLevels(unsigned char* pSrc, unsigned char* pDst, int width,
int height, int depth, ImageFormat imageFormat, float srcGamma, float dstGamma,
int numLevels = 0);
bool RotateImageLeft(const unsigned char* src, unsigned char* dst,
int widthHeight, ImageFormat imageFormat);
bool RotateImage180(const unsigned char* src, unsigned char* dst,
int widthHeight, ImageFormat imageFormat);
bool FlipImageVertically(void* pSrc, void* pDst, int nWidth, int nHeight, ImageFormat imageFormat, int nDstStride = 0);
bool FlipImageHorizontally(void* pSrc, void* pDst, int nWidth, int nHeight, ImageFormat imageFormat, int nDstStride = 0);
bool SwapAxes(unsigned char* src,
int widthHeight, ImageFormat imageFormat);
ImageFormatInfo_t const& ImageFormatInfo(ImageFormat fmt);
inline char const* GetName(ImageFormat fmt)
{
return ImageFormatInfo(fmt).m_pName;
}
inline int SizeInBytes(ImageFormat fmt)
{
return ImageFormatInfo(fmt).m_NumBytes;
}
inline bool IsTransparent(ImageFormat fmt)
{
return ImageFormatInfo(fmt).m_NumAlphaBits > 0;
}
inline bool IsCompressed(ImageFormat fmt)
{
return ImageFormatInfo(fmt).m_IsCompressed;
}
inline bool HasChannelLargerThan8Bits(ImageFormat fmt)
{
ImageFormatInfo_t info = ImageFormatInfo(fmt);
return (info.m_NumRedBits > 8 || info.m_NumGreeBits > 8 || info.m_NumBlueBits > 8 || info.m_NumAlphaBits > 8);
}
}
#endif

493
SpyCustom/sdk/imaterial.h Normal file
View File

@ -0,0 +1,493 @@
#ifndef IMATERIAL_H
#define IMATERIAL_H
#ifdef _WIN32
#pragma once
#endif
#include "imageformat.h"
#include "imaterialsystem.h"
class IMaterialVar;
class ITexture;
class IMaterialProxy;
class Vector;
#define VERTEX_POSITION 0x0001
#define VERTEX_NORMAL 0x0002
#define VERTEX_COLOR 0x0004
#define VERTEX_SPECULAR 0x0008
#define VERTEX_TANGENT_S 0x0010
#define VERTEX_TANGENT_T 0x0020
#define VERTEX_TANGENT_SPACE ( VERTEX_TANGENT_S | VERTEX_TANGENT_T )
#define VERTEX_WRINKLE 0x0040
#define VERTEX_BONE_INDEX 0x0080
#define VERTEX_FORMAT_VERTEX_SHADER 0x0100
#define VERTEX_FORMAT_USE_EXACT_FORMAT 0x0200
#define VERTEX_FORMAT_COMPRESSED 0x400
#define VERTEX_LAST_BIT 10
#define VERTEX_BONE_WEIGHT_BIT (VERTEX_LAST_BIT + 1)
#define USER_DATA_SIZE_BIT (VERTEX_LAST_BIT + 4)
#define TEX_COORD_SIZE_BIT (VERTEX_LAST_BIT + 7)
#define VERTEX_BONE_WEIGHT_MASK ( 0x7 << VERTEX_BONE_WEIGHT_BIT )
#define USER_DATA_SIZE_MASK ( 0x7 << USER_DATA_SIZE_BIT )
#define VERTEX_FORMAT_FIELD_MASK 0x0FF
#define VERTEX_FORMAT_UNKNOWN 0
#define VERTEX_BONEWEIGHT( _n ) ((_n) << VERTEX_BONE_WEIGHT_BIT)
#define VERTEX_USERDATA_SIZE( _n ) ((_n) << USER_DATA_SIZE_BIT)
#define VERTEX_TEXCOORD_MASK( _coord ) (( 0x7ULL ) << ( TEX_COORD_SIZE_BIT + 3 * (_coord) ))
inline VertexFormat_t VERTEX_TEXCOORD_SIZE(int nIndex, int nNumCoords)
{
uint64 n64 = nNumCoords;
uint64 nShift = TEX_COORD_SIZE_BIT + (3 * nIndex);
return n64 << nShift;
}
inline int VertexFlags(VertexFormat_t vertexFormat)
{
return static_cast<int> (vertexFormat & ((1 << (VERTEX_LAST_BIT + 1)) - 1));
}
inline int NumBoneWeights(VertexFormat_t vertexFormat)
{
return static_cast<int> ((vertexFormat >> VERTEX_BONE_WEIGHT_BIT) & 0x7);
}
inline int UserDataSize(VertexFormat_t vertexFormat)
{
return static_cast<int> ((vertexFormat >> USER_DATA_SIZE_BIT) & 0x7);
}
inline int TexCoordSize(int nTexCoordIndex, VertexFormat_t vertexFormat)
{
return static_cast<int> ((vertexFormat >> (TEX_COORD_SIZE_BIT + 3 * nTexCoordIndex)) & 0x7);
}
inline bool UsesVertexShader(VertexFormat_t vertexFormat)
{
return (vertexFormat & VERTEX_FORMAT_VERTEX_SHADER) != 0;
}
inline VertexCompressionType_t CompressionType(VertexFormat_t vertexFormat)
{
if (vertexFormat & VERTEX_FORMAT_COMPRESSED)
return VERTEX_COMPRESSION_ON;
else
return VERTEX_COMPRESSION_NONE;
}
enum VertexElement_t
{
VERTEX_ELEMENT_NONE = -1,
VERTEX_ELEMENT_POSITION = 0,
VERTEX_ELEMENT_NORMAL = 1,
VERTEX_ELEMENT_COLOR = 2,
VERTEX_ELEMENT_SPECULAR = 3,
VERTEX_ELEMENT_TANGENT_S = 4,
VERTEX_ELEMENT_TANGENT_T = 5,
VERTEX_ELEMENT_WRINKLE = 6,
VERTEX_ELEMENT_BONEINDEX = 7,
VERTEX_ELEMENT_BONEWEIGHTS1 = 8,
VERTEX_ELEMENT_BONEWEIGHTS2 = 9,
VERTEX_ELEMENT_BONEWEIGHTS3 = 10,
VERTEX_ELEMENT_BONEWEIGHTS4 = 11,
VERTEX_ELEMENT_USERDATA1 = 12,
VERTEX_ELEMENT_USERDATA2 = 13,
VERTEX_ELEMENT_USERDATA3 = 14,
VERTEX_ELEMENT_USERDATA4 = 15,
VERTEX_ELEMENT_TEXCOORD1D_0 = 16,
VERTEX_ELEMENT_TEXCOORD1D_1 = 17,
VERTEX_ELEMENT_TEXCOORD1D_2 = 18,
VERTEX_ELEMENT_TEXCOORD1D_3 = 19,
VERTEX_ELEMENT_TEXCOORD1D_4 = 20,
VERTEX_ELEMENT_TEXCOORD1D_5 = 21,
VERTEX_ELEMENT_TEXCOORD1D_6 = 22,
VERTEX_ELEMENT_TEXCOORD1D_7 = 23,
VERTEX_ELEMENT_TEXCOORD2D_0 = 24,
VERTEX_ELEMENT_TEXCOORD2D_1 = 25,
VERTEX_ELEMENT_TEXCOORD2D_2 = 26,
VERTEX_ELEMENT_TEXCOORD2D_3 = 27,
VERTEX_ELEMENT_TEXCOORD2D_4 = 28,
VERTEX_ELEMENT_TEXCOORD2D_5 = 29,
VERTEX_ELEMENT_TEXCOORD2D_6 = 30,
VERTEX_ELEMENT_TEXCOORD2D_7 = 31,
VERTEX_ELEMENT_TEXCOORD3D_0 = 32,
VERTEX_ELEMENT_TEXCOORD3D_1 = 33,
VERTEX_ELEMENT_TEXCOORD3D_2 = 34,
VERTEX_ELEMENT_TEXCOORD3D_3 = 35,
VERTEX_ELEMENT_TEXCOORD3D_4 = 36,
VERTEX_ELEMENT_TEXCOORD3D_5 = 37,
VERTEX_ELEMENT_TEXCOORD3D_6 = 38,
VERTEX_ELEMENT_TEXCOORD3D_7 = 39,
VERTEX_ELEMENT_TEXCOORD4D_0 = 40,
VERTEX_ELEMENT_TEXCOORD4D_1 = 41,
VERTEX_ELEMENT_TEXCOORD4D_2 = 42,
VERTEX_ELEMENT_TEXCOORD4D_3 = 43,
VERTEX_ELEMENT_TEXCOORD4D_4 = 44,
VERTEX_ELEMENT_TEXCOORD4D_5 = 45,
VERTEX_ELEMENT_TEXCOORD4D_6 = 46,
VERTEX_ELEMENT_TEXCOORD4D_7 = 47,
VERTEX_ELEMENT_NUMELEMENTS = 48
};
inline void Detect_VertexElement_t_Changes(VertexElement_t element)
{
Assert(VERTEX_ELEMENT_NUMELEMENTS == 48);
switch (element)
{
case VERTEX_ELEMENT_POSITION: Assert(VERTEX_ELEMENT_POSITION == 0); break;
case VERTEX_ELEMENT_NORMAL: Assert(VERTEX_ELEMENT_NORMAL == 1); break;
case VERTEX_ELEMENT_COLOR: Assert(VERTEX_ELEMENT_COLOR == 2); break;
case VERTEX_ELEMENT_SPECULAR: Assert(VERTEX_ELEMENT_SPECULAR == 3); break;
case VERTEX_ELEMENT_TANGENT_S: Assert(VERTEX_ELEMENT_TANGENT_S == 4); break;
case VERTEX_ELEMENT_TANGENT_T: Assert(VERTEX_ELEMENT_TANGENT_T == 5); break;
case VERTEX_ELEMENT_WRINKLE: Assert(VERTEX_ELEMENT_WRINKLE == 6); break;
case VERTEX_ELEMENT_BONEINDEX: Assert(VERTEX_ELEMENT_BONEINDEX == 7); break;
case VERTEX_ELEMENT_BONEWEIGHTS1: Assert(VERTEX_ELEMENT_BONEWEIGHTS1 == 8); break;
case VERTEX_ELEMENT_BONEWEIGHTS2: Assert(VERTEX_ELEMENT_BONEWEIGHTS2 == 9); break;
case VERTEX_ELEMENT_BONEWEIGHTS3: Assert(VERTEX_ELEMENT_BONEWEIGHTS3 == 10); break;
case VERTEX_ELEMENT_BONEWEIGHTS4: Assert(VERTEX_ELEMENT_BONEWEIGHTS4 == 11); break;
case VERTEX_ELEMENT_USERDATA1: Assert(VERTEX_ELEMENT_USERDATA1 == 12); break;
case VERTEX_ELEMENT_USERDATA2: Assert(VERTEX_ELEMENT_USERDATA2 == 13); break;
case VERTEX_ELEMENT_USERDATA3: Assert(VERTEX_ELEMENT_USERDATA3 == 14); break;
case VERTEX_ELEMENT_USERDATA4: Assert(VERTEX_ELEMENT_USERDATA4 == 15); break;
case VERTEX_ELEMENT_TEXCOORD1D_0: Assert(VERTEX_ELEMENT_TEXCOORD1D_0 == 16); break;
case VERTEX_ELEMENT_TEXCOORD1D_1: Assert(VERTEX_ELEMENT_TEXCOORD1D_1 == 17); break;
case VERTEX_ELEMENT_TEXCOORD1D_2: Assert(VERTEX_ELEMENT_TEXCOORD1D_2 == 18); break;
case VERTEX_ELEMENT_TEXCOORD1D_3: Assert(VERTEX_ELEMENT_TEXCOORD1D_3 == 19); break;
case VERTEX_ELEMENT_TEXCOORD1D_4: Assert(VERTEX_ELEMENT_TEXCOORD1D_4 == 20); break;
case VERTEX_ELEMENT_TEXCOORD1D_5: Assert(VERTEX_ELEMENT_TEXCOORD1D_5 == 21); break;
case VERTEX_ELEMENT_TEXCOORD1D_6: Assert(VERTEX_ELEMENT_TEXCOORD1D_6 == 22); break;
case VERTEX_ELEMENT_TEXCOORD1D_7: Assert(VERTEX_ELEMENT_TEXCOORD1D_7 == 23); break;
case VERTEX_ELEMENT_TEXCOORD2D_0: Assert(VERTEX_ELEMENT_TEXCOORD2D_0 == 24); break;
case VERTEX_ELEMENT_TEXCOORD2D_1: Assert(VERTEX_ELEMENT_TEXCOORD2D_1 == 25); break;
case VERTEX_ELEMENT_TEXCOORD2D_2: Assert(VERTEX_ELEMENT_TEXCOORD2D_2 == 26); break;
case VERTEX_ELEMENT_TEXCOORD2D_3: Assert(VERTEX_ELEMENT_TEXCOORD2D_3 == 27); break;
case VERTEX_ELEMENT_TEXCOORD2D_4: Assert(VERTEX_ELEMENT_TEXCOORD2D_4 == 28); break;
case VERTEX_ELEMENT_TEXCOORD2D_5: Assert(VERTEX_ELEMENT_TEXCOORD2D_5 == 29); break;
case VERTEX_ELEMENT_TEXCOORD2D_6: Assert(VERTEX_ELEMENT_TEXCOORD2D_6 == 30); break;
case VERTEX_ELEMENT_TEXCOORD2D_7: Assert(VERTEX_ELEMENT_TEXCOORD2D_7 == 31); break;
case VERTEX_ELEMENT_TEXCOORD3D_0: Assert(VERTEX_ELEMENT_TEXCOORD3D_0 == 32); break;
case VERTEX_ELEMENT_TEXCOORD3D_1: Assert(VERTEX_ELEMENT_TEXCOORD3D_1 == 33); break;
case VERTEX_ELEMENT_TEXCOORD3D_2: Assert(VERTEX_ELEMENT_TEXCOORD3D_2 == 34); break;
case VERTEX_ELEMENT_TEXCOORD3D_3: Assert(VERTEX_ELEMENT_TEXCOORD3D_3 == 35); break;
case VERTEX_ELEMENT_TEXCOORD3D_4: Assert(VERTEX_ELEMENT_TEXCOORD3D_4 == 36); break;
case VERTEX_ELEMENT_TEXCOORD3D_5: Assert(VERTEX_ELEMENT_TEXCOORD3D_5 == 37); break;
case VERTEX_ELEMENT_TEXCOORD3D_6: Assert(VERTEX_ELEMENT_TEXCOORD3D_6 == 38); break;
case VERTEX_ELEMENT_TEXCOORD3D_7: Assert(VERTEX_ELEMENT_TEXCOORD3D_7 == 39); break;
case VERTEX_ELEMENT_TEXCOORD4D_0: Assert(VERTEX_ELEMENT_TEXCOORD4D_0 == 40); break;
case VERTEX_ELEMENT_TEXCOORD4D_1: Assert(VERTEX_ELEMENT_TEXCOORD4D_1 == 41); break;
case VERTEX_ELEMENT_TEXCOORD4D_2: Assert(VERTEX_ELEMENT_TEXCOORD4D_2 == 42); break;
case VERTEX_ELEMENT_TEXCOORD4D_3: Assert(VERTEX_ELEMENT_TEXCOORD4D_3 == 43); break;
case VERTEX_ELEMENT_TEXCOORD4D_4: Assert(VERTEX_ELEMENT_TEXCOORD4D_4 == 44); break;
case VERTEX_ELEMENT_TEXCOORD4D_5: Assert(VERTEX_ELEMENT_TEXCOORD4D_5 == 45); break;
case VERTEX_ELEMENT_TEXCOORD4D_6: Assert(VERTEX_ELEMENT_TEXCOORD4D_6 == 46); break;
case VERTEX_ELEMENT_TEXCOORD4D_7: Assert(VERTEX_ELEMENT_TEXCOORD4D_7 == 47); break;
default:
Assert(0);
break;
}
}
#define COMPRESSED_NORMALS_SEPARATETANGENTS_SHORT2 0
#define COMPRESSED_NORMALS_COMBINEDTANGENTS_UBYTE4 1
#define COMPRESSED_NORMALS_TYPE COMPRESSED_NORMALS_COMBINEDTANGENTS_UBYTE4
inline int GetVertexElementSize(VertexElement_t element, VertexCompressionType_t compressionType)
{
Detect_VertexElement_t_Changes(element);
if (compressionType == VERTEX_COMPRESSION_ON)
{
switch (element)
{
#if ( COMPRESSED_NORMALS_TYPE == COMPRESSED_NORMALS_SEPARATETANGENTS_SHORT2 )
case VERTEX_ELEMENT_NORMAL:
return (2 * sizeof(short));
case VERTEX_ELEMENT_USERDATA4:
return (2 * sizeof(short));
#else
case VERTEX_ELEMENT_NORMAL:
return (4 * sizeof(unsigned char));
case VERTEX_ELEMENT_USERDATA4:
return (0);
#endif
case VERTEX_ELEMENT_BONEWEIGHTS1:
case VERTEX_ELEMENT_BONEWEIGHTS2:
return (2 * sizeof(short));
default:
break;
}
}
switch (element)
{
case VERTEX_ELEMENT_POSITION: return (3 * sizeof(float));
case VERTEX_ELEMENT_NORMAL: return (3 * sizeof(float));
case VERTEX_ELEMENT_COLOR: return (4 * sizeof(unsigned char));
case VERTEX_ELEMENT_SPECULAR: return (4 * sizeof(unsigned char));
case VERTEX_ELEMENT_TANGENT_S: return (3 * sizeof(float));
case VERTEX_ELEMENT_TANGENT_T: return (3 * sizeof(float));
case VERTEX_ELEMENT_WRINKLE: return (1 * sizeof(float));
case VERTEX_ELEMENT_BONEINDEX: return (4 * sizeof(unsigned char));
case VERTEX_ELEMENT_BONEWEIGHTS1: return (1 * sizeof(float));
case VERTEX_ELEMENT_BONEWEIGHTS2: return (2 * sizeof(float));
case VERTEX_ELEMENT_BONEWEIGHTS3: return (3 * sizeof(float));
case VERTEX_ELEMENT_BONEWEIGHTS4: return (4 * sizeof(float));
case VERTEX_ELEMENT_USERDATA1: return (1 * sizeof(float));
case VERTEX_ELEMENT_USERDATA2: return (2 * sizeof(float));
case VERTEX_ELEMENT_USERDATA3: return (3 * sizeof(float));
case VERTEX_ELEMENT_USERDATA4: return (4 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD1D_0: return (1 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD1D_1: return (1 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD1D_2: return (1 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD1D_3: return (1 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD1D_4: return (1 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD1D_5: return (1 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD1D_6: return (1 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD1D_7: return (1 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD2D_0: return (2 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD2D_1: return (2 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD2D_2: return (2 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD2D_3: return (2 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD2D_4: return (2 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD2D_5: return (2 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD2D_6: return (2 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD2D_7: return (2 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD3D_0: return (3 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD3D_1: return (3 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD3D_2: return (3 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD3D_3: return (3 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD3D_4: return (3 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD3D_5: return (3 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD3D_6: return (3 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD3D_7: return (3 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD4D_0: return (4 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD4D_1: return (4 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD4D_2: return (4 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD4D_3: return (4 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD4D_4: return (4 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD4D_5: return (4 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD4D_6: return (4 * sizeof(float));
case VERTEX_ELEMENT_TEXCOORD4D_7: return (4 * sizeof(float));
default:
Assert(0);
return 0;
};
}
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),
};
enum MaterialVarFlags2_t
{
MATERIAL_VAR2_LIGHTING_UNLIT = 0,
MATERIAL_VAR2_LIGHTING_VERTEX_LIT = (1 << 1),
MATERIAL_VAR2_LIGHTING_LIGHTMAP = (1 << 2),
MATERIAL_VAR2_LIGHTING_BUMPED_LIGHTMAP = (1 << 3),
MATERIAL_VAR2_LIGHTING_MASK =
(MATERIAL_VAR2_LIGHTING_VERTEX_LIT |
MATERIAL_VAR2_LIGHTING_LIGHTMAP |
MATERIAL_VAR2_LIGHTING_BUMPED_LIGHTMAP),
MATERIAL_VAR2_DIFFUSE_BUMPMAPPED_MODEL = (1 << 4),
MATERIAL_VAR2_USES_ENV_CUBEMAP = (1 << 5),
MATERIAL_VAR2_NEEDS_TANGENT_SPACES = (1 << 6),
MATERIAL_VAR2_NEEDS_SOFTWARE_LIGHTING = (1 << 7),
MATERIAL_VAR2_BLEND_WITH_LIGHTMAP_ALPHA = (1 << 8),
MATERIAL_VAR2_NEEDS_BAKED_LIGHTING_SNAPSHOTS = (1 << 9),
MATERIAL_VAR2_USE_FLASHLIGHT = (1 << 10),
MATERIAL_VAR2_USE_FIXED_FUNCTION_BAKED_LIGHTING = (1 << 11),
MATERIAL_VAR2_NEEDS_FIXED_FUNCTION_FLASHLIGHT = (1 << 12),
MATERIAL_VAR2_USE_EDITOR = (1 << 13),
MATERIAL_VAR2_NEEDS_POWER_OF_TWO_FRAME_BUFFER_TEXTURE = (1 << 14),
MATERIAL_VAR2_NEEDS_FULL_FRAME_BUFFER_TEXTURE = (1 << 15),
MATERIAL_VAR2_IS_SPRITECARD = (1 << 16),
MATERIAL_VAR2_USES_VERTEXID = (1 << 17),
MATERIAL_VAR2_SUPPORTS_HW_SKINNING = (1 << 18),
MATERIAL_VAR2_SUPPORTS_FLASHLIGHT = (1 << 19),
};
enum PreviewImageRetVal_t
{
MATERIAL_PREVIEW_IMAGE_BAD = 0,
MATERIAL_PREVIEW_IMAGE_OK,
MATERIAL_NO_PREVIEW_IMAGE,
};
abstract_class IMaterial
{
public:
virtual const char* GetName() const = 0;
virtual const char* GetTextureGroupName() const = 0;
virtual PreviewImageRetVal_t GetPreviewImageProperties(int* width, int* height,
ImageFormat* imageFormat, bool* isTranslucent) const = 0;
virtual PreviewImageRetVal_t GetPreviewImage(unsigned char* data,
int width, int height,
ImageFormat imageFormat) const = 0;
virtual int GetMappingWidth() = 0;
virtual int GetMappingHeight() = 0;
virtual int GetNumAnimationFrames() = 0;
virtual bool InMaterialPage(void) = 0;
virtual void GetMaterialOffset(float* pOffset) = 0;
virtual void GetMaterialScale(float* pScale) = 0;
virtual IMaterial* GetMaterialPage(void) = 0;
virtual IMaterialVar* FindVar(const char* varName, bool* found, bool complain = true) = 0;
virtual void IncrementReferenceCount(void) = 0;
virtual void DecrementReferenceCount(void) = 0;
inline void AddRef() { IncrementReferenceCount(); }
inline void Release() { DecrementReferenceCount(); }
virtual int GetEnumerationID(void) const = 0;
virtual void GetLowResColorSample(float s, float t, float* color) const = 0;
virtual void RecomputeStateSnapshots() = 0;
virtual bool IsTranslucent() = 0;
virtual bool IsAlphaTested() = 0;
virtual bool IsVertexLit() = 0;
virtual VertexFormat_t GetVertexFormat() const = 0;
virtual bool HasProxy(void) const = 0;
virtual bool UsesEnvCubemap(void) = 0;
virtual bool NeedsTangentSpace(void) = 0;
virtual bool NeedsPowerOfTwoFrameBufferTexture(bool bCheckSpecificToThisFrame = true) = 0;
virtual bool NeedsFullFrameBufferTexture(bool bCheckSpecificToThisFrame = true) = 0;
virtual bool NeedsSoftwareSkinning(void) = 0;
virtual void AlphaModulate(float alpha) = 0;
virtual void ColorModulate(float r, float g, float b) = 0;
virtual void SetMaterialVarFlag(MaterialVarFlags_t flag, bool on) = 0;
virtual bool GetMaterialVarFlag(MaterialVarFlags_t flag) const = 0;
virtual void GetReflectivity(Vector& reflect) = 0;
virtual bool GetPropertyFlag(MaterialPropertyTypes_t type) = 0;
virtual bool IsTwoSided() = 0;
virtual void SetShader(const char* pShaderName) = 0;
virtual int GetNumPasses(void) = 0;
virtual int GetTextureMemoryBytes(void) = 0;
virtual void Refresh() = 0;
virtual bool NeedsLightmapBlendAlpha(void) = 0;
virtual bool NeedsSoftwareLighting(void) = 0;
virtual int ShaderParamCount() const = 0;
virtual IMaterialVar** GetShaderParams(void) = 0;
virtual bool IsErrorMaterial() const = 0;
virtual void SetUseFixedFunctionBakedLighting(bool bEnable) = 0;
virtual float GetAlphaModulation() = 0;
virtual void GetColorModulation(float* r, float* g, float* b) = 0;
virtual MorphFormat_t GetMorphFormat() const = 0;
virtual IMaterialVar* FindVarFast(char const* pVarName, unsigned int* pToken) = 0;
virtual void SetShaderAndParams(KeyValues* pKeyValues) = 0;
virtual const char* GetShaderName() const = 0;
virtual void DeleteIfUnreferenced() = 0;
virtual bool IsSpriteCard() = 0;
virtual void CallBindProxy(void* proxyData) = 0;
virtual IMaterial* CheckProxyReplacement(void* proxyData) = 0;
virtual void RefreshPreservingMaterialVars() = 0;
virtual bool WasReloadedFromWhitelist() = 0;
virtual bool IsPrecached() const = 0;
};
inline bool IsErrorMaterial(IMaterial* pMat)
{
return !pMat || pMat->IsErrorMaterial();
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,200 @@
#ifndef IMATERIALSYSTEMHARDWARECONFIG_H
#define IMATERIALSYSTEMHARDWARECONFIG_H
#ifdef _WIN32
#pragma once
#endif
#if defined( DX_TO_GL_ABSTRACTION )
#define IsPlatformOpenGL() true
#else
#define IsPlatformOpenGL() false
#endif
#include "interface.h"
#include "imageformat.h"
#include "imaterialsystem.h"
FORCEINLINE bool IsOpenGL(void)
{
return IsPlatformOpenGL();
}
enum VertexCompressionType_t
{
VERTEX_COMPRESSION_INVALID = 0xFFFFFFFF,
VERTEX_COMPRESSION_NONE = 0,
VERTEX_COMPRESSION_ON = 1
};
#ifdef _GAMECONSOLE
#define DEFCONFIGMETHOD( ret_type, method, xbox_return_value ) \
FORCEINLINE ret_type method const \
{ \
return xbox_return_value; \
}
#else
#define DEFCONFIGMETHOD( ret_type, method, xbox_return_value ) \
virtual ret_type method const = 0;
#endif
enum ShadowFilterMode_t
{
SHADOWFILTERMODE_DEFAULT = 0,
NVIDIA_PCF = 0,
ATI_NO_PCF_FETCH4 = 1,
NVIDIA_PCF_CHEAP = 2,
ATI_NOPCF = 3,
GAMECONSOLE_NINE_TAP_PCF = 0,
GAMECONSOLE_SINGLE_TAP_PCF = 1,
#if defined( _GAMECONSOLE )
SHADOWFILTERMODE_FIRST_CHEAP_MODE = GAMECONSOLE_SINGLE_TAP_PCF,
#else
SHADOWFILTERMODE_FIRST_CHEAP_MODE = NVIDIA_PCF_CHEAP,
#endif
};
enum CSMQualityMode_t
{
CSMQUALITY_VERY_LOW,
CSMQUALITY_LOW,
CSMQUALITY_MEDIUM,
CSMQUALITY_HIGH,
CSMQUALITY_TOTAL_MODES
};
enum CSMShaderMode_t
{
CSMSHADERMODE_LOW_OR_VERY_LOW = 0,
CSMSHADERMODE_MEDIUM = 1,
CSMSHADERMODE_HIGH = 2,
CSMSHADERMODE_ATIFETCH4 = 3,
CSMSHADERMODE_TOTAL_MODES
};
class IMaterialSystemHardwareConfig
{
public:
virtual int GetFrameBufferColorDepth() const = 0;
virtual int GetSamplerCount() const = 0;
virtual bool HasSetDeviceGammaRamp() const = 0;
DEFCONFIGMETHOD(bool, SupportsStaticControlFlow(), true);
virtual VertexCompressionType_t SupportsCompressedVertices() const = 0;
virtual int MaximumAnisotropicLevel() const = 0;
virtual int MaxTextureWidth() const = 0;
virtual int MaxTextureHeight() const = 0;
virtual int TextureMemorySize() const = 0;
virtual bool SupportsMipmappedCubemaps() const = 0;
virtual int NumVertexShaderConstants() const = 0;
virtual int NumPixelShaderConstants() const = 0;
virtual int MaxNumLights() const = 0;
virtual int MaxTextureAspectRatio() const = 0;
virtual int MaxVertexShaderBlendMatrices() const = 0;
virtual int MaxUserClipPlanes() const = 0;
virtual bool UseFastClipping() const = 0;
DEFCONFIGMETHOD(int, GetDXSupportLevel(), 98);
virtual const char* GetShaderDLLName() const = 0;
virtual bool ReadPixelsFromFrontBuffer() const = 0;
virtual bool PreferDynamicTextures() const = 0;
DEFCONFIGMETHOD(bool, SupportsHDR(), true);
virtual bool NeedsAAClamp() const = 0;
virtual bool NeedsATICentroidHack() const = 0;
virtual int GetMaxDXSupportLevel() const = 0;
virtual bool SpecifiesFogColorInLinearSpace() const = 0;
DEFCONFIGMETHOD(bool, SupportsSRGB(), true);
DEFCONFIGMETHOD(bool, FakeSRGBWrite(), false);
DEFCONFIGMETHOD(bool, CanDoSRGBReadFromRTs(), true);
virtual bool SupportsGLMixedSizeTargets() const = 0;
virtual bool IsAAEnabled() const = 0;
virtual int GetVertexSamplerCount() const = 0;
virtual int GetMaxVertexTextureDimension() const = 0;
virtual int MaxTextureDepth() const = 0;
virtual HDRType_t GetHDRType() const = 0;
virtual HDRType_t GetHardwareHDRType() const = 0;
virtual bool SupportsStreamOffset() const = 0;
virtual int StencilBufferBits() const = 0;
virtual int MaxViewports() const = 0;
virtual void OverrideStreamOffsetSupport(bool bOverrideEnabled, bool bEnableSupport) = 0;
virtual ShadowFilterMode_t GetShadowFilterMode(bool bForceLowQualityShadows, bool bPS30) const = 0;
virtual int NeedsShaderSRGBConversion() const = 0;
DEFCONFIGMETHOD(bool, UsesSRGBCorrectBlending(), IsX360());
virtual bool HasFastVertexTextures() const = 0;
virtual int MaxHWMorphBatchCount() const = 0;
virtual bool SupportsHDRMode(HDRType_t nHDRMode) const = 0;
virtual bool GetHDREnabled(void) const = 0;
virtual void SetHDREnabled(bool bEnable) = 0;
virtual bool SupportsBorderColor(void) const = 0;
virtual bool SupportsFetch4(void) const = 0;
virtual float GetShadowDepthBias() const = 0;
virtual float GetShadowSlopeScaleDepthBias() const = 0;
virtual bool PreferZPrepass() const = 0;
virtual bool SuppressPixelShaderCentroidHackFixup() const = 0;
virtual bool PreferTexturesInHWMemory() const = 0;
virtual bool PreferHardwareSync() const = 0;
virtual bool ActualHasFastVertexTextures() const = 0;
virtual bool SupportsShadowDepthTextures(void) const = 0;
virtual ImageFormat GetShadowDepthTextureFormat(void) const = 0;
virtual ImageFormat GetHighPrecisionShadowDepthTextureFormat(void) const = 0;
virtual ImageFormat GetNullTextureFormat(void) const = 0;
virtual int GetMinDXSupportLevel() const = 0;
virtual bool IsUnsupported() const = 0;
virtual float GetLightMapScaleFactor() const = 0;
virtual bool SupportsCascadedShadowMapping() const = 0;
virtual CSMQualityMode_t GetCSMQuality() const = 0;
virtual bool SupportsBilinearPCFSampling() const = 0;
virtual CSMShaderMode_t GetCSMShaderMode(CSMQualityMode_t nQualityLevel) const = 0;
virtual bool GetCSMAccurateBlending(void) const = 0;
virtual void SetCSMAccurateBlending(bool bEnable) = 0;
virtual bool SupportsResolveDepth() const = 0;
virtual bool HasFullResolutionDepthTexture() const = 0;
#if defined ( STDSHADER_DBG_DLL_EXPORT ) || defined( STDSHADER_DX9_DLL_EXPORT )
inline bool SupportsPixelShaders_2_b() const { return GetDXSupportLevel() >= 92; }
inline bool SupportsPixelShaders_3_0() const { return GetDXSupportLevel() >= 95; }
#endif
inline bool ShouldAlwaysUseShaderModel2bShaders() const { return IsOpenGL(); }
inline bool PlatformRequiresNonNullPixelShaders() const { return IsOpenGL(); }
};
#endif

169
SpyCustom/sdk/imdlcache.h Normal file
View File

@ -0,0 +1,169 @@
#ifndef IMDLCACHE_H
#define IMDLCACHE_H
#ifdef _WIN32
#pragma once
#endif
#include "IAppSystem.h"
struct studiohdr_t;
struct studiohwdata_t;
struct vcollide_t;
struct virtualmodel_t;
struct vertexFileHeader_t;
namespace OptimizedModel
{
struct FileHeader_t;
}
typedef unsigned short MDLHandle_t;
enum
{
MDLHANDLE_INVALID = (MDLHandle_t)~0
};
enum MDLCacheDataType_t
{
MDLCACHE_STUDIOHDR = 0,
MDLCACHE_STUDIOHWDATA,
MDLCACHE_VCOLLIDE,
MDLCACHE_ANIMBLOCK,
MDLCACHE_VIRTUALMODEL,
MDLCACHE_VERTEXES,
MDLCACHE_DECODEDANIMBLOCK,
};
abstract_class IMDLCacheNotify
{
public:
virtual void OnDataLoaded(MDLCacheDataType_t type, MDLHandle_t handle) = 0;
virtual void OnDataUnloaded(MDLCacheDataType_t type, MDLHandle_t handle) = 0;
};
enum MDLCacheFlush_t
{
MDLCACHE_FLUSH_STUDIOHDR = 0x01,
MDLCACHE_FLUSH_STUDIOHWDATA = 0x02,
MDLCACHE_FLUSH_VCOLLIDE = 0x04,
MDLCACHE_FLUSH_ANIMBLOCK = 0x08,
MDLCACHE_FLUSH_VIRTUALMODEL = 0x10,
MDLCACHE_FLUSH_AUTOPLAY = 0x20,
MDLCACHE_FLUSH_VERTEXES = 0x40,
MDLCACHE_FLUSH_IGNORELOCK = 0x80000000,
MDLCACHE_FLUSH_ALL = 0xFFFFFFFF
};
#define MDLCACHE_INTERFACE_VERSION "MDLCache004"
abstract_class IMDLCache : public IAppSystem
{
public:
virtual void SetCacheNotify(IMDLCacheNotify * pNotify) = 0;
virtual MDLHandle_t FindMDL(const char* pMDLRelativePath) = 0;
virtual int AddRef(MDLHandle_t handle) = 0;
virtual int Release(MDLHandle_t handle) = 0;
virtual int GetRef(MDLHandle_t handle) = 0;
virtual studiohdr_t* GetStudioHdr(MDLHandle_t handle) = 0;
virtual studiohwdata_t* GetHardwareData(MDLHandle_t handle) = 0;
virtual vcollide_t* GetVCollide(MDLHandle_t handle) = 0;
virtual unsigned char* GetAnimBlock(MDLHandle_t handle, int nBlock) = 0;
virtual virtualmodel_t* GetVirtualModel(MDLHandle_t handle) = 0;
virtual int GetAutoplayList(MDLHandle_t handle, unsigned short** pOut) = 0;
virtual vertexFileHeader_t* GetVertexData(MDLHandle_t handle) = 0;
virtual void TouchAllData(MDLHandle_t handle) = 0;
virtual void SetUserData(MDLHandle_t handle, void* pData) = 0;
virtual void* GetUserData(MDLHandle_t handle) = 0;
virtual bool IsErrorModel(MDLHandle_t handle) = 0;
virtual void Flush(MDLCacheFlush_t nFlushFlags = MDLCACHE_FLUSH_ALL) = 0;
virtual void Flush(MDLHandle_t handle, int nFlushFlags = MDLCACHE_FLUSH_ALL) = 0;
virtual const char* GetModelName(MDLHandle_t handle) = 0;
virtual virtualmodel_t* GetVirtualModelFast(const studiohdr_t* pStudioHdr, MDLHandle_t handle) = 0;
virtual void BeginLock() = 0;
virtual void EndLock() = 0;
virtual int* GetFrameUnlockCounterPtrOLD() = 0;
virtual void FinishPendingLoads() = 0;
virtual vcollide_t* GetVCollideEx(MDLHandle_t handle, bool synchronousLoad = true) = 0;
virtual bool GetVCollideSize(MDLHandle_t handle, int* pVCollideSize) = 0;
virtual bool GetAsyncLoad(MDLCacheDataType_t type) = 0;
virtual bool SetAsyncLoad(MDLCacheDataType_t type, bool bAsync) = 0;
virtual void BeginMapLoad() = 0;
virtual void EndMapLoad() = 0;
virtual void MarkAsLoaded(MDLHandle_t handle) = 0;
virtual void InitPreloadData(bool rebuild) = 0;
virtual void ShutdownPreloadData() = 0;
virtual bool IsDataLoaded(MDLHandle_t handle, MDLCacheDataType_t type) = 0;
virtual int* GetFrameUnlockCounterPtr(MDLCacheDataType_t type) = 0;
virtual studiohdr_t* LockStudioHdr(MDLHandle_t handle) = 0;
virtual void UnlockStudioHdr(MDLHandle_t handle) = 0;
virtual bool PreloadModel(MDLHandle_t handle) = 0;
virtual void ResetErrorModelStatus(MDLHandle_t handle) = 0;
virtual void MarkFrame() = 0;
};
class CMDLCacheCriticalSection
{
public:
CMDLCacheCriticalSection(IMDLCache* pCache) : m_pCache(pCache)
{
m_pCache->BeginLock();
}
~CMDLCacheCriticalSection()
{
m_pCache->EndLock();
}
private:
IMDLCache* m_pCache;
};
#define MDCACHE_FINE_GRAINED 1
#if defined(MDCACHE_FINE_GRAINED)
#define MDLCACHE_CRITICAL_SECTION_( pCache ) CMDLCacheCriticalSection cacheCriticalSection(pCache)
#define MDLCACHE_COARSE_LOCK_( pCache ) ((void)(0))
#elif defined(MDLCACHE_LEVEL_LOCKED)
#define MDLCACHE_CRITICAL_SECTION_( pCache ) ((void)(0))
#define MDLCACHE_COARSE_LOCK_( pCache ) ((void)(0))
#else
#define MDLCACHE_CRITICAL_SECTION_( pCache ) ((void)(0))
#define MDLCACHE_COARSE_LOCK_( pCache ) CMDLCacheCriticalSection cacheCriticalSection(pCache)
#endif
#define MDLCACHE_CRITICAL_SECTION() MDLCACHE_CRITICAL_SECTION_(mdlcache)
#define MDLCACHE_COARSE_LOCK() MDLCACHE_COARSE_LOCK_(mdlcache)
#endif

View File

@ -0,0 +1,74 @@
#ifndef IMOVEHELPER_H
#define IMOVEHELPER_H
#ifdef _WIN32
#pragma once
#endif
enum PLAYER_ANIM;
class IPhysicsSurfaceProps;
class Vector;
struct model_t;
struct cmodel_t;
struct vcollide_t;
class CGameTrace;
enum soundlevel_t;
enum
{
WL_NotInWater = 0,
WL_Feet,
WL_Waist,
WL_Eyes
};
typedef CBaseHandle EntityHandle_t;
#define INVALID_ENTITY_HANDLE INVALID_EHANDLE_INDEX
abstract_class IMoveHelper
{
public:
static IMoveHelper * GetSingleton() { return sm_pSingleton; }
virtual char const* GetName(EntityHandle_t handle) const = 0;
virtual void ResetTouchList(void) = 0;
virtual bool AddToTouched(const CGameTrace& tr, const Vector& impactvelocity) = 0;
virtual void ProcessImpacts(void) = 0;
virtual void Con_NPrintf(int idx, PRINTF_FORMAT_STRING char const* fmt, ...) = 0;
virtual void StartSound(const Vector& origin, int channel, char const* sample, float volume, soundlevel_t soundlevel, int fFlags, int pitch) = 0;
virtual void StartSound(const Vector& origin, const char* soundname) = 0;
virtual void PlaybackEventFull(int flags, int clientindex, unsigned short eventindex, float delay, Vector& origin, Vector& angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2) = 0;
virtual bool PlayerFallingDamage(void) = 0;
virtual void PlayerSetAnimation(PLAYER_ANIM playerAnim) = 0;
virtual IPhysicsSurfaceProps* GetSurfaceProps(void) = 0;
virtual bool IsWorldEntity(const CBaseHandle& handle) = 0;
protected:
static void SetSingleton(IMoveHelper* pMoveHelper) { sm_pSingleton = pMoveHelper; }
virtual ~IMoveHelper() {}
static IMoveHelper* sm_pSingleton;
};
#define IMPLEMENT_MOVEHELPER() \
IMoveHelper* IMoveHelper::sm_pSingleton = 0
inline IMoveHelper* MoveHelper()
{
return IMoveHelper::GetSingleton();
}
#endif

View File

@ -0,0 +1,85 @@
#ifndef INETCHANNEL_H
#define INETCHANNEL_H
#ifdef _WIN32
#pragma once
#endif
#include "platform.h"
#include "inetchannelinfo.h"
#include "bitbuf.h"
class IDemoRecorder;
class INetMessage;
class INetChannelHandler;
class INetChannelInfo;
typedef struct netpacket_s netpacket_t;
typedef struct netadr_s netadr_t;
abstract_class INetChannel : public INetChannelInfo
{
public:
virtual ~INetChannel(void) {};
virtual void SetDataRate(float rate) = 0;
virtual bool RegisterMessage(INetMessage* msg) = 0;
virtual bool UnregisterMessage(INetMessageBinder* msg) = 0;
virtual bool StartStreaming(unsigned int challengeNr) = 0;
virtual void ResetStreaming(void) = 0;
virtual void SetTimeout(float seconds) = 0;
virtual void SetDemoRecorder(IDemoRecorder* recorder) = 0;
virtual void SetChallengeNr(unsigned int chnr) = 0;
virtual void Reset(void) = 0;
virtual void Clear(void) = 0;
virtual void Shutdown(const char* reason) = 0;
virtual void ProcessPlayback(void) = 0;
virtual bool ProcessStream(void) = 0;
virtual void ProcessPacket(struct netpacket_s* packet, bool bHasHeader) = 0;
virtual bool SendNetMsg(INetMessage& msg, bool bForceReliable = false, bool bVoice = false) = 0;
#ifdef POSIX
FORCEINLINE bool SendNetMsg(INetMessage const& msg, bool bForceReliable = false, bool bVoice = false) { return SendNetMsg(*((INetMessage*)&msg), bForceReliable, bVoice); }
#endif
virtual bool SendData(bf_write& msg, bool bReliable = true) = 0;
virtual bool SendFile(const char* filename, unsigned int transferID) = 0;
virtual void DenyFile(const char* filename, unsigned int transferID) = 0;
virtual void RequestFile_OLD(const char* filename, unsigned int transferID) = 0;
virtual void SetChoked(void) = 0;
virtual int SendDatagram(bf_write* data) = 0;
virtual bool Transmit(bool onlyReliable = false) = 0;
virtual const netadr_t& GetRemoteAddress(void) const = 0;
virtual INetChannelHandler* GetMsgHandler(void) const = 0;
virtual int GetDropNumber(void) const = 0;
virtual int GetSocket(void) const = 0;
virtual unsigned int GetChallengeNr(void) const = 0;
virtual void GetSequenceData(int& nOutSequenceNr, int& nInSequenceNr, int& nOutSequenceNrAck) = 0;
virtual void SetSequenceData(int nOutSequenceNr, int nInSequenceNr, int nOutSequenceNrAck) = 0;
virtual void UpdateMessageStats(int msggroup, int bits) = 0;
virtual bool CanPacket(void) const = 0;
virtual bool IsOverflowed(void) const = 0;
virtual bool IsTimedOut(void) const = 0;
virtual bool HasPendingReliableData(void) = 0;
virtual void SetFileTransmissionMode(bool bBackgroundMode) = 0;
virtual void SetCompressionMode(bool bUseCompression) = 0;
virtual unsigned int RequestFile(const char* filename) = 0;
virtual float GetTimeSinceLastReceived(void) const = 0;
virtual void SetMaxBufferSize(bool bReliable, int nBytes, bool bVoice = false) = 0;
virtual bool IsNull() const = 0;
virtual int GetNumBitsWritten(bool bReliable) = 0;
virtual void SetInterpolationAmount(float flInterpolationAmount) = 0;
virtual void SetRemoteFramerate(float flFrameTime, float flFrameTimeStdDeviation) = 0;
virtual void SetMaxRoutablePayloadSize(int nSplitSize) = 0;
virtual int GetMaxRoutablePayloadSize() = 0;
virtual int GetProtocolVersion() = 0;
};
#endif

View File

@ -0,0 +1,64 @@
#if !defined( INETCHANNELINFO_H )
#define INETCHANNELINFO_H
#ifdef _WIN32
#pragma once
#endif
#define FLOW_OUTGOING 0
#define FLOW_INCOMING 1
#define MAX_FLOWS 2
class INetChannelInfo
{
public:
enum {
GENERIC = 0,
LOCALPLAYER,
OTHERPLAYERS,
ENTITIES,
SOUNDS,
EVENTS,
USERMESSAGES,
ENTMESSAGES,
VOICE,
STRINGTABLE,
MOVE,
STRINGCMD,
SIGNON,
TOTAL,
};
virtual const char* GetName(void) const = 0;
virtual const char* GetAddress(void) const = 0;
virtual float GetTime(void) const = 0;
virtual float GetTimeConnected(void) const = 0;
virtual int GetBufferSize(void) const = 0;
virtual int GetDataRate(void) const = 0;
virtual bool IsLoopback(void) const = 0;
virtual bool IsTimingOut(void) const = 0;
virtual bool IsPlayback(void) const = 0;
virtual float GetLatency(int flow) const = 0;
virtual float GetAvgLatency(int flow) const = 0;
virtual float GetAvgLoss(int flow) const = 0;
virtual float GetAvgChoke(int flow) const = 0;
virtual float GetAvgData(int flow) const = 0;
virtual float GetAvgPackets(int flow) const = 0;
virtual int GetTotalData(int flow) const = 0;
virtual int GetSequenceNr(int flow) const = 0;
virtual bool IsValidPacket(int flow, int frame_number) const = 0;
virtual float GetPacketTime(int flow, int frame_number) const = 0;
virtual int GetPacketBytes(int flow, int frame_number, int group) const = 0;
virtual bool GetStreamProgress(int flow, int* received, int* total) const = 0;
virtual float GetTimeSinceLastReceived(void) const = 0;
virtual float GetCommandInterpolationAmount(int flow, int frame_number) const = 0;
virtual void GetPacketResponseLatency(int flow, int frame_number, int* pnLatencyMsecs, int* pnChoke) const = 0;
virtual void GetRemoteFramerate(float* pflFrameTime, float* pflFrameTimeStdDeviation) const = 0;
virtual float GetTimeoutSeconds() const = 0;
};
#endif

View File

@ -0,0 +1,74 @@
#ifndef INETMESSAGE_H
#define INETMESSAGE_H
#include "bitbuf.h"
class INetMsgHandler;
class INetMessage;
class INetChannel;
class INetMessage
{
public:
virtual ~INetMessage() {};
virtual void SetNetChannel(INetChannel* netchan) { DebuggerBreak(); return; }
virtual void SetReliable(bool state) = 0;
virtual bool Process(void) { DebuggerBreak(); return false; }
virtual bool ReadFromBuffer(bf_read& buffer) = 0;
virtual bool WriteToBuffer(bf_write& buffer) const = 0;
virtual bool IsReliable(void) const = 0;
virtual int GetType(void) const = 0;
virtual int GetGroup(void) const = 0;
virtual const char* GetName(void) const = 0;
virtual INetChannel* GetNetChannel(void) const { DebuggerBreak(); return NULL; }
virtual const char* ToString(void) const = 0;
virtual size_t GetSize() const = 0;
};
class INetMessageBinder
{
public:
virtual ~INetMessageBinder() {};
virtual int GetType(void) const = 0;
virtual void SetNetChannel(INetChannel* netchan) = 0;
virtual INetMessage* CreateFromBuffer(bf_read& buffer) = 0;
virtual bool Process(const INetMessage& src) = 0;
};
class INetChannelHandler
{
public:
virtual ~INetChannelHandler(void) {};
virtual void ConnectionStart(INetChannel* chan) = 0;
virtual void ConnectionStop() = 0;
virtual void ConnectionClosing(const char* reason) = 0;
virtual void ConnectionCrashed(const char* reason) = 0;
virtual void PacketStart(int incoming_sequence, int outgoing_acknowledged) = 0;
virtual void PacketEnd(void) = 0;
virtual void FileRequested(const char* fileName, unsigned int transferID, bool isReplayDemoFile) = 0;
virtual void FileReceived(const char* fileName, unsigned int transferID, bool isReplayDemoFile) = 0;
virtual void FileDenied(const char* fileName, unsigned int transferID, bool isReplayDemoFile) = 0;
virtual void FileSent(const char* fileName, unsigned int transferID, bool isReplayDemoFile) = 0;
virtual bool ChangeSplitscreenUser(int nSplitScreenUserSlot) = 0;
};
#endif

View File

@ -0,0 +1,21 @@
#if !defined( INETMSGHANDLER_H )
#define INETMSGHANDLER_H
#ifdef _WIN32
#pragma once
#endif
#include "inetmessage.h"
class INetChannel;
typedef struct netpacket_s netpacket_t;
class IConnectionlessPacketHandler
{
public:
virtual ~IConnectionlessPacketHandler(void) {};
virtual bool ProcessConnectionlessPacket(netpacket_t* packet) = 0;
};
#endif

139
SpyCustom/sdk/interface.h Normal file
View File

@ -0,0 +1,139 @@
#ifndef INTERFACE_H
#define INTERFACE_H
#ifdef _WIN32
#pragma once
#endif
class IBaseInterface
{
public:
virtual ~IBaseInterface() {}
};
#if !defined( _X360 )
#define CREATEINTERFACE_PROCNAME "CreateInterface"
#else
#define CREATEINTERFACE_PROCNAME ((const char*)1)
#endif
typedef void* (*CreateInterfaceFn)(const char* pName, int* pReturnCode);
typedef void* (*InstantiateInterfaceFn)();
class InterfaceReg
{
public:
InterfaceReg(InstantiateInterfaceFn fn, const char* pName);
public:
InstantiateInterfaceFn m_CreateFn;
const char* m_pName;
InterfaceReg* m_pNext;
static InterfaceReg* s_pInterfaceRegs;
};
#if !defined(_STATIC_LINKED) || !defined(_SUBSYSTEM)
#define EXPOSE_INTERFACE_FN(functionName, interfaceName, versionName) \
static InterfaceReg __g_Create##interfaceName##_reg(functionName, versionName);
#else
#define EXPOSE_INTERFACE_FN(functionName, interfaceName, versionName) \
namespace _SUBSYSTEM \
{ \
static InterfaceReg __g_Create##interfaceName##_reg(functionName, versionName); \
}
#endif
#if !defined(_STATIC_LINKED) || !defined(_SUBSYSTEM)
#define EXPOSE_INTERFACE(className, interfaceName, versionName) \
static void* __Create##className##_interface() {return static_cast<interfaceName *>( new className );} \
static InterfaceReg __g_Create##className##_reg(__Create##className##_interface, versionName );
#else
#define EXPOSE_INTERFACE(className, interfaceName, versionName) \
namespace _SUBSYSTEM \
{ \
static void* __Create##className##_interface() {return static_cast<interfaceName *>( new className );} \
static InterfaceReg __g_Create##className##_reg(__Create##className##_interface, versionName ); \
}
#endif
#if !defined(_STATIC_LINKED) || !defined(_SUBSYSTEM)
#define EXPOSE_SINGLE_INTERFACE_GLOBALVAR_WITH_NAMESPACE(className, interfaceNamespace, interfaceName, versionName, globalVarName) \
static void* __Create##className##interfaceName##_interface() {return static_cast<interfaceNamespace interfaceName *>( &globalVarName );} \
static InterfaceReg __g_Create##className##interfaceName##_reg(__Create##className##interfaceName##_interface, versionName);
#else
#define EXPOSE_SINGLE_INTERFACE_GLOBALVAR_WITH_NAMESPACE(className, interfaceNamespace, interfaceName, versionName, globalVarName) \
namespace _SUBSYSTEM \
{ \
static void* __Create##className##interfaceName##_interface() {return static_cast<interfaceNamespace interfaceName *>( &globalVarName );} \
static InterfaceReg __g_Create##className##interfaceName##_reg(__Create##className##interfaceName##_interface, versionName); \
}
#endif
#define EXPOSE_SINGLE_INTERFACE_GLOBALVAR(className, interfaceName, versionName, globalVarName) \
EXPOSE_SINGLE_INTERFACE_GLOBALVAR_WITH_NAMESPACE(className, , interfaceName, versionName, globalVarName)
#if !defined(_STATIC_LINKED) || !defined(_SUBSYSTEM)
#define EXPOSE_SINGLE_INTERFACE(className, interfaceName, versionName) \
static className __g_##className##_singleton; \
EXPOSE_SINGLE_INTERFACE_GLOBALVAR(className, interfaceName, versionName, __g_##className##_singleton)
#else
#define EXPOSE_SINGLE_INTERFACE(className, interfaceName, versionName) \
namespace _SUBSYSTEM \
{ \
static className __g_##className##_singleton; \
} \
EXPOSE_SINGLE_INTERFACE_GLOBALVAR(className, interfaceName, versionName, __g_##className##_singleton)
#endif
class CSysModule;
enum
{
IFACE_OK = 0,
IFACE_FAILED
};
void* CreateInterface(const char* pName, int* pReturnCode);
#if defined( _X360 )
DLL_EXPORT void* CreateInterfaceThunk(const char* pName, int* pReturnCode);
#endif
extern CreateInterfaceFn Sys_GetFactory(CSysModule* pModule);
extern CreateInterfaceFn Sys_GetFactory(const char* pModuleName);
extern CreateInterfaceFn Sys_GetFactoryThis(void);
enum Sys_Flags
{
SYS_NOFLAGS = 0x00,
SYS_NOLOAD = 0x01
};
extern CSysModule* Sys_LoadModule(const char* pModuleName, Sys_Flags flags = SYS_NOFLAGS);
extern void Sys_UnloadModule(CSysModule* pModule);
bool Sys_LoadInterface(
const char* pModuleName,
const char* pInterfaceVersionName,
CSysModule** pOutModule,
void** pOutInterface);
bool Sys_IsDebuggerPresent();
class CDllDemandLoader
{
public:
CDllDemandLoader(char const* pchModuleName);
virtual ~CDllDemandLoader();
CreateInterfaceFn GetFactory();
void Unload();
private:
char const* m_pchModuleName;
CSysModule* m_hModule;
bool m_bLoadAttempted;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,152 @@
#ifndef IPREDICTIONSYSTEM_H
#define IPREDICTIONSYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include "predictable_entity.h"
class CBaseEntity;
class IPredictionSystem
{
public:
IPredictionSystem()
{
m_pNextSystem = g_pPredictionSystems;
g_pPredictionSystems = this;
m_bSuppressEvent = false;
m_pSuppressHost = NULL;
m_nStatusPushed = 0;
};
virtual ~IPredictionSystem() {};
IPredictionSystem* GetNext()
{
return m_pNextSystem;
}
void SetSuppressEvent(bool state)
{
m_bSuppressEvent = state;
}
void SetSuppressHost(CBaseEntity* host)
{
m_pSuppressHost = host;
}
CBaseEntity const* GetSuppressHost(void)
{
if (DisableFiltering())
{
return NULL;
}
return m_pSuppressHost;
}
bool CanPredict(void) const
{
if (DisableFiltering())
{
return false;
}
return !m_bSuppressEvent;
}
static IPredictionSystem* g_pPredictionSystems;
static void SuppressEvents(bool state)
{
IPredictionSystem* sys = g_pPredictionSystems;
while (sys)
{
sys->SetSuppressEvent(state);
sys = sys->GetNext();
}
}
static void SuppressHostEvents(CBaseEntity* host)
{
IPredictionSystem* sys = g_pPredictionSystems;
while (sys)
{
sys->SetSuppressHost(host);
sys = sys->GetNext();
}
}
private:
static void Push(void)
{
IPredictionSystem* sys = g_pPredictionSystems;
while (sys)
{
sys->_Push();
sys = sys->GetNext();
}
}
static void Pop(void)
{
IPredictionSystem* sys = g_pPredictionSystems;
while (sys)
{
sys->_Pop();
sys = sys->GetNext();
}
}
void _Push(void)
{
++m_nStatusPushed;
}
void _Pop(void)
{
--m_nStatusPushed;
}
bool DisableFiltering(void) const
{
return (m_nStatusPushed > 0) ? true : false;
}
IPredictionSystem* m_pNextSystem;
bool m_bSuppressEvent;
CBaseEntity* m_pSuppressHost;
int m_nStatusPushed;
friend class CDisablePredictionFiltering;
};
class CDisablePredictionFiltering
{
public:
CDisablePredictionFiltering(bool disable = true)
{
m_bDisabled = disable;
if (m_bDisabled)
{
IPredictionSystem::Push();
}
}
~CDisablePredictionFiltering(void)
{
if (m_bDisabled)
{
IPredictionSystem::Pop();
}
}
private:
bool m_bDisabled;
};
#endif

View File

@ -0,0 +1,29 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef IRECIPIENTFILTER_H
#define IRECIPIENTFILTER_H
#ifdef _WIN32
#pragma once
#endif
//-----------------------------------------------------------------------------
// Purpose: Generic interface for routing messages to users
//-----------------------------------------------------------------------------
class IRecipientFilter
{
public:
virtual ~IRecipientFilter() {}
virtual bool IsReliable(void) const = 0;
virtual bool IsInitMessage(void) const = 0;
virtual int GetRecipientCount(void) const = 0;
virtual int GetRecipientIndex(int slot) const = 0;
};
#endif // IRECIPIENTFILTER_H

View File

@ -0,0 +1,16 @@
#ifndef ISCENETOKENPROCESSOR_H
#define ISCENETOKENPROCESSOR_H
#ifdef _WIN32
#pragma once
#endif
class ISceneTokenProcessor
{
public:
virtual const char* CurrentToken(void) = 0;
virtual bool GetToken(bool crossline) = 0;
virtual bool TokenAvailable(void) = 0;
virtual void Error(PRINTF_FORMAT_STRING const char* fmt, ...) = 0;
};
#endif

View File

@ -0,0 +1,32 @@
#ifndef ISERVERENTITY_H
#define ISERVERENTITY_H
#ifdef _WIN32
#pragma once
#endif
#include "iserverunknown.h"
#include "string_t.h"
struct Ray_t;
class ServerClass;
class ICollideable;
class IServerNetworkable;
class Vector;
class QAngle;
class IServerEntity : public IServerUnknown
{
public:
virtual ~IServerEntity() {}
virtual int GetModelIndex(void) const = 0;
virtual string_t GetModelName(void) const = 0;
virtual void SetModelIndex(int index) = 0;
};
#endif

View File

@ -0,0 +1,89 @@
#ifndef ISERVERNETWORKABLE_H
#define ISERVERNETWORKABLE_H
#ifdef _WIN32
#pragma once
#endif
#include "ihandleentity.h"
#include "basetypes.h"
#include "bitvec.h"
#include "const.h"
#include "bspfile.h"
#define MAX_FAST_ENT_CLUSTERS 4
#define MAX_ENT_CLUSTERS 64
#define MAX_WORLD_AREAS 8
class ServerClass;
class SendTable;
struct edict_t;
class CBaseEntity;
class CSerialEntity;
class CBaseNetworkable;
class CCheckTransmitInfo
{
public:
edict_t* m_pClientEnt;
byte m_PVS[PAD_NUMBER(MAX_MAP_CLUSTERS, 8) / 8];
int m_nPVSSize;
CBitVec<MAX_EDICTS>* m_pTransmitEdict;
CBitVec<MAX_EDICTS>* m_pTransmitAlways;
int m_AreasNetworked;
int m_Areas[MAX_WORLD_AREAS];
byte m_AreaFloodNums[MAX_MAP_AREAS];
int m_nMapAreas;
};
struct PVSInfo_t
{
short m_nHeadNode;
short m_nClusterCount;
unsigned short* m_pClusters;
short m_nAreaNum;
short m_nAreaNum2;
float m_vCenter[3];
private:
unsigned short m_pClustersInline[MAX_FAST_ENT_CLUSTERS];
friend class CVEngineServer;
};
class IServerNetworkable
{
public:
virtual IHandleEntity* GetEntityHandle() = 0;
virtual ServerClass* GetServerClass() = 0;
virtual edict_t* GetEdict() const = 0;
virtual const char* GetClassName() const = 0;
virtual void Release() = 0;
virtual int AreaNum() const = 0;
virtual CBaseNetworkable* GetBaseNetworkable() = 0;
virtual CBaseEntity* GetBaseEntity() = 0;
virtual PVSInfo_t* GetPVSInfo() = 0;
protected:
virtual ~IServerNetworkable() {}
};
#endif

View File

@ -0,0 +1,103 @@
#ifndef ISERVERPLUGIN_H
#define ISERVERPLUGIN_H
#ifdef _WIN32
#pragma once
#endif
#include "edict.h"
#include "interface.h"
#include "KeyValues.h"
class CCommand;
typedef enum
{
PLUGIN_CONTINUE = 0,
PLUGIN_OVERRIDE,
PLUGIN_STOP,
} PLUGIN_RESULT;
typedef enum
{
eQueryCvarValueStatus_ValueIntact = 0,
eQueryCvarValueStatus_CvarNotFound = 1,
eQueryCvarValueStatus_NotACvar = 2,
eQueryCvarValueStatus_CvarProtected = 3
} EQueryCvarValueStatus;
typedef int QueryCvarCookie_t;
#define InvalidQueryCvarCookie -1
#define INTERFACEVERSION_ISERVERPLUGINCALLBACKS_VERSION_1 "ISERVERPLUGINCALLBACKS001"
#define INTERFACEVERSION_ISERVERPLUGINCALLBACKS_VERSION_2 "ISERVERPLUGINCALLBACKS002"
#define INTERFACEVERSION_ISERVERPLUGINCALLBACKS "ISERVERPLUGINCALLBACKS003"
abstract_class IServerPluginCallbacks
{
public:
virtual bool Load(CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory) = 0;
virtual void Unload(void) = 0;
virtual void Pause(void) = 0;
virtual void UnPause(void) = 0;
virtual const char* GetPluginDescription(void) = 0;
virtual void LevelInit(char const* pMapName) = 0;
virtual void ServerActivate(edict_t* pEdictList, int edictCount, int clientMax) = 0;
virtual void GameFrame(bool simulating) = 0;
virtual void LevelShutdown(void) = 0;
virtual void ClientActive(edict_t* pEntity) = 0;
virtual void ClientDisconnect(edict_t* pEntity) = 0;
virtual void ClientPutInServer(edict_t* pEntity, char const* playername) = 0;
virtual void SetCommandClient(int index) = 0;
virtual void ClientSettingsChanged(edict_t* pEdict) = 0;
virtual PLUGIN_RESULT ClientConnect(bool* bAllowConnect, edict_t* pEntity, const char* pszName, const char* pszAddress, char* reject, int maxrejectlen) = 0;
virtual PLUGIN_RESULT ClientCommand(edict_t* pEntity, const CCommand& args) = 0;
virtual PLUGIN_RESULT NetworkIDValidated(const char* pszUserName, const char* pszNetworkID) = 0;
virtual void OnQueryCvarValueFinished(QueryCvarCookie_t iCookie, edict_t* pPlayerEntity, EQueryCvarValueStatus eStatus, const char* pCvarName, const char* pCvarValue) = 0;
virtual void OnEdictAllocated(edict_t* edict) = 0;
virtual void OnEdictFreed(const edict_t* edict) = 0;
};
#define INTERFACEVERSION_ISERVERPLUGINHELPERS "ISERVERPLUGINHELPERS001"
typedef enum
{
DIALOG_MSG = 0,
DIALOG_MENU,
DIALOG_TEXT,
DIALOG_ENTRY,
DIALOG_ASKCONNECT
} DIALOG_TYPE;
abstract_class IServerPluginHelpers
{
public:
virtual void CreateMessage(edict_t * pEntity, DIALOG_TYPE type, KeyValues * data, IServerPluginCallbacks * plugin) = 0;
virtual void ClientCommand(edict_t* pEntity, const char* cmd) = 0;
virtual QueryCvarCookie_t StartQueryCvarValue(edict_t* pEntity, const char* pName) = 0;
};
#endif

View File

@ -0,0 +1,25 @@
#ifndef ISERVERUNKNOWN_H
#define ISERVERUNKNOWN_H
#ifdef _WIN32
#pragma once
#endif
#include "ihandleentity.h"
class ICollideable;
class IServerNetworkable;
class CBaseEntity;
class IServerUnknown : public IHandleEntity
{
public:
virtual ICollideable* GetCollideable() = 0;
virtual IServerNetworkable* GetNetworkable() = 0;
virtual CBaseEntity* GetBaseEntity() = 0;
};
#endif

116
SpyCustom/sdk/ishadowmgr.h Normal file
View File

@ -0,0 +1,116 @@
#ifndef ISHADOWMGR_H
#define ISHADOWMGR_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "vmatrix.h"
class IMaterial;
class Vector;
class Vector2D;
struct model_t;
typedef unsigned short ModelInstanceHandle_t;
class IClientRenderable;
class ITexture;
#define ENGINE_SHADOWMGR_INTERFACE_VERSION "VEngineShadowMgr002"
enum ShadowFlags_t
{
SHADOW_FLAGS_FLASHLIGHT = (1 << 0),
SHADOW_FLAGS_SHADOW = (1 << 1),
SHADOW_FLAGS_LAST_FLAG = SHADOW_FLAGS_SHADOW
};
#define SHADOW_FLAGS_PROJECTED_TEXTURE_TYPE_MASK ( SHADOW_FLAGS_FLASHLIGHT | SHADOW_FLAGS_SHADOW )
typedef unsigned short ShadowHandle_t;
enum
{
SHADOW_HANDLE_INVALID = (ShadowHandle_t)~0
};
enum ShadowCreateFlags_t
{
SHADOW_CACHE_VERTS = (1 << 0),
SHADOW_FLASHLIGHT = (1 << 1),
SHADOW_LAST_FLAG = SHADOW_FLASHLIGHT,
};
struct ShadowInfo_t
{
VMatrix m_WorldToShadow;
float m_FalloffOffset;
float m_MaxDist;
float m_FalloffAmount;
Vector2D m_TexOrigin;
Vector2D m_TexSize;
unsigned char m_FalloffBias;
};
struct FlashlightState_t;
abstract_class IShadowMgr
{
public:
virtual ShadowHandle_t CreateShadow(IMaterial * pMaterial, IMaterial * pModelMaterial, void* pBindProxy, int creationFlags) = 0;
virtual void DestroyShadow(ShadowHandle_t handle) = 0;
virtual void SetShadowMaterial(ShadowHandle_t handle, IMaterial* pMaterial, IMaterial* pModelMaterial, void* pBindProxy) = 0;
virtual void ProjectShadow(ShadowHandle_t handle, const Vector& origin,
const Vector& projectionDir, const VMatrix& worldToShadow, const Vector2D& size,
int nLeafCount, const int* pLeafList,
float maxHeight, float falloffOffset, float falloffAmount, const Vector& vecCasterOrigin) = 0;
virtual void ProjectFlashlight(ShadowHandle_t handle, const VMatrix& worldToShadow, int nLeafCount, const int* pLeafList) = 0;
virtual const ShadowInfo_t& GetInfo(ShadowHandle_t handle) = 0;
virtual const Frustum_t& GetFlashlightFrustum(ShadowHandle_t handle) = 0;
virtual void AddShadowToBrushModel(ShadowHandle_t handle,
model_t* pModel, const Vector& origin, const QAngle& angles) = 0;
virtual void RemoveAllShadowsFromBrushModel(model_t* pModel) = 0;
virtual void SetShadowTexCoord(ShadowHandle_t handle, float x, float y, float w, float h) = 0;
virtual void AddShadowToModel(ShadowHandle_t shadow, ModelInstanceHandle_t instance) = 0;
virtual void RemoveAllShadowsFromModel(ModelInstanceHandle_t instance) = 0;
virtual void ClearExtraClipPlanes(ShadowHandle_t shadow) = 0;
virtual void AddExtraClipPlane(ShadowHandle_t shadow, const Vector& normal, float dist) = 0;
virtual void EnableShadow(ShadowHandle_t shadow, bool bEnable) = 0;
virtual void SetFalloffBias(ShadowHandle_t shadow, unsigned char ucBias) = 0;
virtual void UpdateFlashlightState(ShadowHandle_t shadowHandle, const FlashlightState_t& lightState) = 0;
virtual void DrawFlashlightDepthTexture() = 0;
virtual void AddFlashlightRenderable(ShadowHandle_t shadow, IClientRenderable* pRenderable) = 0;
virtual ShadowHandle_t CreateShadowEx(IMaterial* pMaterial, IMaterial* pModelMaterial, void* pBindProxy, int creationFlags) = 0;
virtual void SetFlashlightDepthTexture(ShadowHandle_t shadowHandle, ITexture* pFlashlightDepthTexture, unsigned char ucShadowStencilBit) = 0;
virtual const FlashlightState_t& GetFlashlightState(ShadowHandle_t handle) = 0;
virtual void SetFlashlightRenderState(ShadowHandle_t handle) = 0;
};
#endif

View File

@ -0,0 +1,157 @@
#ifndef ISPATIALPARTITION_H
#define ISPATIALPARTITION_H
#include "interface.h"
class Vector;
struct Ray_t;
class IHandleEntity;
#define INTERFACEVERSION_SPATIALPARTITION "SpatialPartition001"
enum
{
PARTITION_ENGINE_SOLID_EDICTS = (1 << 0),
PARTITION_ENGINE_TRIGGER_EDICTS = (1 << 1),
PARTITION_CLIENT_SOLID_EDICTS = (1 << 2),
PARTITION_CLIENT_RESPONSIVE_EDICTS = (1 << 3),
PARTITION_ENGINE_NON_STATIC_EDICTS = (1 << 4),
PARTITION_CLIENT_STATIC_PROPS = (1 << 5),
PARTITION_ENGINE_STATIC_PROPS = (1 << 6),
PARTITION_CLIENT_NON_STATIC_EDICTS = (1 << 7),
};
#define PARTITION_ALL_CLIENT_EDICTS ( \
PARTITION_CLIENT_NON_STATIC_EDICTS | \
PARTITION_CLIENT_STATIC_PROPS | \
PARTITION_CLIENT_RESPONSIVE_EDICTS | \
PARTITION_CLIENT_SOLID_EDICTS \
)
#define PARTITION_CLIENT_GAME_EDICTS (PARTITION_ALL_CLIENT_EDICTS & ~PARTITION_CLIENT_STATIC_PROPS)
#define PARTITION_SERVER_GAME_EDICTS (PARTITION_ENGINE_SOLID_EDICTS|PARTITION_ENGINE_TRIGGER_EDICTS|PARTITION_ENGINE_NON_STATIC_EDICTS)
enum IterationRetval_t
{
ITERATION_CONTINUE = 0,
ITERATION_STOP,
};
typedef unsigned short SpatialPartitionHandle_t;
typedef int SpatialPartitionListMask_t;
typedef int SpatialTempHandle_t;
class IPartitionEnumerator
{
public:
virtual IterationRetval_t EnumElement(IHandleEntity* pHandleEntity) = 0;
};
class IPartitionQueryCallback
{
public:
virtual void OnPreQuery_V1() = 0;
virtual void OnPreQuery(SpatialPartitionListMask_t listMask) = 0;
virtual void OnPostQuery(SpatialPartitionListMask_t listMask) = 0;
};
enum
{
PARTITION_INVALID_HANDLE = (SpatialPartitionHandle_t)~0
};
abstract_class ISpatialPartition
{
public:
virtual ~ISpatialPartition() {}
virtual SpatialPartitionHandle_t CreateHandle(IHandleEntity * pHandleEntity) = 0;
virtual SpatialPartitionHandle_t CreateHandle(IHandleEntity* pHandleEntity,
SpatialPartitionListMask_t listMask, const Vector& mins, const Vector& maxs) = 0;
virtual void DestroyHandle(SpatialPartitionHandle_t handle) = 0;
virtual void Insert(SpatialPartitionListMask_t listMask,
SpatialPartitionHandle_t handle) = 0;
virtual void Remove(SpatialPartitionListMask_t listMask,
SpatialPartitionHandle_t handle) = 0;
virtual void RemoveAndInsert(SpatialPartitionListMask_t removeMask, SpatialPartitionListMask_t insertMask,
SpatialPartitionHandle_t handle) = 0;
virtual void Remove(SpatialPartitionHandle_t handle) = 0;
virtual void ElementMoved(SpatialPartitionHandle_t handle,
const Vector& mins, const Vector& maxs) = 0;
virtual SpatialTempHandle_t HideElement(SpatialPartitionHandle_t handle) = 0;
virtual void UnhideElement(SpatialPartitionHandle_t handle, SpatialTempHandle_t tempHandle) = 0;
virtual void InstallQueryCallback_V1(IPartitionQueryCallback* pCallback) = 0;
virtual void RemoveQueryCallback(IPartitionQueryCallback* pCallback) = 0;
virtual void EnumerateElementsInBox(
SpatialPartitionListMask_t listMask,
const Vector& mins,
const Vector& maxs,
bool coarseTest,
IPartitionEnumerator* pIterator
) = 0;
virtual void EnumerateElementsInSphere(
SpatialPartitionListMask_t listMask,
const Vector& origin,
float radius,
bool coarseTest,
IPartitionEnumerator* pIterator
) = 0;
virtual void EnumerateElementsAlongRay(
SpatialPartitionListMask_t listMask,
const Ray_t& ray,
bool coarseTest,
IPartitionEnumerator* pIterator
) = 0;
virtual void EnumerateElementsAtPoint(
SpatialPartitionListMask_t listMask,
const Vector& pt,
bool coarseTest,
IPartitionEnumerator* pIterator
) = 0;
virtual void SuppressLists(SpatialPartitionListMask_t nListMask, bool bSuppress) = 0;
virtual SpatialPartitionListMask_t GetSuppressedLists() = 0;
virtual void RenderAllObjectsInTree(float flTime) = 0;
virtual void RenderObjectsInPlayerLeafs(const Vector& vecPlayerMin, const Vector& vecPlayerMax, float flTime) = 0;
virtual void RenderLeafsForRayTraceStart(float flTime) = 0;
virtual void RenderLeafsForRayTraceEnd(void) = 0;
virtual void RenderLeafsForHullTraceStart(float flTime) = 0;
virtual void RenderLeafsForHullTraceEnd(void) = 0;
virtual void RenderLeafsForBoxStart(float flTime) = 0;
virtual void RenderLeafsForBoxEnd(void) = 0;
virtual void RenderLeafsForSphereStart(float flTime) = 0;
virtual void RenderLeafsForSphereEnd(void) = 0;
virtual void RenderObjectsInBox(const Vector& vecMin, const Vector& vecMax, float flTime) = 0;
virtual void RenderObjectsInSphere(const Vector& vecCenter, float flRadius, float flTime) = 0;
virtual void RenderObjectsAlongRay(const Ray_t& ray, float flTime) = 0;
virtual void ReportStats(const char* pFileName) = 0;
virtual void InstallQueryCallback(IPartitionQueryCallback* pCallback) = 0;
};
#endif

View File

@ -0,0 +1,290 @@
#ifndef ISTUDIORENDER_H
#define ISTUDIORENDER_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "vector.h"
#include "vector4d.h"
#include "utlbuffer.h"
#include "utlvector.h"
#include "imaterial.h"
#include "imaterialsystem.h"
#include "IAppSystem.h"
#include "imdlcache.h"
#include "studio.h"
struct studiohdr_t;
struct studiomeshdata_t;
class Vector;
struct LightDesc_t;
class IMaterial;
struct studiohwdata_t;
struct Ray_t;
class Vector4D;
class IMaterialSystem;
struct matrix3x4_t;
class IMesh;
struct vertexFileHeader_t;
struct FlashlightState_t;
class VMatrix;
namespace OptimizedModel { struct FileHeader_t; }
class IPooledVBAllocator;
typedef void (*StudioRender_Printf_t)(PRINTF_FORMAT_STRING const char* fmt, ...);
struct StudioRenderConfig_t
{
float fEyeShiftX;
float fEyeShiftY;
float fEyeShiftZ;
float fEyeSize;
float fEyeGlintPixelWidthLODThreshold;
int maxDecalsPerModel;
int drawEntities;
int skin;
int fullbright;
bool bEyeMove : 1;
bool bSoftwareSkin : 1;
bool bNoHardware : 1;
bool bNoSoftware : 1;
bool bTeeth : 1;
bool bEyes : 1;
bool bFlex : 1;
bool bWireframe : 1;
bool bDrawNormals : 1;
bool bDrawTangentFrame : 1;
bool bDrawZBufferedWireframe : 1;
bool bSoftwareLighting : 1;
bool bShowEnvCubemapOnly : 1;
bool bWireframeDecals : 1;
int m_nReserved[4];
};
DECLARE_POINTER_HANDLE(StudioDecalHandle_t);
#define STUDIORENDER_DECAL_INVALID ( (StudioDecalHandle_t)0 )
enum
{
ADDDECAL_TO_ALL_LODS = -1
};
enum
{
STUDIORENDER_DRAW_ENTIRE_MODEL = 0,
STUDIORENDER_DRAW_OPAQUE_ONLY = 0x01,
STUDIORENDER_DRAW_TRANSLUCENT_ONLY = 0x02,
STUDIORENDER_DRAW_GROUP_MASK = 0x03,
STUDIORENDER_DRAW_NO_FLEXES = 0x04,
STUDIORENDER_DRAW_STATIC_LIGHTING = 0x08,
STUDIORENDER_DRAW_ACCURATETIME = 0x10,
STUDIORENDER_DRAW_NO_SHADOWS = 0x20,
STUDIORENDER_DRAW_GET_PERF_STATS = 0x40,
STUDIORENDER_DRAW_WIREFRAME = 0x80,
STUDIORENDER_DRAW_ITEM_BLINK = 0x100,
STUDIORENDER_SHADOWDEPTHTEXTURE = 0x200,
STUDIORENDER_SSAODEPTHTEXTURE = 0x1000,
STUDIORENDER_GENERATE_STATS = 0x8000,
};
#define VERTEX_TEXCOORD0_2D ( ( (uint64) 2 ) << ( TEX_COORD_SIZE_BIT + ( 3*0 ) ) )
enum MaterialVertexFormat_t
{
MATERIAL_VERTEX_FORMAT_MODEL_SKINNED = (VertexFormat_t)VERTEX_POSITION | VERTEX_COLOR | VERTEX_NORMAL | VERTEX_TEXCOORD0_2D | VERTEX_BONEWEIGHT(2) | VERTEX_BONE_INDEX | VERTEX_USERDATA_SIZE(4),
MATERIAL_VERTEX_FORMAT_MODEL_SKINNED_DX7 = (VertexFormat_t)VERTEX_POSITION | VERTEX_COLOR | VERTEX_NORMAL | VERTEX_TEXCOORD0_2D | VERTEX_BONEWEIGHT(2) | VERTEX_BONE_INDEX,
MATERIAL_VERTEX_FORMAT_MODEL = (VertexFormat_t)VERTEX_POSITION | VERTEX_COLOR | VERTEX_NORMAL | VERTEX_TEXCOORD0_2D | VERTEX_USERDATA_SIZE(4),
MATERIAL_VERTEX_FORMAT_MODEL_DX7 = (VertexFormat_t)VERTEX_POSITION | VERTEX_COLOR | VERTEX_NORMAL | VERTEX_TEXCOORD0_2D,
MATERIAL_VERTEX_FORMAT_COLOR = (VertexFormat_t)VERTEX_SPECULAR
};
enum OverrideType_t
{
OVERRIDE_NORMAL = 0,
OVERRIDE_BUILD_SHADOWS,
OVERRIDE_DEPTH_WRITE,
OVERRIDE_SSAO_DEPTH_WRITE,
};
enum
{
USESHADOWLOD = -2,
};
#define MAX_DRAW_MODEL_INFO_MATERIALS 8
struct DrawModelResults_t
{
int m_ActualTriCount;
int m_TextureMemoryBytes;
int m_NumHardwareBones;
int m_NumBatches;
int m_NumMaterials;
int m_nLODUsed;
int m_flLODMetric;
CFastTimer m_RenderTime;
CUtlVectorFixed<IMaterial*, MAX_DRAW_MODEL_INFO_MATERIALS> m_Materials;
};
struct ColorMeshInfo_t
{
IMesh* m_pMesh;
IPooledVBAllocator* m_pPooledVBAllocator;
int m_nVertOffsetInBytes;
int m_nNumVerts;
};
struct DrawModelInfo_t
{
studiohdr_t* m_pStudioHdr;
studiohwdata_t* m_pHardwareData;
StudioDecalHandle_t m_Decals;
int m_Skin;
int m_Body;
int m_HitboxSet;
void* m_pClientEntity;
int m_Lod;
ColorMeshInfo_t* m_pColorMeshes;
bool m_bStaticLighting;
Vector m_vecAmbientCube[6];
int m_nLocalLightCount;
LightDesc_t m_LocalLightDescs[4];
};
struct GetTriangles_Vertex_t
{
Vector m_Position;
Vector m_Normal;
Vector4D m_TangentS;
Vector2D m_TexCoord;
Vector4D m_BoneWeight;
int m_BoneIndex[4];
int m_NumBones;
};
struct GetTriangles_MaterialBatch_t
{
IMaterial* m_pMaterial;
CUtlVector<GetTriangles_Vertex_t> m_Verts;
CUtlVector<int> m_TriListIndices;
};
struct GetTriangles_Output_t
{
CUtlVector<GetTriangles_MaterialBatch_t> m_MaterialBatches;
matrix3x4_t m_PoseToWorld[MAXSTUDIOBONES];
};
struct model_array_instance_t
{
matrix3x4_t modelToWorld;
};
#define STUDIO_DATA_CACHE_INTERFACE_VERSION "VStudioDataCache005"
abstract_class IStudioDataCache : public IAppSystem
{
public:
virtual bool VerifyHeaders(studiohdr_t * pStudioHdr) = 0;
virtual vertexFileHeader_t* CacheVertexData(studiohdr_t* pStudioHdr) = 0;
};
#define STUDIO_RENDER_INTERFACE_VERSION "VStudioRender025"
abstract_class IStudioRender : public IAppSystem
{
public:
virtual void BeginFrame(void) = 0;
virtual void EndFrame(void) = 0;
virtual void Mat_Stub(IMaterialSystem* pMatSys) = 0;
virtual void UpdateConfig(const StudioRenderConfig_t& config) = 0;
virtual void GetCurrentConfig(StudioRenderConfig_t& config) = 0;
virtual bool LoadModel(studiohdr_t* pStudioHdr, void* pVtxData, studiohwdata_t* pHardwareData) = 0;
virtual void UnloadModel(studiohwdata_t* pHardwareData) = 0;
virtual void RefreshStudioHdr(studiohdr_t* pStudioHdr, studiohwdata_t* pHardwareData) = 0;
virtual void SetEyeViewTarget(const studiohdr_t* pStudioHdr, int nBodyIndex, const Vector& worldPosition) = 0;
virtual int GetNumAmbientLightSamples() = 0;
virtual const Vector* GetAmbientLightDirections() = 0;
virtual void SetAmbientLightColors(const Vector4D* pAmbientOnlyColors) = 0;
virtual void SetAmbientLightColors(const Vector* pAmbientOnlyColors) = 0;
virtual void SetLocalLights(int numLights, const LightDesc_t* pLights) = 0;
virtual void SetViewState(const Vector& viewOrigin, const Vector& viewRight,
const Vector& viewUp, const Vector& viewPlaneNormal) = 0;
virtual void LockFlexWeights(int nWeightCount, float** ppFlexWeights, float** ppFlexDelayedWeights = NULL) = 0;
virtual void UnlockFlexWeights() = 0;
virtual matrix3x4_t* LockBoneMatrices(int nBoneCount) = 0;
virtual void UnlockBoneMatrices() = 0;
virtual int GetNumLODs(const studiohwdata_t& hardwareData) const = 0;
virtual float GetLODSwitchValue(const studiohwdata_t& hardwareData, int lod) const = 0;
virtual void SetLODSwitchValue(studiohwdata_t& hardwareData, int lod, float switchValue) = 0;
virtual void SetColorModulation(float const* pColor) = 0;
virtual void SetAlphaModulation(float flAlpha) = 0;
virtual void DrawModel(DrawModelResults_t* pResults, const DrawModelInfo_t& info,
matrix3x4_t* pBoneToWorld, float* pFlexWeights, float* pFlexDelayedWeights, const Vector& modelOrigin, int flags = STUDIORENDER_DRAW_ENTIRE_MODEL) = 0;
virtual void DrawModelStaticProp(const DrawModelInfo_t& drawInfo, const matrix3x4_t& modelToWorld, int flags = STUDIORENDER_DRAW_ENTIRE_MODEL) = 0;
virtual void DrawStaticPropDecals(const DrawModelInfo_t& drawInfo, const matrix3x4_t& modelToWorld) = 0;
virtual void DrawStaticPropShadows(const DrawModelInfo_t& drawInfo, const matrix3x4_t& modelToWorld, int flags) = 0;
virtual void ForcedMaterialOverride(IMaterial* newMaterial, OverrideType_t nOverrideType = OVERRIDE_NORMAL) = 0;
virtual StudioDecalHandle_t CreateDecalList(studiohwdata_t* pHardwareData) = 0;
virtual void DestroyDecalList(StudioDecalHandle_t handle) = 0;
virtual void AddDecal(StudioDecalHandle_t handle, studiohdr_t* pStudioHdr, matrix3x4_t* pBoneToWorld,
const Ray_t& ray, const Vector& decalUp, IMaterial* pDecalMaterial, float radius, int body, bool noPokethru = false, int maxLODToDecal = ADDDECAL_TO_ALL_LODS) = 0;
virtual void ComputeLighting(const Vector* pAmbient, int lightCount,
LightDesc_t* pLights, const Vector& pt, const Vector& normal, Vector& lighting) = 0;
virtual void ComputeLightingConstDirectional(const Vector* pAmbient, int lightCount,
LightDesc_t* pLights, const Vector& pt, const Vector& normal, Vector& lighting, float flDirectionalAmount) = 0;
virtual void AddShadow(IMaterial* pMaterial, void* pProxyData, FlashlightState_t* m_pFlashlightState = NULL, VMatrix* pWorldToTexture = NULL, ITexture* pFlashlightDepthTexture = NULL) = 0;
virtual void ClearAllShadows() = 0;
virtual int ComputeModelLod(studiohwdata_t* pHardwareData, float unitSphereSize, float* pMetric = NULL) = 0;
virtual void GetPerfStats(DrawModelResults_t* pResults, const DrawModelInfo_t& info, CUtlBuffer* pSpewBuf = NULL) const = 0;
virtual void GetTriangles(const DrawModelInfo_t& info, matrix3x4_t* pBoneToWorld, GetTriangles_Output_t& out) = 0;
virtual int GetMaterialList(studiohdr_t* pStudioHdr, int count, IMaterial** ppMaterials) = 0;
virtual int GetMaterialListFromBodyAndSkin(MDLHandle_t studio, int nSkin, int nBody, int nCountOutputMaterials, IMaterial** ppOutputMaterials) = 0;
virtual void DrawModelArray(const DrawModelInfo_t& drawInfo, int arrayCount, model_array_instance_t* pInstanceData, int instanceStride, int flags = STUDIORENDER_DRAW_ENTIRE_MODEL) = 0;
};
extern IStudioRender* g_pStudioRender;
#endif

View File

@ -0,0 +1,202 @@
#ifndef ITEM_SELECTION_CRITERIA_H
#define ITEM_SELECTION_CRITERIA_H
#ifdef _WIN32
#pragma once
#endif
#include "game_item_schema.h"
const int k_cchCreateItemLen = 64;
enum EItemCriteriaOperator
{
k_EOperator_String_EQ = 0,
k_EOperator_Not = 1,
k_EOperator_String_Not_EQ = 1,
k_EOperator_Float_EQ = 2,
k_EOperator_Float_Not_EQ = 3,
k_EOperator_Float_LT = 4,
k_EOperator_Float_Not_LT = 5,
k_EOperator_Float_LTE = 6,
k_EOperator_Float_Not_LTE = 7,
k_EOperator_Float_GT = 8,
k_EOperator_Float_Not_GT = 9,
k_EOperator_Float_GTE = 10,
k_EOperator_Float_Not_GTE = 11,
k_EOperator_Subkey_Contains = 12,
k_EOperator_Subkey_Not_Contains = 13,
k_EItemCriteriaOperator_Count = 14,
};
EItemCriteriaOperator EItemCriteriaOperatorFromName(const char* pch);
const char* PchNameFromEItemCriteriaOperator(int eItemCriteriaOperator);
class CEconItemSchema;
class CEconItemDefinition;
class CEconItem;
class CSOItemCriteria;
class CSOItemCriteriaCondition;
const uint8 k_unItemRarity_Any = 0xF;
const uint8 k_unItemQuality_Any = 0xF;
class CItemSelectionCriteria
{
public:
CItemSelectionCriteria() :
m_bItemLevelSet(false),
m_unItemLevel(0),
m_bQualitySet(false),
m_nItemQuality(k_unItemQuality_Any),
m_bRaritySet(false),
m_nItemRarity(k_unItemRarity_Any),
m_unInitialInventory(0),
m_unInitialQuantity(1),
m_bForcedQualityMatch(false),
m_bIgnoreEnabledFlag(false),
m_bRecentOnly(false),
m_bIsLootList(false)
{
}
CItemSelectionCriteria(const CItemSelectionCriteria& that);
CItemSelectionCriteria& operator=(const CItemSelectionCriteria& rhs);
~CItemSelectionCriteria();
bool BItemLevelSet(void) const { return m_bItemLevelSet; }
uint32 GetItemLevel(void) const { Assert(m_bItemLevelSet); return m_unItemLevel; }
void SetItemLevel(uint32 unLevel) { m_unItemLevel = unLevel; m_bItemLevelSet = true; }
bool BQualitySet(void) const { return m_bQualitySet; }
int32 GetQuality(void) const { Assert(m_bQualitySet); return m_nItemQuality; }
void SetQuality(int32 nQuality) { m_nItemQuality = nQuality; m_bQualitySet = true; }
bool BRaritySet(void) const { return m_bRaritySet; }
int32 GetRarity(void) const { Assert(m_bRaritySet); return m_nItemRarity; }
void SetRarity(int32 nRarity) { m_nItemRarity = nRarity; m_bRaritySet = true; }
uint32 GetInitialInventory(void) const { return m_unInitialInventory; }
void SetInitialInventory(uint32 unInventory) { m_unInitialInventory = unInventory; }
uint32 GetInitialQuantity(void) const { return m_unInitialQuantity; }
void SetInitialQuantity(uint32 unQuantity) { m_unInitialQuantity = unQuantity; }
void SetExplicitQualityMatch(bool bExplicit) { m_bForcedQualityMatch = bExplicit; }
void SetIgnoreEnabledFlag(bool bIgnore) { m_bIgnoreEnabledFlag = bIgnore; }
void SetRecentOnly(bool bCheck) { m_bRecentOnly = bCheck; }
bool IsLootList(void) const { return m_bIsLootList; }
bool BAddCondition(const char* pszField, EItemCriteriaOperator eOp, float flValue, bool bRequired);
bool BAddCondition(const char* pszField, EItemCriteriaOperator eOp, const char* pszValue, bool bRequired);
int GetConditionsCount() { return m_vecConditions.Count(); }
const char* GetValueForFirstConditionOfFieldName(const char* pchName) const;
bool BInitFromKV(KeyValues* pKVCriteria, const CEconItemSchema& schemaa);
bool BInitFromItemAndPaint(int nItemDef, int nPaintID, const CEconItemSchema& schemaa);
bool BSerializeToMsg(CSOItemCriteria& msg) const;
bool BDeserializeFromMsg(const CSOItemCriteria& msg);
bool BEvaluate(const CEconItemDefinition* pItemDef, const CEconItemSchema& pschema) const;
bool BEvaluate(const CEconItem* pItem, const CEconItemSchema& pschema) const;
private:
class CCondition
{
public:
CCondition(const char* pszField, EItemCriteriaOperator eOp, bool bRequired)
: m_sField(pszField), m_EOp(eOp), m_bRequired(bRequired)
{
}
virtual ~CCondition() { }
bool BEvaluate(KeyValues* pKVItem) const;
virtual bool BSerializeToMsg(CSOItemCriteriaCondition& msg) const;
EItemCriteriaOperator GetEOp(void) const { return m_EOp; }
virtual const char* GetField(void) { return m_sField.Get(); }
virtual const char* GetValue(void) { Assert(0); return NULL; }
protected:
virtual bool BInternalEvaluate(KeyValues* pKVItem) const = 0;
CUtlString m_sField;
EItemCriteriaOperator m_EOp;
bool m_bRequired;
};
class CStringCondition : public CCondition
{
public:
CStringCondition(const char* pszField, EItemCriteriaOperator eOp, const char* pszValue, bool bRequired)
: CCondition(pszField, eOp, bRequired), m_sValue(pszValue)
{
}
virtual ~CStringCondition() { }
virtual const char* GetValue(void) { return m_sValue.Get(); }
protected:
virtual bool BInternalEvaluate(KeyValues* pKVItem) const;
virtual bool BSerializeToMsg(CSOItemCriteriaCondition& msg) const;
CUtlString m_sValue;
};
class CFloatCondition : public CCondition
{
public:
CFloatCondition(const char* pszField, EItemCriteriaOperator eOp, float flValue, bool bRequired)
: CCondition(pszField, eOp, bRequired), m_flValue(flValue)
{
}
virtual ~CFloatCondition() { }
protected:
virtual bool BInternalEvaluate(KeyValues* pKVItem) const;
virtual bool BSerializeToMsg(CSOItemCriteriaCondition& msg) const;
float m_flValue;
};
class CSetCondition : public CCondition
{
public:
CSetCondition(const char* pszField, EItemCriteriaOperator eOp, const char* pszValue, bool bRequired)
: CCondition(pszField, eOp, bRequired), m_sValue(pszValue)
{
}
virtual ~CSetCondition() { }
protected:
virtual bool BInternalEvaluate(KeyValues* pKVItem) const;
virtual bool BSerializeToMsg(CSOItemCriteriaCondition& msg) const;
CUtlString m_sValue;
};
bool m_bItemLevelSet;
uint32 m_unItemLevel;
bool m_bQualitySet;
int32 m_nItemQuality;
bool m_bRaritySet;
int32 m_nItemRarity;
uint32 m_unInitialInventory;
uint32 m_unInitialQuantity;
bool m_bForcedQualityMatch;
bool m_bIgnoreEnabledFlag;
bool m_bRecentOnly;
bool m_bIsLootList;
CUtlVector<CCondition*> m_vecConditions;
};
#endif

118
SpyCustom/sdk/itempents.h Normal file
View File

@ -0,0 +1,118 @@
#if !defined( ITEMPENTS_H )
#define ITEMPENTS_H
#ifdef _WIN32
#pragma once
#endif
#include "ipredictionsystem.h"
#include "shattersurfacetypes.h"
#include "irecipientfilter.h"
class CEffectData;
class KeyValues;
abstract_class ITempEntsSystem : public IPredictionSystem
{
public:
virtual bool SuppressTE(IRecipientFilter & filter) = 0;
virtual void ArmorRicochet(IRecipientFilter& filer, float delay,
const Vector* pos, const Vector* dir) = 0;
virtual void BeamEntPoint(IRecipientFilter& filer, float delay,
int nStartEntity, const Vector* start, int nEndEntity, const Vector* end,
int modelindex, int haloindex, int startframe, int framerate,
float life, float width, float endWidth, int fadeLength, float amplitude,
int r, int g, int b, int a, int speed) = 0;
virtual void BeamEnts(IRecipientFilter& filer, float delay,
int start, int end, int modelindex, int haloindex, int startframe, int framerate,
float life, float width, float endWidth, int fadeLength, float amplitude,
int r, int g, int b, int a, int speed) = 0;
virtual void BeamFollow(IRecipientFilter& filter, float delay,
int iEntIndex, int modelIndex, int haloIndex, float life, float width, float endWidth,
float fadeLength, float r, float g, float b, float a) = 0;
virtual void BeamPoints(IRecipientFilter& filer, float delay,
const Vector* start, const Vector* end, int modelindex, int haloindex, int startframe, int framerate,
float life, float width, float endWidth, int fadeLength, float amplitude,
int r, int g, int b, int a, int speed) = 0;
virtual void BeamLaser(IRecipientFilter& filer, float delay,
int start, int end, int modelindex, int haloindex, int startframe, int framerate,
float life, float width, float endWidth, int fadeLength, float amplitude, int r, int g, int b, int a, int speed) = 0;
virtual void BeamRing(IRecipientFilter& filer, float delay,
int start, int end, int modelindex, int haloindex, int startframe, int framerate,
float life, float width, int spread, float amplitude, int r, int g, int b, int a, int speed, int flags = 0) = 0;
virtual void BeamRingPoint(IRecipientFilter& filer, float delay,
const Vector& center, float start_radius, float end_radius, int modelindex, int haloindex, int startframe, int framerate,
float life, float width, int spread, float amplitude, int r, int g, int b, int a, int speed, int flags = 0) = 0;
virtual void BeamSpline(IRecipientFilter& filer, float delay,
int points, Vector* rgPoints) = 0;
virtual void BloodStream(IRecipientFilter& filer, float delay,
const Vector* org, const Vector* dir, int r, int g, int b, int a, int amount) = 0;
virtual void BloodSprite(IRecipientFilter& filer, float delay,
const Vector* org, const Vector* dir, int r, int g, int b, int a, int size) = 0;
virtual void BreakModel(IRecipientFilter& filer, float delay,
const Vector& pos, const QAngle& angle, const Vector& size, const Vector& vel,
int modelindex, int randomization, int count, float time, int flags) = 0;
virtual void BSPDecal(IRecipientFilter& filer, float delay,
const Vector* pos, int entity, int index) = 0;
virtual void ProjectDecal(IRecipientFilter& filter, float delay,
const Vector* pos, const QAngle* angles, float distance, int index) = 0;
virtual void Bubbles(IRecipientFilter& filer, float delay,
const Vector* mins, const Vector* maxs, float height, int modelindex, int count, float speed) = 0;
virtual void BubbleTrail(IRecipientFilter& filer, float delay,
const Vector* mins, const Vector* maxs, float height, int modelindex, int count, float speed) = 0;
virtual void Decal(IRecipientFilter& filer, float delay,
const Vector* pos, const Vector* start, int entity, int hitbox, int index) = 0;
virtual void DynamicLight(IRecipientFilter& filer, float delay,
const Vector* org, int r, int g, int b, int exponent, float radius, float time, float decay) = 0;
virtual void Explosion(IRecipientFilter& filer, float delay,
const Vector* pos, int modelindex, float scale, int framerate, int flags, int radius, int magnitude, const Vector* normal = NULL, unsigned char materialType = 'C') = 0;
virtual void ShatterSurface(IRecipientFilter& filer, float delay,
const Vector* pos, const QAngle* angle, const Vector* vForce, const Vector* vForcePos,
float width, float height, float shardsize, ShatterSurface_t surfacetype,
int front_r, int front_g, int front_b, int back_r, int back_g, int back_b) = 0;
virtual void GlowSprite(IRecipientFilter& filer, float delay,
const Vector* pos, int modelindex, float life, float size, int brightness) = 0;
virtual void FootprintDecal(IRecipientFilter& filer, float delay, const Vector* origin, const Vector* right,
int entity, int index, unsigned char materialType) = 0;
virtual void Fizz(IRecipientFilter& filer, float delay,
const CBaseEntity* ed, int modelindex, int density, int current) = 0;
virtual void KillPlayerAttachments(IRecipientFilter& filer, float delay,
int player) = 0;
virtual void LargeFunnel(IRecipientFilter& filer, float delay,
const Vector* pos, int modelindex, int reversed) = 0;
virtual void MetalSparks(IRecipientFilter& filer, float delay,
const Vector* pos, const Vector* dir) = 0;
virtual void EnergySplash(IRecipientFilter& filer, float delay,
const Vector* pos, const Vector* dir, bool bExplosive) = 0;
virtual void PlayerDecal(IRecipientFilter& filer, float delay,
const Vector* pos, int player, int entity) = 0;
virtual void ShowLine(IRecipientFilter& filer, float delay,
const Vector* start, const Vector* end) = 0;
virtual void Smoke(IRecipientFilter& filer, float delay,
const Vector* pos, int modelindex, float scale, int framerate) = 0;
virtual void Sparks(IRecipientFilter& filer, float delay,
const Vector* pos, int nMagnitude, int nTrailLength, const Vector* pDir) = 0;
virtual void Sprite(IRecipientFilter& filer, float delay,
const Vector* pos, int modelindex, float size, int brightness) = 0;
virtual void SpriteSpray(IRecipientFilter& filer, float delay,
const Vector* pos, const Vector* dir, int modelindex, int speed, float noise, int count) = 0;
virtual void WorldDecal(IRecipientFilter& filer, float delay,
const Vector* pos, int index) = 0;
virtual void MuzzleFlash(IRecipientFilter& filer, float delay,
const Vector& start, const QAngle& angles, float scale, int type) = 0;
virtual void Dust(IRecipientFilter& filer, float delay,
const Vector& pos, const Vector& dir, float size, float speed) = 0;
virtual void GaussExplosion(IRecipientFilter& filer, float delay,
const Vector& pos, const Vector& dir, int type) = 0;
virtual void PhysicsProp(IRecipientFilter& filter, float delay, int modelindex, int skin,
const Vector& pos, const QAngle& angles, const Vector& vel, int flags, int effects) = 0;
virtual void TriggerTempEntity(KeyValues* pKeyValues) = 0;
virtual void ClientProjectile(IRecipientFilter& filter, float delay,
const Vector* vecOrigin, const Vector* vecVelocity, int modelindex, int lifetime, CBaseEntity* pOwner) = 0;
};
extern ITempEntsSystem* te;
#endif

93
SpyCustom/sdk/itexture.h Normal file
View File

@ -0,0 +1,93 @@
#ifndef ITEXTURE_H
#define ITEXTURE_H
#ifdef _WIN32
#pragma once
#endif
#include "platform.h"
#include "imageformat.h"
class IVTFTexture;
class ITexture;
struct Rect_t;
abstract_class ITextureRegenerator
{
public:
virtual void RegenerateTextureBits(ITexture * pTexture, IVTFTexture * pVTFTexture, Rect_t * pRect) = 0;
virtual void Release() = 0;
};
abstract_class ITexture
{
public:
virtual const char* GetName(void) const = 0;
virtual int GetMappingWidth() const = 0;
virtual int GetMappingHeight() const = 0;
virtual int GetActualWidth() const = 0;
virtual int GetActualHeight() const = 0;
virtual int GetNumAnimationFrames() const = 0;
virtual bool IsTranslucent() const = 0;
virtual bool IsMipmapped() const = 0;
virtual void GetLowResColorSample(float s, float t, float* color) const = 0;
virtual void* GetResourceData(uint32 eDataType, size_t* pNumBytes) const = 0;
virtual void IncrementReferenceCount(void) = 0;
virtual void DecrementReferenceCount(void) = 0;
inline void AddRef() { IncrementReferenceCount(); }
inline void Release() { DecrementReferenceCount(); }
virtual void SetTextureRegenerator(ITextureRegenerator* pTextureRegen) = 0;
virtual void Download(Rect_t* pRect = 0, int nAdditionalCreationFlags = 0) = 0;
virtual int GetApproximateVidMemBytes(void) const = 0;
virtual bool IsError() const = 0;
virtual bool IsVolumeTexture() const = 0;
virtual int GetMappingDepth() const = 0;
virtual int GetActualDepth() const = 0;
virtual ImageFormat GetImageFormat() const = 0;
virtual NormalDecodeMode_t GetNormalDecodeMode() const = 0;
virtual bool IsRenderTarget() const = 0;
virtual bool IsCubeMap() const = 0;
virtual bool IsNormalMap() const = 0;
virtual bool IsProcedural() const = 0;
virtual void DeleteIfUnreferenced() = 0;
#if defined( _X360 )
virtual bool ClearTexture(int r, int g, int b, int a) = 0;
virtual bool CreateRenderTargetSurface(int width, int height, ImageFormat format, bool bSameAsTexture) = 0;
#endif
virtual void SwapContents(ITexture* pOther) = 0;
virtual unsigned int GetFlags(void) const = 0;
virtual void ForceLODOverride(int iNumLodsOverrideUpOrDown) = 0;
virtual bool SaveToFile(const char* fileName) = 0;
virtual void CopyToStagingTexture(ITexture* pDstTex) = 0;
virtual void SetErrorTexture(bool bIsErrorTexture) = 0;
};
inline bool IsErrorTexture(ITexture* pTex)
{
return !pTex || pTex->IsError();
}
#endif

190
SpyCustom/sdk/itoolentity.h Normal file
View File

@ -0,0 +1,190 @@
#ifndef ITOOLENTITY_H
#define ITOOLENTITY_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "utlvector.h"
#include "Color.h"
#include "basehandle.h"
#include "iclientrenderable.h"
#include "ishadowmgr.h"
class IServerEntity;
class IClientEntity;
class IToolSystem;
class IClientRenderable;
class Vector;
class QAngle;
class CBaseEntity;
class CBaseAnimating;
class CTakeDamageInfo;
class ITempEntsSystem;
class IEntityFactoryDictionary;
typedef unsigned int HTOOLHANDLE;
enum
{
HTOOLHANDLE_INVALID = 0
};
enum ClientShadowFlags_t
{
SHADOW_FLAGS_USE_RENDER_TO_TEXTURE = (SHADOW_FLAGS_LAST_FLAG << 1),
SHADOW_FLAGS_ANIMATING_SOURCE = (SHADOW_FLAGS_LAST_FLAG << 2),
SHADOW_FLAGS_USE_DEPTH_TEXTURE = (SHADOW_FLAGS_LAST_FLAG << 3),
CLIENT_SHADOW_FLAGS_LAST_FLAG = SHADOW_FLAGS_USE_DEPTH_TEXTURE
};
typedef void* EntitySearchResult;
class IClientTools : public IBaseInterface
{
public:
virtual HTOOLHANDLE AttachToEntity(EntitySearchResult entityToAttach) = 0;
virtual void DetachFromEntity(EntitySearchResult entityToDetach) = 0;
virtual bool IsValidHandle(HTOOLHANDLE handle) = 0;
virtual int GetNumRecordables() = 0;
virtual HTOOLHANDLE GetRecordable(int index) = 0;
virtual EntitySearchResult NextEntity(EntitySearchResult currentEnt) = 0;
EntitySearchResult FirstEntity() { return NextEntity(NULL); }
virtual void SetEnabled(HTOOLHANDLE handle, bool enabled) = 0;
virtual void SetRecording(HTOOLHANDLE handle, bool recording) = 0;
virtual bool ShouldRecord(HTOOLHANDLE handle) = 0;
virtual HTOOLHANDLE GetToolHandleForEntityByIndex(int entindex) = 0;
virtual int GetModelIndex(HTOOLHANDLE handle) = 0;
virtual const char* GetModelName(HTOOLHANDLE handle) = 0;
virtual const char* GetClassname(HTOOLHANDLE handle) = 0;
virtual void AddClientRenderable(IClientRenderable* pRenderable, int renderGroup) = 0;
virtual void RemoveClientRenderable(IClientRenderable* pRenderable) = 0;
virtual void SetRenderGroup(IClientRenderable* pRenderable, int renderGroup) = 0;
virtual void MarkClientRenderableDirty(IClientRenderable* pRenderable) = 0;
virtual void UpdateProjectedTexture(ClientShadowHandle_t h, bool bForce) = 0;
virtual bool DrawSprite(IClientRenderable* pRenderable, float scale, float frame, int rendermode, int renderfx, const Color& color, float flProxyRadius, int* pVisHandle) = 0;
virtual EntitySearchResult GetLocalPlayer() = 0;
virtual bool GetLocalPlayerEyePosition(Vector& org, QAngle& ang, float& fov) = 0;
virtual ClientShadowHandle_t CreateShadow(CBaseHandle handle, int nFlags) = 0;
virtual void DestroyShadow(ClientShadowHandle_t h) = 0;
virtual ClientShadowHandle_t CreateFlashlight(const FlashlightState_t& lightState) = 0;
virtual void DestroyFlashlight(ClientShadowHandle_t h) = 0;
virtual void UpdateFlashlightState(ClientShadowHandle_t h, const FlashlightState_t& lightState) = 0;
virtual void AddToDirtyShadowList(ClientShadowHandle_t h, bool force = false) = 0;
virtual void MarkRenderToTextureShadowDirty(ClientShadowHandle_t h) = 0;
virtual void EnableRecordingMode(bool bEnable) = 0;
virtual bool IsInRecordingMode() const = 0;
virtual void TriggerTempEntity(KeyValues* pKeyValues) = 0;
virtual int GetOwningWeaponEntIndex(int entindex) = 0;
virtual int GetEntIndex(EntitySearchResult entityToAttach) = 0;
virtual int FindGlobalFlexcontroller(char const* name) = 0;
virtual char const* GetGlobalFlexControllerName(int idx) = 0;
virtual EntitySearchResult GetOwnerEntity(EntitySearchResult currentEnt) = 0;
virtual bool IsPlayer(EntitySearchResult currentEnt) = 0;
virtual bool IsBaseCombatCharacter(EntitySearchResult currentEnt) = 0;
virtual bool IsNPC(EntitySearchResult currentEnt) = 0;
virtual Vector GetAbsOrigin(HTOOLHANDLE handle) = 0;
virtual QAngle GetAbsAngles(HTOOLHANDLE handle) = 0;
virtual void ReloadParticleDefintions(const char* pFileName, const void* pBufData, int nLen) = 0;
virtual void PostToolMessage(KeyValues* pKeyValues) = 0;
virtual void EnableParticleSystems(bool bEnable) = 0;
virtual bool IsRenderingThirdPerson() const = 0;
};
#define VCLIENTTOOLS_INTERFACE_VERSION "VCLIENTTOOLS001"
class IServerTools : public IBaseInterface
{
public:
virtual IServerEntity* GetIServerEntity(IClientEntity* pClientEntity) = 0;
virtual bool SnapPlayerToPosition(const Vector& org, const QAngle& ang, IClientEntity* pClientPlayer = NULL) = 0;
virtual bool GetPlayerPosition(Vector& org, QAngle& ang, IClientEntity* pClientPlayer = NULL) = 0;
virtual bool SetPlayerFOV(int fov, IClientEntity* pClientPlayer = NULL) = 0;
virtual int GetPlayerFOV(IClientEntity* pClientPlayer = NULL) = 0;
virtual bool IsInNoClipMode(IClientEntity* pClientPlayer = NULL) = 0;
virtual CBaseEntity* FirstEntity(void) = 0;
virtual CBaseEntity* NextEntity(CBaseEntity* pEntity) = 0;
virtual CBaseEntity* FindEntityByHammerID(int iHammerID) = 0;
virtual bool GetKeyValue(CBaseEntity* pEntity, const char* szField, char* szValue, int iMaxLen) = 0;
virtual bool SetKeyValue(CBaseEntity* pEntity, const char* szField, const char* szValue) = 0;
virtual bool SetKeyValue(CBaseEntity* pEntity, const char* szField, float flValue) = 0;
virtual bool SetKeyValue(CBaseEntity* pEntity, const char* szField, const Vector& vecValue) = 0;
virtual CBaseEntity* CreateEntityByName(const char* szClassName) = 0;
virtual void DispatchSpawn(CBaseEntity* pEntity) = 0;
virtual void ReloadParticleDefintions(const char* pFileName, const void* pBufData, int nLen) = 0;
virtual void AddOriginToPVS(const Vector& org) = 0;
virtual void MoveEngineViewTo(const Vector& vPos, const QAngle& vAngles) = 0;
virtual bool DestroyEntityByHammerId(int iHammerID) = 0;
virtual CBaseEntity* GetBaseEntityByEntIndex(int iEntIndex) = 0;
virtual void RemoveEntity(CBaseEntity* pEntity) = 0;
virtual void RemoveEntityImmediate(CBaseEntity* pEntity) = 0;
virtual IEntityFactoryDictionary* GetEntityFactoryDictionary(void) = 0;
virtual void SetMoveType(CBaseEntity* pEntity, int val) = 0;
virtual void SetMoveType(CBaseEntity* pEntity, int val, int moveCollide) = 0;
virtual void ResetSequence(CBaseAnimating* pEntity, int nSequence) = 0;
virtual void ResetSequenceInfo(CBaseAnimating* pEntity) = 0;
virtual void ClearMultiDamage(void) = 0;
virtual void ApplyMultiDamage(void) = 0;
virtual void AddMultiDamage(const CTakeDamageInfo& pTakeDamageInfo, CBaseEntity* pEntity) = 0;
virtual void RadiusDamage(const CTakeDamageInfo& info, const Vector& vecSrc, float flRadius, int iClassIgnore, CBaseEntity* pEntityIgnore) = 0;
virtual ITempEntsSystem* GetTempEntsSystem(void) = 0;
};
typedef IServerTools IServerTools001;
#define VSERVERTOOLS_INTERFACE_VERSION_1 "VSERVERTOOLS001"
#define VSERVERTOOLS_INTERFACE_VERSION "VSERVERTOOLS002"
#define VSERVERTOOLS_INTERFACE_VERSION_INT 2
class IServerChoreoTools : public IBaseInterface
{
public:
virtual EntitySearchResult NextChoreoEntity(EntitySearchResult currentEnt) = 0;
EntitySearchResult FirstChoreoEntity() { return NextChoreoEntity(NULL); }
virtual const char* GetSceneFile(EntitySearchResult sr) = 0;
virtual int GetEntIndex(EntitySearchResult sr) = 0;
virtual void ReloadSceneFromDisk(int entindex) = 0;
};
#define VSERVERCHOREOTOOLS_INTERFACE_VERSION "VSERVERCHOREOTOOLS001"
#endif

View File

@ -0,0 +1,44 @@
#ifndef IVDEBUGOVERLAY_H
#define IVDEBUGOVERLAY_H
#ifdef _WIN32
#pragma once
#endif
class Vector;
#define VDEBUG_OVERLAY_INTERFACE_VERSION "VDebugOverlay003"
#define NDEBUG_PERSIST_TILL_NEXT_SERVER (0.0f)
class OverlayText_t;
abstract_class IVDebugOverlay
{
public:
virtual void __unkn() = 0;
virtual void AddEntityTextOverlay(int ent_index, int line_offset, float duration, int r, int g, int b, int a, const char* format, ...) = 0;
virtual void AddBoxOverlay(const Vector& origin, const Vector& mins, const Vector& max, Vector const& orientation, int r, int g, int b, int a, float duration) = 0;
virtual void AddSphereOverlay(const Vector& vOrigin, float flRadius, int nTheta, int nPhi, int r, int g, int b, int a, float flDuration) = 0;
virtual void AddTriangleOverlay(const Vector& p1, const Vector& p2, const Vector& p3, int r, int g, int b, int a, bool noDepthTest, float duration) = 0;
virtual void AddLineOverlay(const Vector& origin, const Vector& dest, int r, int g, int b, bool noDepthTest, float duration) = 0;
virtual void AddTextOverlay(const Vector& origin, float duration, const char* format, ...) = 0;
virtual void AddTextOverlay(const Vector& origin, int line_offset, float duration, const char* format, ...) = 0;
virtual void AddScreenTextOverlay(float flXPos, float flYPos, float flDuration, int r, int g, int b, int a, const char* text) = 0;
virtual void AddSweptBoxOverlay(const Vector& start, const Vector& end, const Vector& mins, const Vector& max, const QAngle& angles, int r, int g, int b, int a, float flDuration) = 0;
virtual void AddGridOverlay(const Vector& origin) = 0;
virtual void AddCoordFrameOverlay(const matrix3x4_t& frame, float flScale, int vColorTable[3][3] = NULL) = 0;
virtual int ScreenPosition(const Vector& point, Vector& screen) = 0;
virtual int ScreenPosition(float flXPos, float flYPos, Vector& screen) = 0;
virtual OverlayText_t* GetFirst(void) = 0;
virtual OverlayText_t* GetNext(OverlayText_t* current) = 0;
virtual void ClearDeadOverlays(void) = 0;
virtual void ClearAllOverlays() = 0;
virtual void AddTextOverlayRGB(const Vector& origin, int line_offset, float duration, float r, float g, float b, float alpha, const char* format, ...) = 0;
virtual void AddTextOverlayRGB(const Vector& origin, int line_offset, float duration, int r, int g, int b, int a, const char* format, ...) = 0;
virtual void AddLineOverlayAlpha(const Vector& origin, const Vector& dest, int r, int g, int b, int a, bool noDepthTest, float duration) = 0;
virtual void AddBoxOverlay2(const Vector& origin, const Vector& mins, const Vector& max, QAngle const& orientation, const Color& faceColor, const Color& edgeColor, float duration) = 0;
virtual void PurgeTextOverlays() = 0;
virtual void DrawPill(const Vector& mins, const Vector& max, float& diameter, int r, int g, int b, int a, float duration) = 0;
};
#endif

125
SpyCustom/sdk/iviewrender.h Normal file
View File

@ -0,0 +1,125 @@
#if !defined( IVIEWRENDER_H )
#define IVIEWRENDER_H
#ifdef _WIN32
#pragma once
#endif
#include "ivrenderview.h"
#define MAX_DEPTH_TEXTURE_SHADOWS 1
#define MAX_DEPTH_TEXTURE_HIGHRES_SHADOWS 0
#define MAX_DEPTH_TEXTURE_SHADOWS_TOOLS 8
#define MAX_DEPTH_TEXTURE_HIGHRES_SHADOWS_TOOLS 0
enum DrawFlags_t
{
DF_RENDER_REFRACTION = 0x1,
DF_RENDER_REFLECTION = 0x2,
DF_CLIP_Z = 0x4,
DF_CLIP_BELOW = 0x8,
DF_RENDER_UNDERWATER = 0x10,
DF_RENDER_ABOVEWATER = 0x20,
DF_RENDER_WATER = 0x40,
DF_SSAO_DEPTH_PASS = 0x80,
DF_RENDER_PSEUDO_TRANSLUCENT_WATER = 0x100,
DF_WATERHEIGHT = 0x200,
DF_DRAW_SSAO = 0x400,
DF_DRAWSKYBOX = 0x800,
DF_FUDGE_UP = 0x1000,
DF_DRAW_ENTITITES = 0x2000,
DF_SKIP_WORLD = 0x4000,
DF_SKIP_WORLD_DECALS_AND_OVERLAYS = 0x8000,
DF_UNUSED5 = 0x10000,
DF_SAVEGAMESCREENSHOT = 0x20000,
DF_CLIP_SKYBOX = 0x40000,
DF_DRAW_SIMPLE_WORLD_MODEL = 0x80000,
DF_SHADOW_DEPTH_MAP = 0x100000,
DF_FAST_ENTITY_RENDERING = 0x200000,
DF_DRAW_SIMPLE_WORLD_MODEL_WATER = 0x400000,
};
class CViewSetup;
class C_BaseEntity;
struct vrect_t;
class C_BaseViewModel;
abstract_class IViewRender
{
public:
virtual void Init(void) = 0;
virtual void LevelInit(void) = 0;
virtual void LevelShutdown(void) = 0;
virtual void Shutdown(void) = 0;
virtual void OnRenderStart() = 0;
virtual void Render(vrect_t* rect) = 0;
virtual void RenderView(const CViewSetup& view, const CViewSetup& hudViewSetup, int nClearFlags, int whatToDraw) = 0;
virtual int GetDrawFlags() = 0;
virtual void StartPitchDrift(void) = 0;
virtual void StopPitchDrift(void) = 0;
virtual VPlane* GetFrustum() = 0;
virtual bool ShouldDrawBrushModels(void) = 0;
virtual const CViewSetup* GetPlayerViewSetup(int nSlot = -1) const = 0;
virtual const CViewSetup* GetViewSetup(void) const = 0;
virtual void DisableVis(void) = 0;
virtual int BuildWorldListsNumber() const = 0;
virtual void SetCheapWaterStartDistance(float flCheapWaterStartDistance) = 0;
virtual void SetCheapWaterEndDistance(float flCheapWaterEndDistance) = 0;
virtual void GetWaterLODParams(float& flCheapWaterStartDistance, float& flCheapWaterEndDistance) = 0;
virtual void DriftPitch(void) = 0;
virtual void SetScreenOverlayMaterial(IMaterial* pMaterial) = 0;
virtual IMaterial* GetScreenOverlayMaterial() = 0;
virtual void WriteSaveGameScreenshot(const char* pFilename) = 0;
virtual void WriteSaveGameScreenshotOfSize(const char* pFilename, int width, int height) = 0;
virtual void QueueOverlayRenderView(const CViewSetup& view, int nClearFlags, int whatToDraw) = 0;
virtual float GetZNear() = 0;
virtual float GetZFar() = 0;
virtual void GetScreenFadeDistances(float* pMin, float* pMax, float* pScale) = 0;
virtual C_BaseEntity* GetCurrentlyDrawingEntity() = 0;
virtual void SetCurrentlyDrawingEntity(C_BaseEntity* pEnt) = 0;
virtual bool UpdateShadowDepthTexture(ITexture* pRenderTarget, ITexture* pDepthTexture, const CViewSetup& shadowView, bool bRenderWorldAndObjects = true, bool bRenderViewModels = false) = 0;
virtual void FreezeFrame(float flFreezeTime) = 0;
virtual void InitFadeData(void) = 0;
};
extern IViewRender* view;
#endif

View File

@ -0,0 +1,144 @@
#if !defined( IVIEWRENDER_BEAMS_H )
#define IVIEWRENDER_BEAMS_H
#ifdef _WIN32
#pragma once
#endif
#include "vector.h"
#include "beam_flags.h"
#include "tempentity.h"
extern void SetBeamCreationAllowed(bool state);
extern bool BeamCreationAllowed(void);
class C_Beam;
class Beam_t;
struct BeamTrail_t
{
BeamTrail_t* next;
float die;
Vector org;
Vector vel;
};
struct BeamInfo_t
{
int m_nType;
C_BaseEntity* m_pStartEnt;
int m_nStartAttachment;
C_BaseEntity* m_pEndEnt;
int m_nEndAttachment;
Vector m_vecStart;
Vector m_vecEnd;
int m_nModelIndex;
const char* m_pszModelName;
int m_nHaloIndex;
const char* m_pszHaloName;
float m_flHaloScale;
float m_flLife;
float m_flWidth;
float m_flEndWidth;
float m_flFadeLength;
float m_flAmplitude;
float m_flBrightness;
float m_flSpeed;
int m_nStartFrame;
float m_flFrameRate;
float m_flRed;
float m_flGreen;
float m_flBlue;
bool m_bRenderable;
int m_nSegments;
int m_nFlags;
Vector m_vecCenter;
float m_flStartRadius;
float m_flEndRadius;
BeamInfo_t()
{
m_nType = TE_BEAMPOINTS;
m_nSegments = -1;
m_pszModelName = NULL;
m_pszHaloName = NULL;
m_nModelIndex = -1;
m_nHaloIndex = -1;
m_bRenderable = true;
m_nFlags = 0;
}
};
abstract_class IViewRenderBeams
{
public:
public:
public:
virtual void InitBeams(void) = 0;
virtual void ShutdownBeams(void) = 0;
virtual void ClearBeams(void) = 0;
virtual void UpdateTempEntBeams() = 0;
virtual void DrawBeam(C_Beam* pbeam, ITraceFilter* pEntityBeamTraceFilter = NULL) = 0;
virtual void DrawBeam(Beam_t* pbeam) = 0;
virtual void KillDeadBeams(CBaseEntity* pEnt) = 0;
virtual Beam_t* CreateBeamEnts(BeamInfo_t& beamInfo) = 0;
virtual Beam_t* CreateBeamEntPoint(BeamInfo_t& beamInfo) = 0;
virtual Beam_t* CreateBeamPoints(BeamInfo_t& beamInfo) = 0;
virtual Beam_t* CreateBeamRing(BeamInfo_t& beamInfo) = 0;
virtual Beam_t* CreateBeamRingPoint(BeamInfo_t& beamInfo) = 0;
virtual Beam_t* CreateBeamCirclePoints(BeamInfo_t& beamInfo) = 0;
virtual Beam_t* CreateBeamFollow(BeamInfo_t& beamInfo) = 0;
virtual void FreeBeam(Beam_t* pBeam) = 0;
virtual void UpdateBeamInfo(Beam_t* pBeam, BeamInfo_t& beamInfo) = 0;
virtual void CreateBeamEnts(int startEnt, int endEnt, int modelIndex, int haloIndex, float haloScale,
float life, float width, float m_nEndWidth, float m_nFadeLength, float amplitude,
float brightness, float speed, int startFrame,
float framerate, float r, float g, float b, int type = -1) = 0;
virtual void CreateBeamEntPoint(int nStartEntity, const Vector* pStart, int nEndEntity, const Vector* pEnd,
int modelIndex, int haloIndex, float haloScale,
float life, float width, float m_nEndWidth, float m_nFadeLength, float amplitude,
float brightness, float speed, int startFrame,
float framerate, float r, float g, float b) = 0;
virtual void CreateBeamPoints(Vector& start, Vector& end, int modelIndex, int haloIndex, float haloScale,
float life, float width, float m_nEndWidth, float m_nFadeLength, float amplitude,
float brightness, float speed, int startFrame,
float framerate, float r, float g, float b) = 0;
virtual void CreateBeamRing(int startEnt, int endEnt, int modelIndex, int haloIndex, float haloScale,
float life, float width, float m_nEndWidth, float m_nFadeLength, float amplitude,
float brightness, float speed, int startFrame,
float framerate, float r, float g, float b, int flags = 0) = 0;
virtual void CreateBeamRingPoint(const Vector& center, float start_radius, float end_radius, int modelIndex, int haloIndex, float haloScale,
float life, float width, float m_nEndWidth, float m_nFadeLength, float amplitude,
float brightness, float speed, int startFrame,
float framerate, float r, float g, float b, int flags = 0) = 0;
virtual void CreateBeamCirclePoints(int type, Vector& start, Vector& end,
int modelIndex, int haloIndex, float haloScale, float life, float width,
float m_nEndWidth, float m_nFadeLength, float amplitude, float brightness, float speed,
int startFrame, float framerate, float r, float g, float b) = 0;
virtual void CreateBeamFollow(int startEnt, int modelIndex, int haloIndex, float haloScale,
float life, float width, float m_nEndWidth, float m_nFadeLength, float r, float g, float b,
float brightness) = 0;
};
#endif

152
SpyCustom/sdk/ivmodelinfo.h Normal file
View File

@ -0,0 +1,152 @@
#ifndef IVMODELINFO_H
#define IVMODELINFO_H
#ifdef _WIN32
#pragma once
#endif
#include "platform.h"
#include "dbg.h"
class IMaterial;
class KeyValues;
struct vcollide_t;
struct model_t;
class Vector;
class QAngle;
class CGameTrace;
struct cplane_t;
typedef CGameTrace trace_t;
struct studiohdr_t;
struct virtualmodel_t;
typedef unsigned char byte;
struct virtualterrainparams_t;
class CPhysCollide;
typedef unsigned short MDLHandle_t;
class CUtlBuffer;
class IClientRenderable;
class CStudioHdr;
enum RenderableTranslucencyType_t
{
RENDERABLE_IS_OPAQUE = 0,
RENDERABLE_IS_TRANSLUCENT,
RENDERABLE_IS_TWO_PASS,
};
abstract_class IModelLoadCallback
{
public:
virtual void OnModelLoadComplete(const model_t * pModel) = 0;
protected:
~IModelLoadCallback();
};
class CRefCountedModelIndex
{
private:
int m_nIndex;
public:
CRefCountedModelIndex() : m_nIndex(-1) { }
~CRefCountedModelIndex() { Set(-1); }
CRefCountedModelIndex(const CRefCountedModelIndex& src) : m_nIndex(-1) { Set(src.m_nIndex); }
CRefCountedModelIndex& operator=(const CRefCountedModelIndex& src) { Set(src.m_nIndex); return *this; }
explicit CRefCountedModelIndex(int i) : m_nIndex(-1) { Set(i); }
CRefCountedModelIndex& operator=(int i) { Set(i); return *this; }
int Get() const { return m_nIndex; }
void Set(int i);
void Clear() { Set(-1); }
operator int() const { return m_nIndex; }
};
#define VMODELINFO_CLIENT_INTERFACE_VERSION "VModelInfoClient006"
#define VMODELINFO_SERVER_INTERFACE_VERSION_3 "VModelInfoServer003"
#define VMODELINFO_SERVER_INTERFACE_VERSION "VModelInfoServer004"
inline bool IsDynamicModelIndex(int modelindex) { return modelindex < -1; }
inline bool IsClientOnlyModelIndex(int modelindex) { return modelindex < -1 && (modelindex & 1); }
class IVModelInfo
{
public:
virtual ~IVModelInfo(void) {}
virtual const model_t* GetModel(int modelindex) const = 0;
virtual int GetModelIndex(const char* name) const = 0;
virtual const char* GetModelName(const model_t* model) const = 0;
virtual vcollide_t* GetVCollide(const model_t* model) const = 0;
virtual vcollide_t* GetVCollide(int modelindex) const = 0;
virtual void GetModelBounds(const model_t* model, Vector& mins, Vector& maxs) const = 0;
virtual void GetModelRenderBounds(const model_t* model, Vector& mins, Vector& maxs) const = 0;
virtual int GetModelFrameCount(const model_t* model) const = 0;
virtual int GetModelType(const model_t* model) const = 0;
virtual void* GetModelExtraData(const model_t* model) = 0;
virtual bool ModelHasMaterialProxy(const model_t* model) const = 0;
virtual bool IsTranslucent(model_t const* model) const = 0;
virtual bool IsTranslucentTwoPass(const model_t* model) const = 0;
virtual void Unused0() {};
virtual void UNUSED() = 0;
virtual void UNUSE11D() = 0;
virtual RenderableTranslucencyType_t ComputeTranslucencyType(const model_t* model, int nSkin, int nBody) = 0;
virtual int GetModelMaterialCount(const model_t* model) const = 0;
virtual void GetModelMaterials(const model_t* model, int count, IMaterial** ppMaterial) = 0;
virtual bool IsModelVertexLit(const model_t* model) const = 0;
virtual const char* GetModelKeyValueText(const model_t* model) = 0;
virtual bool GetModelKeyValue(const model_t* model, CUtlBuffer& buf) = 0;
virtual float GetModelRadius(const model_t* model) = 0;
virtual CStudioHdr* GetStudioHdr(MDLHandle_t handle) = 0;
virtual const studiohdr_t* FindModel(const studiohdr_t* pStudioHdr, void** cache, const char* modelname) const = 0;
virtual const studiohdr_t* FindModel(void* cache) const = 0;
virtual virtualmodel_t* GetVirtualModel(const studiohdr_t* pStudioHdr) const = 0;
virtual uint8_t* GetAnimBlock(const studiohdr_t* pStudioHdr, int iBlock) const = 0;
virtual void GetModelMaterialColorAndLighting(const model_t* model, Vector const& origin, QAngle const& angles, trace_t* pTrace, Vector& lighting, Vector& matColor) = 0;
virtual void GetIlluminationPoint(const model_t* model, IClientRenderable* pRenderable, Vector const& origin, QAngle const& angles, Vector* pLightingCenter) = 0;
virtual int GetModelContents(int modelIndex) const = 0;
virtual studiohdr_t* GetStudiomodel(const model_t* mod) = 0;
virtual int GetModelSpriteWidth(const model_t* model) const = 0;
virtual int GetModelSpriteHeight(const model_t* model) const = 0;
virtual void SetLevelScreenFadeRange(float flMinSize, float flMaxSize) = 0;
virtual void GetLevelScreenFadeRange(float* pMinArea, float* pMaxArea) const = 0;
virtual void SetViewScreenFadeRange(float flMinSize, float flMaxSize) = 0;
virtual unsigned char ComputeLevelScreenFade(const Vector& vecAbsOrigin, float flRadius, float flFadeScale) const = 0;
virtual unsigned char ComputeViewScreenFade(const Vector& vecAbsOrigin, float flRadius, float flFadeScale) const = 0;
virtual int GetAutoplayList(const studiohdr_t* pStudioHdr, unsigned short** pAutoplayList) const = 0;
virtual CPhysCollide* GetCollideForVirtualTerrain(int index) = 0;
virtual bool IsUsingFBTexture(const model_t* model, int nSkin, int nBody, IClientRenderable** pClientRenderable) const = 0;
virtual const model_t* FindOrLoadModel(const char* name) const = 0;
virtual MDLHandle_t GetCacheHandle(const model_t* model) const = 0;
virtual int GetBrushModelPlaneCount(const model_t* model) const = 0;
virtual void GetBrushModelPlane(const model_t* model, int nIndex, cplane_t& plane, Vector* pOrigin) const = 0;
virtual int GetSurfacepropsForVirtualTerrain(int index) = 0;
virtual bool UsesEnvCubemap(const model_t* model) const = 0;
virtual bool UsesStaticLighting(const model_t* model) const = 0;
};
typedef IVModelInfo IVModelInfo003;
abstract_class IVModelInfoClient : public IVModelInfo
{
public:
virtual void OnDynamicModelsStringTableChange(int nStringIndex, const char* pString, const void* pData) = 0;
virtual const model_t* FindOrLoadModel(const char* name) = 0;
};
struct virtualterrainparams_t
{
int index;
};
#endif

View File

@ -0,0 +1,131 @@
#ifndef IVMODELRENDER_H
#define IVMODELRENDER_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
#include "mathlib.h"
#include "istudiorender.h"
#include "idatacache.h"
struct mstudioanimdesc_t;
struct mstudioseqdesc_t;
struct model_t;
class IClientRenderable;
class Vector;
struct studiohdr_t;
class IMaterial;
class CStudioHdr;
struct MaterialLightingState_t;
FORWARD_DECLARE_HANDLE(LightCacheHandle_t);
struct DrawModelState_t
{
studiohdr_t* m_pStudioHdr;
studiohwdata_t* m_pStudioHWData;
IClientRenderable* m_pRenderable;
const matrix3x4_t* m_pModelToWorld;
StudioDecalHandle_t m_decals;
int m_drawFlags;
int m_lod;
};
#define VENGINE_HUDMODEL_INTERFACE_VERSION "VEngineModel016"
typedef unsigned short ModelInstanceHandle_t;
enum
{
MODEL_INSTANCE_INVALID = (ModelInstanceHandle_t)~0
};
struct ModelRenderInfo_t
{
Vector origin;
Vector angles;
char pad[4];
IClientRenderable* pRenderable;
const model_t* pModel;
const matrix3x4_t* pModelToWorld;
const matrix3x4_t* pLightingOffset;
const Vector* pLightingOrigin;
int flags;
int entity_index;
int skin;
int body;
int hitboxset;
ModelInstanceHandle_t instance;
ModelRenderInfo_t()
{
pModelToWorld = NULL;
pLightingOffset = NULL;
pLightingOrigin = NULL;
}
};
struct StaticPropRenderInfo_t
{
const matrix3x4_t* pModelToWorld;
const model_t* pModel;
IClientRenderable* pRenderable;
Vector* pLightingOrigin;
short skin;
ModelInstanceHandle_t instance;
};
struct LightingQuery_t
{
Vector m_LightingOrigin;
ModelInstanceHandle_t m_InstanceHandle;
bool m_bAmbientBoost;
};
struct StaticLightingQuery_t : public LightingQuery_t
{
IClientRenderable * m_pRenderable;
};
class IVModelRender
{
public:
virtual int DrawModel(int flags, IClientRenderable* pRenderable, ModelInstanceHandle_t instance, int entity_index, const model_t* model, Vector const& origin, QAngle const& angles, int skin, int body, int hitboxset, const matrix3x4_t* modelToWorld = NULL, const matrix3x4_t* pLightingOffset = NULL) = 0;
virtual void ForcedMaterialOverride(IMaterial* newMaterial, OverrideType_t nOverrideType = OVERRIDE_NORMAL, int nOverrides = 0) = 0;
virtual bool IsForcedMaterialOverride(void) = 0;
virtual void SetViewTarget(const CStudioHdr* pStudioHdr, int nBodyIndex, const Vector& target) = 0;
virtual ModelInstanceHandle_t CreateInstance(IClientRenderable* pRenderable, LightCacheHandle_t* pCache = NULL) = 0;
virtual void DestroyInstance(ModelInstanceHandle_t handle) = 0;
virtual void SetStaticLighting(ModelInstanceHandle_t handle, LightCacheHandle_t* pHandle) = 0;
virtual LightCacheHandle_t GetStaticLighting(ModelInstanceHandle_t handle) = 0;
virtual bool ChangeInstance(ModelInstanceHandle_t handle, IClientRenderable* pRenderable) = 0;
virtual void AddDecal(ModelInstanceHandle_t handle, Ray_t const& ray, Vector const& decalUp, int decalIndex, int body, bool noPokeThru, int maxLODToDecal) = 0;
virtual void RemoveAllDecals(ModelInstanceHandle_t handle) = 0;
virtual bool ModelHasDecals(ModelInstanceHandle_t handle) = 0;
virtual void RemoveAllDecalsFromAllModels() = 0;
virtual matrix3x4_t* DrawModelShadowSetup(IClientRenderable* pRenderable, int body, int skin, DrawModelInfo_t* pInfo, matrix3x4_t* pCustomBoneToWorld = NULL) = 0;
virtual void DrawModelShadow(IClientRenderable* pRenderable, const DrawModelInfo_t& info, matrix3x4_t* pCustomBoneToWorld = NULL) = 0;
virtual bool RecomputeStaticLighting(ModelInstanceHandle_t handle) = 0;
virtual void ReleaseAllStaticPropColorData(void) = 0;
virtual void RestoreAllStaticPropColorData(void) = 0;
virtual int DrawModelEx(ModelRenderInfo_t& pInfo) = 0;
virtual int DrawModelExStaticProp(ModelRenderInfo_t& pInfo) = 0;
virtual bool DrawModelSetup(ModelRenderInfo_t& pInfo, DrawModelState_t* pState, matrix3x4_t** ppBoneToWorldOut) = 0;
virtual void DrawModelExecute(IMatRenderContext* ctx, const DrawModelState_t& state, const ModelRenderInfo_t& pInfo, matrix3x4_t* pCustomBoneToWorld = NULL) = 0;
virtual void SetupLighting(const Vector& vecCenter) = 0;
virtual int DrawStaticPropArrayFast(StaticPropRenderInfo_t* pProps, int count, bool bShadowDepth) = 0;
virtual void SuppressEngineLighting(bool bSuppress) = 0;
virtual void SetupColorMeshes(int nTotalVerts) = 0;
virtual void SetupLightingEx(const Vector& vecCenter, ModelInstanceHandle_t handle) = 0;
virtual bool GetBrightestShadowingLightSource(const Vector& vecCenter, Vector& lightPos, Vector& lightBrightness, bool bAllowNonTaggedLights) = 0;
virtual void ComputeLightingState(int nCount, const LightingQuery_t* pQuery, MaterialLightingState_t* pState, ITexture** ppEnvCubemapTexture) = 0;
virtual void GetModelDecalHandles(StudioDecalHandle_t* pDecals, int nDecalStride, int nCount, const ModelInstanceHandle_t* pHandles) = 0;
virtual void ComputeStaticLightingState(int nCount, const StaticLightingQuery_t* pQuery, MaterialLightingState_t* pState, MaterialLightingState_t* pDecalState, ColorMeshInfo_t** ppStaticLighting, ITexture** ppEnvCubemapTexture, DataCacheHandle_t* pColorMeshHandles) = 0;
virtual void CleanupStaticLightingState(int nCount, DataCacheHandle_t* pColorMeshHandles) = 0;
};
#endif

View File

@ -0,0 +1,310 @@
#if !defined( IVRENDERVIEW_H )
#define IVRENDERVIEW_H
#ifdef _WIN32
#pragma once
#endif
#include "basetypes.h"
#include "vplane.h"
#include "interface.h"
#include "imaterialsystem.h"
#include "const.h"
#include "vertexcolor.h"
#include "refcount.h"
class CViewSetup;
class CEngineSprite;
class IClientEntity;
class IMaterial;
struct model_t;
class IClientRenderable;
class IMatRenderContext;
class CVolumeCuller;
enum
{
DRAWWORLDLISTS_DRAW_STRICTLYABOVEWATER = 0x001,
DRAWWORLDLISTS_DRAW_STRICTLYUNDERWATER = 0x002,
DRAWWORLDLISTS_DRAW_INTERSECTSWATER = 0x004,
DRAWWORLDLISTS_DRAW_WATERSURFACE = 0x008,
DRAWWORLDLISTS_DRAW_SKYBOX = 0x010,
DRAWWORLDLISTS_DRAW_CLIPSKYBOX = 0x020,
DRAWWORLDLISTS_DRAW_SHADOWDEPTH = 0x040,
DRAWWORLDLISTS_DRAW_REFRACTION = 0x080,
DRAWWORLDLISTS_DRAW_REFLECTION = 0x100,
DRAWWORLDLISTS_DRAW_WORLD_GEOMETRY = 0x200,
DRAWWORLDLISTS_DRAW_DECALS_AND_OVERLAYS = 0x400,
DRAWWORLDLISTS_DRAW_SIMPLE_WORLD_MODEL = 0x800,
DRAWWORLDLISTS_DRAW_SIMPLE_WORLD_MODEL_WATER = 0x1000,
DRAWWORLDLISTS_DRAW_SKIP_DISPLACEMENTS = 0x2000,
DRAWWORLDLISTS_DRAW_SSAO = 0x4000,
};
enum
{
MAT_SORT_GROUP_STRICTLY_ABOVEWATER = 0,
MAT_SORT_GROUP_STRICTLY_UNDERWATER,
MAT_SORT_GROUP_INTERSECTS_WATER_SURFACE,
MAT_SORT_GROUP_WATERSURFACE,
MAX_MAT_SORT_GROUPS
};
enum ERenderDepthMode_t
{
DEPTH_MODE_NORMAL = 0,
DEPTH_MODE_SHADOW = 1,
DEPTH_MODE_SSA0 = 2,
DEPTH_MODE_MAX
};
static const char* s_pMatSortGroupsString[] =
{
"Sort: Abovewater",
"Sort: Underwater",
"Sort: IntersectsWater",
"Sort: WaterSurface",
};
typedef VPlane Frustum[FRUSTUM_NUMPLANES];
typedef unsigned short LeafIndex_t;
enum
{
INVALID_LEAF_INDEX = (LeafIndex_t)~0
};
#if 1
struct WorldListLeafData_t
{
LeafIndex_t leafIndex;
int16 waterData;
uint16 firstTranslucentSurface;
uint16 translucentSurfaceCount;
};
#else
struct WorldListLeafData_t
{
uint32 leafIndex;
int32 waterData;
uint32 firstTranslucentSurface;
uint32 translucentSurfaceCount;
};
#endif
struct WorldListInfo_t
{
int m_ViewFogVolume;
int m_LeafCount;
bool m_bHasWater;
WorldListLeafData_t* m_pLeafDataList;
};
class IWorldRenderList : public IRefCounted
{
};
struct VisibleFogVolumeInfo_t
{
int m_nVisibleFogVolume;
int m_nVisibleFogVolumeLeaf;
bool m_bEyeInFogVolume;
float m_flDistanceToWater;
float m_flWaterHeight;
IMaterial* m_pFogVolumeMaterial;
};
struct BrushVertex_t
{
Vector m_Pos;
Vector m_Normal;
Vector m_TangentS;
Vector m_TangentT;
Vector2D m_TexCoord;
Vector2D m_LightmapCoord;
private:
BrushVertex_t(const BrushVertex_t& src);
};
struct VisOverrideData_t
{
Vector m_vecVisOrigin;
float m_fDistToAreaPortalTolerance;
Vector m_vPortalCorners[4];
bool m_bTrimFrustumToPortalCorners;
Vector m_vPortalOrigin;
Vector m_vPortalForward;
float m_flPortalRadius;
};
class IBrushSurface
{
public:
virtual void ComputeTextureCoordinate(Vector const& worldPos, Vector2D& texCoord) = 0;
virtual void ComputeLightmapCoordinate(Vector const& worldPos, Vector2D& lightmapCoord) = 0;
virtual int GetVertexCount() const = 0;
virtual void GetVertexData(BrushVertex_t* pVerts) = 0;
virtual IMaterial* GetMaterial() = 0;
};
class IBrushRenderer
{
public:
virtual bool RenderBrushModelSurface(IClientEntity* pBaseEntity, IBrushSurface* pBrushSurface) = 0;
};
#define MAX_VIS_LEAVES 32
enum DrawBrushModelMode_t
{
DBM_DRAW_ALL = 0,
DBM_DRAW_OPAQUE_ONLY,
DBM_DRAW_TRANSLUCENT_ONLY,
};
struct BrushArrayInstanceData_t
{
matrix3x4a_t* m_pBrushToWorld;
const model_t* m_pBrushModel;
Vector4D m_DiffuseModulation;
ShaderStencilState_t* m_pStencilState;
};
class IVRenderView
{
public:
virtual void DrawBrushModel(
IClientEntity* baseentity,
model_t* model,
const Vector& origin,
const QAngle& angles,
bool bUnused) = 0;
virtual void DrawIdentityBrushModel(IWorldRenderList* pList, model_t* model) = 0;
virtual void TouchLight(struct dlight_t* light) = 0;
virtual void Draw3DDebugOverlays(void) = 0;
virtual void SetBlend(float blend) = 0;
virtual float GetBlend(void) = 0;
virtual void SetColorModulation(float const* blend) = 0;
virtual void GetColorModulation(float* blend) = 0;
virtual void SceneBegin(void) = 0;
virtual void SceneEnd(void) = 0;
virtual void GetVisibleFogVolume(const Vector& eyePoint, const VisOverrideData_t* pVisOverrideData, VisibleFogVolumeInfo_t* pInfo) = 0;
virtual IWorldRenderList* CreateWorldList() = 0;
#if defined(_PS3)
virtual IWorldRenderList* CreateWorldList_PS3(int viewID) = 0;
virtual void BuildWorldLists_PS3_Epilogue(IWorldRenderList* pList, WorldListInfo_t* pInfo, bool bShadowDepth) = 0;
#else
virtual void BuildWorldLists_Epilogue(IWorldRenderList* pList, WorldListInfo_t* pInfo, bool bShadowDepth) = 0;
#endif
virtual void BuildWorldLists(IWorldRenderList* pList, WorldListInfo_t* pInfo, int iForceFViewLeaf, const VisOverrideData_t* pVisData = NULL, bool bShadowDepth = false, float* pReflectionWaterHeight = NULL) = 0;
virtual void DrawWorldLists(IMatRenderContext* pRenderContext, IWorldRenderList* pList, unsigned long flags, float waterZAdjust) = 0;
virtual void GetWorldListIndicesInfo(WorldListIndicesInfo_t* pIndicesInfoOut, IWorldRenderList* pList, unsigned long nFlags) = 0;
virtual void DrawTopView(bool enable) = 0;
virtual void TopViewNoBackfaceCulling(bool bDisable) = 0;
virtual void TopViewNoVisCheck(bool bDisable) = 0;
virtual void TopViewBounds(Vector2D const& mins, Vector2D const& maxs) = 0;
virtual void SetTopViewVolumeCuller(const CVolumeCuller* pVolumeCuller) = 0;
virtual void DrawLights(void) = 0;
virtual void DrawMaskEntities(void) = 0;
virtual void DrawTranslucentSurfaces(IMatRenderContext* pRenderContext, IWorldRenderList* pList, int* pSortList, int sortCount, unsigned long flags) = 0;
virtual void DrawLineFile(void) = 0;
virtual void DrawLightmaps(IWorldRenderList* pList, int pageId) = 0;
virtual void ViewSetupVis(bool novis, int numorigins, const Vector origin[]) = 0;
virtual bool AreAnyLeavesVisible(int* leafList, int nLeaves) = 0;
virtual void VguiPaint(void) = 0;
virtual void ViewDrawFade(byte* color, IMaterial* pMaterial, bool mapFullTextureToScreen = true) = 0;
virtual void OLD_SetProjectionMatrix(float fov, float zNear, float zFar) = 0;
virtual colorVec GetLightAtPoint(Vector& pos) = 0;
virtual int GetViewEntity(void) = 0;
virtual bool IsViewEntity(int entindex) = 0;
virtual float GetFieldOfView(void) = 0;
virtual unsigned char** GetAreaBits(void) = 0;
virtual void SetFogVolumeState(int nVisibleFogVolume, bool bUseHeightFog) = 0;
virtual void InstallBrushSurfaceRenderer(IBrushRenderer* pBrushRenderer) = 0;
virtual void DrawBrushModelShadow(IClientRenderable* pRenderable) = 0;
virtual bool LeafContainsTranslucentSurfaces(IWorldRenderList* pList, int sortIndex, unsigned long flags) = 0;
virtual bool DoesBoxIntersectWaterVolume(const Vector& mins, const Vector& maxs, int leafWaterDataID) = 0;
virtual void SetAreaState(
unsigned char chAreaBits[MAX_AREA_STATE_BYTES],
unsigned char chAreaPortalBits[MAX_AREA_PORTAL_STATE_BYTES]) = 0;
virtual void VGui_Paint(int mode) = 0;
virtual void Push3DView(IMatRenderContext* pRenderContext, const CViewSetup& view, int nFlags, ITexture* pRenderTarget, Frustum frustumPlanes) = 0;
virtual void Push2DView(IMatRenderContext* pRenderContext, const CViewSetup& view, int nFlags, ITexture* pRenderTarget, Frustum frustumPlanes) = 0;
virtual void PopView(IMatRenderContext* pRenderContext, Frustum frustumPlanes) = 0;
virtual void SetMainView(const Vector& vecOrigin, const QAngle& angles) = 0;
enum
{
VIEW_SETUP_VIS_EX_RETURN_FLAGS_USES_RADIAL_VIS = 0x00000001
};
virtual void ViewSetupVisEx(bool novis, int numorigins, const Vector origin[], unsigned int& returnFlags) = 0;
virtual void OverrideViewFrustum(Frustum custom) = 0;
virtual void DrawBrushModelShadowDepth(IClientEntity* baseentity, model_t* model, const Vector& origin, const QAngle& angles, ERenderDepthMode_t DepthMode) = 0;
virtual void UpdateBrushModelLightmap(model_t* model, IClientRenderable* pRenderable) = 0;
virtual void BeginUpdateLightmaps(void) = 0;
virtual void EndUpdateLightmaps() = 0;
virtual void OLD_SetOffCenterProjectionMatrix(float fov, float zNear, float zFar, float flAspectRatio, float flBottom, float flTop, float flLeft, float flRight) = 0;
virtual void OLD_SetProjectionMatrixOrtho(float left, float top, float right, float bottom, float zNear, float zFar) = 0;
virtual void Push3DView(IMatRenderContext* pRenderContext, const CViewSetup& view, int nFlags, ITexture* pRenderTarget, Frustum frustumPlanes, ITexture* pDepthTexture) = 0;
virtual void GetMatricesForView(const CViewSetup& view, VMatrix* pWorldToView, VMatrix* pViewToProjection, VMatrix* pWorldToProjection, VMatrix* pWorldToPixels) = 0;
virtual void DrawBrushModelEx(IClientEntity* baseentity, model_t* model, const Vector& origin, const QAngle& angles, DrawBrushModelMode_t mode) = 0;
virtual bool DoesBrushModelNeedPowerOf2Framebuffer(const model_t* model) = 0;
virtual void DrawBrushModelArray(IMatRenderContext* pContext, int nCount, const BrushArrayInstanceData_t* pInstanceData, int nModelTypeFlags) = 0;
};
#define VENGINE_RENDERVIEW_INTERFACE_VERSION "VEngineRenderView014"
#if defined(_STATIC_LINKED) && defined(CLIENT_DLL)
namespace Client
{
extern IVRenderView* render;
}
#else
extern IVRenderView* render;
#endif
#endif

1270
SpyCustom/sdk/jobthread.h Normal file

File diff suppressed because it is too large Load Diff

420
SpyCustom/sdk/keyvalues.h Normal file
View File

@ -0,0 +1,420 @@
#ifndef KEYVALUES_H
#define KEYVALUES_H
#ifdef _WIN32
#pragma once
#endif
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
#include "utlvector.h"
#include "color.h"
#include "exprevaluator.h"
#define TRACK_KV_ADD( ptr, name ) track.AddKv( ptr, name )
#define SPLIT_3_BYTES_INTO_1_AND_2( x1, x2, x3 ) do { x1 = (uint8)(x3); x2 = (uint16)( (x3) >> 8 ); } while( 0 )
#define FOR_EACH_SUBKEY( kvRoot, kvSubKey ) \
for ( KeyValues * kvSubKey = kvRoot->GetFirstSubKey(); kvSubKey != NULL; kvSubKey = kvSubKey->GetNextKey() )
#define FOR_EACH_TRUE_SUBKEY( kvRoot, kvSubKey ) \
for ( KeyValues * kvSubKey = kvRoot->GetFirstTrueSubKey(); kvSubKey != NULL; kvSubKey = kvSubKey->GetNextTrueSubKey() )
#define FOR_EACH_VALUE( kvRoot, kvValue ) \
for ( KeyValues * kvValue = kvRoot->GetFirstValue(); kvValue != NULL; kvValue = kvValue->GetNextValue() )
class IBaseFileSystem;
class CUtlBuffer;
class Color;
class CKeyValuesTokenReader;
class KeyValues;
class IKeyValuesDumpContext;
typedef void* FileHandle_t;
class CKeyValuesGrowableStringTable;
#define KV_BINARY_POOLED_FORMAT 0xAA
#define FOR_EACH_SUBKEY( kvRoot, kvSubKey ) \
for ( KeyValues * kvSubKey = kvRoot->GetFirstSubKey(); kvSubKey != NULL; kvSubKey = kvSubKey->GetNextKey() )
#define FOR_EACH_TRUE_SUBKEY( kvRoot, kvSubKey ) \
for ( KeyValues * kvSubKey = kvRoot->GetFirstTrueSubKey(); kvSubKey != NULL; kvSubKey = kvSubKey->GetNextTrueSubKey() )
#define FOR_EACH_VALUE( kvRoot, kvValue ) \
for ( KeyValues * kvValue = kvRoot->GetFirstValue(); kvValue != NULL; kvValue = kvValue->GetNextValue() )
class KeyValues
{
friend class CKeyValuesTokenReader;
public:
static void SetUseGrowableStringTable(bool bUseGrowableTable);
explicit KeyValues(const char* setName);
class AutoDelete
{
public:
explicit inline AutoDelete(KeyValues* pKeyValues) : m_pKeyValues(pKeyValues) {}
explicit inline AutoDelete(const char* pchKVName) : m_pKeyValues(new KeyValues(pchKVName)) {}
inline ~AutoDelete(void) { delete m_pKeyValues; }
inline void Assign(KeyValues* pKeyValues) { m_pKeyValues = pKeyValues; }
inline KeyValues* Detach() { KeyValues* retval = m_pKeyValues; Assign(NULL); return retval; }
KeyValues* operator->() { return m_pKeyValues; }
operator KeyValues* () { return m_pKeyValues; }
private:
AutoDelete(AutoDelete const& x);
AutoDelete& operator= (AutoDelete const& x);
protected:
KeyValues* m_pKeyValues;
};
class AutoDeleteInline : public AutoDelete
{
public:
explicit inline AutoDeleteInline(KeyValues* pKeyValues) : AutoDelete(pKeyValues) {}
inline operator KeyValues* () const { return m_pKeyValues; }
inline KeyValues* Get() const { return m_pKeyValues; }
};
KeyValues(const char* setName, const char* firstKey, const char* firstValue);
KeyValues(const char* setName, const char* firstKey, const wchar_t* firstValue);
KeyValues(const char* setName, const char* firstKey, int firstValue);
KeyValues(const char* setName, const char* firstKey, const char* firstValue, const char* secondKey, const char* secondValue);
KeyValues(const char* setName, const char* firstKey, int firstValue, const char* secondKey, int secondValue);
~KeyValues();
const char* GetName() const;
void SetName(const char* setName);
int GetNameSymbol() const;
int GetNameSymbolCaseSensitive() const;
void UsesEscapeSequences(bool state);
bool LoadFromFile(IBaseFileSystem* filesystem, const char* resourceName, const char* pathID = NULL);
bool SaveToFile(IBaseFileSystem* filesystem, const char* resourceName, const char* pathID = NULL, bool bWriteEmptySubkeys = false);
bool LoadFromBuffer(char const* resourceName, const char* pBuffer, IBaseFileSystem* pFileSystem = NULL, const char* pPathID = NULL);
bool LoadFromBuffer(char const* resourceName, CUtlBuffer& buf, IBaseFileSystem* pFileSystem = NULL, const char* pPathID = NULL);
KeyValues* FindKey(const char* keyName, bool bCreate = false);
KeyValues* FindKey(int keySymbol) const;
KeyValues* CreateNewKey();
void AddSubKey(KeyValues* pSubkey);
void RemoveSubKey(KeyValues* subKey);
void InsertSubKey(int nIndex, KeyValues* pSubKey);
bool ContainsSubKey(KeyValues* pSubKey);
void SwapSubKey(KeyValues* pExistingSubKey, KeyValues* pNewSubKey);
void ElideSubKey(KeyValues* pSubKey);
KeyValues* CreateKey(const char* keyName);
KeyValues* CreatePeerKey(const char* keyName);
KeyValues* GetFirstSubKey() { return m_pSub; }
KeyValues* GetNextKey() { return m_pPeer; }
void SetNextKey(KeyValues* pDat);
KeyValues* FindLastSubKey();
KeyValues* GetFirstTrueSubKey();
KeyValues* GetNextTrueSubKey();
KeyValues* GetFirstValue();
KeyValues* GetNextValue();
int GetInt(const char* keyName = NULL, int defaultValue = 0);
uint64 GetUint64(const char* keyName = NULL, uint64 defaultValue = 0);
float GetFloat(const char* keyName = NULL, float defaultValue = 0.0f);
const char* GetString(const char* keyName = NULL, const char* defaultValue = "");
const wchar_t* GetWString(const char* keyName = NULL, const wchar_t* defaultValue = L"");
void* GetPtr(const char* keyName = NULL, void* defaultValue = (void*)0);
Color GetColor(const char* keyName = NULL, const Color& defaultColor = Color(0, 0, 0, 0));
bool GetBool(const char* keyName = NULL, bool defaultValue = false) { return GetInt(keyName, defaultValue ? 1 : 0) ? true : false; }
bool IsEmpty(const char* keyName = NULL);
int GetInt(int keySymbol, int defaultValue = 0);
uint64 GetUint64(int keySymbol, uint64 defaultValue = 0);
float GetFloat(int keySymbol, float defaultValue = 0.0f);
const char* GetString(int keySymbol, const char* defaultValue = "");
const wchar_t* GetWString(int keySymbol, const wchar_t* defaultValue = L"");
void* GetPtr(int keySymbol, void* defaultValue = (void*)0);
Color GetColor(int keySymbol );
bool GetBool(int keySymbol, bool defaultValue = false) { return GetInt(keySymbol, defaultValue ? 1 : 0) ? true : false; }
bool IsEmpty(int keySymbol);
void SetWString(const char* keyName, const wchar_t* value);
void SetString(const char* keyName, const char* value);
void SetInt(const char* keyName, int value);
void SetUint64(const char* keyName, uint64 value);
void SetFloat(const char* keyName, float value);
void SetPtr(const char* keyName, void* value);
void SetColor(const char* keyName, Color value);
void SetBool(const char* keyName, bool value) { SetInt(keyName, value ? 1 : 0); }
void* operator new(size_t iAllocSize);
void* operator new(size_t iAllocSize, int nBlockUse, const char* pFileName, int nLine);
void operator delete(void* pMem);
void operator delete(void* pMem, int nBlockUse, const char* pFileName, int nLine);
KeyValues& operator=(KeyValues& src);
bool IsEqual(KeyValues* pRHS);
void ChainKeyValue(KeyValues* pChain);
void RecursiveSaveToFile(CUtlBuffer& buf, int indentLevel);
bool WriteAsBinary(CUtlBuffer& buffer) const;
bool ReadAsBinary(CUtlBuffer& buffer, int nStackDepth = 0);
bool WriteAsBinaryFiltered(CUtlBuffer& buffer);
bool ReadAsBinaryFiltered(CUtlBuffer& buffer, int nStackDepth = 0);
KeyValues* MakeCopy(void) const;
void CopySubkeys(KeyValues* pParent) const;
void Clear(void);
enum types_t
{
TYPE_NONE = 0,
TYPE_STRING,
TYPE_INT,
TYPE_FLOAT,
TYPE_PTR,
TYPE_WSTRING,
TYPE_COLOR,
TYPE_UINT64,
TYPE_COMPILED_INT_BYTE,
TYPE_COMPILED_INT_0,
TYPE_COMPILED_INT_1,
TYPE_NUMTYPES,
};
types_t GetDataType(const char* keyName = NULL);
types_t GetDataType() const;
void deleteThis();
void SetStringValue(char const* strValue);
void UnpackIntoStructure(struct KeyValuesUnpackStructure const* pUnpackTable, void* pDest);
bool ProcessResolutionKeys(const char* pResString);
bool Dump(IKeyValuesDumpContext* pDump, int nIndentLevel = 0);
enum MergeKeyValuesOp_t
{
MERGE_KV_ALL,
MERGE_KV_UPDATE,
MERGE_KV_DELETE,
MERGE_KV_BORROW,
};
void MergeFrom(KeyValues* kvMerge, MergeKeyValuesOp_t eOp = MERGE_KV_ALL);
static KeyValues* FromString(char const* szName, char const* szStringVal, char const** ppEndOfParse = NULL);
KeyValues* CreateKeyUsingKnownLastChild(const char* keyName, KeyValues* pLastChild);
void AddSubkeyUsingKnownLastChild(KeyValues* pSubKey, KeyValues* pLastChild);
KeyValues(KeyValues&);
void RecursiveCopyKeyValues(KeyValues& src);
void RemoveEverything();
void RecursiveSaveToFile(IBaseFileSystem* filesystem, FileHandle_t f, CUtlBuffer* pBuf, int indentLevel, bool bWriteEmptySubkeys = false);
void WriteConvertedString(IBaseFileSystem* filesystem, FileHandle_t f, CUtlBuffer* pBuf, const char* pszString);
void RecursiveLoadFromBuffer(char const* resourceName, CUtlBuffer& buf);
void AppendIncludedKeys(CUtlVector< KeyValues* >& includedKeys);
void ParseIncludedKeys(char const* resourceName, const char* filetoinclude,
IBaseFileSystem* pFileSystem, const char* pPathID, CUtlVector< KeyValues* >& includedKeys);
void MergeBaseKeys(CUtlVector< KeyValues* >& baseKeys);
void RecursiveMergeKeyValues(KeyValues* baseKV);
void InternalWrite(IBaseFileSystem* filesystem, FileHandle_t f, CUtlBuffer* pBuf, const void* pData, int len);
void Init();
const char* ReadToken(CUtlBuffer& buf, bool& wasQuoted, bool& wasConditional);
void WriteIndents(IBaseFileSystem* filesystem, FileHandle_t f, CUtlBuffer* pBuf, int indentLevel);
void FreeAllocatedValue();
void AllocateValueBlock(int size);
bool ReadAsBinaryPooledFormat(CUtlBuffer& buf, IBaseFileSystem* pFileSystem, unsigned int poolKey, GetSymbolProc_t pfnEvaluateSymbolProc);
bool EvaluateConditional(const char* str);
uint32 m_iKeyName : 24;
uint32 m_iKeyNameCaseSensitive1 : 8;
char* m_sValue;
wchar_t* m_wsValue;
union
{
int m_iValue;
float m_flValue;
void* m_pValue;
unsigned char m_Color[4];
};
char m_iDataType;
char m_bHasEscapeSequences;
uint16 m_iKeyNameCaseSensitive2;
KeyValues* m_pPeer;
KeyValues* m_pSub;
KeyValues* m_pChain;
GetSymbolProc_t m_pExpressionGetSymbolProc;
private:
static int (*s_pfGetSymbolForString)(const char* name, bool bCreate);
static const char* (*s_pfGetStringForSymbol)(int symbol);
static CKeyValuesGrowableStringTable* s_pGrowableStringTable;
public:
static int GetSymbolForStringClassic(const char* name, bool bCreate = true);
static const char* GetStringForSymbolClassic(int symbol);
static int GetSymbolForStringGrowable(const char* name, bool bCreate = true);
static const char* GetStringForSymbolGrowable(int symbol);
};
typedef KeyValues::AutoDelete KeyValuesAD;
enum KeyValuesUnpackDestinationTypes_t
{
UNPACK_TYPE_FLOAT,
UNPACK_TYPE_VECTOR,
UNPACK_TYPE_VECTOR_COLOR,
UNPACK_TYPE_STRING,
UNPACK_TYPE_INT,
UNPACK_TYPE_FOUR_FLOATS,
UNPACK_TYPE_TWO_FLOATS,
};
#define UNPACK_FIXED( kname, kdefault, dtype, ofs ) { kname, kdefault, dtype, ofs, 0 }
#define UNPACK_VARIABLE( kname, kdefault, dtype, ofs, sz ) { kname, kdefault, dtype, ofs, sz }
#define UNPACK_END_MARKER { NULL, NULL, UNPACK_TYPE_FLOAT, 0 }
struct KeyValuesUnpackStructure
{
char const* m_pKeyName;
char const* m_pKeyDefault;
KeyValuesUnpackDestinationTypes_t m_eDataType;
size_t m_nFieldOffset;
size_t m_nFieldSize;
};
inline int KeyValues::GetInt(int keySymbol, int defaultValue)
{
KeyValues* dat = FindKey(keySymbol);
return dat ? dat->GetInt((const char*)NULL, defaultValue) : defaultValue;
}
inline uint64 KeyValues::GetUint64(int keySymbol, uint64 defaultValue)
{
KeyValues* dat = FindKey(keySymbol);
return dat ? dat->GetUint64((const char*)NULL, defaultValue) : defaultValue;
}
inline float KeyValues::GetFloat(int keySymbol, float defaultValue)
{
KeyValues* dat = FindKey(keySymbol);
return dat ? dat->GetFloat((const char*)NULL, defaultValue) : defaultValue;
}
inline const char* KeyValues::GetString(int keySymbol, const char* defaultValue)
{
KeyValues* dat = FindKey(keySymbol);
return dat ? dat->GetString((const char*)NULL, defaultValue) : defaultValue;
}
inline const wchar_t* KeyValues::GetWString(int keySymbol, const wchar_t* defaultValue)
{
KeyValues* dat = FindKey(keySymbol);
return dat ? dat->GetWString((const char*)NULL, defaultValue) : defaultValue;
}
inline void* KeyValues::GetPtr(int keySymbol, void* defaultValue)
{
KeyValues* dat = FindKey(keySymbol);
return dat ? dat->GetPtr((const char*)NULL, defaultValue) : defaultValue;
}
inline Color KeyValues::GetColor(int keySymbol)
{
Color defaultValue(0, 0, 0, 0);
KeyValues* dat = FindKey(keySymbol);
return dat ? dat->GetColor() : defaultValue;
}
inline bool KeyValues::IsEmpty(int keySymbol)
{
KeyValues* dat = FindKey(keySymbol);
return dat ? dat->IsEmpty() : true;
}
class IKeyValuesDumpContext
{
public:
virtual bool KvBeginKey(KeyValues* pKey, int nIndentLevel) = 0;
virtual bool KvWriteValue(KeyValues* pValue, int nIndentLevel) = 0;
virtual bool KvEndKey(KeyValues* pKey, int nIndentLevel) = 0;
};
class IKeyValuesDumpContextAsText : public IKeyValuesDumpContext
{
public:
virtual bool KvBeginKey(KeyValues* pKey, int nIndentLevel);
virtual bool KvWriteValue(KeyValues* pValue, int nIndentLevel);
virtual bool KvEndKey(KeyValues* pKey, int nIndentLevel);
public:
virtual bool KvWriteIndent(int nIndentLevel);
virtual bool KvWriteText(char const* szText) = 0;
};
class CKeyValuesDumpContextAsDevMsg : public IKeyValuesDumpContextAsText
{
public:
CKeyValuesDumpContextAsDevMsg(int nDeveloperLevel = 1) : m_nDeveloperLevel(nDeveloperLevel) {}
public:
virtual bool KvBeginKey(KeyValues* pKey, int nIndentLevel);
virtual bool KvWriteText(char const* szText);
protected:
int m_nDeveloperLevel;
};
inline bool KeyValuesDumpAsDevMsg(KeyValues* pKeyValues, int nIndentLevel = 0, int nDeveloperLevel = 1)
{
CKeyValuesDumpContextAsDevMsg ctx(nDeveloperLevel);
return pKeyValues->Dump(&ctx, nIndentLevel);
}
#endif

38
SpyCustom/sdk/l2cache.h Normal file
View File

@ -0,0 +1,38 @@
#ifndef CL2CACHE_H
#define CL2CACHE_H
#ifdef _WIN32
#pragma once
#endif
class P4Event_BSQ_cache_reference;
class CL2Cache
{
public:
CL2Cache();
~CL2Cache();
void Start(void);
void End(void);
int GetL2CacheMisses(void)
{
return m_iL2CacheMissCount;
}
#ifdef DBGFLAG_VALIDATE
void Validate(CValidator& validator, tchar* pchName);
#endif
private:
int m_nID;
P4Event_BSQ_cache_reference* m_pL2CacheEvent;
int64 m_i64Start;
int64 m_i64End;
int m_iL2CacheMissCount;
};
#endif

View File

@ -0,0 +1,157 @@
#ifndef LERP_FUNCTIONS_H
#define LERP_FUNCTIONS_H
#ifdef _WIN32
#pragma once
#endif
template <class T>
inline T LoopingLerp(float flPercent, T flFrom, T flTo)
{
T s = flTo * flPercent + flFrom * (1.0f - flPercent);
return s;
}
template <>
inline float LoopingLerp(float flPercent, float flFrom, float flTo)
{
if (fabs(flTo - flFrom) >= 0.5f)
{
if (flFrom < flTo)
flFrom += 1.0f;
else
flTo += 1.0f;
}
float s = flTo * flPercent + flFrom * (1.0f - flPercent);
s = s - (int)(s);
if (s < 0.0f)
s = s + 1.0f;
return s;
}
template <class T>
inline T Lerp_Hermite(const T& , float t, const T& p0, const T& p1, const T& p2)
{
T d1 = p1 - p0;
T d2 = p2 - p1;
T output;
float tSqr = t * t;
float tCube = t * tSqr;
output = p1 * (2 * tCube - 3 * tSqr + 1);
output += p2 * (-2 * tCube + 3 * tSqr);
output += d1 * (tCube - 2 * tSqr + t);
output += d2 * (tCube - tSqr);
return output;
}
template <class T>
inline T Derivative_Hermite(float t, const T& p0, const T& p1, const T& p2)
{
T d1 = p1 - p0;
T d2 = p2 - p1;
T output;
float tSqr = t * t;
output = p1 * (6 * tSqr - 6 * t);
output += p2 * (-6 * tSqr + 6 * t);
output += d1 * (3 * tSqr - 4 * t + 1);
output += d2 * (3 * tSqr - 2 * t);
return output;
}
inline void Lerp_Clamp(int val)
{
}
inline void Lerp_Clamp(float val)
{
}
inline void Lerp_Clamp(const Vector& val)
{
}
inline void Lerp_Clamp(const QAngle& val)
{
}
template< class T, int minValue, int maxValue, int startValue >
inline void Lerp_Clamp(CRangeCheckedVar<T, minValue, maxValue, startValue>& val)
{
val.Clamp();
}
template<>
inline QAngle Lerp_Hermite<QAngle>(const QAngle&, float t, const QAngle& p0, const QAngle& p1, const QAngle& p2)
{
return Lerp(t, p1, p2);
}
template <class T>
inline T LoopingLerp_Hermite(T current, float t, T p0, T p1, T p2)
{
return Lerp_Hermite(current, t, p0, p1, p2);
}
template <>
inline float LoopingLerp_Hermite(float , float t, float p0, float p1, float p2)
{
if (fabs(p1 - p0) > 0.5f)
{
if (p0 < p1)
p0 += 1.0f;
else
p1 += 1.0f;
}
if (fabs(p2 - p1) > 0.5f)
{
if (p1 < p2)
{
p1 += 1.0f;
if (abs(p1 - p0) > 0.5)
{
if (p0 < p1)
p0 += 1.0f;
else
p1 += 1.0f;
}
}
else
{
p2 += 1.0f;
}
}
float s = Lerp_Hermite( 0.0f, t, p0, p1, p2);
s = s - (int)(s);
if (s < 0.0f)
{
s = s + 1.0f;
}
return s;
}
template< int minValue, int maxValue, int startValue >
inline CRangeCheckedVar<float, minValue, maxValue, startValue> LoopingLerp_Hermite(CRangeCheckedVar<float, minValue, maxValue, startValue> current, float t, CRangeCheckedVar<float, minValue, maxValue, startValue> p0, CRangeCheckedVar<float, minValue, maxValue, startValue> p1, CRangeCheckedVar<float, minValue, maxValue, startValue> p2)
{
return LoopingLerp_Hermite((float)current, t, (float)p0, (float)p1, (float)p2);
}
#endif