ScummVM API documentation
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#ifdef FORCE_TEXT_CONSOLE
26#undef DISABLE_TEXT_CONSOLE
27#endif
28
29#include "common/scummsys.h"
30
31#ifdef DISABLE_TEXT_CONSOLE
32
33static inline void debug(const char *s, ...) {}
34static inline void debug(int level, const char *s, ...) {}
35static inline void debugN(const char *s, ...) {}
36static inline void debugN(int level, const char *s, ...) {}
37static inline void debugC(int level, uint32 debugChannel, const char *s, ...) {}
38static inline void debugC(uint32 debugChannel, const char *s, ...) {}
39static inline void debugCN(int level, uint32 debugChannel, const char *s, ...) {}
40static inline void debugCN(uint32 debugChannel, const char *s, ...) {}
41
42#else
43
56void debug(MSVC_PRINTF const char *s, ...) GCC_PRINTF(1, 2);
57
64void debug(int level, MSVC_PRINTF const char *s, ...) GCC_PRINTF(2, 3);
65
70void debugN(MSVC_PRINTF const char *s, ...) GCC_PRINTF(1, 2);
71
78void debugN(int level, MSVC_PRINTF const char *s, ...) GCC_PRINTF(2, 3);
79
92void debugC(int level, uint32 debugChannel, MSVC_PRINTF const char *s, ...) GCC_PRINTF(3, 4);
93
107void debugCN(int level, uint32 debugChannel, MSVC_PRINTF const char *s, ...) GCC_PRINTF(3, 4);
108
118void debugC(uint32 debugChannel, MSVC_PRINTF const char *s, ...) GCC_PRINTF(2, 3);
119
129void debugCN(uint32 debugChannel, MSVC_PRINTF const char *s, ...) GCC_PRINTF(2, 3);
130
131#endif
132
136bool debugLevelSet(int level);
137
145bool debugChannelSet(int level, uint32 debugChannel);
146
153extern int gDebugLevel;
154
162extern bool gDebugChannelsOnly;
163
166 kDebugGlobalDetection = 100000,
167 kDebugLevelEventRec,
168 kDebugLevelMainGUI,
169 kDebugLevelMacGUI,
170 kDebugLevelMacToolbox,
171 kDebugLevelGGraphics,
172 kDebugLevelGVideo,
173 kDebugLevelGAudio,
174 kDebugImGui,
175};
176
179#endif
void void void void void debugC(int level, uint32 debugChannel, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
void void void void void void debugCN(int level, uint32 debugChannel, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
int gDebugLevel
bool debugChannelSet(int level, uint32 debugChannel)
void debug(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
void void void void void void void void bool debugLevelSet(int level)
void void void debugN(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
GlobalDebugLevels
Definition: debug.h:165
bool gDebugChannelsOnly
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]