runtimelib: Disable debug code outside of debug builds
This commit is contained in:
+404
-79
File diff suppressed because it is too large
Load Diff
@@ -48,6 +48,7 @@ static unsigned curr_clsColor;
|
|||||||
|
|
||||||
static vector<GfxMode> gfx_modes;
|
static vector<GfxMode> gfx_modes;
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
static inline void debugImage(bbImage *i, int frame = 0) {
|
static inline void debugImage(bbImage *i, int frame = 0) {
|
||||||
if (debug) {
|
if (debug) {
|
||||||
if (!image_set.count(i)) ThrowRuntimeException("Image does not exist");
|
if (!image_set.count(i)) ThrowRuntimeException("Image does not exist");
|
||||||
@@ -82,6 +83,13 @@ static inline void debugMode(int n) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define debugImage
|
||||||
|
#define debugFont
|
||||||
|
#define debugCanvas
|
||||||
|
#define debugDriver
|
||||||
|
#define debugMode
|
||||||
|
#endif
|
||||||
|
|
||||||
void bbFreeImage(bbImage *i);
|
void bbFreeImage(bbImage *i);
|
||||||
|
|
||||||
|
|||||||
@@ -301,11 +301,13 @@ int bbCountHostIPs(BBStr *host) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int bbHostIP(int index) {
|
int bbHostIP(int index) {
|
||||||
|
#ifdef _DEBUG
|
||||||
if (debug) {
|
if (debug) {
|
||||||
if (index<1 || index>host_ips.size()) {
|
if (index<1 || index>host_ips.size()) {
|
||||||
ThrowRuntimeException("Host index out of range");
|
ThrowRuntimeException("Host index out of range");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return host_ips[index - 1];
|
return host_ips[index - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user