aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/gameutils.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-03 20:55:19 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-03 20:55:19 +0000
commit9e8232e97db1cfe9f0f9a69bdfde5048a6290df1 (patch)
treebe1324c39dd1680335f4bfaf3d1660b5d6e31514 /NorthstarDedicatedTest/gameutils.cpp
parentf33bab4fb3586fd06896a7730bce8913c2616b78 (diff)
downloadNorthstarLauncher-9e8232e97db1cfe9f0f9a69bdfde5048a6290df1.tar.gz
NorthstarLauncher-9e8232e97db1cfe9f0f9a69bdfde5048a6290df1.zip
slightly awful fix for allocation issues
Diffstat (limited to 'NorthstarDedicatedTest/gameutils.cpp')
-rw-r--r--NorthstarDedicatedTest/gameutils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/gameutils.cpp b/NorthstarDedicatedTest/gameutils.cpp
index 714395c6..c0c01aad 100644
--- a/NorthstarDedicatedTest/gameutils.cpp
+++ b/NorthstarDedicatedTest/gameutils.cpp
@@ -3,6 +3,11 @@
#include "convar.h"
#include "concommand.h"
+// memory
+IMemAlloc* g_pMemAllocSingleton;
+typedef IMemAlloc* (*CreateGlobalMemAllocType)();
+CreateGlobalMemAllocType CreateGlobalMemAlloc;
+
// cmd.h
Cbuf_GetCurrentPlayerType Cbuf_GetCurrentPlayer;
Cbuf_AddTextType Cbuf_AddText;
@@ -75,6 +80,9 @@ void InitialiseTier0GameUtilFunctions(HMODULE baseAddress)
{
baseAddress = GetModuleHandleA("tier0.dll");
+ CreateGlobalMemAlloc = (CreateGlobalMemAllocType)GetProcAddress(baseAddress, "CreateGlobalMemAlloc");
+ g_pMemAllocSingleton = CreateGlobalMemAlloc();
+
Error = (ErrorType)GetProcAddress(baseAddress, "Error");
CommandLine = (CommandLineType)GetProcAddress(baseAddress, "CommandLine");
Plat_FloatTime = (Plat_FloatTimeType)GetProcAddress(baseAddress, "Plat_FloatTime");