mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
KeyValues: fix singleton accessor compile errors
Make each instance implement the accessor instead of the KeyValues system itself.
This commit is contained in:
parent
ab58decd9b
commit
89bb7f35c8
@ -648,4 +648,12 @@ void DetourRegister() // Register detour classes to be searched and hooked.
|
|||||||
REGISTER(VInputSystem);
|
REGISTER(VInputSystem);
|
||||||
REGISTER(VDXGI);
|
REGISTER(VDXGI);
|
||||||
#endif // !DEDICATED
|
#endif // !DEDICATED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Singleton accessors:
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
IKeyValuesSystem* KeyValuesSystem()
|
||||||
|
{
|
||||||
|
return g_pKeyValuesSystem;
|
||||||
|
}
|
||||||
|
@ -20,6 +20,14 @@
|
|||||||
static CKeyValuesSystem s_KeyValuesSystem;
|
static CKeyValuesSystem s_KeyValuesSystem;
|
||||||
static CFileSystem_Stdio g_FullFileSystem;
|
static CFileSystem_Stdio g_FullFileSystem;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: keyvalues singleton accessor
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
IKeyValuesSystem* KeyValuesSystem()
|
||||||
|
{
|
||||||
|
return &s_KeyValuesSystem;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: filesystem singleton accessor
|
// Purpose: filesystem singleton accessor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -33,10 +41,6 @@ CFileSystem_Stdio* FileSystem()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
static void ReVPK_Init()
|
static void ReVPK_Init()
|
||||||
{
|
{
|
||||||
// Assign global kv accessor to static singleton object as we aren't linked
|
|
||||||
// to the game!!!
|
|
||||||
g_pKeyValuesSystem = &s_KeyValuesSystem;
|
|
||||||
|
|
||||||
g_CoreMsgVCallback = EngineLoggerSink;
|
g_CoreMsgVCallback = EngineLoggerSink;
|
||||||
lzham_enable_fail_exceptions(true);
|
lzham_enable_fail_exceptions(true);
|
||||||
|
|
||||||
|
@ -50,6 +50,9 @@
|
|||||||
#define MEM_4BYTES_FROM_0_AND_3BYTES( x03bytes ) ( ( (uint32) (x03bytes) ) & 0x00FFFFFF )
|
#define MEM_4BYTES_FROM_0_AND_3BYTES( x03bytes ) ( ( (uint32) (x03bytes) ) & 0x00FFFFFF )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
CKeyValuesSystem* g_pKeyValuesSystem = nullptr;
|
||||||
|
void* g_pKeyValuesMemPool = nullptr;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Constructor
|
// Purpose: Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -6,7 +6,11 @@
|
|||||||
#include "tier1/utlvector.h"
|
#include "tier1/utlvector.h"
|
||||||
#include "tier1/utlmap.h"
|
#include "tier1/utlmap.h"
|
||||||
|
|
||||||
inline void* g_pKeyValuesMemPool = nullptr;
|
class CKeyValuesSystem;
|
||||||
|
|
||||||
|
/* ==== KEYVALUESSYSTEM ================================================================================================================================================= */
|
||||||
|
extern CKeyValuesSystem* g_pKeyValuesSystem;
|
||||||
|
extern void* g_pKeyValuesMemPool;
|
||||||
|
|
||||||
class CKeyValuesSystem : public IKeyValuesSystem// VTABLE @ 0x1413AA1E8 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
|
class CKeyValuesSystem : public IKeyValuesSystem// VTABLE @ 0x1413AA1E8 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
|
||||||
{
|
{
|
||||||
@ -103,17 +107,6 @@ private:
|
|||||||
CThreadFastMutex m_Mutex;
|
CThreadFastMutex m_Mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ==== KEYVALUESSYSTEM ================================================================================================================================================= */
|
|
||||||
inline CKeyValuesSystem* g_pKeyValuesSystem = nullptr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Instance singleton and expose interface to rest of code
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
FORCEINLINE IKeyValuesSystem* KeyValuesSystem()
|
|
||||||
{
|
|
||||||
return g_pKeyValuesSystem;
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class HKeyValuesSystem : public IDetour
|
class HKeyValuesSystem : public IDetour
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user