ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
debug.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
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 3 of the License, or
10  * (at your option) 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 
22 #ifndef COMMON_DEBUG_H
23 #define COMMON_DEBUG_H
24 
25 #include "common/scummsys.h"
26 
27 #ifdef DISABLE_TEXT_CONSOLE
28 
29 inline void debug(const char *s, ...) {}
30 inline void debug(int level, const char *s, ...) {}
31 inline void debugN(const char *s, ...) {}
32 inline void debugN(int level, const char *s, ...) {}
33 inline void debugC(int level, uint32 debugChannel, const char *s, ...) {}
34 inline void debugC(uint32 debugChannel, const char *s, ...) {}
35 inline void debugCN(int level, uint32 debugChannel, const char *s, ...) {}
36 inline void debugCN(uint32 debugChannel, const char *s, ...) {}
37 
38 #else
39 
52 void debug(MSVC_PRINTF const char *s, ...) GCC_PRINTF(1, 2);
53 
60 void debug(int level, MSVC_PRINTF const char *s, ...) GCC_PRINTF(2, 3);
61 
66 void debugN(MSVC_PRINTF const char *s, ...) GCC_PRINTF(1, 2);
67 
74 void debugN(int level, MSVC_PRINTF const char *s, ...) GCC_PRINTF(2, 3);
75 
88 void debugC(int level, uint32 debugChannel, MSVC_PRINTF const char *s, ...) GCC_PRINTF(3, 4);
89 
103 void debugCN(int level, uint32 debugChannel, MSVC_PRINTF const char *s, ...) GCC_PRINTF(3, 4);
104 
114 void debugC(uint32 debugChannel, MSVC_PRINTF const char *s, ...) GCC_PRINTF(2, 3);
115 
125 void debugCN(uint32 debugChannel, MSVC_PRINTF const char *s, ...) GCC_PRINTF(2, 3);
126 
127 #endif
128 
132 bool debugLevelSet(int level);
133 
141 bool debugChannelSet(int level, uint32 debugChannel);
142 
149 extern int gDebugLevel;
150 
158 extern bool gDebugChannelsOnly;
159 
162  kDebugGlobalDetection = 100000,
163  kDebugLevelEventRec,
164  kDebugLevelMainGUI,
165  kDebugLevelMacGUI,
166  kDebugLevelGGraphics,
167  kDebugLevelGVideo,
168 };
169 
172 #endif
bool debugChannelSet(int level, uint32 debugChannel)
void void void debugN(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
void void void void void void debugCN(int level, uint32 debugChannel, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
void void void void void debugC(int level, uint32 debugChannel, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]
void debug(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
void void void void void void void void bool debugLevelSet(int level)
GlobalDebugLevels
Definition: debug.h:161
bool gDebugChannelsOnly
int gDebugLevel