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