summaryrefslogtreecommitdiffstats
path: root/src/skel
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-11-26 16:44:57 +0100
committerGitHub <noreply@github.com>2020-11-26 16:44:57 +0100
commitf55859a79f4b867344756a8bf7b43a3738aa699e (patch)
tree9e38a65296bb049d0292948c135ef8f3a939df9b /src/skel
parentrename badly named camera variable (diff)
parentmemory heap starting to work (diff)
downloadre3-f55859a79f4b867344756a8bf7b43a3738aa699e.tar
re3-f55859a79f4b867344756a8bf7b43a3738aa699e.tar.gz
re3-f55859a79f4b867344756a8bf7b43a3738aa699e.tar.bz2
re3-f55859a79f4b867344756a8bf7b43a3738aa699e.tar.lz
re3-f55859a79f4b867344756a8bf7b43a3738aa699e.tar.xz
re3-f55859a79f4b867344756a8bf7b43a3738aa699e.tar.zst
re3-f55859a79f4b867344756a8bf7b43a3738aa699e.zip
Diffstat (limited to 'src/skel')
-rw-r--r--src/skel/glfw/glfw.cpp9
-rw-r--r--src/skel/win/win.cpp11
2 files changed, 19 insertions, 1 deletions
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index 982e8641..2722a4df 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -40,6 +40,7 @@
#include "Sprite2d.h"
#include "AnimViewer.h"
#include "Font.h"
+#include "MemoryHeap.h"
#define MAX_SUBSYSTEMS (16)
@@ -277,7 +278,11 @@ psMouseSetPos(RwV2d *pos)
RwMemoryFunctions*
psGetMemoryFunctions(void)
{
+#ifdef USE_CUSTOM_ALLOCATOR
+ return &memFuncs;
+#else
return nil;
+#endif
}
/*
@@ -1461,6 +1466,10 @@ main(int argc, char *argv[])
RwV2d pos;
RwInt32 i;
+#ifdef USE_CUSTOM_ALLOCATOR
+ InitMemoryMgr();
+#endif
+
#ifndef _WIN32
struct sigaction act;
act.sa_sigaction = terminateHandler;
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index 9effaa31..b4897d67 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -97,6 +97,7 @@ static psGlobalType PsGlobal;
#include "Sprite2d.h"
#include "AnimViewer.h"
#include "Font.h"
+#include "MemoryHeap.h"
VALIDATE_SIZE(psGlobalType, 0x28);
@@ -304,7 +305,11 @@ psMouseSetPos(RwV2d *pos)
RwMemoryFunctions*
psGetMemoryFunctions(void)
{
+#ifdef USE_CUSTOM_ALLOCATOR
+ return &memFuncs;
+#else
return nil;
+#endif
}
/*
@@ -2006,7 +2011,11 @@ WinMain(HINSTANCE instance,
RwChar **argv;
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE);
-#if 0
+#ifdef USE_CUSTOM_ALLOCATOR
+ InitMemoryMgr();
+#endif
+
+#if 1
// TODO: make this an option somewhere
AllocConsole();
freopen("CONIN$", "r", stdin);