ManaPlus
debug.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2011-2018 The ManaPlus Developers
4  *
5  * This file is part of The ManaPlus Client.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include "localconsts.h"
22 
23 // #define DEBUG_JOYSTICK 1
24 
25 #ifdef ENABLE_MEM_DEBUG
26 
27 // #define _DEBUG_NEW_EMULATE_MALLOC 1
28 #include "debug/nvwa/debug_new.h"
29 
30 #endif // ENABLE_MEM_DEBUG
31 
32 #ifdef DEBUG_SDL_SURFACES
33 
34 #define MIMG_LoadPNG_RW(src) FakeIMG_LoadPNG_RW(src, __FILE__, __LINE__)
35 #define MIMG_LoadJPG_RW(src) FakeIMG_LoadJPG_RW(src, __FILE__, __LINE__)
36 #define MSDL_FreeSurface(s) FakeSDL_FreeSurface(s, __FILE__, __LINE__)
37 #define MSDL_CreateRGBSurface(flags, w, h, d, r, g, b, a) \
38  FakeSDL_CreateRGBSurface(flags, w, h, d, r, g, b, a, __FILE__, __LINE__)
39 #define MSDL_ConvertSurface(src, fmt, flags) \
40  FakeSDL_ConvertSurface(src, fmt, flags, __FILE__, __LINE__)
41 #define MTTF_RenderUTF8_Blended(font, text, fg) \
42  FakeTTF_RenderUTF8_Blended(font, text, fg, __FILE__, __LINE__)
43 #define MIMG_Load(file) FakeIMG_Load(file, __FILE__, __LINE__)
44 #define MSDL_DisplayFormatAlpha(surface) \
45  FakeSDL_DisplayFormatAlpha(surface, __FILE__, __LINE__)
46 #define MSDL_DisplayFormat(surface) \
47  FakeSDL_DisplayFormat(surface, __FILE__, __LINE__)
48 
49 #else // ENABLE_SDL_DEBUG
50 
51 #define MIMG_LoadPNG_RW(src) IMG_LoadPNG_RW(src)
52 #define MIMG_LoadJPG_RW(src) IMG_LoadJPG_RW(src)
53 #define MSDL_FreeSurface(surface) SDL_FreeSurface(surface)
54 #define MSDL_CreateRGBSurface(flags, w, h, d, r, g, b, a) \
55  SDL_CreateRGBSurface(flags, w, h, d, r, g, b, a)
56 #define MSDL_ConvertSurface(src, fmt, flags) \
57  SDL_ConvertSurface(src, fmt, flags)
58 #define MTTF_RenderUTF8_Blended(font, text, fg) \
59  TTF_RenderUTF8_Blended(font, text, fg)
60 #define MIMG_Load(file) IMG_Load(file)
61 #define MSDL_DisplayFormatAlpha(surface) SDL_DisplayFormatAlpha(surface)
62 #define MSDL_DisplayFormat(surface) SDL_DisplayFormat(surface)
63 
64 #endif // ENABLE_SDL_DEBUG