diff options
author | Nikolay <nickvnuk@gmail.com> | 2020-12-19 17:15:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-19 17:15:52 +0100 |
commit | 867133e93d57dba5319bb13abeeb3f73bbaf6ae1 (patch) | |
tree | e16891b3bd62f38bc959c295ebeca1aa6b9952d7 /src/skel | |
parent | silly mistake (diff) | |
parent | fixed cmakelists (diff) | |
download | re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.gz re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.bz2 re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.lz re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.xz re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.tar.zst re3-867133e93d57dba5319bb13abeeb3f73bbaf6ae1.zip |
Diffstat (limited to 'src/skel')
-rw-r--r-- | src/skel/glfw/glfw.cpp | 9 | ||||
-rw-r--r-- | src/skel/skeleton.cpp | 5 | ||||
-rw-r--r-- | src/skel/win/win.cpp | 9 |
3 files changed, 23 insertions, 0 deletions
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index 418f93e4..f039819c 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 "MemoryMgr.h" #define MAX_SUBSYSTEMS (16) @@ -279,7 +280,11 @@ psMouseSetPos(RwV2d *pos) RwMemoryFunctions* psGetMemoryFunctions(void) { +#ifdef USE_CUSTOM_ALLOCATOR + return &memFuncs; +#else return nil; +#endif } /* @@ -1521,6 +1526,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/skeleton.cpp b/src/skel/skeleton.cpp index a21d5674..0d70f27d 100644 --- a/src/skel/skeleton.cpp +++ b/src/skel/skeleton.cpp @@ -11,6 +11,7 @@ #include "skeleton.h" #include "platform.h" #include "main.h" +#include "MemoryHeap.h" // --MIAMI: file done @@ -306,6 +307,8 @@ RsRwInitialize(void *displayID) { RwEngineOpenParams openParams; + PUSH_MEMID(MEMID_RENDER); // NB: not popped on failed return + /* * Start RenderWare... */ @@ -373,6 +376,8 @@ RsRwInitialize(void *displayID) RwTextureSetAutoMipmapping(TRUE); RwTextureSetMipmapping(FALSE); + POP_MEMID(); + return TRUE; } diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index a437a3b4..1fd959f2 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -98,6 +98,7 @@ static psGlobalType PsGlobal; #include "Sprite2d.h" #include "AnimViewer.h" #include "Font.h" +#include "MemoryMgr.h" VALIDATE_SIZE(psGlobalType, 0x28); @@ -309,7 +310,11 @@ psMouseSetPos(RwV2d *pos) RwMemoryFunctions* psGetMemoryFunctions(void) { +#ifdef USE_CUSTOM_ALLOCATOR + return &memFuncs; +#else return nil; +#endif } /* @@ -2009,6 +2014,10 @@ WinMain(HINSTANCE instance, } #endif +#ifdef USE_CUSTOM_ALLOCATOR + InitMemoryMgr(); +#endif + /* * Initialize the platform independent data. * This will in turn initialize the platform specific data... |