diff options
author | aap <aap@papnet.eu> | 2020-04-25 11:25:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-25 11:25:19 +0200 |
commit | ad9ebbd390e06de485d6d212f498326cc7d73d83 (patch) | |
tree | 7bc1ccc789ebbc5a22e57ec5ee65ac1ea8d3afb7 /src/rw | |
parent | disable mouse steering by default (diff) | |
parent | implemented debugmenu (diff) | |
download | re3-ad9ebbd390e06de485d6d212f498326cc7d73d83.tar re3-ad9ebbd390e06de485d6d212f498326cc7d73d83.tar.gz re3-ad9ebbd390e06de485d6d212f498326cc7d73d83.tar.bz2 re3-ad9ebbd390e06de485d6d212f498326cc7d73d83.tar.lz re3-ad9ebbd390e06de485d6d212f498326cc7d73d83.tar.xz re3-ad9ebbd390e06de485d6d212f498326cc7d73d83.tar.zst re3-ad9ebbd390e06de485d6d212f498326cc7d73d83.zip |
Diffstat (limited to '')
-rw-r--r-- | src/rw/RwHelper.cpp | 11 | ||||
-rw-r--r-- | src/rw/RwHelper.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index 5aa4475f..02a07558 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -9,12 +9,20 @@ RtCharset *debugCharset; #endif +static bool charsetOpen; +void OpenCharsetSafe() +{ + if(!charsetOpen) + RtCharsetOpen(); + charsetOpen = true; +} + void CreateDebugFont() { #ifndef FINAL RwRGBA color = { 255, 255, 128, 255 }; RwRGBA colorbg = { 0, 0, 0, 0 }; - RtCharsetOpen(); + OpenCharsetSafe(); debugCharset = RtCharsetCreate(&color, &colorbg); #endif } @@ -24,6 +32,7 @@ void DestroyDebugFont() #ifndef FINAL RtCharsetDestroy(debugCharset); RtCharsetClose(); + charsetOpen = false; #endif } diff --git a/src/rw/RwHelper.h b/src/rw/RwHelper.h index 9f178ec2..e6740031 100644 --- a/src/rw/RwHelper.h +++ b/src/rw/RwHelper.h @@ -3,6 +3,7 @@ void *RwMallocAlign(RwUInt32 size, RwUInt32 align); void RwFreeAlign(void *mem); +void OpenCharsetSafe(); void CreateDebugFont(); void DestroyDebugFont(); void ObrsPrintfString(const char *str, short x, short y); |