diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-25 11:26:37 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-25 11:26:37 +0200 |
commit | bb14d9689fbd28ea2b8e340472e3e593e4b84c1e (patch) | |
tree | 8f30747dab46c7ccf3ade06946aab1956664e798 /src/extras/debugmenu.cpp | |
parent | Merge remote-tracking branch 'upstream/master' (diff) | |
parent | Merge branch 'master' of github.com:gtamodding/re3 (diff) | |
download | re3-bb14d9689fbd28ea2b8e340472e3e593e4b84c1e.tar re3-bb14d9689fbd28ea2b8e340472e3e593e4b84c1e.tar.gz re3-bb14d9689fbd28ea2b8e340472e3e593e4b84c1e.tar.bz2 re3-bb14d9689fbd28ea2b8e340472e3e593e4b84c1e.tar.lz re3-bb14d9689fbd28ea2b8e340472e3e593e4b84c1e.tar.xz re3-bb14d9689fbd28ea2b8e340472e3e593e4b84c1e.tar.zst re3-bb14d9689fbd28ea2b8e340472e3e593e4b84c1e.zip |
Diffstat (limited to 'src/extras/debugmenu.cpp')
-rw-r--r-- | src/extras/debugmenu.cpp | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/src/extras/debugmenu.cpp b/src/extras/debugmenu.cpp index d6ee18ab..f419e76f 100644 --- a/src/extras/debugmenu.cpp +++ b/src/extras/debugmenu.cpp @@ -95,6 +95,18 @@ createMenuFont(void) RtCharsetGetDesc(fontStyles[MENUFONT_NORMAL], &fontDesc); } +void +destroyMenuFont(void) +{ + RtCharsetDestroy(fontStyles[MENUFONT_NORMAL]); + fontStyles[MENUFONT_NORMAL] = nil; + RtCharsetDestroy(fontStyles[MENUFONT_SEL_ACTIVE]); + fontStyles[MENUFONT_SEL_ACTIVE] = nil; + RtCharsetDestroy(fontStyles[MENUFONT_SEL_INACTIVE]); + fontStyles[MENUFONT_SEL_INACTIVE] = nil; + RtCharsetDestroy(fontStyles[MENUFONT_MOUSE]); + fontStyles[MENUFONT_MOUSE] = nil; +} @@ -755,7 +767,7 @@ static uint8 arrowPx[] = { }; void -initDebug(void) +DebugMenuInit(void) { createMenuFont(); @@ -779,6 +791,22 @@ initDebug(void) arrow = RwRasterSetFromImage(arrow, img); assert(arrow); RwImageDestroy(img); + + menuInitialized = true; +} + +void +DebugMenuShutdown(void) +{ + if(menuInitialized){ + destroyMenuFont(); + RwRasterDestroy(cursor); + cursor = nil; + RwRasterDestroy(arrow); + arrow = nil; + // TODO: the menus ... + } + menuInitialized = false; } void @@ -971,10 +999,8 @@ DebugMenuProcess(void) pad->DisablePlayerControls = 1; // TODO: this could happen earlier - if(!menuInitialized){ - initDebug(); - menuInitialized = 1; - } + if(!menuInitialized) + DebugMenuInit(); updateMouse(); } |