aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/gameutils.h
diff options
context:
space:
mode:
authorNorthstar <northstar@northstar.tf>2022-02-03 22:09:08 -0300
committerBarichello <artur@barichello.me>2022-02-03 22:09:08 -0300
commit75bf194b2fca06de805a7bc025c6dd8379250fa5 (patch)
treec9327ac7921ae80bb2d91381bb7db11b47ca2403 /NorthstarDedicatedTest/gameutils.h
parente9f93ba2e8b9df280aed20131a1606d731d2dbbe (diff)
downloadNorthstarLauncher-75bf194b2fca06de805a7bc025c6dd8379250fa5.tar.gz
NorthstarLauncher-75bf194b2fca06de805a7bc025c6dd8379250fa5.zip
Format project
Diffstat (limited to 'NorthstarDedicatedTest/gameutils.h')
-rw-r--r--NorthstarDedicatedTest/gameutils.h93
1 files changed, 47 insertions, 46 deletions
diff --git a/NorthstarDedicatedTest/gameutils.h b/NorthstarDedicatedTest/gameutils.h
index 48ad75e4..f382d6c0 100644
--- a/NorthstarDedicatedTest/gameutils.h
+++ b/NorthstarDedicatedTest/gameutils.h
@@ -4,36 +4,36 @@
// memory
class IMemAlloc
{
-public:
+ public:
struct VTable
{
void* unknown[1]; // alloc debug
- void* (*Alloc) (IMemAlloc* memAlloc, size_t nSize);
+ void* (*Alloc)(IMemAlloc* memAlloc, size_t nSize);
void* unknown2[1]; // realloc debug
void* (*Realloc)(IMemAlloc* memAlloc, void* pMem, size_t nSize);
void* unknown3[1]; // free #1
- void (*Free) (IMemAlloc* memAlloc, void* pMem);
+ void (*Free)(IMemAlloc* memAlloc, void* pMem);
void* unknown4[2]; // nullsubs, maybe CrtSetDbgFlag
- size_t(*GetSize) (IMemAlloc* memAlloc, void* pMem);
+ size_t (*GetSize)(IMemAlloc* memAlloc, void* pMem);
void* unknown5[9]; // they all do literally nothing
- void (*DumpStats) (IMemAlloc* memAlloc);
- void (*DumpStatsFileBase) (IMemAlloc* memAlloc, const char* pchFileBase);
+ void (*DumpStats)(IMemAlloc* memAlloc);
+ void (*DumpStatsFileBase)(IMemAlloc* memAlloc, const char* pchFileBase);
void* unknown6[4];
- int (*heapchk) (IMemAlloc* memAlloc);
+ int (*heapchk)(IMemAlloc* memAlloc);
};
VTable* m_vtable;
};
extern IMemAlloc* g_pMemAllocSingleton;
-typedef IMemAlloc*(*CreateGlobalMemAllocType)();
+typedef IMemAlloc* (*CreateGlobalMemAllocType)();
extern CreateGlobalMemAllocType CreateGlobalMemAlloc;
// cmd.h
enum class ECommandTarget_t
{
CBUF_FIRST_PLAYER = 0,
- CBUF_LAST_PLAYER = 1, // MAX_SPLITSCREEN_CLIENTS - 1, MAX_SPLITSCREEN_CLIENTS = 2
+ CBUF_LAST_PLAYER = 1, // MAX_SPLITSCREEN_CLIENTS - 1, MAX_SPLITSCREEN_CLIENTS = 2
CBUF_SERVER = CBUF_LAST_PLAYER + 1,
CBUF_COUNT,
@@ -75,20 +75,20 @@ enum class cmd_source_t
kCommandSrcInvalid = -1
};
-typedef ECommandTarget_t(*Cbuf_GetCurrentPlayerType)();
+typedef ECommandTarget_t (*Cbuf_GetCurrentPlayerType)();
extern Cbuf_GetCurrentPlayerType Cbuf_GetCurrentPlayer;
// compared to the defs i've seen, this is missing an arg, it could be nTickInterval or source, not sure, guessing it's source
-typedef void(*Cbuf_AddTextType)(ECommandTarget_t eTarget, const char* text, cmd_source_t source);
+typedef void (*Cbuf_AddTextType)(ECommandTarget_t eTarget, const char* text, cmd_source_t source);
extern Cbuf_AddTextType Cbuf_AddText;
-typedef void(*Cbuf_ExecuteType)();
+typedef void (*Cbuf_ExecuteType)();
extern Cbuf_ExecuteType Cbuf_Execute;
// commandline stuff
class CCommandLine
{
-public:
+ public:
// based on the defs in the 2013 source sdk, but for some reason has an extra function (may be another CreateCmdLine overload?)
// these seem to line up with what they should be though
virtual void CreateCmdLine(const char* commandline) {}
@@ -109,7 +109,7 @@ public:
virtual const char* GetParm(int nIndex) const {}
virtual void SetParm(int nIndex, char const* pParm) {}
- //virtual const char** GetParms() const {}
+ // virtual const char** GetParms() const {}
};
// hoststate stuff
@@ -127,7 +127,7 @@ enum HostState_t
struct CHostState
{
-public:
+ public:
HostState_t m_iCurrentState;
HostState_t m_iNextState;
@@ -138,16 +138,17 @@ public:
char m_mapGroupName[32];
char m_landmarkName[32];
char m_saveName[32];
- float m_flShortFrameTime; // run a few one-tick frames to avoid large timesteps while loading assets
-
- bool m_activeGame;
- bool m_bRememberLocation;
- bool m_bBackgroundLevel;
- bool m_bWaitingForConnection;
- bool m_bLetToolsOverrideLoadGameEnts; // During a load game, this tells Foundry to override ents that are selected in Hammer.
- bool m_bSplitScreenConnect;
- bool m_bGameHasShutDownAndFlushedMemory; // This is false once we load a map into memory, and set to true once the map is unloaded and all memory flushed
- bool m_bWorkshopMapDownloadPending;
+ float m_flShortFrameTime; // run a few one-tick frames to avoid large timesteps while loading assets
+
+ bool m_activeGame;
+ bool m_bRememberLocation;
+ bool m_bBackgroundLevel;
+ bool m_bWaitingForConnection;
+ bool m_bLetToolsOverrideLoadGameEnts; // During a load game, this tells Foundry to override ents that are selected in Hammer.
+ bool m_bSplitScreenConnect;
+ bool m_bGameHasShutDownAndFlushedMemory; // This is false once we load a map into memory, and set to true once the map is unloaded and
+ // all memory flushed
+ bool m_bWorkshopMapDownloadPending;
};
extern CHostState* g_pHostState;
@@ -162,17 +163,17 @@ enum EngineQuitState
enum EngineState_t
{
- DLL_INACTIVE = 0, // no dll
- DLL_ACTIVE, // engine is focused
- DLL_CLOSE, // closing down dll
- DLL_RESTART, // engine is shutting down but will restart right away
- DLL_PAUSED, // engine is paused, can become active from this state
+ DLL_INACTIVE = 0, // no dll
+ DLL_ACTIVE, // engine is focused
+ DLL_CLOSE, // closing down dll
+ DLL_RESTART, // engine is shutting down but will restart right away
+ DLL_PAUSED, // engine is paused, can become active from this state
};
class CEngine
{
-public:
- virtual void unknown() {} // unsure if this is where
+ public:
+ virtual void unknown() {} // unsure if this is where
virtual bool Load(bool dedicated, const char* baseDir) {}
virtual void Unload() {}
virtual void SetNextState(EngineState_t iNextState) {}
@@ -195,10 +196,10 @@ extern CEngine* g_pEngine;
enum server_state_t
{
- ss_dead = 0, // Dead
- ss_loading, // Spawning
- ss_active, // Running
- ss_paused, // Running, but paused
+ ss_dead = 0, // Dead
+ ss_loading, // Spawning
+ ss_active, // Running
+ ss_paused, // Running, but paused
};
extern server_state_t* sv_m_State;
@@ -208,20 +209,20 @@ extern ConVar* Cvar_hostport;
extern ConVar* Cvar_net_datablock_enabled;
// playlist stuff
-typedef const char*(*GetCurrentPlaylistType)();
+typedef const char* (*GetCurrentPlaylistType)();
extern GetCurrentPlaylistType GetCurrentPlaylistName;
-typedef void(*SetCurrentPlaylistType)(const char* playlistName);
+typedef void (*SetCurrentPlaylistType)(const char* playlistName);
extern SetCurrentPlaylistType SetCurrentPlaylist;
-typedef void(*SetPlaylistVarOverrideType)(const char* varName, const char* value);
+typedef void (*SetPlaylistVarOverrideType)(const char* varName, const char* value);
extern SetPlaylistVarOverrideType SetPlaylistVarOverride;
-typedef char*(*GetCurrentPlaylistVarType)(const char* varName, bool useOverrides);
+typedef char* (*GetCurrentPlaylistVarType)(const char* varName, bool useOverrides);
extern GetCurrentPlaylistVarType GetCurrentPlaylistVar;
// server entity stuff
-typedef void*(*Server_GetEntityByIndexType)(int index);
+typedef void* (*Server_GetEntityByIndexType)(int index);
extern Server_GetEntityByIndexType Server_GetEntityByIndex;
// server tickrate stuff
@@ -236,19 +237,19 @@ extern char* g_LocalPlayerOriginToken;
extern ConVar* Cvar_match_defaultMap;
extern ConVar* Cvar_communities_hostname;
-typedef void(*ErrorType)(const char* fmt, ...);
+typedef void (*ErrorType)(const char* fmt, ...);
extern ErrorType Error;
-typedef CCommandLine*(*CommandLineType)();
+typedef CCommandLine* (*CommandLineType)();
extern CommandLineType CommandLine;
-typedef double(*Plat_FloatTimeType)();
+typedef double (*Plat_FloatTimeType)();
extern Plat_FloatTimeType Plat_FloatTime;
-typedef bool(*ThreadInServerFrameThreadType)();
+typedef bool (*ThreadInServerFrameThreadType)();
extern ThreadInServerFrameThreadType ThreadInServerFrameThread;
-typedef void*(*GetBaseLocalClientType)();
+typedef void* (*GetBaseLocalClientType)();
extern GetBaseLocalClientType GetBaseLocalClient;
void InitialiseEngineGameUtilFunctions(HMODULE baseAddress);