Add files via upload

This commit is contained in:
0TheSpy
2021-06-16 16:10:20 +03:00
committed by GitHub
parent 4f40d789d8
commit d05ba71db8
100 changed files with 18673 additions and 0 deletions

49
SpyCustom/FocusNavGroup.h Normal file
View File

@ -0,0 +1,49 @@
#ifndef FOCUSNAVGROUP_H
#define FOCUSNAVGROUP_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "PHandle.h"
namespace vgui
{
class Panel;
class FocusNavGroup
{
public:
FocusNavGroup(Panel* panel);
~FocusNavGroup();
virtual Panel* GetDefaultPanel();
virtual void SetDefaultButton(Panel* panel);
virtual VPANEL GetDefaultButton();
virtual VPANEL GetCurrentDefaultButton();
virtual Panel* FindPanelByHotkey(wchar_t key);
virtual bool RequestFocusPrev(VPANEL panel = NULL);
virtual bool RequestFocusNext(VPANEL panel = NULL);
virtual Panel* GetCurrentFocus();
virtual VPANEL SetCurrentFocus(VPANEL panel, VPANEL defaultPanel);
virtual void SetFocusTopLevel(bool state);
virtual void SetCurrentDefaultButton(VPANEL panel, bool sendCurrentDefaultButtonMessage = true);
private:
bool CanButtonBeDefault(VPANEL panel);
VPanelHandle _defaultButton;
VPanelHandle _currentDefaultButton;
VPanelHandle _currentFocus;
Panel* _mainPanel;
bool _topLevelFocus;
};
}
#endif

198
SpyCustom/Frame.h Normal file
View File

@ -0,0 +1,198 @@
#ifndef VGUI_FRAME_H
#define VGUI_FRAME_H
#ifdef _WIN32
#pragma once
#endif
#include "vgui.h"
#include "Dar.h"
#include "Panel.h"
#include "EditablePanel.h"
#include "FocusNavGroup.h"
namespace vgui
{
class FrameButton;
class FrameSystemButton;
class Frame : public EditablePanel
{
DECLARE_CLASS_SIMPLE(Frame, EditablePanel);
public:
Frame(Panel* parent, const char* panelName, bool showTaskbarIcon = true, bool bPopup = true);
virtual ~Frame();
virtual void SetTitle(const char* title, bool surfaceTitle);
virtual void SetTitle(const wchar_t* title, bool surfaceTitle);
virtual void Activate();
virtual void ActivateMinimized();
MESSAGE_FUNC(Close, "Close");
MESSAGE_FUNC(CloseModal, "CloseModal");
virtual void SetDeleteSelfOnClose(bool state);
virtual void MoveToCenterOfScreen();
virtual void SetMoveable(bool state);
virtual bool IsMoveable();
virtual void SetSizeable(bool state);
virtual bool IsSizeable();
virtual void SetMenuButtonVisible(bool state);
void SetMenuButtonResponsive(bool state);
virtual void SetMinimizeButtonVisible(bool state);
virtual void SetMaximizeButtonVisible(bool state);
virtual void SetMinimizeToSysTrayButtonVisible(bool state);
virtual void SetCloseButtonVisible(bool state);
virtual bool IsMinimized();
virtual void FlashWindow();
virtual void FlashWindowStop();
virtual void OnCommand(const char* command);
virtual Menu* GetSysMenu();
virtual void SetSysMenu(Menu* menu);
void SetImages(const char* pEnabledImage, const char* pDisabledImage = NULL);
virtual void SetTitleBarVisible(bool state);
virtual void SetClipToParent(bool state);
virtual bool GetClipToParent() const;
virtual void SetSmallCaption(bool state);
virtual bool IsSmallCaption() const;
virtual int GetDraggerSize();
virtual int GetCornerSize();
virtual int GetBottomRightSize();
virtual int GetCaptionHeight();
virtual void LoadControlSettings(const char* dialogResourceName, const char* pathID = NULL, KeyValues* pPreloadedKeyValues = NULL, KeyValues* pConditions = NULL);
void SetChainKeysToParent(bool state);
bool CanChainKeysToParent() const;
virtual void DoModal();
void PlaceUnderCursor();
void DisableFadeEffect(void);
void SetFadeEffectDisableOverride(bool disabled);
virtual void OnGripPanelMoved(int nNewX, int nNewY, int nNewW, int nNewH);
virtual void OnGripPanelMoveFinished() {}
protected:
virtual void OnMousePressed(MouseCode code);
virtual void OnKeyCodeTyped(KeyCode code);
virtual void OnKeyTyped(wchar_t unichar);
virtual void OnKeyCodeReleased(KeyCode code);
virtual void OnKeyFocusTicked();
virtual void ApplySchemeSettings(IScheme* pScheme);
virtual void PerformLayout();
virtual void OnClose();
virtual void OnFinishedClose();
MESSAGE_FUNC(OnMinimize, "Minimize");
virtual void OnMinimizeToSysTray();
MESSAGE_FUNC(OnCloseFrameButtonPressed, "CloseFrameButtonPressed");
virtual void OnChildAdded(VPANEL child);
virtual void ApplySettings(KeyValues* inResourceData);
virtual void GetSettings(KeyValues* outResourceData);
virtual const char* GetDescription(void);
virtual bool GetDefaultScreenPosition(int& x, int& y, int& wide, int& tall);
virtual void PaintBackground();
virtual void OnThink();
virtual void OnScreenSizeChanged(int iOldWide, int iOldTall);
virtual void GetClientArea(int& x, int& y, int& wide, int& tall);
virtual void ApplyUserConfigSettings(KeyValues* userConfig);
virtual void GetUserConfigSettings(KeyValues* userConfig);
virtual bool HasUserConfigSettings();
virtual void GetSizerClientArea(int& x, int& y, int& wide, int& tall);
private:
MESSAGE_FUNC_CHARPTR(InternalSetTitle, "SetTitle", text);
MESSAGE_FUNC(InternalFlashWindow, "FlashWindow");
MESSAGE_FUNC_PARAMS(OnDialogVariablesChanged, "DialogVariables", dialogVariables);
void SetupResizeCursors();
void LayoutProportional(FrameButton* bt);
void FinishClose();
void OnFrameFocusChanged(bool bHasFocus);
Color _titleBarBgColor;
Color _titleBarDisabledBgColor;
Color _titleBarFgColor;
Color _titleBarDisabledFgColor;
Color m_InFocusBgColor;
Color m_OutOfFocusBgColor;
TextImage* _title;
#if !defined( _GAMECONSOLE )
Panel* _topGrip;
Panel* _bottomGrip;
Panel* _leftGrip;
Panel* _rightGrip;
Panel* _topLeftGrip;
Panel* _topRightGrip;
Panel* _bottomLeftGrip;
Panel* _bottomRightGrip;
Panel* _captionGrip;
FrameButton* _minimizeButton;
FrameButton* _maximizeButton;
FrameButton* _minimizeToSysTrayButton;
FrameButton* _closeButton;
FrameSystemButton* _menuButton;
Menu* _sysMenu;
#endif
float m_flTransitionEffectTime;
float m_flFocusTransitionEffectTime;
int m_iClientInsetX;
int m_iClientInsetY;
int m_iTitleTextInsetX;
int m_nGripperWidth;
VPANEL m_hPreviousModal;
HFont m_hCustomTitleFont;
bool _sizeable : 1;
bool _moveable : 1;
bool m_bHasFocus : 1;
bool _flashWindow : 1;
bool _nextFlashState : 1;
bool _drawTitleBar : 1;
bool m_bPreviouslyVisible : 1;
bool m_bFadingOut : 1;
bool m_bDeleteSelfOnClose : 1;
bool m_bDisableFadeEffect : 1;
bool m_bClipToParent : 1;
bool m_bSmallCaption : 1;
bool m_bChainKeysToParent : 1;
bool m_bPrimed : 1;
bool m_iClientInsetXOverridden : 1;
CPanelAnimationVarAliasType(int, m_iTitleTextInsetXOverride, "titletextinsetX", "0", "proportional_int");
CPanelAnimationVarAliasType(int, m_iTitleTextInsetYOverride, "titletextinsetY", "0", "proportional_int");
};
}
#endif

View File

@ -0,0 +1,52 @@
#ifndef GAME_EVENT_LISTENER_H
#define GAME_EVENT_LISTENER_H
#ifdef _WIN32
#pragma once
#endif
#include "igameevents.h"
extern IGameEventManager2* gameeventmanager;
class CGameEventListener : public IGameEventListener2
{
public:
CGameEventListener() : m_bRegisteredForEvents(false)
{
}
~CGameEventListener()
{
StopListeningForAllEvents();
}
void ListenForGameEvent(const char* name)
{
m_bRegisteredForEvents = true;
#ifdef CLIENT_DLL
bool bServerSide = false;
#else
bool bServerSide = true;
#endif
if (gameeventmanager)
gameeventmanager->AddListener(this, name, bServerSide);
}
void StopListeningForAllEvents()
{
if (m_bRegisteredForEvents)
{
if (gameeventmanager)
gameeventmanager->RemoveListener(this);
m_bRegisteredForEvents = false;
}
}
virtual void FireGameEvent(IGameEvent* event) = 0;
private:
bool m_bRegisteredForEvents;
};
#endif

View File

@ -0,0 +1,157 @@
#if !defined ( GAMEEVENTMANAGER_H )
#define GAMEEVENTMANAGER_H
#ifdef _WIN32
#pragma once
#endif
#include "igameevents.h"
#include "utlvector.h"
#include "KeyValues.h"
#include "networkstringtabledefs.h"
#include "utlsymbol.h"
#include "bitbuf.h"
class SVC_GameEventList;
class CLC_ListenEvents;
class CGameEventCallback
{
public:
void* m_pCallback;
int m_nListenerType;
};
class CGameEventDescriptor
{
public:
CGameEventDescriptor()
{
name[0] = 0;
eventid = -1;
keys = NULL;
local = false;
reliable = true;
}
public:
char name[MAX_EVENT_NAME_LENGTH];
int eventid;
KeyValues* keys;
bool local;
bool reliable;
CUtlVector<CGameEventCallback*> listeners;
};
class CGameEvent : public IGameEvent
{
public:
CGameEvent(CGameEventDescriptor* descriptor);
virtual ~CGameEvent();
const char* GetName() const;
bool IsEmpty(const char* keyName = NULL);
bool IsLocal() const;
bool IsReliable() const;
bool GetBool(const char* keyName = NULL, bool defaultValue = false);
int GetInt(const char* keyName = NULL, int defaultValue = 0);
float GetFloat(const char* keyName = NULL, float defaultValue = 0.0f);
const char* GetString(const char* keyName = NULL, const char* defaultValue = "");
void SetBool(const char* keyName, bool value);
void SetInt(const char* keyName, int value);
void SetFloat(const char* keyName, float value);
void SetString(const char* keyName, const char* value);
CGameEventDescriptor* m_pDescriptor;
KeyValues* m_pDataKeys;
};
class CGameEventManager : public IGameEventManager2
{
friend class CGameEventManagerOld;
public:
enum
{
SERVERSIDE = 0,
CLIENTSIDE,
CLIENTSTUB,
SERVERSIDE_OLD,
CLIENTSIDE_OLD,
};
enum
{
TYPE_LOCAL = 0,
TYPE_STRING,
TYPE_FLOAT,
TYPE_LONG,
TYPE_SHORT,
TYPE_BYTE,
TYPE_BOOL
};
CGameEventManager();
virtual ~CGameEventManager();
int LoadEventsFromFile(const char* filename);
void Reset();
bool AddListener(IGameEventListener2* listener, const char* name, bool bServerSide);
bool FindListener(IGameEventListener2* listener, const char* name);
void RemoveListener(IGameEventListener2* listener);
IGameEvent* CreateEvent(const char* name, bool bForce = false);
IGameEvent* DuplicateEvent(IGameEvent* event);
bool FireEvent(IGameEvent* event, bool bDontBroadcast = false);
bool FireEventClientSide(IGameEvent* event);
void FreeEvent(IGameEvent* event);
bool SerializeEvent(IGameEvent* event, bf_write* buf);
IGameEvent* UnserializeEvent(bf_read* buf);
public:
bool Init();
void Shutdown();
void ReloadEventDefinitions();
bool AddListener(void* listener, CGameEventDescriptor* descriptor, int nListenerType);
CGameEventDescriptor* GetEventDescriptor(const char* name);
CGameEventDescriptor* GetEventDescriptor(IGameEvent* event);
CGameEventDescriptor* GetEventDescriptor(int eventid);
void WriteEventList(SVC_GameEventList* msg);
bool ParseEventList(SVC_GameEventList* msg);
void WriteListenEventList(CLC_ListenEvents* msg);
bool HasClientListenersChanged(bool bReset = true);
void ConPrintEvent(IGameEvent* event);
bool AddListenerAll(void* listener, int nListenerType);
void RemoveListenerOld(void* listener);
protected:
IGameEvent* CreateEvent(CGameEventDescriptor* descriptor);
bool RegisterEvent(KeyValues* keys);
void UnregisterEvent(int index);
bool FireEventIntern(IGameEvent* event, bool bServerSide, bool bClientOnly);
CGameEventCallback* FindEventListener(void* listener);
CUtlVector<CGameEventDescriptor> m_GameEvents;
CUtlVector<CGameEventCallback*> m_Listeners;
CUtlSymbolTable m_EventFiles;
CUtlVector<CUtlSymbol> m_EventFileNames;
bool m_bClientListenersChanged;
};
extern CGameEventManager& g_GameEventManager;
#endif

56
SpyCustom/GetVfunc.hpp Normal file
View File

@ -0,0 +1,56 @@
#ifndef GETVFUNC
#define GETVFUNC
#pragma once
inline void**& getvtable(void* inst, size_t offset = 0)
{
return *reinterpret_cast<void***>((size_t)inst + offset);
}
inline const void** getvtable(const void* inst, size_t offset = 0)
{
return *reinterpret_cast<const void***>((size_t)inst + offset);
}
template<typename Fn>
inline Fn getvfunc(const void* inst, size_t index, size_t offset = 0)
{
return reinterpret_cast<Fn>(getvtable(inst, offset)[index]);
}
template <typename Fn = void*>
Fn get_vfunc(void* class_base, const size_t index)
{
return (*reinterpret_cast<Fn**>(class_base))[index];
}
#include <string>
#include <memory>
inline char* MakeControlChars(char str[1024]) {
char name[1024];
strcpy(name, str);
for (int i = 0; i < 1024; i++)
{
if (name[i] == 0x5C && name[i + 1] == 0x78)
{
char controlchar[3]; controlchar[0] = name[i + 2]; controlchar[1] = name[i + 3]; controlchar[2] = 0x0;
short x = std::stoul(controlchar, nullptr, 16);
name[i] = x;
for (int j = i + 4; j < 1024; j++)
{
name[j - 3] = name[j];
if (name[j] == 0x0)
break;
}
}
if (name[i] == 0x0)
break;
}
return name;
}
#endif

201
SpyCustom/Hooks.hpp Normal file
View File

@ -0,0 +1,201 @@
#pragma once
VMTHook* SoundHook = nullptr;
void __fastcall hkEmitSound1(void* _this, int edx, IRecipientFilter& filter, int iEntIndex, int iChannel, char* pSoundEntry, unsigned int nSoundEntryHash, const char* pSample, float flVolume, int nSeed, float flAttenuation, int iFlags, int iPitch, const Vector* pOrigin, const Vector* pDirection, void* pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity, int unk) {
static auto ofunc = SoundHook->GetOriginal<decltype(&hkEmitSound1)>(5);
if (*g_Options.soundhook_count) {
soundlist vv = GetCfgWavpathBySoundHash(nSoundEntryHash);
if (vv.cfgindex != -1)
{
Sounds ff = g_Options.models.value->arr[vv.cfgindex].sounds[vv.sndindex];
return ofunc(iff.g_pEngineSound, edx, filter, iEntIndex, iChannel, pSoundEntry, -1, ff.wavpath, ff.volume, nSeed, flAttenuation, 0, ff.pitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, unk);
}
}
return ofunc(iff.g_pEngineSound, edx, filter, iEntIndex, iChannel, pSoundEntry, nSoundEntryHash, pSample, flVolume, nSeed, flAttenuation, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, unk);
}
VMTHook* DMEHook = nullptr;
void replacemat(int d)
{
IMaterial* material;
if (g_Options.materials.value->arr[d].customtextureselected != -1)
if (g_Options.customtextures.value->arr[g_Options.materials.value->arr[d].customtextureselected].texturelink != nullptr)
material = (IMaterial*)g_Options.customtextures.value->arr[g_Options.materials.value->arr[d].customtextureselected].texturelink;
else material = iff.g_pMaterialSystem->FindMaterial("__err", TEXTURE_GROUP_MODEL);
else
material = iff.g_pMaterialSystem->FindMaterial(g_Options.materials.value->arr[d].texture, TEXTURE_GROUP_MODEL);
material->SetMaterialVarFlag(MATERIAL_VAR_WIREFRAME, g_Options.materials.value->arr[d].wireframe);
material->SetMaterialVarFlag(MATERIAL_VAR_FLAT, g_Options.materials.value->arr[d].flat);
material->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, g_Options.materials.value->arr[d].nodraw);
material->ColorModulate(g_Options.materials.value->arr[d].coloralpha.x, g_Options.materials.value->arr[d].coloralpha.y, g_Options.materials.value->arr[d].coloralpha.z);
material->AlphaModulate(g_Options.materials.value->arr[d].coloralpha.w);
iff.g_pMdlRender->ForcedMaterialOverride(material);
}
void __stdcall DrawModelExecute(IMatRenderContext* ctx, const DrawModelState_t& state, const ModelRenderInfo_t& pInfo, matrix3x4_t* pCustomBoneToWorld)
{
static auto ofunc = DMEHook->GetOriginal<void(__thiscall*)(IVModelRender*, IMatRenderContext*, const DrawModelState_t&, const ModelRenderInfo_t&, matrix3x4_t*)>(21);
if (iff.g_pMdlRender->IsForcedMaterialOverride() || opt.loading || !*g_Options.dmeloop_count)
return ofunc(iff.g_pMdlRender, ctx, state, pInfo, pCustomBoneToWorld);
const char* szName = iff.g_pMdlInfo->GetModelName(pInfo.pModel);
if (g_Options.materials.value->arr[3].active)
if (strstr(szName, "player/legacy/t") != nullptr)
replacemat(3);
if (g_Options.materials.value->arr[4].active)
if (strstr(szName, "player/legacy/ct") != nullptr)
replacemat(4);
if (strstr(szName, "weapons/v_")) {
int namehash = fnv2::hashRuntime(szName);
bool is_arm = strstr(szName, "arms") != nullptr;
bool is_sleeve = strstr(szName, "sleeve") != nullptr;
bool is_wep = !is_arm && !is_sleeve;
for (int d = 0; d < g_Options.materials.value->itemcount; d++)
{
if (d == 1 && !is_arm) continue;
if (d == 2 && !is_sleeve) continue;
if (d == 0 && !is_wep) continue;
if (d == 3 || d == 4) continue;
if ((d > 2 && d != 5) && namehash != g_Options.materials.value->arr[d].model_hash) continue;
if (d == 5 && !strstr(szName, "knife")) continue;
if (g_Options.materials.value->arr[d].active) {
replacemat(d);
}
}
}
ofunc(iff.g_pMdlRender, ctx, state, pInfo, pCustomBoneToWorld);
iff.g_pMdlRender->ForcedMaterialOverride(nullptr);
}
VMTHook* CacheHook = nullptr;
MDLHandle_t __fastcall hkFindMDL(void* ecx, void* edx, char* FilePath)
{
static auto oFindMDL = CacheHook->GetOriginal<MDLHandle_t(__thiscall*)(void*, char*)>(10);
if (g_Options.models.value->arr[2].active && strstr(FilePath, "models/weapons/v_models/arms") && !strstr(FilePath, "gloves"))
{
#ifdef DEBUG
printf("Replacing %s with %s\n", FilePath, g_Options.models.value->arr[2].vmodel_repl);
#endif
sprintf(FilePath, g_Options.models.value->arr[2].vmodel_repl);
}
if (g_Options.models.value->arr[3].active && strstr(FilePath, "models/weapons/v_knife"))
{
#ifdef DEBUG
printf("Replacing %s with %s\n", FilePath, g_Options.models.value->arr[3].vmodel_repl);
#endif
sprintf(FilePath, g_Options.models.value->arr[3].vmodel_repl);
}
for (int i = 4; i < g_Options.models.value->itemcount; i++)
{
if (g_Options.models.value->arr[i].active && g_Options.models.value->arr[i].findMDLmethode && strstr(FilePath, g_Options.models.value->arr[i].vmodel_orig))
{
#ifdef DEBUG
printf("Replacing %s with %s\n", FilePath, g_Options.models.value->arr[i].vmodel_repl);
#endif
sprintf(FilePath, g_Options.models.value->arr[i].vmodel_repl);
}
}
return oFindMDL(ecx, FilePath);
}
VMTHook* ClientModeHook = nullptr;
static void __stdcall hkdoPostScreenEffects(void* param) noexcept
{
static auto ofunc = ClientModeHook->GetOriginal<void(__thiscall*)(IClientMode*, void*)>(44);
if (*g_Options.entityloop_count) {
if (iff.g_pEngineClient->IsInGame())
{
int localplayer_index = iff.g_pEngineClient->GetLocalPlayer();
C_BasePlayer* localplayer = static_cast<C_BasePlayer*>(iff.g_pEntityList->GetClientEntity(localplayer_index));
for (int i = iff.g_pEngineClient->GetMaxClients() + 1; i <= iff.g_pEntityList->GetHighestEntityIndex(); ++i)
{
C_BasePlayer* pEntity = (C_BasePlayer*)iff.g_pEntityList->GetClientEntity(i);
if (!pEntity)
continue;
bool bDormant = pEntity->IsDormant();
if (bDormant)
continue;
int cfgindex = GetCfgIndexByClassId(fnv2::hashRuntime(pEntity->GetClientClass()->GetName()));
if (cfgindex != -1)
{
if (g_Options.models.value->arr[cfgindex].active_scale)
pEntity->GetModelScale() = g_Options.models.value->arr[cfgindex].scale;
if (g_Options.models.value->arr[cfgindex].active_w)
{
char* model = g_Options.models.value->arr[cfgindex].wmodel_repl;
pEntity->SetModelIndex(iff.g_pMdlInfo->GetModelIndex(model));
if (const auto modelprecache = iff.g_pNetworkStringTableContainer->FindTable("modelprecache"))
modelprecache->AddString(false, model);
}
}
}
}
}
ofunc(iff.g_ClientMode, param);
}
VMTHook* VGUISurfHook = nullptr;
void __fastcall hkLockCursor(void* _this)
{
static auto ofunc = VGUISurfHook->GetOriginal<decltype(&hkLockCursor)>(67);
if (opt.show) {
iff.g_pVGuiSurface->UnlockCursor();
iff.g_pInputSystem->ResetInputState();
return;
}
ofunc(iff.g_pVGuiSurface);
}
VMTHook* FileSystemHook = nullptr;
int __stdcall hkGetUnverifiedFileHashes(void* _this, void* someclass, int nMaxFiles)
{
return 0;
}

84
SpyCustom/IAppSystem.h Normal file
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/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

71
SpyCustom/IClientPanel.h Normal file
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

58
SpyCustom/ICollideable.h Normal file
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/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

123
SpyCustom/IEngineSound.h Normal file
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

55
SpyCustom/IEngineVgui.h Normal file
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/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/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/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/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/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/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/IMesh.h Normal file

File diff suppressed because it is too large Load Diff

118
SpyCustom/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/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/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/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

64
SpyCustom/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

82
SpyCustom/InputEnums.h Normal file
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

180
SpyCustom/Interfaces.cpp Normal file
View File

@ -0,0 +1,180 @@
#include "Interfaces.hpp"
#include "PatternScan.hpp"
IF iff;
void* IF::GetInterface(const char* dllname, const char* interfacename)
{
tCreateInterface CreateInterface = (tCreateInterface)GetProcAddress(GetModuleHandleA(dllname), "CreateInterface");
int returnCode = 0;
void* ointerface = CreateInterface(interfacename, &returnCode);
#ifdef DEBUG
printf("%s = %x\n", interfacename, ointerface);
#endif
return ointerface;
}
PVOID FindHudElement(const char* name)
{
void* pointer1 = (void*)(FindPatternV2("client.dll", "B9 ? ? ? ? E8 ? ? ? ? 8B 5D 08") + 1);
static void* pThis = *reinterpret_cast<DWORD**>(pointer1);
void* pointer2 = (void*)(FindPatternV2("client.dll", "55 8B EC 53 8B 5D 08 56 57 8B F9 33 F6 39 77 28"));
static auto find_hud_element
= reinterpret_cast<DWORD(__thiscall*)(void*, const char*)>(
pointer2
);
return (void*)find_hud_element(pThis, name);
}
#define VTBL(classptr) (*(DWORD*)classptr)
#define PVFN_(classptr, offset) (VTBL(classptr) + offset)
#define VFN_(classptr, offset) *(DWORD*)PVFN_(classptr, offset)
#define VFN(classptr, offset) VFN_(classptr, (offset * sizeof(void*)))
void IF::Init()
{
g_pEntityList = (IClientEntityList*)GetInterface("client.dll", "VClientEntityList003");
g_pGameUI = (CGameUI*)GetInterface("client.dll", "GameUI011");
g_pVGuiPanel = (vgui::IPanel*)GetInterface("vgui2.dll", "VGUI_Panel009");
g_pGameEvents = (CGameEventManager*)GetInterface("engine.dll", "GAMEEVENTSMANAGER002");
g_pEngineClient = (IVEngineClient*)GetInterface("engine.dll", "VEngineClient014");
g_pEnginetrace = (IEngineTrace*)GetInterface("engine.dll", "EngineTraceClient004");
g_pEnginevgui = (IEngineVGui*)GetInterface("engine.dll", "VEngineVGui001");
g_pVGui = (vgui::IVGui*)GetInterface("vgui2.dll", "VGUI_ivgui008");
g_pClient = (IBaseClientDLL*)GetInterface("client.dll", "VClient018");
g_pMdlInfo = (IVModelInfoClient*)GetInterface("engine.dll", "VModelInfoClient004");
g_pMdlRender = (IVModelRender*)GetInterface("engine.dll", "VEngineModel016");
g_pMaterialSystem = (IMaterialSystem*)GetInterface("materialsystem.dll", "VMaterialSystem080");
g_pCVar = (ICvar*)GetInterface("vstdlib.dll", "VEngineCvar007");
g_pVGuiSystem = (vgui::ISystem*)GetInterface("vgui2.dll", "VGUI_System010");
g_pVGuiSchemeManager = (vgui::ISchemeManager*)GetInterface("vgui2.dll", "VGUI_Scheme010");
g_pVGuiInput = (vgui::IInput*)GetInterface("vgui2.dll", "VGUI_Input005");
g_pFullFileSystem = (IFileSystem*)GetInterface("filesystem_stdio.dll", "VFileSystem017");
g_pGameConsole = (IGameConsole*)GetInterface("client.dll", "GameConsole004");
g_pEfx = (IVEfx*)GetInterface("engine.dll", "VEngineEffects001");
g_pPhysProps = (IPhysicsSurfaceProps*)GetInterface("vphysics.dll", "VPhysicsSurfaceProps001");
g_pRenderView = (IVRenderView*)GetInterface("engine.dll", "VEngineRenderView014");
g_pDebugOverlay = (IVDebugOverlay*)GetInterface("engine.dll", "VDebugOverlay004");
g_pEffects = (IEffects*)GetInterface("client.dll", "IEffects001");
g_pStudioRender = (IStudioRender*)GetInterface("studiorender.dll", "VStudioRender026");
typedef PVOID(__cdecl* oKeyValuesSystem)();
oKeyValuesSystem pkeyValuesSystem = (oKeyValuesSystem)GetProcAddress(GetModuleHandleA("vstdlib.dll"), "KeyValuesSystem");
keyValuesSystem = (IKeyValuesSystem*)pkeyValuesSystem();
#ifdef DEBUG
printf("KeyValuesSystem = %x\n", keyValuesSystem);
#endif
myConMsg = (CONMSGPROC)GetProcAddress(GetModuleHandleA("tier0.dll"), "?ConMsg@@YAXPBDZZ");
myConColorMsg = (CONCOLORMSGPROC)GetProcAddress(GetModuleHandleA("tier0.dll"), "?ConColorMsg@@YAXABVColor@@PBDZZ");
g_pGlobals = **(CGlobalVarsBase***)(FindPatternV2("client.dll", "A1 ? ? ? ? 5E 8B 40 10") + 1);
g_pInput = *(CInput**)(FindPatternV2("client.dll", "B9 ? ? ? ? F3 0F 11 04 24 FF 50 10") + 1);
g_pViewRenderBeams = *(IViewRenderBeams**)(FindPatternV2("client.dll", "B9 ?? ?? ?? ?? A1 ?? ?? ?? ?? FF 10 A1 ?? ?? ?? ?? B9") + 0x1);
#ifdef DEBUG
printf("g_pGlobals = %x\n", g_pGlobals);
printf("g_pInput = %x\n", g_pInput);
printf("g_pViewRenderBeams = %x\n", g_pViewRenderBeams);
#endif
FX_Tesla = (FX_TeslaFn)FindPatternV2("client.dll", "55 8B EC 81 EC ? ? ? ? 56 57 8B F9 8B 47 18");
#ifdef DEBUG
printf("FX_TeslaFn %x\n", FX_Tesla);
#endif
BloodSprayFn = (FX_BloodSprayFn)FindPatternV2("client.dll", "55 8B EC 8B 4D 08 F3 0F 10 51 ? 8D");
#ifdef DEBUG
printf("FX_BloodSprayFn %x\n", BloodSprayFn);
#endif
DispatchEffect = (FXDispatchEffect)FindPatternV2("client.dll", "55 8B EC 83 E4 F8 83 EC 20 56 57 8B F9 C7 44 24");
#ifdef DEBUG
printf("DispatchEffect %x\n", DispatchEffect);
#endif
g_pChatElement = (CHudChat*)FindHudElement("CHudChat");
#ifdef DEBUG
printf("Chat element %x\n", g_pChatElement);
#endif
LoadFromFile = (void*)FindPatternV2("client.dll", "55 8B EC 83 EC 0C 53 8B 5D 08 56 8B F1 3B");
#ifdef DEBUG
printf("LoadFromFile %x\n", LoadFromFile);
#endif
g_pD3DDevice9 = **(IDirect3DDevice9***)(FindPatternV2("shaderapidx9.dll", "A1 ? ? ? ? 50 8B 08 FF 51 0C") + 1);
#ifdef DEBUG
printf("g_pD3DDevice9 %x\n", g_pD3DDevice9);
#endif
g_pMemAlloc = *(IMemAlloc**)(GetProcAddress(GetModuleHandle("tier0.dll"), "g_pMemAlloc"));
#ifdef DEBUG
printf("g_pMemAlloc %x\n", g_pMemAlloc);
#endif
g_pClientState = **reinterpret_cast<CClientState***>(getvfunc<uintptr_t>(g_pEngineClient, 12) + 0x10);
#ifdef DEBUG
printf("g_pClientState %x\n", g_pClientState);
#endif
CHudElement* g_pHudElement = (CHudElement*)FindHudElement("CCSGO_HudDeathNotice");
#ifdef DEBUG
printf("Hud element %x\n", g_pHudElement);
#endif
auto SteamClient = ((ISteamClient * (__cdecl*)(void))GetProcAddress(GetModuleHandleA("steam_api.dll"), "SteamClient"))();
g_SteamGameCoordinator = (ISteamGameCoordinator*)SteamClient->GetISteamGenericInterface((void*)1, (void*)1, "SteamGameCoordinator001");
g_SteamUser = SteamClient->GetISteamUser((void*)1, (void*)1, "SteamUser019");
#ifdef DEBUG
printf("SteamClient %X\n", SteamClient);
printf("g_SteamGameCoordinator %X\n", g_SteamGameCoordinator);
printf("g_SteamUser %X\n", g_SteamUser);
#endif
g_pClientLeafSystem = (IClientLeafSystem*)GetInterface("client.dll", "ClientLeafSystem002");
#ifdef DEBUG
printf("g_pClientLeafSystem %x\n", g_pClientLeafSystem);
#endif
g_pNetworkStringTableContainer = (INetworkStringTableContainer*)GetInterface("engine.dll", "VEngineClientStringTable001");
#ifdef DEBUG
printf("g_pNetworkStringTableContainer %x\n", g_pNetworkStringTableContainer);
#endif
getPlayerViewmodelArmConfigForPlayerModel = relativeToAbsolute<decltype(getPlayerViewmodelArmConfigForPlayerModel)>(FindPatternV2("client.dll", "E8 ? ? ? ? 89 87 ? ? ? ? 6A") + 1);
g_pMdlCache = (IMDLCache*)GetInterface("datacache.dll", "MDLCache004");
g_pEngineSound = (IEngineSound*)GetInterface("engine.dll", "IEngineSoundClient003");
g_pClientShadowMgr = *(IClientShadowMgr**)(FindPatternV2("client.dll", "A1 ? ? ? ? FF 90 ? ? ? ? 6A 00 6A 00") + 1);
#ifdef DEBUG
printf("g_pClientShadowMgr %x\n", g_pClientShadowMgr);
#endif
g_ViewRender = *(CCSViewRender**)(FindPatternV2("client.dll", "A1 ? ? ? ? B9 ? ? ? ? C7 05 ? ? ? ? ? ? ? ? FF 10") + 1);
#ifdef DEBUG
printf("g_ViewRender %x\n", g_ViewRender);
#endif
g_ClientMode = **(IClientMode***)((*(DWORD**)g_pClient)[10] + 0x5);
#ifdef DEBUG
printf("g_ClientMode %x\n", g_ClientMode);
#endif
g_pInputSystem = (IInputSystem*)GetInterface("inputsystem.dll", "InputSystemVersion001");
g_pVGuiSurface = (vgui::ISurface*)GetInterface("vguimatsurface.dll", "VGUI_Surface031");
prime = (uint8_t*)FindPatternV2("client.dll", "A1 ? ? ? ? 85 C0 75 07 83 F8 05 0F 94 C0 C3");
#ifdef DEBUG
printf("Prime found at %x\n", prime);
#endif
}
auto is_code_ptr(void* ptr) -> bool
{
constexpr const DWORD protect_flags = PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY;
MEMORY_BASIC_INFORMATION out;
VirtualQuery(ptr, &out, sizeof out);
return out.Type
&& !(out.Protect & (PAGE_GUARD | PAGE_NOACCESS))
&& out.Protect & protect_flags;
}

326
SpyCustom/Interfaces.hpp Normal file
View File

@ -0,0 +1,326 @@
#ifndef INTERFACES
#define INTERFACES
#pragma once
#define DEBUG
#define CLIENT_DLL
#include "GetVfunc.hpp"
#include <iostream>
#include <windows.h>
#include "icliententitylist.h"
#include "CGameUI.h"
#include "GameEventManager.h"
#include "cdll_int.h"
#include "ISurface.h"
#include "IEngineVgui.h"
#include "ivmodelinfo.h"
#include "idatacache.h"
#include "ILocalize.h"
#include "IGameUI.h"
#include "dt_recv.h"
#include "client_class.h"
#include "enginetrace.h"
#include "gameconsole.h"
#include "ivrenderview.h"
#include "ivdebugoverlay.h"
#include "vphysics_interface.h"
#include "iefx.h"
#include "c_input.h"
#include "IEffects.h"
#include "iviewrender_beams.h"
#include "sdk_hud_chat.h"
#include "fx.h"
#include "globalvars_base.h"
#include "IInput.h"
#include "icliententity.h"
#include "iclient.h"
#include "cdll_int.h"
#include "baseclientstate.h"
#include "imgui/imgui_impl_dx9.h"
#include "flashlighteffect.h"
#include "inetchannel.h"
#include "steam.h"
#include "animationlayer.h"
#include "clientleafsystem.h"
#include "filesystem.h"
#include "modelloader.h"
#include "IEngineSound.h"
#include "iclientshadowmgr.h"
#include "cs_view_scene.h"
#include "iclientmode.h"
#include "itexture.h"
#include "precipitation_shared.h"
#include "iinputsystem.h"
#include "vpkparser.h"
#include "itempents.h"
#include "c_te_legacytempents.h"
#include "XorStr.hpp"
PVOID FindHudElement(const char* name);
auto is_code_ptr(void* ptr) -> bool;
#include "resource.h"
class IF {
public:
IClientEntityList* g_pEntityList = nullptr;
CGameUI* g_pGameUI = nullptr;
vgui::IPanel* g_pVGuiPanel = nullptr;
CGameEventManager* g_pGameEvents = nullptr;
IVEngineClient* g_pEngineClient = nullptr;
vgui::ISurface* g_pVGuiSurface = nullptr;
IEngineVGui* g_pEnginevgui = nullptr;
vgui::IVGui* g_pVGui = nullptr;
IBaseClientDLL* g_pClient = nullptr;
IVModelInfoClient* g_pMdlInfo = nullptr;
IVModelRender* g_pMdlRender = nullptr;
IMaterialSystem* g_pMaterialSystem = nullptr;
IKeyValuesSystem* keyValuesSystem = nullptr;
ICvar* g_pCVar = nullptr;
vgui::ISystem* g_pVGuiSystem = nullptr;
vgui::ISchemeManager* g_pVGuiSchemeManager = nullptr;
vgui::IInput* g_pVGuiInput = nullptr;
IFileSystem* g_pFullFileSystem = nullptr;
vgui::ILocalize* g_pVGuiLocalize = nullptr;
IEngineTrace* g_pEnginetrace = nullptr;
IVEfx* g_pEfx = nullptr;
IGameConsole* g_pGameConsole = nullptr;
IPhysicsSurfaceProps* g_pPhysProps = nullptr;
IVRenderView* g_pRenderView = nullptr;
IVDebugOverlay* g_pDebugOverlay = nullptr;
CGlobalVarsBase* g_pGlobals = nullptr;
CInput* g_pInput = nullptr;
IEffects* g_pEffects = nullptr;
IViewRenderBeams* g_pViewRenderBeams = nullptr;
IStudioRender* g_pStudioRender = nullptr;
CHudChat* g_pChatElement = nullptr;
using FX_TeslaFn = void(__thiscall*)(CTeslaInfo&);
FX_TeslaFn FX_Tesla = nullptr;
using FX_BloodSprayFn = bool(__cdecl*)(const CEffectData&);
FX_BloodSprayFn BloodSprayFn = nullptr;
using FXDispatchEffect = int(__fastcall*)(const char* name, const CEffectData&);
FXDispatchEffect DispatchEffect = nullptr;
void Init();
void* GetInterface(const char* dllname, const char* interfacename);
typedef void(__cdecl* CONMSGPROC)(const char*, ...);
CONMSGPROC myConMsg = nullptr;
typedef void(__cdecl* CONCOLORMSGPROC)(Color& clr, const char*, ...);
CONCOLORMSGPROC myConColorMsg = nullptr;
PVOID LoadFromFile = nullptr;
IDirect3DDevice9* g_pD3DDevice9 = nullptr;
IMemAlloc* g_pMemAlloc = nullptr;
ISteamGameCoordinator* g_SteamGameCoordinator = nullptr;
ISteamUser* g_SteamUser = nullptr;
CClientState* g_pClientState = nullptr;
CHudElement* g_pHudElement = nullptr;
IClientLeafSystem* g_pClientLeafSystem = nullptr;
INetworkStringTableContainer* g_pNetworkStringTableContainer = nullptr;
std::add_pointer_t<const char** __fastcall(const char* playerModelName)> getPlayerViewmodelArmConfigForPlayerModel;
IMDLCache* g_pMdlCache = nullptr;
IModelLoader* g_ModelLoader = nullptr;
IEngineSound* g_pEngineSound = nullptr;
IClientShadowMgr* g_pClientShadowMgr = nullptr;
CCSViewRender* g_ViewRender = nullptr;
IClientMode* g_ClientMode = nullptr;
CGlobalVarsBase* g_Globals = nullptr;
IInputSystem* g_pInputSystem = nullptr;
ITempEnts* g_pTempEnts = nullptr;
uint8_t* prime;
char oldprime[5];
};
extern IF iff;
typedef void* (__cdecl* tCreateInterface)(const char* name, int* returnCode);
template <typename T>
static constexpr auto relativeToAbsolute(uintptr_t address) noexcept
{
return (T)(address + 4 + *reinterpret_cast<std::int32_t*>(address));
}
namespace vgui {
inline vgui::IInput* input()
{
return iff.g_pVGuiInput;
}
inline vgui::ISchemeManager* scheme()
{
return iff.g_pVGuiSchemeManager;
}
inline vgui::ISurface* surface()
{
return iff.g_pVGuiSurface;
}
inline vgui::ISystem* system()
{
return iff.g_pVGuiSystem;
}
inline vgui::IVGui* ivgui()
{
return iff.g_pVGui;
}
inline vgui::IPanel* ipanel()
{
return iff.g_pVGuiPanel;
}
}
class ICvar2 : public ICvar
{
public:
ConVar* FindVar2(const char* var)
{
printf("Trying to find var %s\n", var);
typedef ConVar* (*oFindVar)(void*, const char*);
return getvfunc<oFindVar>(this, 16)(this, var);
}
template <typename... Values>
void ConsoleColorPrintf2(const Color& MsgColor, const char* szMsgFormat, Values... Parameters)
{
printf("Trying to print %s\n", szMsgFormat);
typedef void(*oConsoleColorPrintf)(void*, const Color&, const char*, ...);
return getvfunc<oConsoleColorPrintf>(this, 25)(this, MsgColor, szMsgFormat, Parameters...);
}
};
struct model_t
{
void* fnHandle;
char szName[260];
__int32 nLoadFlags;
__int32 nServerCount;
__int32 type;
__int32 flags;
Vector vecMins;
Vector vecMaxs;
float radius;
char pad[0x1C];
};
void AngleVectors(const Vector& angles, Vector* forward, Vector* right, Vector* up);
enum ItemDefinitionIndex
{
ITEM_NONE = 0,
WEAPON_DEAGLE = 1,
WEAPON_ELITE = 2,
WEAPON_FIVESEVEN = 3,
WEAPON_GLOCK = 4,
WEAPON_AK47 = 7,
WEAPON_AUG = 8,
WEAPON_AWP = 9,
WEAPON_FAMAS = 10,
WEAPON_G3SG1 = 11,
WEAPON_GALILAR = 13,
WEAPON_M249 = 14,
WEAPON_M4A1 = 16,
WEAPON_MAC10 = 17,
WEAPON_P90 = 19,
WEAPON_UMP45 = 24,
WEAPON_XM1014 = 25,
WEAPON_BIZON = 26,
WEAPON_MAG7 = 27,
WEAPON_NEGEV = 28,
WEAPON_SAWEDOFF = 29,
WEAPON_TEC9 = 30,
WEAPON_TASER = 31,
WEAPON_HKP2000 = 32,
WEAPON_MP7 = 33,
WEAPON_MP9 = 34,
WEAPON_NOVA = 35,
WEAPON_P250 = 36,
WEAPON_SCAR20 = 38,
WEAPON_SG553 = 39,
WEAPON_SSG08 = 40,
WEAPON_KNIFE_GOLD = 41,
WEAPON_KNIFE = 42,
WEAPON_FLASHBANG = 43,
WEAPON_HEGRENADE = 44,
WEAPON_SMOKEGRENADE = 45,
WEAPON_MOLOTOV = 46,
WEAPON_DECOY = 47,
WEAPON_INCGRENADE = 48,
WEAPON_C4 = 49,
WEAPON_KNIFE_T = 59,
WEAPON_M4A1_SILENCER = 60,
WEAPON_USP_SILENCER = 61,
WEAPON_CZ75A = 63,
WEAPON_REVOLVER = 64,
WEAPON_KNIFE_BAYONET = 500,
WEAPON_KNIFE_FLIP = 505,
WEAPON_KNIFE_GUT = 506,
WEAPON_KNIFE_KARAMBIT = 507,
WEAPON_KNIFE_M9_BAYONET = 508,
WEAPON_KNIFE_TACTICAL = 509,
WEAPON_KNIFE_FALCHION = 512,
WEAPON_KNIFE_SURVIVAL_BOWIE = 514,
WEAPON_KNIFE_BUTTERFLY = 515,
WEAPON_KNIFE_PUSH = 516,
GLOVE_STUDDED_BLOODHOUND = 5027,
GLOVE_T_SIDE = 5028,
GLOVE_CT_SIDE = 5029,
GLOVE_SPORTY = 5030,
GLOVE_SLICK = 5031,
GLOVE_LEATHER_WRAP = 5032,
GLOVE_MOTORCYCLE = 5033,
GLOVE_SPECIALIST = 5034,
MAX_ITEMDEFINITIONINDEX
};
static int random(int min, int max) noexcept
{
return rand() % (max - min + 1) + min;
}
enum Sequence
{
SEQUENCE_DEFAULT_DRAW = 0,
SEQUENCE_DEFAULT_IDLE1 = 1,
SEQUENCE_DEFAULT_IDLE2 = 2,
SEQUENCE_DEFAULT_LIGHT_MISS1 = 3,
SEQUENCE_DEFAULT_LIGHT_MISS2 = 4,
SEQUENCE_DEFAULT_HEAVY_MISS1 = 9,
SEQUENCE_DEFAULT_HEAVY_HIT1 = 10,
SEQUENCE_DEFAULT_HEAVY_BACKSTAB = 11,
SEQUENCE_DEFAULT_LOOKAT01 = 12,
SEQUENCE_BUTTERFLY_DRAW = 0,
SEQUENCE_BUTTERFLY_DRAW2 = 1,
SEQUENCE_BUTTERFLY_LOOKAT01 = 13,
SEQUENCE_BUTTERFLY_LOOKAT03 = 15,
SEQUENCE_FALCHION_IDLE1 = 1,
SEQUENCE_FALCHION_HEAVY_MISS1 = 8,
SEQUENCE_FALCHION_HEAVY_MISS1_NOFLIP = 9,
SEQUENCE_FALCHION_LOOKAT01 = 12,
SEQUENCE_FALCHION_LOOKAT02 = 13,
SEQUENCE_DAGGERS_IDLE1 = 1,
SEQUENCE_DAGGERS_LIGHT_MISS1 = 2,
SEQUENCE_DAGGERS_LIGHT_MISS5 = 6,
SEQUENCE_DAGGERS_HEAVY_MISS2 = 11,
SEQUENCE_DAGGERS_HEAVY_MISS1 = 12,
SEQUENCE_BOWIE_IDLE1 = 1,
};
#endif

View File

@ -0,0 +1,319 @@
#ifndef FLASHLIGHTEFFECT_H
#define FLASHLIGHTEFFECT_H
#ifdef _WIN32
#pragma once
#endif
#include "MaterialSystemUtil.h"
class CountdownTimer
{
public:
#ifdef CLIENT_DLL
DECLARE_PREDICTABLE();
#endif
DECLARE_CLASS_NOBASE(CountdownTimer);
DECLARE_EMBEDDED_NETWORKVAR();
CountdownTimer(void);
void Reset(void)
{
m_timestamp = Now() + m_duration;
}
void Start(float duration)
{
m_timestamp = Now() + duration;
m_duration = duration;
}
void StartFromTime(float startTime, float duration)
{
m_timestamp = startTime + duration;
m_duration = duration;
}
void Invalidate(void)
{
m_timestamp = -1.0f;
}
bool HasStarted(void) const
{
return (m_timestamp > 0.0f);
}
bool IsElapsed(void) const
{
return (Now() > m_timestamp);
}
float GetElapsedTime(void) const
{
return Now() - m_timestamp + m_duration;
}
float GetRemainingTime(void) const
{
return (m_timestamp - Now());
}
float GetCountdownDuration(void) const
{
return (m_timestamp > 0.0f) ? m_duration : 0.0f;
}
float GetRemainingRatio(void) const
{
if (HasStarted())
{
float left = GetRemainingTime() / m_duration;
if (left < 0.0f)
return 0.0f;
if (left > 1.0f)
return 1.0f;
return left;
}
return 0.0f;
}
private:
CNetworkVar(float, m_duration);
CNetworkVar(float, m_timestamp);
float Now(void) const;
};
struct dlight_t;
class CFlashlightEffect
{
public:
CFlashlightEffect(int nEntIndex = 0, const char* pszTextureName = NULL, float flFov = 0.0f, float flFarZ = 0.0f, float flLinearAtten = 0.0f);
~CFlashlightEffect();
void UpdateLight(int nEntIdx, const Vector& vecPos, const Vector& vecDir, const Vector& vecRight, const Vector& vecUp, float flFov,
float flFarZ, float flLinearAtten, bool castsShadows, const char* pTextureName);
void UpdateLight(int nEntIdx, const Vector& vecPos, const Vector& vecDir, const Vector& vecRight, const Vector& vecUp, float flFov,
bool castsShadows, ITexture* pFlashlightTexture, const Vector& vecBrightness, bool bTracePlayers = true);
void TurnOn();
void TurnOff();
void SetMuzzleFlashEnabled(bool bEnabled, float flBrightness);
bool IsOn(void) { return m_bIsOn; }
ClientShadowHandle_t GetFlashlightHandle(void) { return m_FlashlightHandle; }
void SetFlashlightHandle(ClientShadowHandle_t Handle) { m_FlashlightHandle = Handle; }
const char* GetFlashlightTextureName(void) const
{
return m_textureName;
}
int GetEntIndex(void) const
{
return m_nEntIndex;
}
bool UpdateDefaultFlashlightState(FlashlightState_t& state, const Vector& vecPos, const Vector& vecDir, const Vector& vecRight,
const Vector& vecUp, bool castsShadows, bool bTracePlayers = true);
bool ComputeLightPosAndOrientation(const Vector& vecPos, const Vector& vecDir, const Vector& vecRight, const Vector& vecUp,
Vector& vecFinalPos, Quaternion& quatOrientation, bool bTracePlayers);
void LightOff();
void UpdateFlashlightTexture(const char* pTextureName);
void UpdateLightTopDown(const Vector& vecPos, const Vector& vecDir, const Vector& vecRight, const Vector& vecUp);
bool m_bIsOn;
int m_nEntIndex;
ClientShadowHandle_t m_FlashlightHandle;
bool m_bMuzzleFlashEnabled;
float m_flMuzzleFlashBrightness;
float m_flFov;
float m_flFarZ;
float m_flLinearAtten;
bool m_bCastsShadows;
float m_flCurrentPullBackDist;
CTextureReference m_FlashlightTexture;
CTextureReference m_MuzzleFlashTexture;
char m_textureName[64];
};
class CHeadlightEffect : public CFlashlightEffect
{
public:
CHeadlightEffect();
~CHeadlightEffect();
virtual void UpdateLight(const Vector& vecPos, const Vector& vecDir, const Vector& vecRight, const Vector& vecUp, int nDistance);
};
class CFlashlightEffectManager
{
private:
CFlashlightEffect* m_pFlashlightEffect;
const char* m_pFlashlightTextureName;
int m_nFlashlightEntIndex;
float m_flFov;
float m_flFarZ;
float m_flLinearAtten;
int m_nMuzzleFlashFrameCountdown;
CountdownTimer m_muzzleFlashTimer;
float m_flMuzzleFlashBrightness;
bool m_bFlashlightOn;
int m_nFXComputeFrame;
bool m_bFlashlightOverride;
public:
CFlashlightEffectManager() : m_pFlashlightEffect(NULL), m_pFlashlightTextureName(NULL), m_nFlashlightEntIndex(-1), m_flFov(0.0f),
m_flFarZ(0.0f), m_flLinearAtten(0.0f), m_nMuzzleFlashFrameCountdown(0), m_flMuzzleFlashBrightness(1.0f),
m_bFlashlightOn(false), m_nFXComputeFrame(-1), m_bFlashlightOverride(false) {}
void TurnOnFlashlight(int nEntIndex = 0, const char* pszTextureName = NULL, float flFov = 0.0f, float flFarZ = 0.0f, float flLinearAtten = 0.0f)
{
m_pFlashlightTextureName = pszTextureName;
m_nFlashlightEntIndex = nEntIndex;
m_flFov = flFov;
m_flFarZ = flFarZ;
m_flLinearAtten = flLinearAtten;
m_bFlashlightOn = true;
if (m_bFlashlightOverride)
{
return;
}
if (!m_pFlashlightEffect)
{
if (pszTextureName)
{
m_pFlashlightEffect = new CFlashlightEffect(m_nFlashlightEntIndex, pszTextureName, flFov, flFarZ, flLinearAtten);
}
else
{
m_pFlashlightEffect = new CFlashlightEffect(m_nFlashlightEntIndex);
}
if (!m_pFlashlightEffect)
{
return;
}
}
m_pFlashlightEffect->TurnOn();
}
void TurnOffFlashlight(bool bForce = false)
{
m_pFlashlightTextureName = NULL;
m_bFlashlightOn = false;
if (bForce)
{
m_bFlashlightOverride = false;
m_nMuzzleFlashFrameCountdown = 0;
m_muzzleFlashTimer.Invalidate();
delete m_pFlashlightEffect;
m_pFlashlightEffect = NULL;
return;
}
if (m_bFlashlightOverride)
{
return;
}
if (m_nMuzzleFlashFrameCountdown == 0 && m_muzzleFlashTimer.IsElapsed())
{
delete m_pFlashlightEffect;
m_pFlashlightEffect = NULL;
}
}
bool IsFlashlightOn() const { return m_bFlashlightOn; }
void UpdateFlashlight(const Vector& vecPos, const Vector& vecDir, const Vector& vecRight, const Vector& vecUp, float flFov, bool castsShadows,
float flFarZ, float flLinearAtten, const char* pTextureName = NULL);
void SetEntityIndex(int index)
{
m_nFlashlightEntIndex = index;
}
void TriggerMuzzleFlash()
{
}
const char* GetFlashlightTextureName(void) const
{
return m_pFlashlightTextureName;
}
int GetFlashlightEntIndex(void) const
{
return m_nFlashlightEntIndex;
}
void EnableFlashlightOverride(bool bEnable)
{
m_bFlashlightOverride = bEnable;
if (!m_bFlashlightOverride)
{
if (m_bFlashlightOn && m_pFlashlightEffect == NULL)
{
TurnOnFlashlight(m_nFlashlightEntIndex, m_pFlashlightTextureName, m_flFov, m_flFarZ, m_flLinearAtten);
}
else if (!m_bFlashlightOn && m_pFlashlightEffect)
{
delete m_pFlashlightEffect;
m_pFlashlightEffect = NULL;
}
}
}
void UpdateFlashlightOverride(bool bFlashlightOn, const Vector& vecPos, const Vector& vecDir, const Vector& vecRight, const Vector& vecUp,
float flFov, bool castsShadows, ITexture* pFlashlightTexture, const Vector& vecBrightness)
{
Assert(m_bFlashlightOverride);
if (!m_bFlashlightOverride)
{
return;
}
if (bFlashlightOn && !m_pFlashlightEffect)
{
m_pFlashlightEffect = new CFlashlightEffect(m_nFlashlightEntIndex);
}
else if (!bFlashlightOn && m_pFlashlightEffect)
{
delete m_pFlashlightEffect;
m_pFlashlightEffect = NULL;
}
if (m_pFlashlightEffect)
{
m_pFlashlightEffect->UpdateLight(m_nFlashlightEntIndex, vecPos, vecDir, vecRight, vecUp, flFov, castsShadows, pFlashlightTexture, vecBrightness, false);
}
}
};
#endif

93
SpyCustom/fltx4.h Normal file
View File

@ -0,0 +1,93 @@
#ifndef FLTX4_H
#define FLTX4_H
#if defined(GNUC)
#define USE_STDC_FOR_SIMD 0
#else
#define USE_STDC_FOR_SIMD 0
#endif
#if (!defined(PLATFORM_PPC) && (USE_STDC_FOR_SIMD == 0))
#define _SSE1 1
#endif
#if USE_STDC_FOR_SIMD
#error "hello"
typedef union
{
float m128_f32[4];
uint32 m128_u32[4];
} fltx4;
typedef fltx4 i32x4;
typedef fltx4 u32x4;
#ifdef _PS3
typedef fltx4 u32x4;
typedef fltx4 i32x4;
#endif
typedef fltx4 bi32x4;
#elif ( defined( _PS3 ) )
typedef union
{
vec_float4 vmxf;
vec_int4 vmxi;
vec_uint4 vmxui;
#if defined(__SPU__)
vec_uint4 vmxbi;
#else
__vector bool vmxbi;
#endif
struct
{
float x;
float y;
float z;
float w;
};
float m128_f32[4];
uint32 m128_u32[4];
int32 m128_i32[4];
} fltx4_union;
typedef vec_float4 fltx4;
typedef vec_uint4 u32x4;
typedef vec_int4 i32x4;
#if defined(__SPU__)
typedef vec_uint4 bi32x4;
#else
typedef __vector bool bi32x4;
#endif
#define DIFFERENT_NATIVE_VECTOR_TYPES
#elif ( defined( _X360 ) )
typedef union
{
__vector4 vmx;
float m128_f32[4];
uint32 m128_u32[4];
} fltx4_union;
typedef __vector4 fltx4;
typedef __vector4 i32x4;
typedef __vector4 u32x4;
typedef fltx4 bi32x4;
#else
typedef __m128 fltx4;
typedef __m128 i32x4;
typedef __m128 u32x4;
typedef __m128i shortx8;
typedef fltx4 bi32x4;
#endif
#endif

798
SpyCustom/functors.h Normal file
View File

@ -0,0 +1,798 @@
#ifndef FUNCTORS_H
#define FUNCTORS_H
#if defined( _WIN32 )
#pragma once
#endif
#include "platform.h"
#include "refcount.h"
#include "utlenvelope.h"
#include <typeinfo>
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_0
#define FUNC_TEMPLATE_ARG_PARAMS_0
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_0
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_0
#define FUNC_ARG_MEMBERS_0
#define FUNC_ARG_FORMAL_PARAMS_0
#define FUNC_PROXY_ARG_FORMAL_PARAMS_0
#define FUNC_CALL_ARGS_INIT_0
#define FUNC_SOLO_CALL_ARGS_INIT_0
#define FUNC_CALL_MEMBER_ARGS_0
#define FUNC_CALL_ARGS_0
#define FUNC_CALL_DATA_ARGS_0( _var )
#define FUNC_FUNCTOR_CALL_ARGS_0
#define FUNC_TEMPLATE_FUNC_PARAMS_0
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_0
#define FUNC_VALIDATION_STRING_0 Q_snprintf( pString, nBufLen, "method( void )" );
#define FUNC_SEPARATOR_0
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_1 typename ARG_TYPE_1
#define FUNC_TEMPLATE_ARG_PARAMS_1 , typename ARG_TYPE_1
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_1 , ARG_TYPE_1
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_1 ARG_TYPE_1
#define FUNC_ARG_MEMBERS_1 ARG_TYPE_1 m_arg1
#define FUNC_ARG_FORMAL_PARAMS_1 , const ARG_TYPE_1 &arg1
#define FUNC_PROXY_ARG_FORMAL_PARAMS_1 const ARG_TYPE_1 &arg1
#define FUNC_CALL_ARGS_INIT_1 , m_arg1( arg1 )
#define FUNC_SOLO_CALL_ARGS_INIT_1 : m_arg1( arg1 )
#define FUNC_CALL_MEMBER_ARGS_1 m_arg1
#define FUNC_CALL_ARGS_1 arg1
#define FUNC_CALL_DATA_ARGS_1( _var ) _var->m_arg1
#define FUNC_FUNCTOR_CALL_ARGS_1 , arg1
#define FUNC_TEMPLATE_FUNC_PARAMS_1 , typename FUNC_ARG_TYPE_1
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_1 FUNC_ARG_TYPE_1
#define FUNC_VALIDATION_STRING_1 Q_snprintf( pString, nBufLen, "method( %s )", typeid( ARG_TYPE_1 ).name() );
#define FUNC_SEPARATOR_1 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_2 typename ARG_TYPE_1, typename ARG_TYPE_2
#define FUNC_TEMPLATE_ARG_PARAMS_2 , typename ARG_TYPE_1, typename ARG_TYPE_2
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_2 , ARG_TYPE_1, ARG_TYPE_2
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_2 ARG_TYPE_1, ARG_TYPE_2
#define FUNC_ARG_MEMBERS_2 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2
#define FUNC_ARG_FORMAL_PARAMS_2 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2
#define FUNC_PROXY_ARG_FORMAL_PARAMS_2 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2
#define FUNC_CALL_ARGS_INIT_2 , m_arg1( arg1 ), m_arg2( arg2 )
#define FUNC_SOLO_CALL_ARGS_INIT_2 : m_arg1( arg1 ), m_arg2( arg2 )
#define FUNC_CALL_MEMBER_ARGS_2 m_arg1, m_arg2
#define FUNC_CALL_ARGS_2 arg1, arg2
#define FUNC_CALL_DATA_ARGS_2( _var ) _var->m_arg1, _var->m_arg2
#define FUNC_FUNCTOR_CALL_ARGS_2 , arg1, arg2
#define FUNC_TEMPLATE_FUNC_PARAMS_2 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_2 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2
#define FUNC_VALIDATION_STRING_2 Q_snprintf( pString, nBufLen, "method( %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name() );
#define FUNC_SEPARATOR_2 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_3 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3
#define FUNC_TEMPLATE_ARG_PARAMS_3 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_3 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_3 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3
#define FUNC_ARG_MEMBERS_3 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3
#define FUNC_ARG_FORMAL_PARAMS_3 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3
#define FUNC_PROXY_ARG_FORMAL_PARAMS_3 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3
#define FUNC_CALL_ARGS_INIT_3 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 )
#define FUNC_SOLO_CALL_ARGS_INIT_3 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 )
#define FUNC_CALL_MEMBER_ARGS_3 m_arg1, m_arg2, m_arg3
#define FUNC_CALL_ARGS_3 arg1, arg2, arg3
#define FUNC_CALL_DATA_ARGS_3( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3
#define FUNC_FUNCTOR_CALL_ARGS_3 , arg1, arg2, arg3
#define FUNC_TEMPLATE_FUNC_PARAMS_3 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_3 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3
#define FUNC_VALIDATION_STRING_3 Q_snprintf( pString, nBufLen, "method( %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name() );
#define FUNC_SEPARATOR_3 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_4 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4
#define FUNC_TEMPLATE_ARG_PARAMS_4 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_4 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_4 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4
#define FUNC_ARG_MEMBERS_4 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3; ARG_TYPE_4 m_arg4
#define FUNC_ARG_FORMAL_PARAMS_4 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4
#define FUNC_PROXY_ARG_FORMAL_PARAMS_4 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4
#define FUNC_CALL_ARGS_INIT_4 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 )
#define FUNC_SOLO_CALL_ARGS_INIT_4 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 )
#define FUNC_CALL_MEMBER_ARGS_4 m_arg1, m_arg2, m_arg3, m_arg4
#define FUNC_CALL_ARGS_4 arg1, arg2, arg3, arg4
#define FUNC_CALL_DATA_ARGS_4( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3, _var->m_arg4
#define FUNC_FUNCTOR_CALL_ARGS_4 , arg1, arg2, arg3, arg4
#define FUNC_TEMPLATE_FUNC_PARAMS_4 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3, typename FUNC_ARG_TYPE_4
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_4 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3, FUNC_ARG_TYPE_4
#define FUNC_VALIDATION_STRING_4 Q_snprintf( pString, nBufLen, "method( %s, %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name(), typeid( ARG_TYPE_4 ).name() );
#define FUNC_SEPARATOR_4 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_5 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5
#define FUNC_TEMPLATE_ARG_PARAMS_5 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_5 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_5 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5
#define FUNC_ARG_MEMBERS_5 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3; ARG_TYPE_4 m_arg4; ARG_TYPE_5 m_arg5
#define FUNC_ARG_FORMAL_PARAMS_5 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5
#define FUNC_PROXY_ARG_FORMAL_PARAMS_5 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5
#define FUNC_CALL_ARGS_INIT_5 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 )
#define FUNC_SOLO_CALL_ARGS_INIT_5 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 )
#define FUNC_CALL_MEMBER_ARGS_5 m_arg1, m_arg2, m_arg3, m_arg4, m_arg5
#define FUNC_CALL_ARGS_5 arg1, arg2, arg3, arg4, arg5
#define FUNC_CALL_DATA_ARGS_5( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3, _var->m_arg4, _var->m_arg5
#define FUNC_FUNCTOR_CALL_ARGS_5 , arg1, arg2, arg3, arg4, arg5
#define FUNC_TEMPLATE_FUNC_PARAMS_5 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3, typename FUNC_ARG_TYPE_4, typename FUNC_ARG_TYPE_5
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_5 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3, FUNC_ARG_TYPE_4, FUNC_ARG_TYPE_5
#define FUNC_VALIDATION_STRING_5 Q_snprintf( pString, nBufLen, "method( %s, %s, %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name(), typeid( ARG_TYPE_4 ).name(), typeid( ARG_TYPE_5 ).name() );
#define FUNC_SEPARATOR_5 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_6 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6
#define FUNC_TEMPLATE_ARG_PARAMS_6 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_6 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_6 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6
#define FUNC_ARG_MEMBERS_6 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3; ARG_TYPE_4 m_arg4; ARG_TYPE_5 m_arg5; ARG_TYPE_6 m_arg6
#define FUNC_ARG_FORMAL_PARAMS_6 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6
#define FUNC_PROXY_ARG_FORMAL_PARAMS_6 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6
#define FUNC_CALL_ARGS_INIT_6 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 )
#define FUNC_SOLO_CALL_ARGS_INIT_6 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 )
#define FUNC_CALL_MEMBER_ARGS_6 m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6
#define FUNC_CALL_ARGS_6 arg1, arg2, arg3, arg4, arg5, arg6
#define FUNC_CALL_DATA_ARGS_6( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3, _var->m_arg4, _var->m_arg5, _var->m_arg6
#define FUNC_FUNCTOR_CALL_ARGS_6 , arg1, arg2, arg3, arg4, arg5, arg6
#define FUNC_TEMPLATE_FUNC_PARAMS_6 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3, typename FUNC_ARG_TYPE_4, typename FUNC_ARG_TYPE_5, typename FUNC_ARG_TYPE_6
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_6 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3, FUNC_ARG_TYPE_4, FUNC_ARG_TYPE_5, FUNC_ARG_TYPE_6
#define FUNC_VALIDATION_STRING_6 Q_snprintf( pString, nBufLen, "method( %s, %s, %s, %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name(), typeid( ARG_TYPE_4 ).name(), typeid( ARG_TYPE_5 ).name(), typeid( ARG_TYPE_6 ).name() );
#define FUNC_SEPARATOR_6 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_7 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7
#define FUNC_TEMPLATE_ARG_PARAMS_7 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_7 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_7 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7
#define FUNC_ARG_MEMBERS_7 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3; ARG_TYPE_4 m_arg4; ARG_TYPE_5 m_arg5; ARG_TYPE_6 m_arg6; ARG_TYPE_7 m_arg7;
#define FUNC_ARG_FORMAL_PARAMS_7 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7
#define FUNC_PROXY_ARG_FORMAL_PARAMS_7 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7
#define FUNC_CALL_ARGS_INIT_7 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 )
#define FUNC_SOLO_CALL_ARGS_INIT_7 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 )
#define FUNC_CALL_MEMBER_ARGS_7 m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7
#define FUNC_CALL_ARGS_7 arg1, arg2, arg3, arg4, arg5, arg6, arg7
#define FUNC_CALL_DATA_ARGS_7( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3, _var->m_arg4, _var->m_arg5, _var->m_arg6, _var->m_arg7
#define FUNC_FUNCTOR_CALL_ARGS_7 , arg1, arg2, arg3, arg4, arg5, arg6, arg7
#define FUNC_TEMPLATE_FUNC_PARAMS_7 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3, typename FUNC_ARG_TYPE_4, typename FUNC_ARG_TYPE_5, typename FUNC_ARG_TYPE_6, typename FUNC_ARG_TYPE_7
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_7 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3, FUNC_ARG_TYPE_4, FUNC_ARG_TYPE_5, FUNC_ARG_TYPE_6, FUNC_ARG_TYPE_7
#define FUNC_VALIDATION_STRING_7 Q_snprintf( pString, nBufLen, "method( %s, %s, %s, %s, %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name(), typeid( ARG_TYPE_4 ).name(), typeid( ARG_TYPE_5 ).name(), typeid( ARG_TYPE_6 ).name(), typeid( ARG_TYPE_7 ).name() );
#define FUNC_SEPARATOR_7 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_8 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8
#define FUNC_TEMPLATE_ARG_PARAMS_8 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_8 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_8 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8
#define FUNC_ARG_MEMBERS_8 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3; ARG_TYPE_4 m_arg4; ARG_TYPE_5 m_arg5; ARG_TYPE_6 m_arg6; ARG_TYPE_7 m_arg7; ARG_TYPE_8 m_arg8;
#define FUNC_ARG_FORMAL_PARAMS_8 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8
#define FUNC_PROXY_ARG_FORMAL_PARAMS_8 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8
#define FUNC_CALL_ARGS_INIT_8 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 )
#define FUNC_SOLO_CALL_ARGS_INIT_8 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 )
#define FUNC_CALL_MEMBER_ARGS_8 m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8
#define FUNC_CALL_ARGS_8 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8
#define FUNC_CALL_DATA_ARGS_8( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3, _var->m_arg4, _var->m_arg5, _var->m_arg6, _var->m_arg7, _var->m_arg8
#define FUNC_FUNCTOR_CALL_ARGS_8 , arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8
#define FUNC_TEMPLATE_FUNC_PARAMS_8 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3, typename FUNC_ARG_TYPE_4, typename FUNC_ARG_TYPE_5, typename FUNC_ARG_TYPE_6, typename FUNC_ARG_TYPE_7, typename FUNC_ARG_TYPE_8
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_8 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3, FUNC_ARG_TYPE_4, FUNC_ARG_TYPE_5, FUNC_ARG_TYPE_6, FUNC_ARG_TYPE_7, FUNC_ARG_TYPE_8
#define FUNC_VALIDATION_STRING_8 Q_snprintf( pString, nBufLen, "method( %s, %s, %s, %s, %s, %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name(), typeid( ARG_TYPE_4 ).name(), typeid( ARG_TYPE_5 ).name(), typeid( ARG_TYPE_6 ).name(), typeid( ARG_TYPE_7 ).name(), typeid( ARG_TYPE_8 ).name() );
#define FUNC_SEPARATOR_8 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_9 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9
#define FUNC_TEMPLATE_ARG_PARAMS_9 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_9 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_9 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9
#define FUNC_ARG_MEMBERS_9 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3; ARG_TYPE_4 m_arg4; ARG_TYPE_5 m_arg5; ARG_TYPE_6 m_arg6; ARG_TYPE_7 m_arg7; ARG_TYPE_8 m_arg8; ARG_TYPE_9 m_arg9;
#define FUNC_ARG_FORMAL_PARAMS_9 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9
#define FUNC_PROXY_ARG_FORMAL_PARAMS_9 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9
#define FUNC_CALL_ARGS_INIT_9 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 )
#define FUNC_SOLO_CALL_ARGS_INIT_9 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 )
#define FUNC_CALL_MEMBER_ARGS_9 m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8, m_arg9
#define FUNC_CALL_ARGS_9 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
#define FUNC_CALL_DATA_ARGS_9( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3, _var->m_arg4, _var->m_arg5, _var->m_arg6, _var->m_arg7, _var->m_arg8, _var->m_arg9
#define FUNC_FUNCTOR_CALL_ARGS_9 , arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
#define FUNC_TEMPLATE_FUNC_PARAMS_9 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3, typename FUNC_ARG_TYPE_4, typename FUNC_ARG_TYPE_5, typename FUNC_ARG_TYPE_6, typename FUNC_ARG_TYPE_7, typename FUNC_ARG_TYPE_8, typename FUNC_ARG_TYPE_9
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_9 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3, FUNC_ARG_TYPE_4, FUNC_ARG_TYPE_5, FUNC_ARG_TYPE_6, FUNC_ARG_TYPE_7, FUNC_ARG_TYPE_8, FUNC_ARG_TYPE_9
#define FUNC_VALIDATION_STRING_9 Q_snprintf( pString, nBufLen, "method( %s, %s, %s, %s, %s, %s, %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name(), typeid( ARG_TYPE_4 ).name(), typeid( ARG_TYPE_5 ).name(), typeid( ARG_TYPE_6 ).name(), typeid( ARG_TYPE_7 ).name(), typeid( ARG_TYPE_8 ).name(), typeid( ARG_TYPE_9 ).name() );
#define FUNC_SEPARATOR_9 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_10 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9, typename ARG_TYPE_10
#define FUNC_TEMPLATE_ARG_PARAMS_10 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9, typename ARG_TYPE_10
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_10 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9, ARG_TYPE_10
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_10 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9, ARG_TYPE_10
#define FUNC_ARG_MEMBERS_10 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3; ARG_TYPE_4 m_arg4; ARG_TYPE_5 m_arg5; ARG_TYPE_6 m_arg6; ARG_TYPE_7 m_arg7; ARG_TYPE_8 m_arg8; ARG_TYPE_9 m_arg9; ARG_TYPE_10 m_arg10;
#define FUNC_ARG_FORMAL_PARAMS_10 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9, const ARG_TYPE_10 &arg10
#define FUNC_PROXY_ARG_FORMAL_PARAMS_10 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9, const ARG_TYPE_10 &arg10
#define FUNC_CALL_ARGS_INIT_10 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 ), m_arg10( arg10 )
#define FUNC_SOLO_CALL_ARGS_INIT_10 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 ), m_arg10( arg10 )
#define FUNC_CALL_MEMBER_ARGS_10 m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8, m_arg9, m_arg10
#define FUNC_CALL_ARGS_10 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10
#define FUNC_CALL_DATA_ARGS_10( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3, _var->m_arg4, _var->m_arg5, _var->m_arg6, _var->m_arg7, _var->m_arg8, _var->m_arg9, _var->m_arg10
#define FUNC_FUNCTOR_CALL_ARGS_10 , arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10
#define FUNC_TEMPLATE_FUNC_PARAMS_10 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3, typename FUNC_ARG_TYPE_4, typename FUNC_ARG_TYPE_5, typename FUNC_ARG_TYPE_6, typename FUNC_ARG_TYPE_7, typename FUNC_ARG_TYPE_8, typename FUNC_ARG_TYPE_9, typename FUNC_ARG_TYPE_10
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_10 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3, FUNC_ARG_TYPE_4, FUNC_ARG_TYPE_5, FUNC_ARG_TYPE_6, FUNC_ARG_TYPE_7, FUNC_ARG_TYPE_8, FUNC_ARG_TYPE_9, FUNC_ARG_TYPE_10
#define FUNC_VALIDATION_STRING_10 Q_snprintf( pString, nBufLen, "method( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name(), typeid( ARG_TYPE_4 ).name(), typeid( ARG_TYPE_5 ).name(), typeid( ARG_TYPE_6 ).name(), typeid( ARG_TYPE_7 ).name(), typeid( ARG_TYPE_8 ).name(), typeid( ARG_TYPE_9 ).name(), typeid( ARG_TYPE_10 ).name() );
#define FUNC_SEPARATOR_10 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_11 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9, typename ARG_TYPE_10, typename ARG_TYPE_11
#define FUNC_TEMPLATE_ARG_PARAMS_11 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9, typename ARG_TYPE_10, typename ARG_TYPE_11
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_11 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9, ARG_TYPE_10, ARG_TYPE_11
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_11 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9, ARG_TYPE_10, ARG_TYPE_11
#define FUNC_ARG_MEMBERS_11 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3; ARG_TYPE_4 m_arg4; ARG_TYPE_5 m_arg5; ARG_TYPE_6 m_arg6; ARG_TYPE_7 m_arg7; ARG_TYPE_8 m_arg8; ARG_TYPE_9 m_arg9; ARG_TYPE_10 m_arg10; ARG_TYPE_11 m_arg11
#define FUNC_ARG_FORMAL_PARAMS_11 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9, const ARG_TYPE_10 &arg10, const ARG_TYPE_11 &arg11
#define FUNC_PROXY_ARG_FORMAL_PARAMS_11 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9, const ARG_TYPE_10 &arg10, const ARG_TYPE_11 &arg11
#define FUNC_CALL_ARGS_INIT_11 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 ), m_arg10( arg10 ), m_arg11( arg11 )
#define FUNC_SOLO_CALL_ARGS_INIT_11 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 ), m_arg10( arg10 ), m_arg11( arg11 )
#define FUNC_CALL_MEMBER_ARGS_11 m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8, m_arg9, m_arg10, m_arg11
#define FUNC_CALL_ARGS_11 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11
#define FUNC_CALL_DATA_ARGS_11( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3, _var->m_arg4, _var->m_arg5, _var->m_arg6, _var->m_arg7, _var->m_arg8, _var->m_arg9, _var->m_arg10, _var->m_arg11
#define FUNC_FUNCTOR_CALL_ARGS_11 , arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11
#define FUNC_TEMPLATE_FUNC_PARAMS_11 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3, typename FUNC_ARG_TYPE_4, typename FUNC_ARG_TYPE_5, typename FUNC_ARG_TYPE_6, typename FUNC_ARG_TYPE_7, typename FUNC_ARG_TYPE_8, typename FUNC_ARG_TYPE_9, typename FUNC_ARG_TYPE_10, typename FUNC_ARG_TYPE_11
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_11 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3, FUNC_ARG_TYPE_4, FUNC_ARG_TYPE_5, FUNC_ARG_TYPE_6, FUNC_ARG_TYPE_7, FUNC_ARG_TYPE_8, FUNC_ARG_TYPE_9, FUNC_ARG_TYPE_10, FUNC_ARG_TYPE_11
#define FUNC_VALIDATION_STRING_11 Q_snprintf( pString, nBufLen, "method( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name(), typeid( ARG_TYPE_4 ).name(), typeid( ARG_TYPE_5 ).name(), typeid( ARG_TYPE_6 ).name(), typeid( ARG_TYPE_7 ).name(), typeid( ARG_TYPE_8 ).name(), typeid( ARG_TYPE_9 ).name(), typeid( ARG_TYPE_10 ).name(), typeid( ARG_TYPE_11 ).name() );
#define FUNC_SEPARATOR_11 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_12 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9, typename ARG_TYPE_10, typename ARG_TYPE_11, typename ARG_TYPE_12
#define FUNC_TEMPLATE_ARG_PARAMS_12 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9, typename ARG_TYPE_10, typename ARG_TYPE_11, typename ARG_TYPE_12
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_12 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9, ARG_TYPE_10, ARG_TYPE_11, ARG_TYPE_12
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_12 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9, ARG_TYPE_10, ARG_TYPE_11, ARG_TYPE_12
#define FUNC_ARG_MEMBERS_12 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3; ARG_TYPE_4 m_arg4; ARG_TYPE_5 m_arg5; ARG_TYPE_6 m_arg6; ARG_TYPE_7 m_arg7; ARG_TYPE_8 m_arg8; ARG_TYPE_9 m_arg9; ARG_TYPE_10 m_arg10; ARG_TYPE_11 m_arg11; ARG_TYPE_12 m_arg12
#define FUNC_ARG_FORMAL_PARAMS_12 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9, const ARG_TYPE_10 &arg10, const ARG_TYPE_11 &arg11, const ARG_TYPE_12 &arg12
#define FUNC_PROXY_ARG_FORMAL_PARAMS_12 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9, const ARG_TYPE_10 &arg10, const ARG_TYPE_11 &arg11, const ARG_TYPE_12 &arg12
#define FUNC_CALL_ARGS_INIT_12 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 ), m_arg10( arg10 ), m_arg11( arg11 ), m_arg12( arg12 )
#define FUNC_SOLO_CALL_ARGS_INIT_12 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 ), m_arg10( arg10 ), m_arg11( arg11 ), m_arg12( arg12 )
#define FUNC_CALL_MEMBER_ARGS_12 m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8, m_arg9, m_arg10, m_arg11, m_arg12
#define FUNC_CALL_ARGS_12 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12
#define FUNC_CALL_DATA_ARGS_12( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3, _var->m_arg4, _var->m_arg5, _var->m_arg6, _var->m_arg7, _var->m_arg8, _var->m_arg9, _var->m_arg10, _var->m_arg11, _var->m_arg12
#define FUNC_FUNCTOR_CALL_ARGS_12 , arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12
#define FUNC_TEMPLATE_FUNC_PARAMS_12 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3, typename FUNC_ARG_TYPE_4, typename FUNC_ARG_TYPE_5, typename FUNC_ARG_TYPE_6, typename FUNC_ARG_TYPE_7, typename FUNC_ARG_TYPE_8, typename FUNC_ARG_TYPE_9, typename FUNC_ARG_TYPE_10, typename FUNC_ARG_TYPE_11, typename FUNC_ARG_TYPE_12
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_12 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3, FUNC_ARG_TYPE_4, FUNC_ARG_TYPE_5, FUNC_ARG_TYPE_6, FUNC_ARG_TYPE_7, FUNC_ARG_TYPE_8, FUNC_ARG_TYPE_9, FUNC_ARG_TYPE_10, FUNC_ARG_TYPE_11, FUNC_ARG_TYPE_12
#define FUNC_VALIDATION_STRING_12 Q_snprintf( pString, nBufLen, "method( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name(), typeid( ARG_TYPE_4 ).name(), typeid( ARG_TYPE_5 ).name(), typeid( ARG_TYPE_6 ).name(), typeid( ARG_TYPE_7 ).name(), typeid( ARG_TYPE_8 ).name(), typeid( ARG_TYPE_9 ).name(), typeid( ARG_TYPE_10 ).name(), typeid( ARG_TYPE_11 ).name(), typeid( ARG_TYPE_12 ).name() );
#define FUNC_SEPARATOR_12 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_13 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9, typename ARG_TYPE_10, typename ARG_TYPE_11, typename ARG_TYPE_12, typename ARG_TYPE_13
#define FUNC_TEMPLATE_ARG_PARAMS_13 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9, typename ARG_TYPE_10, typename ARG_TYPE_11, typename ARG_TYPE_12, typename ARG_TYPE_13
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_13 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9, ARG_TYPE_10, ARG_TYPE_11, ARG_TYPE_12, ARG_TYPE_13
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_13 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9, ARG_TYPE_10, ARG_TYPE_11, ARG_TYPE_12, ARG_TYPE_13
#define FUNC_ARG_MEMBERS_13 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3; ARG_TYPE_4 m_arg4; ARG_TYPE_5 m_arg5; ARG_TYPE_6 m_arg6; ARG_TYPE_7 m_arg7; ARG_TYPE_8 m_arg8; ARG_TYPE_9 m_arg9; ARG_TYPE_10 m_arg10; ARG_TYPE_11 m_arg11; ARG_TYPE_12 m_arg12; ARG_TYPE_13 m_arg13
#define FUNC_ARG_FORMAL_PARAMS_13 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9, const ARG_TYPE_10 &arg10, const ARG_TYPE_11 &arg11, const ARG_TYPE_12 &arg12, const ARG_TYPE_13 &arg13
#define FUNC_PROXY_ARG_FORMAL_PARAMS_13 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9, const ARG_TYPE_10 &arg10, const ARG_TYPE_11 &arg11, const ARG_TYPE_12 &arg12, const ARG_TYPE_13 &arg13
#define FUNC_CALL_ARGS_INIT_13 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 ), m_arg10( arg10 ), m_arg11( arg11 ), m_arg12( arg12 ), m_arg13( arg13 )
#define FUNC_SOLO_CALL_ARGS_INIT_13 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 ), m_arg10( arg10 ), m_arg11( arg11 ), m_arg12( arg12 ), m_arg13( arg13 )
#define FUNC_CALL_MEMBER_ARGS_13 m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8, m_arg9, m_arg10, m_arg11, m_arg12, m_arg13
#define FUNC_CALL_ARGS_13 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13
#define FUNC_CALL_DATA_ARGS_13( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3, _var->m_arg4, _var->m_arg5, _var->m_arg6, _var->m_arg7, _var->m_arg8, _var->m_arg9, _var->m_arg10, _var->m_arg11, _var->m_arg12, _var->m_arg13
#define FUNC_FUNCTOR_CALL_ARGS_13 , arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13
#define FUNC_TEMPLATE_FUNC_PARAMS_13 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3, typename FUNC_ARG_TYPE_4, typename FUNC_ARG_TYPE_5, typename FUNC_ARG_TYPE_6, typename FUNC_ARG_TYPE_7, typename FUNC_ARG_TYPE_8, typename FUNC_ARG_TYPE_9, typename FUNC_ARG_TYPE_10, typename FUNC_ARG_TYPE_11, typename FUNC_ARG_TYPE_12, typename FUNC_ARG_TYPE_13
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_13 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3, FUNC_ARG_TYPE_4, FUNC_ARG_TYPE_5, FUNC_ARG_TYPE_6, FUNC_ARG_TYPE_7, FUNC_ARG_TYPE_8, FUNC_ARG_TYPE_9, FUNC_ARG_TYPE_10, FUNC_ARG_TYPE_11, FUNC_ARG_TYPE_12, FUNC_ARG_TYPE_13
#define FUNC_VALIDATION_STRING_13 Q_snprintf( pString, nBufLen, "method( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name(), typeid( ARG_TYPE_4 ).name(), typeid( ARG_TYPE_5 ).name(), typeid( ARG_TYPE_6 ).name(), typeid( ARG_TYPE_7 ).name(), typeid( ARG_TYPE_8 ).name(), typeid( ARG_TYPE_9 ).name(), typeid( ARG_TYPE_10 ).name(), typeid( ARG_TYPE_11 ).name(), typeid( ARG_TYPE_12 ).name(), typeid( ARG_TYPE_13 ).name() );
#define FUNC_SEPARATOR_13 ,
#define FUNC_SOLO_TEMPLATE_ARG_PARAMS_14 typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9, typename ARG_TYPE_10, typename ARG_TYPE_11, typename ARG_TYPE_12, typename ARG_TYPE_13, typename ARG_TYPE_14
#define FUNC_TEMPLATE_ARG_PARAMS_14 , typename ARG_TYPE_1, typename ARG_TYPE_2, typename ARG_TYPE_3, typename ARG_TYPE_4, typename ARG_TYPE_5, typename ARG_TYPE_6, typename ARG_TYPE_7, typename ARG_TYPE_8, typename ARG_TYPE_9, typename ARG_TYPE_10, typename ARG_TYPE_11, typename ARG_TYPE_12, typename ARG_TYPE_13, typename ARG_TYPE_14
#define FUNC_BASE_TEMPLATE_ARG_PARAMS_14 , ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9, ARG_TYPE_10, ARG_TYPE_11, ARG_TYPE_12, ARG_TYPE_13, ARG_TYPE_14
#define FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_14 ARG_TYPE_1, ARG_TYPE_2, ARG_TYPE_3, ARG_TYPE_4, ARG_TYPE_5, ARG_TYPE_6, ARG_TYPE_7, ARG_TYPE_8, ARG_TYPE_9, ARG_TYPE_10, ARG_TYPE_11, ARG_TYPE_12, ARG_TYPE_13, ARG_TYPE_14
#define FUNC_ARG_MEMBERS_14 ARG_TYPE_1 m_arg1; ARG_TYPE_2 m_arg2; ARG_TYPE_3 m_arg3; ARG_TYPE_4 m_arg4; ARG_TYPE_5 m_arg5; ARG_TYPE_6 m_arg6; ARG_TYPE_7 m_arg7; ARG_TYPE_8 m_arg8; ARG_TYPE_9 m_arg9; ARG_TYPE_10 m_arg10; ARG_TYPE_11 m_arg11; ARG_TYPE_12 m_arg12; ARG_TYPE_13 m_arg13; ARG_TYPE_14 m_arg14
#define FUNC_ARG_FORMAL_PARAMS_14 , const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9, const ARG_TYPE_10 &arg10, const ARG_TYPE_11 &arg11, const ARG_TYPE_12 &arg12, const ARG_TYPE_13 &arg13, const ARG_TYPE_14 &arg14
#define FUNC_PROXY_ARG_FORMAL_PARAMS_14 const ARG_TYPE_1 &arg1, const ARG_TYPE_2 &arg2, const ARG_TYPE_3 &arg3, const ARG_TYPE_4 &arg4, const ARG_TYPE_5 &arg5, const ARG_TYPE_6 &arg6, const ARG_TYPE_7 &arg7, const ARG_TYPE_8 &arg8, const ARG_TYPE_9 &arg9, const ARG_TYPE_10 &arg10, const ARG_TYPE_11 &arg11, const ARG_TYPE_12 &arg12, const ARG_TYPE_13 &arg13, const ARG_TYPE_14 &arg14
#define FUNC_CALL_ARGS_INIT_14 , m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 ), m_arg10( arg10 ), m_arg11( arg11 ), m_arg12( arg12 ), m_arg13( arg13 ), m_arg14( arg14 )
#define FUNC_SOLO_CALL_ARGS_INIT_14 : m_arg1( arg1 ), m_arg2( arg2 ), m_arg3( arg3 ), m_arg4( arg4 ), m_arg5( arg5 ), m_arg6( arg6 ), m_arg7( arg7 ), m_arg8( arg8 ), m_arg9( arg9 ), m_arg10( arg10 ), m_arg11( arg11 ), m_arg12( arg12 ), m_arg13( arg13 ), m_arg14( arg14 )
#define FUNC_CALL_MEMBER_ARGS_14 m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7, m_arg8, m_arg9, m_arg10, m_arg11, m_arg12, m_arg13, m_arg14
#define FUNC_CALL_ARGS_14 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14
#define FUNC_CALL_DATA_ARGS_14( _var ) _var->m_arg1, _var->m_arg2, _var->m_arg3, _var->m_arg4, _var->m_arg5, _var->m_arg6, _var->m_arg7, _var->m_arg8, _var->m_arg9, _var->m_arg10, _var->m_arg11, _var->m_arg12, _var->m_arg13, _var->m_arg14
#define FUNC_FUNCTOR_CALL_ARGS_14 , arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14
#define FUNC_TEMPLATE_FUNC_PARAMS_14 , typename FUNC_ARG_TYPE_1, typename FUNC_ARG_TYPE_2, typename FUNC_ARG_TYPE_3, typename FUNC_ARG_TYPE_4, typename FUNC_ARG_TYPE_5, typename FUNC_ARG_TYPE_6, typename FUNC_ARG_TYPE_7, typename FUNC_ARG_TYPE_8, typename FUNC_ARG_TYPE_9, typename FUNC_ARG_TYPE_10, typename FUNC_ARG_TYPE_11, typename FUNC_ARG_TYPE_12, typename FUNC_ARG_TYPE_13, typename FUNC_ARG_TYPE_14
#define FUNC_BASE_TEMPLATE_FUNC_PARAMS_14 FUNC_ARG_TYPE_1, FUNC_ARG_TYPE_2, FUNC_ARG_TYPE_3, FUNC_ARG_TYPE_4, FUNC_ARG_TYPE_5, FUNC_ARG_TYPE_6, FUNC_ARG_TYPE_7, FUNC_ARG_TYPE_8, FUNC_ARG_TYPE_9, FUNC_ARG_TYPE_10, FUNC_ARG_TYPE_11, FUNC_ARG_TYPE_12, FUNC_ARG_TYPE_13, FUNC_ARG_TYPE_14
#define FUNC_VALIDATION_STRING_14 Q_snprintf( pString, nBufLen, "method( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )", typeid( ARG_TYPE_1 ).name(), typeid( ARG_TYPE_2 ).name(), typeid( ARG_TYPE_3 ).name(), typeid( ARG_TYPE_4 ).name(), typeid( ARG_TYPE_5 ).name(), typeid( ARG_TYPE_6 ).name(), typeid( ARG_TYPE_7 ).name(), typeid( ARG_TYPE_8 ).name(), typeid( ARG_TYPE_9 ).name(), typeid( ARG_TYPE_10 ).name(), typeid( ARG_TYPE_11 ).name(), typeid( ARG_TYPE_12 ).name(), typeid( ARG_TYPE_13 ).name(), typeid( ARG_TYPE_14 ).name() );
#define FUNC_SEPARATOR_14 ,
#define FUNC_GENERATE_ALL_BUT0( INNERMACRONAME ) \
INNERMACRONAME(1); \
INNERMACRONAME(2); \
INNERMACRONAME(3); \
INNERMACRONAME(4); \
INNERMACRONAME(5); \
INNERMACRONAME(6); \
INNERMACRONAME(7); \
INNERMACRONAME(8); \
INNERMACRONAME(9); \
INNERMACRONAME(10);\
INNERMACRONAME(11);\
INNERMACRONAME(12);\
INNERMACRONAME(13);\
INNERMACRONAME(14)
#define FUNC_GENERATE_ALL( INNERMACRONAME ) \
INNERMACRONAME(0); \
FUNC_GENERATE_ALL_BUT0( INNERMACRONAME )
abstract_class CFunctor : public IRefCounted
{
public:
CFunctor()
{
#ifdef DEBUG
m_nUserID = 0;
#endif
}
virtual ~CFunctor() {}
virtual void operator()() = 0;
unsigned m_nUserID;
};
abstract_class CFunctorData : public IRefCounted
{
public:
virtual void ComputeValidationString(char* pString, size_t nBufLen) const = 0;
};
abstract_class CFunctorCallback : public IRefCounted
{
public:
virtual bool IsEqual(CFunctorCallback * pSrc) const = 0;
virtual void operator()(CFunctorData* pData) = 0;
virtual void ComputeValidationString(char* pString, size_t nBufLen) const = 0;
virtual const char* GetImplClassName() const = 0;
virtual const void* GetTarget() const = 0;
};
template <typename T>
inline T RefToVal(const T& item)
{
return item;
}
template <typename T>
class CLateBoundPtr
{
public:
CLateBoundPtr(T** ppObject)
: m_ppObject(ppObject)
{
}
T* operator->() { return *m_ppObject; }
T& operator *() { return **m_ppObject; }
operator T* () const { return (T*)(*m_ppObject); }
operator void* () { return *m_ppObject; }
private:
T** m_ppObject;
};
class CFuncMemPolicyNone
{
public:
static void OnAcquire(void* pObject) {}
static void OnRelease(void* pObject) {}
};
template <class OBJECT_TYPE_PTR = IRefCounted*>
class CFuncMemPolicyRefCount
{
public:
static void OnAcquire(OBJECT_TYPE_PTR pObject) { pObject->AddRef(); }
static void OnRelease(OBJECT_TYPE_PTR pObject) { pObject->Release(); }
};
template <class OBJECT_TYPE_PTR, typename FUNCTION_TYPE, class MEM_POLICY = CFuncMemPolicyNone >
class CMemberFuncProxyBase
{
public:
bool operator==(const CMemberFuncProxyBase& src) const
{
return m_pfnProxied == src.m_pfnProxied && m_pObject == src.m_pObject;
}
const void* GetTarget() const
{
return m_pObject;
}
protected:
CMemberFuncProxyBase(OBJECT_TYPE_PTR pObject, FUNCTION_TYPE pfnProxied)
: m_pObject(pObject),
m_pfnProxied(pfnProxied)
{
MEM_POLICY::OnAcquire(m_pObject);
}
~CMemberFuncProxyBase()
{
MEM_POLICY::OnRelease(m_pObject);
}
void Set(OBJECT_TYPE_PTR pObject, FUNCTION_TYPE pfnProxied)
{
m_pfnProxied = pfnProxied;
m_pObject = pObject;
}
void OnCall()
{
Assert((void*)m_pObject != NULL);
}
FUNCTION_TYPE m_pfnProxied;
OBJECT_TYPE_PTR m_pObject;
};
#define DEFINE_MEMBER_FUNC_PROXY( N ) \
template <class OBJECT_TYPE_PTR, typename FUNCTION_TYPE FUNC_TEMPLATE_ARG_PARAMS_##N, class MEM_POLICY = CFuncMemPolicyNone> \
class CMemberFuncProxy##N : public CMemberFuncProxyBase<OBJECT_TYPE_PTR, FUNCTION_TYPE, MEM_POLICY> \
{ \
public: \
CMemberFuncProxy##N( OBJECT_TYPE_PTR pObject = NULL, FUNCTION_TYPE pfnProxied = NULL ) \
: CMemberFuncProxyBase<OBJECT_TYPE_PTR, FUNCTION_TYPE, MEM_POLICY >( pObject, pfnProxied ) \
{ \
} \
\
void operator()( FUNC_PROXY_ARG_FORMAL_PARAMS_##N ) \
{ \
this->OnCall(); \
((*this->m_pObject).*this->m_pfnProxied)( FUNC_CALL_ARGS_##N ); \
} \
}
FUNC_GENERATE_ALL(DEFINE_MEMBER_FUNC_PROXY);
#include "memdbgon.h"
typedef CRefCounted1<CFunctor, CRefCountServiceMT> CFunctorBase;
#define DEFINE_FUNCTOR_TEMPLATE(N) \
template <typename FUNC_TYPE FUNC_TEMPLATE_ARG_PARAMS_##N, class FUNCTOR_BASE = CFunctorBase> \
class CFunctor##N : public CFunctorBase \
{ \
public: \
CFunctor##N( FUNC_TYPE pfnProxied FUNC_ARG_FORMAL_PARAMS_##N ) : m_pfnProxied( pfnProxied ) FUNC_CALL_ARGS_INIT_##N {} \
void operator()() { m_pfnProxied(FUNC_CALL_MEMBER_ARGS_##N); } \
\
private: \
FUNC_TYPE m_pfnProxied; \
FUNC_ARG_MEMBERS_##N; \
}
FUNC_GENERATE_ALL(DEFINE_FUNCTOR_TEMPLATE);
#define DEFINE_MEMBER_FUNCTOR( N ) \
template <class OBJECT_TYPE_PTR, typename FUNCTION_TYPE FUNC_TEMPLATE_ARG_PARAMS_##N, class FUNCTOR_BASE = CFunctorBase, class MEM_POLICY = CFuncMemPolicyNone> \
class CMemberFunctor##N : public FUNCTOR_BASE \
{ \
public: \
CMemberFunctor##N( OBJECT_TYPE_PTR pObject, FUNCTION_TYPE pfnProxied FUNC_ARG_FORMAL_PARAMS_##N ) : m_Proxy( pObject, pfnProxied ) FUNC_CALL_ARGS_INIT_##N {} \
void operator()() { m_Proxy(FUNC_CALL_MEMBER_ARGS_##N); } \
\
private: \
CMemberFuncProxy##N<OBJECT_TYPE_PTR, FUNCTION_TYPE FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, MEM_POLICY> m_Proxy; \
FUNC_ARG_MEMBERS_##N; \
};
FUNC_GENERATE_ALL(DEFINE_MEMBER_FUNCTOR);
typedef CRefCounted1<CFunctorData, CRefCountServiceMT> CFunctorDataBase;
class CFunctorCallbackBase : public CRefCounted1<CFunctorCallback, CRefCountServiceMT>
{
protected:
virtual void ValidateFunctorData(CFunctorData* pData)
{
#ifdef _DEBUG
char pDataString[1024];
char pCallbackString[1024];
ComputeValidationString(pCallbackString, sizeof(pCallbackString));
pData->ComputeValidationString(pDataString, sizeof(pDataString));
bool bMatch = !Q_stricmp(pDataString, pCallbackString);
if (!bMatch)
{
Warning("Functor doesn't match data!\n\tExpected:\t%s\n\tEncountered:\t%s\n",
pCallbackString, pDataString);
Assert(0);
}
#endif
}
};
#define DEFINE_FUNCTOR_DATA_TEMPLATE(N) \
template < FUNC_SOLO_TEMPLATE_ARG_PARAMS_##N > \
class CFunctorData##N : public CFunctorDataBase \
{ \
public: \
CFunctorData##N( FUNC_PROXY_ARG_FORMAL_PARAMS_##N ) FUNC_SOLO_CALL_ARGS_INIT_##N {} \
virtual void ComputeValidationString( char *pString, size_t nBufLen ) const { FUNC_VALIDATION_STRING_##N } \
FUNC_ARG_MEMBERS_##N; \
}
class CFunctorData0 : public CFunctorDataBase
{
public:
CFunctorData0() {}
virtual void ComputeValidationString(char* pString, size_t nBufLen_) const { int nBufLen = (int)nBufLen_; FUNC_VALIDATION_STRING_0 }
};
FUNC_GENERATE_ALL_BUT0(DEFINE_FUNCTOR_DATA_TEMPLATE);
#define DEFINE_FUNCTOR_CALLBACK_TEMPLATE(N) \
template < FUNC_SOLO_TEMPLATE_ARG_PARAMS_##N > \
class CFunctorCallback##N : public CFunctorCallbackBase \
{ \
typedef void (*Callback_t)( FUNC_PROXY_ARG_FORMAL_PARAMS_##N ); \
public: \
CFunctorCallback##N( Callback_t pfnProxied ) : m_pfnProxied( pfnProxied ) {} \
void operator()( CFunctorData *pFunctorDataBase ) \
{ \
ValidateFunctorData( pFunctorDataBase ); \
CFunctorData##N< FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_##N > *pFunctorData = static_cast< CFunctorData##N< FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_##N >* >( pFunctorDataBase ); \
m_pfnProxied( FUNC_CALL_DATA_ARGS_##N(pFunctorData) ); \
} \
virtual bool IsEqual( CFunctorCallback *pSrc ) const { return !Q_stricmp( GetImplClassName(), pSrc->GetImplClassName() ) && ( m_pfnProxied == static_cast< CFunctorCallback##N * >( pSrc )->m_pfnProxied ); } \
virtual void ComputeValidationString( char *pString, size_t nBufLen ) const { FUNC_VALIDATION_STRING_##N } \
virtual const char *GetImplClassName() const { return "CFunctorCallback" #N; } \
virtual const void *GetTarget() const { return m_pfnProxied; } \
private: \
Callback_t m_pfnProxied; \
}
class CFunctorCallback0 : public CFunctorCallbackBase
{
typedef void (*Callback_t)();
public:
CFunctorCallback0(Callback_t pfnProxied) : m_pfnProxied(pfnProxied) {}
void operator()(CFunctorData* pFunctorDataBase)
{
ValidateFunctorData(pFunctorDataBase);
m_pfnProxied();
}
virtual void ComputeValidationString(char* pString, size_t nBufLen_) const { int nBufLen = (int)nBufLen_; FUNC_VALIDATION_STRING_0 }
virtual bool IsEqual(CFunctorCallback* pSrc) const
{
if (Q_stricmp(GetImplClassName(), pSrc->GetImplClassName()))
return false;
return m_pfnProxied == static_cast<CFunctorCallback0*>(pSrc)->m_pfnProxied;
}
virtual const char* GetImplClassName() const { return "CFunctorCallback0"; }
virtual const void* GetTarget() const { return (void*)m_pfnProxied; }
private:
Callback_t m_pfnProxied;
};
FUNC_GENERATE_ALL_BUT0(DEFINE_FUNCTOR_CALLBACK_TEMPLATE);
#define DEFINE_MEMBER_FUNCTOR_CALLBACK_TEMPLATE( N ) \
template < class FUNCTION_CLASS FUNC_TEMPLATE_ARG_PARAMS_##N, class MEM_POLICY = CFuncMemPolicyNone > \
class CMemberFunctorCallback##N : public CFunctorCallbackBase \
{ \
typedef void (FUNCTION_CLASS::*MemberCallback_t)( FUNC_PROXY_ARG_FORMAL_PARAMS_##N ); \
public: \
CMemberFunctorCallback##N( FUNCTION_CLASS *pObject, MemberCallback_t pfnProxied ) : m_Proxy( pObject, pfnProxied ) {} \
void operator()( CFunctorData *pFunctorDataBase ) \
{ \
ValidateFunctorData( pFunctorDataBase ); \
CFunctorData##N< FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_##N > *pFunctorData = static_cast< CFunctorData##N< FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_##N >* >( pFunctorDataBase ); \
m_Proxy( FUNC_CALL_DATA_ARGS_##N( pFunctorData ) ); \
} \
virtual void ComputeValidationString( char *pString, size_t nBufLen ) const { FUNC_VALIDATION_STRING_##N } \
virtual bool IsEqual( CFunctorCallback *pSrc ) const { return !Q_stricmp( GetImplClassName(), pSrc->GetImplClassName() ) && ( m_Proxy == static_cast< CMemberFunctorCallback##N* >( pSrc )->m_Proxy ); } \
virtual const char *GetImplClassName() const { return "CMemberFunctorCallback" #N; } \
virtual const void *GetTarget() const { return m_Proxy.GetTarget(); } \
private: \
CMemberFuncProxy##N< FUNCTION_CLASS *, MemberCallback_t FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, MEM_POLICY> m_Proxy; \
}
template < class FUNCTION_CLASS, class MEM_POLICY = CFuncMemPolicyNone >
class CMemberFunctorCallback0 : public CFunctorCallbackBase
{
typedef void (FUNCTION_CLASS::* MemberCallback_t)();
public:
CMemberFunctorCallback0(FUNCTION_CLASS* pObject, MemberCallback_t pfnProxied) : m_Proxy(pObject, pfnProxied) {}
void operator()(CFunctorData* pFunctorDataBase)
{
ValidateFunctorData(pFunctorDataBase);
m_Proxy();
}
virtual void ComputeValidationString(char* pString, size_t nBufLen) const { FUNC_VALIDATION_STRING_0 }
virtual bool IsEqual(CFunctorCallback* pSrc) const
{
if (Q_stricmp(GetImplClassName(), pSrc->GetImplClassName()))
return false;
return m_Proxy == static_cast<CMemberFunctorCallback0*>(pSrc)->m_Proxy;
}
virtual const char* GetImplClassName() const { return "CMemberFunctorCallback0"; }
virtual const void* GetTarget() const { return m_Proxy.GetTarget(); }
private:
CMemberFuncProxy0< FUNCTION_CLASS*, MemberCallback_t, MEM_POLICY > m_Proxy;
};
FUNC_GENERATE_ALL_BUT0(DEFINE_MEMBER_FUNCTOR_CALLBACK_TEMPLATE);
#define DEFINE_NONMEMBER_FUNCTOR_FACTORY(N) \
template <typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline CFunctor *CreateFunctor(FUNCTION_RETTYPE (*pfnProxied)( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
typedef FUNCTION_RETTYPE (*Func_t)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N); \
return new CFunctor##N<Func_t FUNC_BASE_TEMPLATE_ARG_PARAMS_##N>( pfnProxied FUNC_FUNCTOR_CALL_ARGS_##N ); \
}
FUNC_GENERATE_ALL(DEFINE_NONMEMBER_FUNCTOR_FACTORY);
#define DEFINE_MEMBER_FUNCTOR_FACTORY(N) \
template <typename OBJECT_TYPE_PTR, typename FUNCTION_CLASS, typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline CFunctor *CreateFunctor(OBJECT_TYPE_PTR pObject, FUNCTION_RETTYPE ( FUNCTION_CLASS::*pfnProxied )( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
return new CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) FUNC_BASE_TEMPLATE_ARG_PARAMS_##N>(pObject, pfnProxied FUNC_FUNCTOR_CALL_ARGS_##N); \
}
FUNC_GENERATE_ALL(DEFINE_MEMBER_FUNCTOR_FACTORY);
#define DEFINE_CONST_MEMBER_FUNCTOR_FACTORY(N) \
template <typename OBJECT_TYPE_PTR, typename FUNCTION_CLASS, typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline CFunctor *CreateFunctor(OBJECT_TYPE_PTR pObject, FUNCTION_RETTYPE ( FUNCTION_CLASS::*pfnProxied )( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) const FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
return new CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) const FUNC_BASE_TEMPLATE_ARG_PARAMS_##N>(pObject, pfnProxied FUNC_FUNCTOR_CALL_ARGS_##N); \
}
FUNC_GENERATE_ALL(DEFINE_CONST_MEMBER_FUNCTOR_FACTORY);
#define DEFINE_REF_COUNTING_MEMBER_FUNCTOR_FACTORY(N) \
template <typename OBJECT_TYPE_PTR, typename FUNCTION_CLASS, typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline CFunctor *CreateRefCountingFunctor(OBJECT_TYPE_PTR pObject, FUNCTION_RETTYPE ( FUNCTION_CLASS::*pfnProxied )( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
return new CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CFuncMemPolicyRefCount<OBJECT_TYPE_PTR> >(pObject, pfnProxied FUNC_FUNCTOR_CALL_ARGS_##N); \
}
FUNC_GENERATE_ALL(DEFINE_REF_COUNTING_MEMBER_FUNCTOR_FACTORY);
#define DEFINE_REF_COUNTING_CONST_MEMBER_FUNCTOR_FACTORY(N) \
template <typename OBJECT_TYPE_PTR, typename FUNCTION_CLASS, typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline CFunctor *CreateRefCountingFunctor(OBJECT_TYPE_PTR pObject, FUNCTION_RETTYPE ( FUNCTION_CLASS::*pfnProxied )( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) const FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
return new CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) const FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CFuncMemPolicyRefCount<OBJECT_TYPE_PTR> >(pObject, pfnProxied FUNC_FUNCTOR_CALL_ARGS_##N); \
}
FUNC_GENERATE_ALL(DEFINE_REF_COUNTING_CONST_MEMBER_FUNCTOR_FACTORY);
#define DEFINE_FUNCTOR_DATA_FACTORY(N) \
template < FUNC_SOLO_TEMPLATE_ARG_PARAMS_##N > \
inline CFunctorData *CreateFunctorData( FUNC_PROXY_ARG_FORMAL_PARAMS_##N ) \
{ \
return new CFunctorData##N< FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_##N >( FUNC_CALL_ARGS_##N ); \
}
inline CFunctorData* CreateFunctorData()
{
return new CFunctorData0();
}
FUNC_GENERATE_ALL_BUT0(DEFINE_FUNCTOR_DATA_FACTORY);
#define DEFINE_FUNCTOR_CALLBACK_FACTORY(N) \
template < FUNC_SOLO_TEMPLATE_ARG_PARAMS_##N > \
inline CFunctorCallback *CreateFunctorCallback( void (*pfnProxied)( FUNC_PROXY_ARG_FORMAL_PARAMS_##N ) ) \
{ \
return new CFunctorCallback##N< FUNC_SOLO_BASE_TEMPLATE_ARG_PARAMS_##N >( pfnProxied ); \
}
inline CFunctorCallback* CreateFunctorCallback(void (*pfnProxied)())
{
return new CFunctorCallback0(pfnProxied);
}
FUNC_GENERATE_ALL_BUT0(DEFINE_FUNCTOR_CALLBACK_FACTORY);
#define DEFINE_MEMBER_FUNCTOR_CALLBACK_FACTORY(N) \
template < typename FUNCTION_CLASS FUNC_TEMPLATE_ARG_PARAMS_##N > \
inline CFunctorCallback *CreateFunctorCallback( FUNCTION_CLASS *pObject, void ( FUNCTION_CLASS::*pfnProxied )( FUNC_PROXY_ARG_FORMAL_PARAMS_##N ) ) \
{ \
return new CMemberFunctorCallback##N< FUNCTION_CLASS FUNC_BASE_TEMPLATE_ARG_PARAMS_##N >( pObject, pfnProxied ); \
}
FUNC_GENERATE_ALL(DEFINE_MEMBER_FUNCTOR_CALLBACK_FACTORY);
#define DEFINE_NONMEMBER_FUNCTOR_DIRECT(N) \
template <typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline void FunctorDirectCall(FUNCTION_RETTYPE (*pfnProxied)( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
(*pfnProxied)( FUNC_CALL_ARGS_##N ); \
}
FUNC_GENERATE_ALL(DEFINE_NONMEMBER_FUNCTOR_DIRECT);
#define DEFINE_MEMBER_FUNCTOR_DIRECT(N) \
template <typename OBJECT_TYPE_PTR, typename FUNCTION_CLASS, typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline void FunctorDirectCall(OBJECT_TYPE_PTR pObject, FUNCTION_RETTYPE ( FUNCTION_CLASS::*pfnProxied )( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
((*pObject).*pfnProxied)(FUNC_CALL_ARGS_##N); \
}
FUNC_GENERATE_ALL(DEFINE_MEMBER_FUNCTOR_DIRECT);
#define DEFINE_CONST_MEMBER_FUNCTOR_DIRECT(N) \
template <typename OBJECT_TYPE_PTR, typename FUNCTION_CLASS, typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline void FunctorDirectCall(OBJECT_TYPE_PTR pObject, FUNCTION_RETTYPE ( FUNCTION_CLASS::*pfnProxied )( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) const FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
((*pObject).*pfnProxied)(FUNC_CALL_ARGS_##N); \
}
FUNC_GENERATE_ALL(DEFINE_CONST_MEMBER_FUNCTOR_DIRECT);
#include "memdbgoff.h"
class CDefaultFunctorFactory
{
public:
FUNC_GENERATE_ALL(DEFINE_NONMEMBER_FUNCTOR_FACTORY);
FUNC_GENERATE_ALL(DEFINE_MEMBER_FUNCTOR_FACTORY);
FUNC_GENERATE_ALL(DEFINE_CONST_MEMBER_FUNCTOR_FACTORY);
FUNC_GENERATE_ALL(DEFINE_REF_COUNTING_MEMBER_FUNCTOR_FACTORY);
FUNC_GENERATE_ALL(DEFINE_REF_COUNTING_CONST_MEMBER_FUNCTOR_FACTORY);
};
template <class CAllocator, class CCustomFunctorBase = CFunctorBase>
class CCustomizedFunctorFactory
{
public:
void SetAllocator(CAllocator* pAllocator)
{
m_pAllocator = pAllocator;
}
#define DEFINE_NONMEMBER_FUNCTOR_FACTORY_CUSTOM(N) \
template <typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline CFunctor *CreateFunctor( FUNCTION_RETTYPE (*pfnProxied)( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
typedef FUNCTION_RETTYPE (*Func_t)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N); \
return new (m_pAllocator->Alloc( sizeof(CFunctor##N<Func_t FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CCustomFunctorBase>) )) CFunctor##N<Func_t FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CCustomFunctorBase>( pfnProxied FUNC_FUNCTOR_CALL_ARGS_##N ); \
}
FUNC_GENERATE_ALL(DEFINE_NONMEMBER_FUNCTOR_FACTORY_CUSTOM);
#define DEFINE_MEMBER_FUNCTOR_FACTORY_CUSTOM(N) \
template <typename OBJECT_TYPE_PTR, typename FUNCTION_CLASS, typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline CFunctor *CreateFunctor(OBJECT_TYPE_PTR pObject, FUNCTION_RETTYPE ( FUNCTION_CLASS::*pfnProxied )( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
return new (m_pAllocator->Alloc( sizeof(CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CCustomFunctorBase>) )) CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CCustomFunctorBase>(pObject, pfnProxied FUNC_FUNCTOR_CALL_ARGS_##N); \
}
FUNC_GENERATE_ALL(DEFINE_MEMBER_FUNCTOR_FACTORY_CUSTOM);
#define DEFINE_CONST_MEMBER_FUNCTOR_FACTORY_CUSTOM(N) \
template <typename OBJECT_TYPE_PTR, typename FUNCTION_CLASS, typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline CFunctor *CreateFunctor( OBJECT_TYPE_PTR pObject, FUNCTION_RETTYPE ( FUNCTION_CLASS::*pfnProxied )( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) const FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
return new (m_pAllocator->Alloc( sizeof(CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) const FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CCustomFunctorBase>) )) CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) const FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CCustomFunctorBase>(pObject, pfnProxied FUNC_FUNCTOR_CALL_ARGS_##N); \
}
FUNC_GENERATE_ALL(DEFINE_CONST_MEMBER_FUNCTOR_FACTORY_CUSTOM);
#define DEFINE_REF_COUNTING_MEMBER_FUNCTOR_FACTORY_CUSTOM(N) \
template <typename OBJECT_TYPE_PTR, typename FUNCTION_CLASS, typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline CFunctor *CreateRefCountingFunctor( OBJECT_TYPE_PTR pObject, FUNCTION_RETTYPE ( FUNCTION_CLASS::*pfnProxied )( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
return new (m_pAllocator->Alloc( sizeof(CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CCustomFunctorBase, CFuncMemPolicyRefCount<OBJECT_TYPE_PTR> >) )) CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CCustomFunctorBase, CFuncMemPolicyRefCount<OBJECT_TYPE_PTR> >(pObject, pfnProxied FUNC_FUNCTOR_CALL_ARGS_##N); \
}
FUNC_GENERATE_ALL(DEFINE_REF_COUNTING_MEMBER_FUNCTOR_FACTORY_CUSTOM);
#define DEFINE_REF_COUNTING_CONST_MEMBER_FUNCTOR_FACTORY_CUSTOM(N) \
template <typename OBJECT_TYPE_PTR, typename FUNCTION_CLASS, typename FUNCTION_RETTYPE FUNC_TEMPLATE_FUNC_PARAMS_##N FUNC_TEMPLATE_ARG_PARAMS_##N> \
inline CFunctor *CreateRefCountingFunctor( OBJECT_TYPE_PTR pObject, FUNCTION_RETTYPE ( FUNCTION_CLASS::*pfnProxied )( FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N ) const FUNC_ARG_FORMAL_PARAMS_##N ) \
{ \
return new (m_pAllocator->Alloc( sizeof(CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) const FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CCustomFunctorBase, CFuncMemPolicyRefCount<OBJECT_TYPE_PTR> >) )) CMemberFunctor##N<OBJECT_TYPE_PTR, FUNCTION_RETTYPE (FUNCTION_CLASS::*)(FUNC_BASE_TEMPLATE_FUNC_PARAMS_##N) const FUNC_BASE_TEMPLATE_ARG_PARAMS_##N, CCustomFunctorBase, CFuncMemPolicyRefCount<OBJECT_TYPE_PTR> >(pObject, pfnProxied FUNC_FUNCTOR_CALL_ARGS_##N); \
}
FUNC_GENERATE_ALL(DEFINE_REF_COUNTING_CONST_MEMBER_FUNCTOR_FACTORY_CUSTOM);
private:
CAllocator* m_pAllocator;
};
#endif

156
SpyCustom/fx.h Normal file
View File

@ -0,0 +1,156 @@
#if !defined( FX_H )
#define FX_H
#ifdef _WIN32
#pragma once
#endif
#include "vector.h"
#include "c_pixel_visibility.h"
#include "mathlib.h"
typedef CBaseHandle ClientEntityHandle_t;
#include "smartptr.h"
class Vector;
class CGameTrace;
typedef CGameTrace trace_t;
enum
{
FX_ENERGYSPLASH_EXPLOSIVE = 0x1,
FX_ENERGYSPLASH_SMOKE = 0x2,
FX_ENERGYSPLASH_LITTLESPARKS = 0x4,
FX_ENERGYSPLASH_BIGSPARKS = 0x8,
FX_ENERGYSPLASH_BIGSPARKSCOLLIDE = 0x10,
FX_ENERGYSPLASH_ENERGYBALLS = 0x20,
FX_ENERGYSPLASH_DLIGHT = 0x40,
FX_ENERGYSPLASH_DEFAULT = ~FX_ENERGYSPLASH_EXPLOSIVE,
FX_ENERGYSPLASH_DEFAULT_EXPLOSIVE = ~0,
};
bool FX_GetAttachmentTransform(ClientEntityHandle_t hEntity, int attachmentIndex, matrix3x4_t& transform);
bool FX_GetAttachmentTransform(ClientEntityHandle_t hEntity, int attachmentIndex, Vector* origin, QAngle* angles);
void FX_RicochetSound(const Vector& pos);
void FX_AntlionImpact(const Vector& pos, trace_t* tr);
void FX_DebrisFlecks(const Vector& origin, trace_t* trace, char materialType, int iScale, bool bNoFlecks = false);
void FX_Tracer(Vector& start, Vector& end, int velocity, bool makeWhiz = true);
void FX_GunshipTracer(Vector& start, Vector& end, int velocity, bool makeWhiz = true);
void FX_StriderTracer(Vector& start, Vector& end, int velocity, bool makeWhiz = true);
void FX_HunterTracer(Vector& start, Vector& end, int velocity, bool makeWhiz = true);
void FX_PlayerTracer(Vector& start, Vector& end);
void FX_BulletPass(Vector& start, Vector& end);
void FX_MetalSpark(const Vector& position, const Vector& direction, const Vector& surfaceNormal, int iScale = 1);
void FX_MetalScrape(Vector& position, Vector& normal);
void FX_Sparks(const Vector& pos, int nMagnitude, int nTrailLength, const Vector& vecDir, float flWidth, float flMinSpeed, float flMaxSpeed, char* pSparkMaterial = NULL);
void FX_ElectricSpark(const Vector& pos, int nMagnitude, int nTrailLength, const Vector* vecDir);
void FX_BugBlood(Vector& pos, Vector& dir, Vector& vWorldMins, Vector& vWorldMaxs);
void FX_Blood(Vector& pos, Vector& dir, float r, float g, float b, float a);
void FX_CreateImpactDust(Vector& origin, Vector& normal);
void FX_EnergySplash(const Vector& pos, const Vector& normal, int nFlags = FX_ENERGYSPLASH_DEFAULT);
void FX_MicroExplosion(Vector& position, Vector& normal);
void FX_Explosion(Vector& origin, Vector& normal, char materialType);
void FX_ConcussiveExplosion(Vector& origin, Vector& normal);
void FX_DustImpact(const Vector& origin, trace_t* tr, int iScale);
void FX_DustImpact(const Vector& origin, trace_t* tr, float flScale);
void FX_MuzzleEffect(const Vector& origin, const QAngle& angles, float scale, ClientEntityHandle_t hEntity, unsigned char* pFlashColor = NULL, bool bOneFrame = false);
void FX_MuzzleEffectAttached(float scale, ClientEntityHandle_t hEntity, int attachmentIndex, unsigned char* pFlashColor = NULL, bool bOneFrame = false);
void FX_StriderMuzzleEffect(const Vector& origin, const QAngle& angles, float scale, ClientEntityHandle_t hEntity, unsigned char* pFlashColor = NULL);
void FX_GunshipMuzzleEffect(const Vector& origin, const QAngle& angles, float scale, ClientEntityHandle_t hEntity, unsigned char* pFlashColor = NULL);
void FX_Smoke(const Vector& origin, const Vector& velocity, float scale, int numParticles, float flDietime, unsigned char* pColor, int iAlpha, const char* pMaterial, float flRoll, float flRollDelta);
void FX_Smoke(const Vector& origin, const QAngle& angles, float scale, int numParticles, unsigned char* pColor = NULL, int iAlpha = -1);
void FX_Dust(const Vector& vecOrigin, const Vector& vecDirection, float flSize, float flSpeed);
void FX_CreateGaussExplosion(const Vector& pos, const Vector& dir, int type);
void FX_GaussTracer(Vector& start, Vector& end, int velocity, bool makeWhiz = true);
void FX_TracerSound(const Vector& start, const Vector& end, int iTracerType);
void UTIL_GetNormalizedColorTintAndLuminosity(const Vector& color, Vector* tint = NULL, float* luminosity = NULL);
bool EffectOccluded(const Vector& pos, pixelvis_handle_t* queryHandle = 0);
class CTeslaInfo
{
public:
Vector m_vPos;
QAngle m_vAngles;
int m_nEntIndex;
char* m_pszSpriteName;
float m_flBeamWidth;
int m_nBeams;
Vector m_vColor;
float m_flTimeVisible;
float m_flRadius;
};
void FX_Tesla(const CTeslaInfo& teslaInfo);
#include "particle_parse.h"
class CEffectData
{
public:
Vector m_vOrigin;
Vector m_vStart;
Vector m_vNormal;
QAngle m_vAngles;
int m_fFlags;
int m_nEntIndex;
float m_flScale;
float m_flMagnitude;
float m_flRadius;
int m_nAttachmentIndex;
short m_nSurfaceProp;
int m_nMaterial;
int m_nDamageType;
int m_nHitBox;
unsigned char m_nColor;
bool m_bCustomColors;
te_tf_particle_effects_colors_t m_CustomColors;
bool m_bControlPoint1;
te_tf_particle_effects_control_point_t m_ControlPoint1;
public:
CEffectData()
{
m_vOrigin.Init();
m_vStart.Init();
m_vNormal.Init();
m_vAngles.Init();
m_fFlags = 0;
m_nEntIndex = 0;
m_flScale = 1.f;
m_nAttachmentIndex = 0;
m_nSurfaceProp = 0;
m_flMagnitude = 0.0f;
m_flRadius = 0.0f;
m_nMaterial = 0;
m_nDamageType = 0;
m_nHitBox = 0;
m_nColor = 0;
m_bCustomColors = false;
m_CustomColors.m_vecColor1.Init(1.f, 1.f, 1.f);
m_CustomColors.m_vecColor2.Init(1.f, 1.f, 1.f);
m_bControlPoint1 = false;
m_ControlPoint1.m_eParticleAttachment = PATTACH_ABSORIGIN;
m_ControlPoint1.m_vecOffset.Init();
}
int GetEffectNameIndex() { return m_iEffectName; }
private:
int m_iEffectName;
};
#endif

View File

@ -0,0 +1,61 @@
#ifndef GAME_ITEM_SCHEMA_H
#define GAME_ITEM_SCHEMA_H
#ifdef _WIN32
#pragma once
#endif
#if defined(TF_CLIENT_DLL) || defined(TF_DLL) || defined(TF_GC_DLL)
class CTFItemSchema;
class CTFItemDefinition;
class CTFItemSystem;
typedef CTFItemSchema GameItemSchema_t;
typedef CTFItemDefinition GameItemDefinition_t;
typedef CTFItemSystem GameItemSystem_t;
#include "tf_item_schema.h"
#elif defined( DOTA_CLIENT_DLL ) || defined( DOTA_DLL ) || defined ( DOTA_GC_DLL )
class CDOTAItemSchema;
class CDOTAItemDefinition;
class CDOTAItemSystem;
typedef CDOTAItemSchema GameItemSchema_t;
typedef CDOTAItemDefinition GameItemDefinition_t;
typedef CDOTAItemSystem GameItemSystem_t;
#include "econ/dota_item_schema.h"
#elif defined( PORTAL2 ) || defined( PORTAL2_GC_DLL )
class CPortal2ItemSchema;
class CPortal2ItemDefinition;
class CPortal2ItemSystem;
typedef CPortal2ItemSchema GameItemSchema_t;
typedef CPortal2ItemDefinition GameItemDefinition_t;
typedef CPortal2ItemSystem GameItemSystem_t;
#include "portal2_item_schema.h"
#elif defined( CSTRIKE15 ) || defined( CSTRIKE_GC_DLL )
class CCStrike15ItemSchema;
class CCStrike15ItemDefinition;
class CCStrike15ItemSystem;
typedef CCStrike15ItemSchema GameItemSchema_t;
typedef CCStrike15ItemDefinition GameItemDefinition_t;
typedef CCStrike15ItemSystem GameItemSystem_t;
#include "cstrike15_item_schema.h"
#else
class CEconItemSchema;
class CEconItemDefinition;
class CEconItemSystem;
typedef CEconItemSchema GameItemSchema_t;
typedef CEconItemDefinition GameItemDefinition_t;
typedef CEconItemSystem GameItemSystem_t;
#include "econ_item_schema.h"
#endif
extern GameItemSchema_t* GetItemSchema();
#endif

42
SpyCustom/gameconsole.h Normal file
View File

@ -0,0 +1,42 @@
#ifndef GAMECONSOLE_H
#define GAMECONSOLE_H
#ifdef _WIN32
#pragma once
#endif
#include "IGameConsole.h"
class CGameConsoleDialog;
class CGameConsole : public IGameConsole
{
public:
CGameConsole();
~CGameConsole();
void Initialize();
virtual void Activate();
virtual void Hide();
virtual void Clear();
void HideImmediately(void);
virtual bool IsConsoleVisible();
void ActivateDelayed(float time);
void SetParent(int parent);
void Shutdown(void);
static void OnCmdCondump();
private:
bool m_bInitialized;
CGameConsoleDialog* m_pConsole;
};
extern CGameConsole& GameConsole();
#endif

105
SpyCustom/gamestringpool.h Normal file
View File

@ -0,0 +1,105 @@
#ifndef GAMESTRINGPOOL_H
#define GAMESTRINGPOOL_H
#if defined( _WIN32 )
#pragma once
#endif
#if !defined( GC )
class IGameSystem;
#endif
string_t AllocPooledString(const char* pszValue);
#define AllocPooledStringConstant( pszValue ) AllocPooledString( pszValue )
string_t FindPooledString(const char* pszValue);
void RemovePooledString(const char* pszValue);
#define AssertIsValidString( s ) AssertMsg( s == NULL_STRING || s == FindPooledString( STRING(s) ), "Invalid string " #s );
#if !defined( GC )
IGameSystem* GameStringSystem();
#endif
class CGameString
{
public:
CGameString() :
m_iszString(NULL_STRING), m_pszString(NULL), m_iSerial(0)
{
}
CGameString(const char* pszString, bool bCopy = false) :
m_iszString(NULL_STRING), m_pszString(NULL), m_iSerial(0)
{
Set(pszString, bCopy);
}
~CGameString()
{
if (m_bCopy)
free((void*)m_pszString);
}
void Set(const char* pszString, bool bCopy = false)
{
if (m_bCopy && m_pszString)
free((void*)m_pszString);
m_iszString = NULL_STRING;
m_pszString = (!bCopy) ? pszString : strdup(pszString);
}
void SetFastNoCopy(string_t iszString)
{
m_iszString = iszString;
m_iSerial = gm_iSerialNumber;
}
bool IsSerialNumberOutOfDate(void) const
{
return m_iSerial != gm_iSerialNumber;
}
string_t Get() const
{
if (m_iszString == NULL_STRING || IsSerialNumberOutOfDate())
{
if (!m_pszString)
return NULL_STRING;
m_iszString = AllocPooledString(m_pszString);
m_iSerial = gm_iSerialNumber;
}
return m_iszString;
}
operator const char* () const
{
return (m_pszString) ? m_pszString : "";
}
#ifndef NO_STRING_T
operator string_t() const
{
return Get();
}
#endif
static void IncrementSerialNumber()
{
gm_iSerialNumber++;
}
private:
mutable string_t m_iszString;
const char* m_pszString;
mutable int m_iSerial;
bool m_bCopy;
static int gm_iSerialNumber;
};
#endif

147
SpyCustom/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

84
SpyCustom/generichash.h Normal file
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

14
SpyCustom/groundlink.h Normal file
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

105
SpyCustom/htmlmessages.h Normal file
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/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

405
SpyCustom/hud_basechat.h Normal file
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/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/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/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

73
SpyCustom/icliententity.h Normal file
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/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

45
SpyCustom/icommandline.h Normal file
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/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/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/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/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

152
SpyCustom/ienginetrace.h Normal file
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/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

28
SpyCustom/igameconsole.h Normal file
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/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

20
SpyCustom/ihandleentity.h Normal file
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

83
SpyCustom/iinputsystem.h Normal file
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/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/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

1632
SpyCustom/imaterialsystem.h Normal file

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/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

74
SpyCustom/imovehelper.h Normal file
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

85
SpyCustom/inetchannel.h Normal file
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

74
SpyCustom/inetmessage.h Normal file
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/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

1429
SpyCustom/interpolatedvar.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,397 @@
#pragma once
#include "ProtoParse.h"
#include "ProtobuffMessages.h"
#include <ctime>
#include "Options.hpp"
struct wskin
{
int wId;
int paintkit;
};
#define START_MUSICKIT_INDEX 1500000
#define START_ITEM_INDEX 2000000
static void clear_equip_state(CMsgClientWelcome::SubscribedType& object);
static void apply_medals(CMsgClientWelcome::SubscribedType& object);
static void apply_music_kits(CMsgClientWelcome::SubscribedType& object);
static void add_item(CMsgClientWelcome::SubscribedType& object, int index, ItemDefinitionIndex itemIndex, int quality, int rarity, int paintKit, int seed, float wear, std::string name, std::string desc, sticker stickers[5], int stattrak, int flag);
static int GetAvailableClassID(int definition_index);
static int GetSlotID(int definition_index);
static std::vector<uint32_t> music_kits = { 3, 4, 5, 6, 7, 8 };
template<typename T>
inline std::string get_4bytes(T value)
{
return std::string{ reinterpret_cast<const char*>(reinterpret_cast<void*>(&value)), 4 };
}
template<typename T>
inline CSOEconItemAttribute make_econ_item_attribute(int def_index, T value)
{
CSOEconItemAttribute attribute;
attribute.def_index().set(def_index);
attribute.value_bytes().set(get_4bytes(value));
return attribute;
}
inline CSOEconItemEquipped make_equipped_state(int team, int slot)
{
CSOEconItemEquipped equipped_state;
equipped_state.new_class().set(team);
equipped_state.new_slot().set(slot);
return equipped_state;
}
static std::string inventory_changer(void* pubDest, uint32_t* pcubMsgSize) {
CMsgClientWelcome msg((void*)((DWORD)pubDest + 8), *pcubMsgSize - 8);
if (!msg.outofdate_subscribed_caches().has())
return msg.serialize();
auto cache = msg.outofdate_subscribed_caches().get();
static auto fix_null_inventory = [&cache]()
{
auto objects = cache.objects().get_all();
auto it = std::find_if(objects.begin(), objects.end(), [](decltype(objects.front()) o)
{
return o.type_id().has() && o.type_id().get() == 1;
});
if (it == objects.end())
{
CMsgClientWelcome::SubscribedType null_object;
null_object.type_id().set(1);
cache.objects().add(null_object);
}
};
fix_null_inventory();
auto objects = cache.objects().get_all();
for (size_t i = 0; i < objects.size(); i++) {
auto object = objects[i];
if (!object.type_id().has())
continue;
switch (object.type_id().get())
{
case 1:
{
if (true)
object.object_data().clear();
int indexcount = 0;
for (int i = 0; i < g_Options.weapons.value->weaponzcount; i++)
if (g_Options.weapons.value->arr[i].active) {
indexcount++;
add_item(object, indexcount,
(ItemDefinitionIndex)g_Options.weapons.value->arr[i].modeldefindex,
g_Options.weapons.value->arr[i].quality,
g_Options.weapons.value->arr[i].rarity,
g_Options.weapons.value->arr[i].skinid,
g_Options.weapons.value->arr[i].seed,
g_Options.weapons.value->arr[i].wear,
g_Options.weapons.value->arr[i].nametag,
g_Options.weapons.value->arr[i].desctag,
g_Options.weapons.value->arr[i].stickers,
g_Options.weapons.value->arr[i].stattrak,
i);
}
cache.objects().set(object, i);
}
break;
}
}
msg.outofdate_subscribed_caches().set(cache);
return msg.serialize();
}
static bool inventory_changer_presend(void* pubData, uint32_t& cubData)
{
CMsgAdjustItemEquippedState msg((void*)((DWORD)pubData + 8), cubData - 8);
if (msg.item_id().has() && (msg.new_class().get() == 0 || msg.new_slot().get() == 54))
{
auto ItemIndex = msg.item_id().get() - START_MUSICKIT_INDEX;
if (ItemIndex > 38 || ItemIndex < 3)
return true;
msg.new_slot().get() == 0xFFFF ? 0 : ItemIndex - 2;
return false;
}
if (!msg.item_id().has() || !msg.new_class().get() || !msg.new_slot().get())
return true;
return false;
}
static void clear_equip_state(CMsgClientWelcome::SubscribedType& object)
{
auto object_data = object.object_data().get_all();
for (size_t j = 0; j < object_data.size(); j++)
{
auto item = object_data[j];
if (!item.equipped_state().has())
continue;
auto null_equipped_state = make_equipped_state(0, 0);
auto equipped_state = item.equipped_state().get_all();
for (size_t k = 0; k < equipped_state.size(); k++)
item.equipped_state().set(null_equipped_state, k);
object.object_data().set(item, j);
}
}
static void add_item(CMsgClientWelcome::SubscribedType& object, int index, ItemDefinitionIndex itemIndex, int quality, int rarity, int paintKit, int seed, float wear, std::string name, std::string desc, sticker stickers[5], int stattrak, int flag)
{
uint32_t steamid = iff.g_SteamUser->GetSteamID().GetAccountID();
CSOEconItem item;
item.id().set(START_ITEM_INDEX + itemIndex);
item.account_id().set(steamid);
if (flag == 5)
item.def_index().set(1314);
else item.def_index().set(itemIndex);
item.inventory().set(START_ITEM_INDEX + index);
item.origin().set(24);
item.quantity().set(1);
item.level().set(1);
item.style().set(0);
item.flags().set(0);
item.in_use().set(true);
item.original_id().set(0);
item.rarity().set(rarity);
item.quality().set(quality);
if (name.size() > 0)
item.custom_name().set(name);
if (desc.size() > 0)
item.custom_desc().set(desc);
if (flag > 5) {
int avalTeam = GetAvailableClassID(itemIndex);
if (avalTeam == TEAM_SPECTATOR || avalTeam == TEAM_TERRORIST) {
item.equipped_state().add(make_equipped_state(TEAM_TERRORIST, GetSlotID(itemIndex)));
}
if (avalTeam == TEAM_SPECTATOR || avalTeam == TEAM_CT) {
item.equipped_state().add(make_equipped_state(TEAM_CT, GetSlotID(itemIndex)));
}
}
item.attribute().add(make_econ_item_attribute(6, float(paintKit)));
item.attribute().add(make_econ_item_attribute(7, float(seed)));
item.attribute().add(make_econ_item_attribute(8, float(wear)));
for (int j = 0; j < 5; j++)
{
item.attribute().add(make_econ_item_attribute(113 + 4 * j, stickers[j].stickerid ));
item.attribute().add(make_econ_item_attribute(114 + 4 * j, stickers[j].wear));
item.attribute().add(make_econ_item_attribute(115 + 4 * j, stickers[j].scale));
item.attribute().add(make_econ_item_attribute(116 + 4 * j, stickers[j].rotation));
}
if (stattrak != -1)
{
item.attribute().add(make_econ_item_attribute(80, stattrak));
item.attribute().add(make_econ_item_attribute(81, 0));
}
if (flag == 0)
{
item.equipped_state().add(make_equipped_state(TEAM_TERRORIST, 0));
item.equipped_state().add(make_equipped_state(TEAM_CT, 0));
}
if (flag == 1)
{
item.equipped_state().add(make_equipped_state(TEAM_TERRORIST, 41));
item.equipped_state().add(make_equipped_state(TEAM_CT, 41));
}
if (flag == 2)
item.equipped_state().set(make_equipped_state(2, 38));
if (flag == 3)
item.equipped_state().set(make_equipped_state(3, 38));
if (flag == 4)
item.equipped_state().set(make_equipped_state(0, 55));
if (flag == 5)
{
item.attribute().add(make_econ_item_attribute(166, itemIndex));
item.inventory().set(START_MUSICKIT_INDEX + itemIndex);
item.id().set(START_MUSICKIT_INDEX + itemIndex);
item.equipped_state().set(make_equipped_state(0, 54));
}
object.object_data().add(item);
}
static int GetAvailableClassID(int definition_index)
{
switch (definition_index)
{
case WEAPON_KNIFE_BAYONET:
case WEAPON_KNIFE_FLIP:
case WEAPON_KNIFE_GUT:
case WEAPON_KNIFE_KARAMBIT:
case WEAPON_KNIFE_M9_BAYONET:
case WEAPON_KNIFE_TACTICAL:
case WEAPON_KNIFE_FALCHION:
case WEAPON_KNIFE_SURVIVAL_BOWIE:
case WEAPON_KNIFE_BUTTERFLY:
case WEAPON_KNIFE_PUSH:
case WEAPON_ELITE:
case WEAPON_P250:
case WEAPON_CZ75A:
case WEAPON_DEAGLE:
case WEAPON_REVOLVER:
case WEAPON_MP7:
case WEAPON_UMP45:
case WEAPON_P90:
case WEAPON_BIZON:
case WEAPON_SSG08:
case WEAPON_AWP:
case WEAPON_NOVA:
case WEAPON_XM1014:
case WEAPON_M249:
case WEAPON_NEGEV:
case GLOVE_STUDDED_BLOODHOUND:
case GLOVE_SPORTY:
case GLOVE_SLICK:
case GLOVE_LEATHER_WRAP:
case GLOVE_MOTORCYCLE:
case GLOVE_SPECIALIST:
return TEAM_SPECTATOR;
case WEAPON_GLOCK:
case WEAPON_AK47:
case WEAPON_MAC10:
case WEAPON_G3SG1:
case WEAPON_TEC9:
case WEAPON_GALILAR:
case WEAPON_SG553:
case WEAPON_SAWEDOFF:
case WEAPON_C4:
return TEAM_TERRORIST;
case WEAPON_AUG:
case WEAPON_FAMAS:
case WEAPON_MAG7:
case WEAPON_FIVESEVEN:
case WEAPON_USP_SILENCER:
case WEAPON_HKP2000:
case WEAPON_MP9:
case WEAPON_M4A1_SILENCER:
case WEAPON_M4A1:
case WEAPON_SCAR20:
return TEAM_CT;
default:
return TEAM_UNASSIGNED;
}
}
static int GetSlotID(int definition_index)
{
switch (definition_index)
{
case WEAPON_KNIFE_BAYONET:
case WEAPON_KNIFE_FLIP:
case WEAPON_KNIFE_GUT:
case WEAPON_KNIFE_KARAMBIT:
case WEAPON_KNIFE_M9_BAYONET:
case WEAPON_KNIFE_TACTICAL:
case WEAPON_KNIFE_FALCHION:
case WEAPON_KNIFE_SURVIVAL_BOWIE:
case WEAPON_KNIFE_BUTTERFLY:
case WEAPON_KNIFE_PUSH:
return 0;
case WEAPON_C4:
return 1;
case WEAPON_USP_SILENCER:
case WEAPON_HKP2000:
case WEAPON_GLOCK:
return 2;
case WEAPON_ELITE:
return 3;
case WEAPON_P250:
return 4;
case WEAPON_TEC9:
case WEAPON_CZ75A:
case WEAPON_FIVESEVEN:
return 5;
case WEAPON_DEAGLE:
case WEAPON_REVOLVER:
return 6;
case WEAPON_MP9:
case WEAPON_MAC10:
return 8;
case WEAPON_MP7:
return 9;
case WEAPON_UMP45:
return 10;
case WEAPON_P90:
return 11;
case WEAPON_BIZON:
return 12;
case WEAPON_FAMAS:
case WEAPON_GALILAR:
return 14;
case WEAPON_M4A1_SILENCER:
case WEAPON_M4A1:
case WEAPON_AK47:
return 15;
case WEAPON_SSG08:
return 16;
case WEAPON_SG553:
case WEAPON_AUG:
return 17;
case WEAPON_AWP:
return 18;
case WEAPON_G3SG1:
case WEAPON_SCAR20:
return 19;
case WEAPON_NOVA:
return 20;
case WEAPON_XM1014:
return 21;
case WEAPON_SAWEDOFF:
case WEAPON_MAG7:
return 22;
case WEAPON_M249:
return 23;
case WEAPON_NEGEV:
return 24;
case GLOVE_STUDDED_BLOODHOUND:
case GLOVE_SPORTY:
case GLOVE_SLICK:
case GLOVE_LEATHER_WRAP:
case GLOVE_MOTORCYCLE:
case GLOVE_SPECIALIST:
return 41;
default:
return -1;
}
}

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

32
SpyCustom/iserverentity.h Normal file
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

103
SpyCustom/iserverplugin.h Normal file
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/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

290
SpyCustom/istudiorender.h Normal file
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/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/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/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,13 @@
#if !defined ( SHATTERSURFACETYPES_H )
#define SHATTERSURFACETYPES_H
#ifdef _WIN32
#pragma once
#endif
enum ShatterSurface_t
{
SHATTERSURFACE_GLASS = 0,
SHATTERSURFACE_TILE = 1,
};
#endif