diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-26 16:09:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-26 16:52:08 +0300 |
commit | 929aeb1591e739588cd8cf629e7d7ac5a95261b1 (patch) | |
tree | 2b61b477d0e0ffed31a90ba2d6c019da926282aa /src/debug.h | |
parent | b661524e8b7b41cec237492ecd52fdda7b9be394 (diff) | |
download | plus-929aeb1591e739588cd8cf629e7d7ac5a95261b1.tar.gz plus-929aeb1591e739588cd8cf629e7d7ac5a95261b1.tar.bz2 plus-929aeb1591e739588cd8cf629e7d7ac5a95261b1.tar.xz plus-929aeb1591e739588cd8cf629e7d7ac5a95261b1.zip |
add surface allocation debug code.
Diffstat (limited to 'src/debug.h')
-rw-r--r-- | src/debug.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/debug.h b/src/debug.h index 35edf12a0..a250aef68 100644 --- a/src/debug.h +++ b/src/debug.h @@ -33,9 +33,36 @@ #define reportTrue(val) reportTrue1(val, __FILE__, __LINE__) #define reportTrue1(val, file, line) reportTrueReal(val, file, line) -#else +#else // ENABLE_MEM_DEBUG #define reportFalse(val) (val) #define reportTrue(val) (val) -#endif +#endif // ENABLE_MEM_DEBUG + + +#ifdef DEBUG_SDL_SURFACES + +#define MIMG_LoadPNG_RW(src) FakeIMG_LoadPNG_RW(src, __FILE__, __LINE__) +#define MSDL_FreeSurface(s) FakeSDL_FreeSurface(s, __FILE__, __LINE__) +#define MSDL_CreateRGBSurface(flags, w, h, d, r, g, b, a) \ + FakeSDL_CreateRGBSurface(flags, w, h, d, r, g, b, a, __FILE__, __LINE__) +#define MSDL_ConvertSurface(src, fmt, flags) \ + FakeSDL_ConvertSurface(src, fmt, flags, __FILE__, __LINE__) +#define MTTF_RenderUTF8_Blended(font, text, fg) \ + FakeTTF_RenderUTF8_Blended(font, text, fg, __FILE__, __LINE__) +#define MIMG_Load(file) FakeIMG_Load(file, __FILE__, __LINE__) + +#else + +#define MIMG_LoadPNG_RW(src) IMG_LoadPNG_RW(src) +#define MSDL_FreeSurface(surface) SDL_FreeSurface(surface) +#define MSDL_CreateRGBSurface(flags, w, h, d, r, g, b, a) \ + SDL_CreateRGBSurface(flags, w, h, d, r, g, b, a) +#define MSDL_ConvertSurface(src, fmt, flags) \ + SDL_ConvertSurface(src, fmt, flags) +#define MTTF_RenderUTF8_Blended(font, text, fg) \ + TTF_RenderUTF8_Blended(font, text, fg) +#define MIMG_Load(file) IMG_Load(file) + +#endif // ENABLE_SDL_DEBUG |