Add IMDLCache and IFileSystem interfaces
This commit is contained in:
parent
171a3815b8
commit
2658ad6a51
@ -52,6 +52,8 @@ class TFGCClientSystem;
|
|||||||
class CGameRules;
|
class CGameRules;
|
||||||
class IEngineVGui;
|
class IEngineVGui;
|
||||||
class IUniformRandomStream;
|
class IUniformRandomStream;
|
||||||
|
class IFileSystem;
|
||||||
|
class IMDLCache;
|
||||||
|
|
||||||
extern TFGCClientSystem *g_TFGCClientSystem;
|
extern TFGCClientSystem *g_TFGCClientSystem;
|
||||||
extern CHud *g_CHUD;
|
extern CHud *g_CHUD;
|
||||||
@ -87,5 +89,10 @@ extern IGameEventManager *g_IGameEventManager;
|
|||||||
extern CGameRules *g_pGameRules;
|
extern CGameRules *g_pGameRules;
|
||||||
extern IEngineVGui *g_IEngineVGui;
|
extern IEngineVGui *g_IEngineVGui;
|
||||||
extern IUniformRandomStream *g_pUniformStream;
|
extern IUniformRandomStream *g_pUniformStream;
|
||||||
|
extern int *g_PredictionRandomSeed;
|
||||||
|
#if ENABLE_NULL_GRAPHICS
|
||||||
|
extern IFileSystem *g_IFileSystem;
|
||||||
|
extern IMDLCache *g_IMDLCache;
|
||||||
|
#endif
|
||||||
|
|
||||||
void CreateInterfaces();
|
void CreateInterfaces();
|
||||||
|
@ -45,6 +45,8 @@ SharedObject &vstdlib();
|
|||||||
SharedObject &tier0();
|
SharedObject &tier0();
|
||||||
SharedObject &inputsystem();
|
SharedObject &inputsystem();
|
||||||
SharedObject &materialsystem();
|
SharedObject &materialsystem();
|
||||||
|
SharedObject &filesystem_stdio();
|
||||||
|
SharedObject &datacache();
|
||||||
#if ENABLE_VISUALS
|
#if ENABLE_VISUALS
|
||||||
SharedObject &vguimatsurface();
|
SharedObject &vguimatsurface();
|
||||||
SharedObject &vgui2();
|
SharedObject &vgui2();
|
||||||
|
@ -51,6 +51,11 @@ CHud *g_CHUD = nullptr;
|
|||||||
CGameRules *g_pGameRules = nullptr;
|
CGameRules *g_pGameRules = nullptr;
|
||||||
IEngineVGui *g_IEngineVGui = nullptr;
|
IEngineVGui *g_IEngineVGui = nullptr;
|
||||||
IUniformRandomStream *g_pUniformStream = nullptr;
|
IUniformRandomStream *g_pUniformStream = nullptr;
|
||||||
|
int *g_PredictionRandomSeed = nullptr;
|
||||||
|
#if ENABLE_NULL_GRAPHICS
|
||||||
|
IFileSystem *g_IFileSystem = nullptr;
|
||||||
|
IMDLCache *g_IMDLCache = nullptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename T> T *BruteforceInterface(std::string name, sharedobj::SharedObject &object, int start = 0)
|
template <typename T> T *BruteforceInterface(std::string name, sharedobj::SharedObject &object, int start = 0)
|
||||||
{
|
{
|
||||||
@ -162,6 +167,10 @@ void CreateInterfaces()
|
|||||||
g_pGameRules = *reinterpret_cast<CGameRules **>(g_pGameRules_sig + 8);
|
g_pGameRules = *reinterpret_cast<CGameRules **>(g_pGameRules_sig + 8);
|
||||||
}
|
}
|
||||||
g_IMaterialSystem = BruteforceInterface<IMaterialSystemFixed>("VMaterialSystem", sharedobj::materialsystem());
|
g_IMaterialSystem = BruteforceInterface<IMaterialSystemFixed>("VMaterialSystem", sharedobj::materialsystem());
|
||||||
|
#if ENABLE_NULL_GRAPHICS
|
||||||
|
g_IFileSystem = BruteforceInterface<IFileSystem>("VFileSystem", sharedobj::filesystem_stdio());
|
||||||
|
g_IMDLCache = BruteforceInterface<IMDLCache>("MDLCache", sharedobj::datacache());
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ENABLE_VISUALS
|
#if ENABLE_VISUALS
|
||||||
g_pUniformStream = **(IUniformRandomStream ***) (gSignatures.GetVstdSignature("A3 ? ? ? ? C3 89 F6") + 0x1);
|
g_pUniformStream = **(IUniformRandomStream ***) (gSignatures.GetVstdSignature("A3 ? ? ? ? C3 89 F6") + 0x1);
|
||||||
|
@ -96,6 +96,8 @@ void LoadAllSharedObjects()
|
|||||||
tier0().Load();
|
tier0().Load();
|
||||||
inputsystem().Load();
|
inputsystem().Load();
|
||||||
materialsystem().Load();
|
materialsystem().Load();
|
||||||
|
filesystem_stdio().Load();
|
||||||
|
datacache().Load();
|
||||||
#if ENABLE_VISUALS
|
#if ENABLE_VISUALS
|
||||||
vguimatsurface().Load();
|
vguimatsurface().Load();
|
||||||
vgui2().Load();
|
vgui2().Load();
|
||||||
@ -149,6 +151,17 @@ SharedObject &materialsystem()
|
|||||||
static SharedObject obj("materialsystem.so", true);
|
static SharedObject obj("materialsystem.so", true);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SharedObject &filesystem_stdio()
|
||||||
|
{
|
||||||
|
static SharedObject obj("filesystem_stdio.so", true);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
SharedObject &datacache()
|
||||||
|
{
|
||||||
|
static SharedObject obj("datacache.so", true);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
#if ENABLE_VISUALS
|
#if ENABLE_VISUALS
|
||||||
SharedObject &vguimatsurface()
|
SharedObject &vguimatsurface()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user