diff --git a/.github/workflows/test_builds.yaml b/.github/workflows/test_builds.yaml index 2d2bff7a2..87d4e0226 100644 --- a/.github/workflows/test_builds.yaml +++ b/.github/workflows/test_builds.yaml @@ -47,14 +47,14 @@ jobs: ShellScripts/Linux/install_mozilla_js.sh system - name: Build Oolite run: | - ./mk.sh build dev + ./mk.sh build deployment - name: Test Oolite if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name run: | - ./mk.sh test dev + ./mk.sh test deployment - name: Build AppImage run: | - ./mk.sh pkg-appimage dev + ./mk.sh pkg-appimage deployment fedora: runs-on: ubuntu-latest @@ -94,14 +94,14 @@ jobs: ldconfig - name: Build Oolite run: | - ./mk.sh build dev + ./mk.sh build deployment - name: Test Oolite if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name run: | - ./mk.sh test dev + ./mk.sh test deployment - name: Build AppImage run: | - ./mk.sh pkg-appimage dev + ./mk.sh pkg-appimage deployment arch: runs-on: ubuntu-latest @@ -141,14 +141,14 @@ jobs: ldconfig - name: Build Oolite run: | - ./mk.sh build dev + ./mk.sh build deployment - name: Test Oolite if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name run: | - ./mk.sh test dev + ./mk.sh test deployment - name: Build AppImage run: | - ./mk.sh pkg-appimage dev + ./mk.sh pkg-appimage deployment windows: runs-on: windows-latest @@ -187,7 +187,7 @@ jobs: msystem: UCRT64 PYTHONUTF8: "1" run: | - ./mk.sh build dev + ./mk.sh build deployment - name: Test Oolite if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name @@ -196,4 +196,4 @@ jobs: msystem: UCRT64 PYTHONUTF8: "1" run: | - ./mk.sh test dev + ./mk.sh test deployment diff --git a/ShellScripts/common/post_build.sh b/ShellScripts/common/post_build.sh index 4a65d3973..6d2d1a281 100755 --- a/ShellScripts/common/post_build.sh +++ b/ShellScripts/common/post_build.sh @@ -38,12 +38,10 @@ run_script() { return 1 fi generate_manifest "$resourcesdir/manifest.plist" "$deployment_release" "$ver_full" "$ver_quad" "$ver_githash" "$buildtime" - if [[ "$deployment_release" == "no" ]]; then - local addonsdir="$progdir/AddOns" - mkdir -p "$addonsdir" - rm -rf "$addonsdir/Basic-debug.oxp" - cp -rf DebugOXP/Debug.oxp "$addonsdir/Basic-debug.oxp" - fi + local addonsdir="$progdir/AddOns" + mkdir -p "$addonsdir" + rm -rf "$addonsdir/Basic-debug.oxp" + cp -rf DebugOXP/Debug.oxp "$addonsdir/Basic-debug.oxp" # Voice Data if [[ "$espeak" == "yes" ]]; then diff --git a/meson.build b/meson.build index 8397f071e..418880e09 100644 --- a/meson.build +++ b/meson.build @@ -55,7 +55,8 @@ if get_option('deployment_release') add_project_arguments( '-DNDEBUG', '-DOO_CHECK_GL_HEAVY=0', - '-DOO_OXP_VERIFIER_ENABLED=0', + '-DOO_DEBUG_MONITOR_ENABLED=1', + '-DOO_OXP_VERIFIER_ENABLED=1', '-DOO_LOCALIZATION_TOOLS=0', '-DDEBUG_GRAPHVIZ=0', '-DOO_FOV_INFLIGHT_CONTROL_ENABLED=0', @@ -68,6 +69,9 @@ else if get_option('oo_exclude_debug_support') add_project_arguments('-DNDEBUG', language: c_family) endif + if get_option('oo_debug_monitor_enabled') + add_project_arguments('-DOO_DEBUG_MONITOR_ENABLED=1', language: c_family) + endif if get_option('oo_oxp_verifier_enabled') add_project_arguments('-DOO_OXP_VERIFIER_ENABLED=1', language: c_family) endif diff --git a/meson.options b/meson.options index 138a83074..e640775ff 100644 --- a/meson.options +++ b/meson.options @@ -22,6 +22,9 @@ option('oo_check_gl_heavy', type: 'boolean', value: false, option('oo_exclude_debug_support', type: 'boolean', value: false, description: 'Force exclude developer debug features (strips diagnostic tools)') +option('oo_debug_monitor_enabled', type: 'boolean', value: true, + description: 'Enable Oolite debug monitor') + option('oo_oxp_verifier_enabled', type: 'boolean', value: true, description: 'Enable Oolite Expansion Pack (OXP) checking and verification stages') diff --git a/mk.sh b/mk.sh index ffbec771c..2847c4555 100755 --- a/mk.sh +++ b/mk.sh @@ -198,10 +198,6 @@ execute_target() { # Target Execution Logic ;; test) validate_build_type "$build_type" - if [[ "$build_type" == "deployment" ]]; then - echo "❌ Cannot test deployment as not set up for debug console!" >&2 - exit 1 - fi source tests/run_test_fn.sh && run_test "$build_type" ;; clean) diff --git a/src/Core/CollisionRegion.m b/src/Core/CollisionRegion.m index 73d332b92..e32e7fa40 100644 --- a/src/Core/CollisionRegion.m +++ b/src/Core/CollisionRegion.m @@ -250,7 +250,7 @@ - (void)findCollisions } } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_COLLISIONS) { OOLog(@"collisionRegion.debug", @"DEBUG in collision region %@ testing %d out of %d entities", self, n_entities_to_test, n_entities); } @@ -297,7 +297,7 @@ - (void)findCollisions dist2 = HPdistance2(e2->position, p1); min_dist2 = r0 * r0; if (dist2 < PROXIMITY_WARN_DISTANCE2 * min_dist2) { -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_COLLISIONS) { OOLog(@"collisionRegion.debug", @"DEBUG Testing collision between %@ (%@) and %@ (%@)", e1, (e1->collisionTestFilter == 3) ? @"YES" : @"NO", e2, (e2->collisionTestFilter == 3) ? @"YES" : @"NO"); @@ -366,7 +366,7 @@ - (void)findCollisions } } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_COLLISIONS) { OOLog(@"collisionRegion.debug", @"Collision test checks %d, within range %d, for %d entities", checks_this_tick, checks_within_range, n_entities_to_test); } diff --git a/src/Core/Debug/OODebugFlags.h b/src/Core/Debug/OODebugFlags.h index 3c9061371..f44361628 100644 --- a/src/Core/Debug/OODebugFlags.h +++ b/src/Core/Debug/OODebugFlags.h @@ -19,7 +19,7 @@ enum OODebugFlags { }; #define DEBUG_ALL 0xffffffff -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED extern uint32_t gDebugFlags; extern uint32_t gLiveEntityCount; diff --git a/src/Core/Debug/OODebugMonitor.m b/src/Core/Debug/OODebugMonitor.m index 5867f0d10..437eb2630 100644 --- a/src/Core/Debug/OODebugMonitor.m +++ b/src/Core/Debug/OODebugMonitor.m @@ -27,7 +27,7 @@ of this software and associated documentation files (the "Software"), to deal */ -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #import "OODebugMonitor.h" #import "NSStringOOExtensions.h" @@ -929,4 +929,4 @@ - (id)autorelease @end -#endif /* NDEBUG */ +#endif /* OO_DEBUG_MONITOR_ENABLED */ diff --git a/src/Core/Debug/OODebugStandards.m b/src/Core/Debug/OODebugStandards.m index cf70fecc6..79cbf8595 100644 --- a/src/Core/Debug/OODebugStandards.m +++ b/src/Core/Debug/OODebugStandards.m @@ -32,7 +32,7 @@ of this software and associated documentation files (the "Software"), to deal #import "OOCollectionExtractors.h" #import "OOLogging.h" -#ifdef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED // in release mode, stubs void OOStandardsDeprecated(NSString* message) { } void OOStandardsError(NSString* message) { } diff --git a/src/Core/Debug/OODebugSupport.h b/src/Core/Debug/OODebugSupport.h index 42100f773..d1a3df6e0 100644 --- a/src/Core/Debug/OODebugSupport.h +++ b/src/Core/Debug/OODebugSupport.h @@ -27,7 +27,7 @@ SOFTWARE. */ -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED void OOInitDebugSupport(void); diff --git a/src/Core/Debug/OODebugSupport.m b/src/Core/Debug/OODebugSupport.m index d3498252f..24538683f 100644 --- a/src/Core/Debug/OODebugSupport.m +++ b/src/Core/Debug/OODebugSupport.m @@ -25,7 +25,7 @@ of this software and associated documentation files (the "Software"), to deal */ -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #import "OODebugSupport.h" #import "GameController.h" @@ -132,4 +132,4 @@ static id LoadDebugPlugIn() #endif -#endif /* NDEBUG */ +#endif /* OO_DEBUG_MONITOR_ENABLED */ diff --git a/src/Core/Debug/OODebugTCPConsoleClient.m b/src/Core/Debug/OODebugTCPConsoleClient.m index 4aae6ebd2..8c7b28549 100644 --- a/src/Core/Debug/OODebugTCPConsoleClient.m +++ b/src/Core/Debug/OODebugTCPConsoleClient.m @@ -27,7 +27,7 @@ of this software and associated documentation files (the "Software"), to deal */ -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #import "OODebugTCPConsoleClient.h" #import "NSDictionaryOOExtensions.h" @@ -671,4 +671,4 @@ static void LogSendPacket(NSDictionary* packet) } #endif -#endif /* NDEBUG */ +#endif /* OO_DEBUG_MONITOR_ENABLED */ diff --git a/src/Core/Debug/OOJSConsole.m b/src/Core/Debug/OOJSConsole.m index 5c0e50f81..0835fb972 100644 --- a/src/Core/Debug/OOJSConsole.m +++ b/src/Core/Debug/OOJSConsole.m @@ -26,7 +26,7 @@ of this software and associated documentation files (the "Software"), to deal */ -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #import "OOJSConsole.h" #import "OODebugMonitor.h" @@ -66,7 +66,7 @@ - (void)inspect; static JSBool ConsoleClearConsole(JSContext* context, uintN argc, jsval* vp); static JSBool ConsoleScriptStack(JSContext* context, uintN argc, jsval* vp); static JSBool ConsoleInspectEntity(JSContext* context, uintN argc, jsval* vp); -#if OO_DEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static JSBool ConsoleCallObjCMethod(JSContext* context, uintN argc, jsval* vp); static JSBool ConsoleSetUpCallObjC(JSContext* context, uintN argc, jsval* vp); #endif @@ -184,7 +184,7 @@ - (void)inspect; { "clearConsole", ConsoleClearConsole, 0 }, { "scriptStack", ConsoleScriptStack, 0 }, { "inspectEntity", ConsoleInspectEntity, 1 }, -#if OO_DEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED { "__setUpCallObjC", ConsoleSetUpCallObjC, 1 }, #endif { "isExecutableJavaScript", ConsoleIsExecutableJavaScript, 2 }, @@ -292,7 +292,7 @@ static JSBool ConsoleGetProperty(JSContext* context, JSObject* this, jsid propID OOJS_NATIVE_ENTER(context) switch (JSID_TO_INT(propID)) { -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED case kConsole_debugFlags: *value = INT_TO_JSVAL((uint32_t)gDebugFlags); break; @@ -391,7 +391,7 @@ static JSBool ConsoleSetProperty(JSContext* context, JSObject* this, jsid propID NSString* sValue; switch (JSID_TO_INT(propID)) { -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED case kConsole_debugFlags: if (JS_ValueToInt32(context, *value, &iValue)) { gDebugFlags = iValue; @@ -693,7 +693,7 @@ static JSBool ConsoleInspectEntity(JSContext* context, uintN argc, jsval* vp) OOJS_NATIVE_EXIT } -#if OO_DEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED // function callObjC(selector : String [, ...]) : Object static JSBool ConsoleCallObjCMethod(JSContext* context, uintN argc, jsval* vp) { @@ -1050,4 +1050,4 @@ static JSBool PerformProfiling(JSContext* context, NSString* nominalFunction, ui #endif // OOJS_PROFILE -#endif /* NDEBUG */ +#endif /* OO_DEBUG_MONITOR_ENABLED */ diff --git a/src/Core/Debug/OOTCPStreamDecoder.c b/src/Core/Debug/OOTCPStreamDecoder.c index 5cc34d71a..c64d72d2f 100644 --- a/src/Core/Debug/OOTCPStreamDecoder.c +++ b/src/Core/Debug/OOTCPStreamDecoder.c @@ -25,7 +25,7 @@ SOFTWARE. */ -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #include "OOTCPStreamDecoder.h" #include "OODebugTCPConsoleProtocol.h" @@ -219,4 +219,4 @@ static void Error(OOTCPStreamDecoderRef decoder, OOALStringRef format, ...) } } -#endif /* NDEBUG */ +#endif /* OO_DEBUG_MONITOR_ENABLED */ diff --git a/src/Core/Debug/OOTCPStreamDecoderAbstractionLayer.m b/src/Core/Debug/OOTCPStreamDecoderAbstractionLayer.m index 5bd1bae6a..ee02fbbfd 100644 --- a/src/Core/Debug/OOTCPStreamDecoderAbstractionLayer.m +++ b/src/Core/Debug/OOTCPStreamDecoderAbstractionLayer.m @@ -6,7 +6,7 @@ Foundation implementation. */ -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #import "OOTCPStreamDecoderAbstractionLayer.h" #import "OOFoundation.h" @@ -109,4 +109,4 @@ OOALObjectRef OOALPropertyListFromData(OOALMutableDataRef data, OOALStringRef* e return result; } -#endif /* NDEBUG */ +#endif /* OO_DEBUG_MONITOR_ENABLED */ diff --git a/src/Core/Entities/DockEntity.m b/src/Core/Entities/DockEntity.m index 37afc768f..5553dc338 100644 --- a/src/Core/Entities/DockEntity.m +++ b/src/Core/Entities/DockEntity.m @@ -650,7 +650,7 @@ - (BOOL)shipIsInDockingCorridor:(ShipEntity*)ship ww *= 0.5; hh *= 0.5; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if ([ship isPlayer] && (gDebugFlags & DEBUG_DOCKING)) { BOOL inLane; float range; diff --git a/src/Core/Entities/DustEntity.m b/src/Core/Entities/DustEntity.m index 5c7900459..7e17bbeb8 100644 --- a/src/Core/Entities/DustEntity.m +++ b/src/Core/Entities/DustEntity.m @@ -256,7 +256,7 @@ - (void)drawImmediate:(bool)immediate translucent:(bool)translucent PlayerEntity* player = PLAYER; assert(player != nil); -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_NO_DUST) return; #endif @@ -407,7 +407,7 @@ - (void)resetGraphicsState #endif } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSString*)descriptionForObjDump { // Don't include range and visibility flag as they're irrelevant. diff --git a/src/Core/Entities/Entity.h b/src/Core/Entities/Entity.h index 6dc030a18..f75710cc7 100644 --- a/src/Core/Entities/Entity.h +++ b/src/Core/Entities/Entity.h @@ -35,7 +35,7 @@ MA 02110-1301, USA. @class Universe, CollisionRegion, ShipEntity, OOVisualEffectEntity; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED extern uint32_t gLiveEntityCount; extern size_t gTotalEntityMemory; @@ -284,7 +284,7 @@ enum OOScanClass { - (void)setAtmosphereFogging:(OOColor*)fogging; - (OOColor*)fogUniform; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSString*)descriptionForObjDumpBasic; - (NSString*)descriptionForObjDump; diff --git a/src/Core/Entities/Entity.m b/src/Core/Entities/Entity.m index 891230690..cbcf087e1 100644 --- a/src/Core/Entities/Entity.m +++ b/src/Core/Entities/Entity.m @@ -39,12 +39,12 @@ #import "NSScannerOOExtensions.h" #import "OODebugFlags.h" -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED uint32_t gLiveEntityCount = 0; size_t gTotalEntityMemory = 0; #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static NSString* const kOOLogEntityAddToList = @"entity.linkedList.add"; static NSString* const kOOLogEntityAddToListError = @"entity.linkedList.add.error"; static NSString* const kOOLogEntityRemoveFromList = @"entity.linkedList.remove"; @@ -86,7 +86,7 @@ - (id)init atmosphereFogging = [[OOColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.0] retain]; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED gLiveEntityCount++; gTotalEntityMemory += [self oo_objectSize]; #endif @@ -104,7 +104,7 @@ - (void)dealloc [self setOwner:nil]; [atmosphereFogging release]; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED gLiveEntityCount--; gTotalEntityMemory -= [self oo_objectSize]; #endif @@ -206,7 +206,7 @@ - (BOOL)validForAddToUniverse - (void)addToLinkedLists { -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_LINKED_LISTS) OOLog(kOOLogEntityAddToList, @"DEBUG adding entity %@ to linked lists", self); #endif @@ -256,7 +256,7 @@ - (void)addToLinkedLists UNIVERSE->z_list_start = self; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_LINKED_LISTS) { if (![self checkLinkedLists]) { OOLog(kOOLogEntityAddToListError, @"DEBUG LINKED LISTS - problem encountered while adding %@ to linked lists", self); @@ -268,7 +268,7 @@ - (void)addToLinkedLists - (void)removeFromLinkedLists { -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_LINKED_LISTS) OOLog(kOOLogEntityRemoveFromList, @"DEBUG removing entity %@ from linked lists", self); #endif @@ -308,7 +308,7 @@ - (void)removeFromLinkedLists z_previous = nil; z_next = nil; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_LINKED_LISTS) { if (![self checkLinkedLists]) { OOLog(kOOLogEntityRemoveFromListError, @"DEBUG LINKED LISTS - problem encountered while removing %@ from linked lists", self); @@ -397,7 +397,7 @@ - (void)updateLinkedLists if ((x_next == nil) && (x_previous == nil)) return; // not in the lists - don't do this! -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_LINKED_LISTS) { if (![self checkLinkedLists]) { OOLog(kOOLogEntityVerificationError, @"DEBUG LINKED LISTS problem encountered before updating linked lists for %@", self); @@ -476,7 +476,7 @@ - (void)updateLinkedLists UNIVERSE->z_list_start = self; // done -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_LINKED_LISTS) { if (![self checkLinkedLists]) { OOLog(kOOLogEntityUpdateError, @"DEBUG LINKED LISTS problem encountered after updating linked lists for %@", self); @@ -998,7 +998,7 @@ - (OOColor*)fogUniform return [[atmosphereFogging retain] autorelease]; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSString*)descriptionForObjDumpBasic { NSString* result = [self descriptionComponents]; diff --git a/src/Core/Entities/OOEntityWithDrawable.m b/src/Core/Entities/OOEntityWithDrawable.m index 8f2495290..0fadebe14 100644 --- a/src/Core/Entities/OOEntityWithDrawable.m +++ b/src/Core/Entities/OOEntityWithDrawable.m @@ -112,7 +112,7 @@ - (void)drawImmediate:(bool)immediate translucent:(bool)translucent OOGLWireframeModeOff(); } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { return [[self drawable] allTextures]; diff --git a/src/Core/Entities/OOLightParticleEntity.m b/src/Core/Entities/OOLightParticleEntity.m index aa3e1094c..6f35abf55 100644 --- a/src/Core/Entities/OOLightParticleEntity.m +++ b/src/Core/Entities/OOLightParticleEntity.m @@ -319,7 +319,7 @@ - (BOOL)canCollide return NO; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { return [NSSet setWithObject:[self texture]]; diff --git a/src/Core/Entities/OOParticleSystem.m b/src/Core/Entities/OOParticleSystem.m index 9f72b9cd5..11b00f85c 100644 --- a/src/Core/Entities/OOParticleSystem.m +++ b/src/Core/Entities/OOParticleSystem.m @@ -232,7 +232,7 @@ - (OOTexture*)texture return [OOLightParticleEntity defaultParticleTexture]; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { return [NSSet setWithObject:[OOLightParticleEntity defaultParticleTexture]]; diff --git a/src/Core/Entities/OOSunEntity.m b/src/Core/Entities/OOSunEntity.m index da739c53e..8ea672570 100644 --- a/src/Core/Entities/OOSunEntity.m +++ b/src/Core/Entities/OOSunEntity.m @@ -223,7 +223,7 @@ - (BOOL)canCollide return YES; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (BOOL)checkCloseCollisionWith:(Entity*)other { if (gDebugFlags & DEBUG_COLLISIONS) { diff --git a/src/Core/Entities/PlanetEntity.h b/src/Core/Entities/PlanetEntity.h index e2c2d07bd..b8956ef97 100644 --- a/src/Core/Entities/PlanetEntity.h +++ b/src/Core/Entities/PlanetEntity.h @@ -119,7 +119,7 @@ typedef struct - (void)drawUnconditionally; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (PlanetEntity*)atmosphere; #endif diff --git a/src/Core/Entities/PlanetEntity.m b/src/Core/Entities/PlanetEntity.m index bbdfae063..4e5f74667 100644 --- a/src/Core/Entities/PlanetEntity.m +++ b/src/Core/Entities/PlanetEntity.m @@ -605,7 +605,7 @@ - (BOOL)canCollide - (BOOL)checkCloseCollisionWith:(Entity*)other { -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_COLLISIONS) OOLog(@"planet.collide", @"PLANET Collision!"); #endif @@ -917,7 +917,7 @@ - (void)drawUnconditionally } } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (PlanetEntity*)atmosphere { return atmosphere; @@ -1473,7 +1473,7 @@ - (OOTexture*)cloudTextureWithCloudColor:(OOColor*)cloudColor cloudImpress:(GLfl return [OOTexture textureWithGenerator:loader]; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { if (_texture != nil) diff --git a/src/Core/Entities/PlayerEntity.h b/src/Core/Entities/PlayerEntity.h index eae1c946a..fde780a18 100644 --- a/src/Core/Entities/PlayerEntity.h +++ b/src/Core/Entities/PlayerEntity.h @@ -654,7 +654,7 @@ typedef enum { NSArray* n_key_dec_field_of_view; #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED NSArray* n_key_dump_target_state; NSArray* n_key_dump_entity_list; NSArray* n_key_debug_full; diff --git a/src/Core/Entities/PlayerEntity.m b/src/Core/Entities/PlayerEntity.m index 974af128d..2b0a02a00 100644 --- a/src/Core/Entities/PlayerEntity.m +++ b/src/Core/Entities/PlayerEntity.m @@ -4395,7 +4395,7 @@ - (NSString*)dial_fpsinfo - (NSString*)dial_objinfo { NSString* result = [NSString stringWithFormat:@"Entities: %3zu", [UNIVERSE entityCount]]; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED result = [NSString stringWithFormat:@"%@ (%d, %zu KiB, avg %zu bytes)", result, gLiveEntityCount, gTotalEntityMemory >> 10, gTotalEntityMemory / gLiveEntityCount]; #endif @@ -11790,7 +11790,7 @@ - (BOOL)setExtraGuiScreenKeys:(OOGUIScreenID)gui definition:(OOJSGuiScreenKeyDef return result; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (void)dumpSelfState { NSMutableArray* flags = nil; diff --git a/src/Core/Entities/PlayerEntityControls.m b/src/Core/Entities/PlayerEntityControls.m index 8ff459e9e..b084d6548 100644 --- a/src/Core/Entities/PlayerEntityControls.m +++ b/src/Core/Entities/PlayerEntityControls.m @@ -92,7 +92,7 @@ static BOOL autopilot_key_pressed; static BOOL fast_autopilot_key_pressed; static BOOL docking_clearance_request_key_pressed; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static BOOL dump_target_state_pressed; static BOOL dump_entity_list_pressed; #endif @@ -494,7 +494,7 @@ - (void)initKeyConfigSettings LOAD_KEY_SETTING2(n_key_dec_field_of_view, 'k', NO, NO, 0, NO, NO); #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED LOAD_KEY_SETTING2(n_key_dump_target_state, 'H', YES, NO, 0, NO, NO); LOAD_KEY_SETTING2(n_key_dump_entity_list, '0', NO, NO, 0, NO, NO); LOAD_KEY_SETTING2(n_key_debug_full, 'd', NO, NO, 0, NO, NO); @@ -1604,7 +1604,7 @@ - (void)pollFlightControls:(double)delta_t } #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED exceptionContext = @"dump target state"; if ([self checkKeyPress:n_key_dump_target_state]) { if (!dump_target_state_pressed) { @@ -1654,7 +1654,7 @@ - (void)pollFlightControls:(double)delta_t } exceptionContext = @"debug keys"; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED // look for debugging keys if ([self checkKeyPress:n_key_dump_entity_list] && ![gameView allowingStringInput]) // look for the '0' key { diff --git a/src/Core/Entities/ShipEntity.h b/src/Core/Entities/ShipEntity.h index c026b83d0..46f747482 100644 --- a/src/Core/Entities/ShipEntity.h +++ b/src/Core/Entities/ShipEntity.h @@ -410,7 +410,7 @@ typedef enum { // Collision detection Octree* octree; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED // DEBUGGING OOBehaviour debugLastBehaviour; #endif @@ -1261,7 +1261,7 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q @end -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED @interface ShipEntity (Debug) - (OOShipGroup*)rawEscortGroup; diff --git a/src/Core/Entities/ShipEntity.m b/src/Core/Entities/ShipEntity.m index d30460aea..d90111de0 100644 --- a/src/Core/Entities/ShipEntity.m +++ b/src/Core/Entities/ShipEntity.m @@ -96,7 +96,7 @@ #define USEMASC 1 static NSString* const kOOLogSyntaxAddShips = @"script.debug.syntax.addShips"; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static NSString* const kOOLogEntityBehaviourChanged = @"entity.behaviour.changed"; #endif @@ -2202,7 +2202,7 @@ - (void)update:(OOTimeDelta)delta_t } // end if !isSubEntity -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED // DEBUGGING if (reportAIMessages && (debugLastBehaviour != behaviour)) { OOLog(kOOLogEntityBehaviourChanged, @"%@ behaviour is now %@", self, OOStringFromBehaviour(behaviour)); @@ -5494,7 +5494,7 @@ - (void)drawImmediate:(bool)immediate translucent:(bool)translucent // Draw self. [super drawImmediate:immediate translucent:translucent]; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED // Draw bounding boxes if we have to before going for the subentities. // TODO: the translucent flag here makes very little sense. Something's wrong with the matrices. if (translucent) @@ -5519,7 +5519,7 @@ - (void)drawImmediate:(bool)immediate translucent:(bool)translucent } } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (void)drawDebugStuff { // HPVect: imprecise here - needs camera relative @@ -5561,7 +5561,7 @@ - (void)drawSubEntityImmediate:(bool)immediate translucent:(bool)translucent OOGLMultModelView(rotMatrix); [self drawImmediate:immediate translucent:translucent]; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_BOUNDING_BOXES) { OODebugDrawBoundingBox([self boundingBox]); } @@ -6003,7 +6003,7 @@ - (void)setEscortGroup:(OOShipGroup*)group } } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (OOShipGroup*)rawEscortGroup { return _escortGroup; @@ -12628,7 +12628,7 @@ - (void)pilotArrived } #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (void)dumpSelfState { NSMutableArray* flags = nil; @@ -12928,7 +12928,7 @@ - (void)doNothing { } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSString*)descriptionForObjDump { NSString* desc = [super descriptionForObjDump]; diff --git a/src/Core/Entities/SkyEntity.m b/src/Core/Entities/SkyEntity.m index 02f18e3dc..2657e61cf 100644 --- a/src/Core/Entities/SkyEntity.m +++ b/src/Core/Entities/SkyEntity.m @@ -214,7 +214,7 @@ - (void)drawImmediate:(bool)immediate translucent:(bool)translucent OOCheckOpenGLErrors(@"SkyEntity after drawing %@", self); } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSString*)descriptionForObjDump { // Don't include range and visibility flag as they're irrelevant. diff --git a/src/Core/GameController.m b/src/Core/GameController.m index 07ad5d3cb..253d301ec 100644 --- a/src/Core/GameController.m +++ b/src/Core/GameController.m @@ -51,7 +51,7 @@ #import static void SetUpSparkle(void); -#elif (OOLITE_GNUSTEP && !defined(NDEBUG)) +#elif (OOLITE_GNUSTEP && defined(OO_DEBUG_MONITOR_ENABLED)) #import "OODebugMonitor.h" #endif @@ -773,7 +773,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender - (void)exitAppWithContext:(NSString*)context { OOLog(@"exit.context", @"Exiting: %@.", context); -#if (OOLITE_GNUSTEP && !defined(NDEBUG)) +#if (OOLITE_GNUSTEP && defined(OO_DEBUG_MONITOR_ENABLED)) [[OODebugMonitor sharedDebugMonitor] applicationWillTerminate]; #endif #if OOLITE_WINDOWS diff --git a/src/Core/Materials/OOBasicMaterial.m b/src/Core/Materials/OOBasicMaterial.m index 85d476c4f..f09361718 100644 --- a/src/Core/Materials/OOBasicMaterial.m +++ b/src/Core/Materials/OOBasicMaterial.m @@ -304,7 +304,7 @@ - (BOOL)permitSpecular return ![UNIVERSE reducedDetail]; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { return [NSSet set]; diff --git a/src/Core/Materials/OOConcreteTexture.h b/src/Core/Materials/OOConcreteTexture.h index fac6bda4e..f65c60ed6 100644 --- a/src/Core/Materials/OOConcreteTexture.h +++ b/src/Core/Materials/OOConcreteTexture.h @@ -70,7 +70,7 @@ SOFTWARE. float _anisotropy; #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED NSString* _name; #endif } diff --git a/src/Core/Materials/OOConcreteTexture.m b/src/Core/Materials/OOConcreteTexture.m index dda86b4a1..c3696629a 100644 --- a/src/Core/Materials/OOConcreteTexture.m +++ b/src/Core/Materials/OOConcreteTexture.m @@ -129,7 +129,7 @@ - (id)initWithPath:(NSString*)path - (void)dealloc { -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED OOLog(_trace ? @"texture.allocTrace.dealloc" : @"texture.dealloc", @"Deallocating and uncaching texture %p", self); #endif @@ -155,7 +155,7 @@ - (void)dealloc DESTROY(_loader); -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED DESTROY(_name); #endif @@ -184,7 +184,7 @@ - (NSString*)shortDescriptionComponents return _key; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSString*)name { if (_name != nil) @@ -394,7 +394,7 @@ - (void)setUpTexture } #endif -#if !defined(NDEBUG) && OOTEXTURE_RELOADABLE +#if defined(OO_DEBUG_MONITOR_ENABLED) && OOTEXTURE_RELOADABLE if (_trace) { static unsigned dumpID = 0; NSString* name = [NSString stringWithFormat:@"tex dump %u \"%@\"", ++dumpID, [self name]]; diff --git a/src/Core/Materials/OOMaterial.h b/src/Core/Materials/OOMaterial.h index c4aad0fe2..74aaa23d2 100644 --- a/src/Core/Materials/OOMaterial.h +++ b/src/Core/Materials/OOMaterial.h @@ -74,7 +74,7 @@ SOFTWARE. - (NSUInteger)countOfTextureUnitsWithBaseCoordinates; #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures; #endif diff --git a/src/Core/Materials/OOMaterial.m b/src/Core/Materials/OOMaterial.m index 3942cf64d..c2c6e8732 100644 --- a/src/Core/Materials/OOMaterial.m +++ b/src/Core/Materials/OOMaterial.m @@ -106,7 +106,7 @@ - (NSUInteger)countOfTextureUnitsWithBaseCoordinates } #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { return nil; diff --git a/src/Core/Materials/OOMultiTextureMaterial.m b/src/Core/Materials/OOMultiTextureMaterial.m index 843d6e4bd..3a257d289 100644 --- a/src/Core/Materials/OOMultiTextureMaterial.m +++ b/src/Core/Materials/OOMultiTextureMaterial.m @@ -190,7 +190,7 @@ - (void)unapplyWithNext:(OOMaterial*)next OOGL(glActiveTextureARB(GL_TEXTURE0_ARB)); } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { if (_diffuseMap == nil) diff --git a/src/Core/Materials/OOShaderMaterial.m b/src/Core/Materials/OOShaderMaterial.m index 20f584dfd..b92816865 100644 --- a/src/Core/Materials/OOShaderMaterial.m +++ b/src/Core/Materials/OOShaderMaterial.m @@ -182,7 +182,7 @@ - (id)initWithName:(NSString*)name { BOOL canFallBack = ![modifiedMacros oo_boolForKey:@"OO_REDUCED_COMPLEXITY"]; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_NO_SHADER_FALLBACK) canFallBack = NO; #endif if (canFallBack) @@ -678,7 +678,7 @@ - (BOOL)permitSpecular return YES; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { return [NSSet setWithObjects:textures count:texCount]; diff --git a/src/Core/Materials/OOShaderProgram.m b/src/Core/Materials/OOShaderProgram.m index aba4eee5e..8a3450669 100644 --- a/src/Core/Materials/OOShaderProgram.m +++ b/src/Core/Materials/OOShaderProgram.m @@ -249,7 +249,7 @@ static BOOL ValidateShaderObject(GLhandleARB object, NSString* name) return NO; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_SHADER_VALIDATION && 0) { OOGL(glValidateProgramARB(object)); OOGL(glGetObjectParameterivARB(object, GL_OBJECT_VALIDATE_STATUS_ARB, &status)); diff --git a/src/Core/Materials/OOShaderUniformMethodType.h b/src/Core/Materials/OOShaderUniformMethodType.h index e748c0b84..a47d7eff9 100644 --- a/src/Core/Materials/OOShaderUniformMethodType.h +++ b/src/Core/Materials/OOShaderUniformMethodType.h @@ -30,7 +30,7 @@ SOFTWARE. #import "OOOpenGLExtensionManager.h" -#if OO_SHADERS || !defined(NDEBUG) +#if OO_SHADERS || defined(OO_DEBUG_MONITOR_ENABLED) #import "OOMaths.h" diff --git a/src/Core/Materials/OOShaderUniformMethodType.m b/src/Core/Materials/OOShaderUniformMethodType.m index 6d710edf7..b9dda2018 100644 --- a/src/Core/Materials/OOShaderUniformMethodType.m +++ b/src/Core/Materials/OOShaderUniformMethodType.m @@ -46,7 +46,7 @@ of this software and associated documentation files (the "Software"), to deal #import "OOShaderUniformMethodType.h" -#if OO_SHADERS || !defined(NDEBUG) +#if OO_SHADERS || defined(OO_DEBUG_MONITOR_ENABLED) #import "OOMaths.h" diff --git a/src/Core/Materials/OOSingleTextureMaterial.m b/src/Core/Materials/OOSingleTextureMaterial.m index 4e69582a0..32e175d0b 100644 --- a/src/Core/Materials/OOSingleTextureMaterial.m +++ b/src/Core/Materials/OOSingleTextureMaterial.m @@ -105,7 +105,7 @@ - (BOOL)wantsNormalsAsTextureCoordinates return [_texture isCubeMap]; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { return [NSSet setWithObject:_texture]; diff --git a/src/Core/Materials/OOTexture.h b/src/Core/Materials/OOTexture.h index 13a96e60d..bf7595c09 100644 --- a/src/Core/Materials/OOTexture.h +++ b/src/Core/Materials/OOTexture.h @@ -107,7 +107,7 @@ enum { typedef OOPixMapFormat OOTextureDataFormat; @interface OOTexture : OOWeakRefObject { -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED @protected BOOL _trace; #endif @@ -249,7 +249,7 @@ typedef OOPixMapFormat OOTextureDataFormat; // Called by OOGraphicsResetManager as necessary. + (void)rebindAllTextures; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (void)setTrace:(BOOL)trace; + (NSArray*)cachedTexturesByAge; diff --git a/src/Core/Materials/OOTexture.m b/src/Core/Materials/OOTexture.m index cf7c09d2b..59d11b530 100644 --- a/src/Core/Materials/OOTexture.m +++ b/src/Core/Materials/OOTexture.m @@ -360,7 +360,7 @@ + (void)rebindAllTextures } } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (void)setTrace:(BOOL)trace { if (trace && !_trace) { diff --git a/src/Core/NSObjectOOExtensions.h b/src/Core/NSObjectOOExtensions.h index 464bbccf6..0375940b0 100644 --- a/src/Core/NSObjectOOExtensions.h +++ b/src/Core/NSObjectOOExtensions.h @@ -31,7 +31,7 @@ SOFTWARE. @interface NSObject (OOExtensions) -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED + (size_t)oo_instanceSize; - (size_t)oo_objectSize; diff --git a/src/Core/NSObjectOOExtensions.m b/src/Core/NSObjectOOExtensions.m index 55a36d1a2..af6655067 100644 --- a/src/Core/NSObjectOOExtensions.m +++ b/src/Core/NSObjectOOExtensions.m @@ -33,7 +33,7 @@ of this software and associated documentation files (the "Software"), to deal @implementation NSObject (OOExtensions) -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED + (size_t)oo_instanceSize { diff --git a/src/Core/OODebugGLDrawing.h b/src/Core/OODebugGLDrawing.h index 2887bfb52..52a0f6c38 100644 --- a/src/Core/OODebugGLDrawing.h +++ b/src/Core/OODebugGLDrawing.h @@ -31,7 +31,7 @@ SOFTWARE. #import "OOColor.h" #import "OOMaths.h" -#if !defined(OODEBUGLDRAWING_DISABLE) && defined(NDEBUG) +#if !defined(OODEBUGLDRAWING_DISABLE) && !defined(OO_DEBUG_MONITOR_ENABLED) #define OODEBUGLDRAWING_DISABLE 1 #endif diff --git a/src/Core/OODrawable.h b/src/Core/OODrawable.h index 8267bcba6..f96abef87 100644 --- a/src/Core/OODrawable.h +++ b/src/Core/OODrawable.h @@ -49,7 +49,7 @@ SOFTWARE. - (void)dumpSelfState; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures; - (size_t)totalSize; // Size including dynamic data, not counting textures. #endif diff --git a/src/Core/OODrawable.m b/src/Core/OODrawable.m index 44b3d5f76..7d8209e1a 100644 --- a/src/Core/OODrawable.m +++ b/src/Core/OODrawable.m @@ -71,7 +71,7 @@ - (void)dumpSelfState { } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { return nil; diff --git a/src/Core/OOFoundation.h b/src/Core/OOFoundation.h index 921f49376..44a3c4fe9 100644 --- a/src/Core/OOFoundation.h +++ b/src/Core/OOFoundation.h @@ -39,7 +39,7 @@ MA 02110-1301, USA. #define OOLITE_DEBUG 1 #endif -#if !OOLITE_DEBUG +#if !OO_DEBUG_MONITOR_ENABLED #define NS_BLOCK_ASSERTIONS 1 #endif diff --git a/src/Core/OOLogHeader.m b/src/Core/OOLogHeader.m index 9831d0e05..da467e143 100644 --- a/src/Core/OOLogHeader.m +++ b/src/Core/OOLogHeader.m @@ -114,7 +114,7 @@ void OOPrintLogHeader(void) @"heavy OpenGL error checking", #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED @"JavaScript console support", #if OOLITE_MAC_OS_X // Under Mac OS X, Debug.oxp adds more than console support. diff --git a/src/Core/OOMesh.m b/src/Core/OOMesh.m index 5728b2d39..bb32026cd 100644 --- a/src/Core/OOMesh.m +++ b/src/Core/OOMesh.m @@ -152,7 +152,7 @@ - (void)calculateBoundingVolumes; - (void)rescaleByFactor:(GLfloat)factor; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (void)debugDrawNormals; #endif @@ -513,7 +513,7 @@ - (void)renderOpaqueParts OOGL(glDisableClientState(GL_TEXTURE_COORD_ARRAY)); #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_DRAW_NORMALS) [self debugDrawNormals]; if (gDebugFlags & DEBUG_OCTREE_DRAW) @@ -752,7 +752,7 @@ - (void)setBindingTarget:(id)target } } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (void)dumpSelfState { [super dumpSelfState]; @@ -764,7 +764,7 @@ - (void)dumpSelfState } #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { NSMutableSet* result = [NSMutableSet set]; @@ -1852,7 +1852,7 @@ - (BoundingBox)boundingBox return boundingBox; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (void)debugDrawNormals { GLuint i; diff --git a/src/Core/OOPlanetDrawable.m b/src/Core/OOPlanetDrawable.m index 023656dc8..5e2925a48 100644 --- a/src/Core/OOPlanetDrawable.m +++ b/src/Core/OOPlanetDrawable.m @@ -33,7 +33,7 @@ #import "OOSingleTextureMaterial.h" #import "Universe.h" -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #import "Entity.h" #import "OODebugFlags.h" #import "OODebugGLDrawing.h" @@ -272,7 +272,7 @@ - (void)renderCommonParts #endif OOGLPopModelView(); -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED if (gDebugFlags & DEBUG_DRAW_NORMALS) [self debugDrawNormals]; #endif @@ -326,7 +326,7 @@ - (void)recalculateTransform _transform = OOMatrixForScaleUniform(_radius); } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (void)debugDrawNormals { @@ -374,7 +374,9 @@ - (void)debugDrawNormals OODebugEndWireframe(state); } +#endif +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { return [[self material] allTextures]; diff --git a/src/Core/OOPolygonSprite.h b/src/Core/OOPolygonSprite.h index adb8f1fa4..adb3dfa14 100644 --- a/src/Core/OOPolygonSprite.h +++ b/src/Core/OOPolygonSprite.h @@ -44,7 +44,7 @@ SOFTWARE. GLuint _outlineVBO; #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED NSString* _name; #endif } diff --git a/src/Core/OOPolygonSprite.m b/src/Core/OOPolygonSprite.m index f0941ef37..5e637d63e 100644 --- a/src/Core/OOPolygonSprite.m +++ b/src/Core/OOPolygonSprite.m @@ -67,10 +67,13 @@ - (BOOL)loadPolygons:(NSArray*)dataArray outlineWidth:(float)outlineWidth; size_t vCount; // Number of vertices so far in primitive. NSPoint pending0, pending1; // Used for splitting GL_TRIANGLE_STRIP/GL_TRIANGLE_FAN primitives. BOOL OK; // Set to false to indicate error. +#ifdef OO_DEBUG_MONITOR_ENABLED + NSString* name; +#endif + #ifndef NDEBUG BOOL generatingOutline; unsigned svgID; - NSString* name; NSMutableString* debugSVG; #endif } TessPolygonData; @@ -131,7 +134,7 @@ @implementation OOPolygonSprite - (id)initWithDataArray:(NSArray*)dataArray outlineWidth:(GLfloat)outlineWidth name:(NSString*)name { if ((self = [super init])) { -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED _name = [name copy]; #endif @@ -159,7 +162,7 @@ - (void)dealloc { [[OOGraphicsResetManager sharedManager] unregisterClient:self]; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED DESTROY(_name); #endif free(_solidData); @@ -168,7 +171,7 @@ - (void)dealloc [super dealloc]; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSString*)descriptionComponents { return _name; @@ -743,7 +746,7 @@ static void APIENTRY ErrorCallback(GLenum error, void* polygonData) NSCParameterAssert(data != NULL); NSString* name = @""; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED name = [NSString stringWithFormat:@" \"%@\"", data->name]; #endif diff --git a/src/Core/OOSkyDrawable.m b/src/Core/OOSkyDrawable.m index 756cc90e0..6cc08eb9d 100644 --- a/src/Core/OOSkyDrawable.m +++ b/src/Core/OOSkyDrawable.m @@ -81,7 +81,7 @@ - (id)initWithQuadsWithTexture:(OOTexture*)texture inArray:(OOSkyQuadDesc*)array - (void)render; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (size_t)totalSize; - (OOTexture*)texture; #endif @@ -230,7 +230,7 @@ - (GLfloat)maxDrawDistance return INFINITY; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (NSSet*)allTextures { NSMutableSet* result = [NSMutableSet setWithCapacity:[_quadSets count]]; @@ -645,7 +645,7 @@ - (void)render OOGL(glDrawArrays(GL_QUADS, 0, 4 * _count)); } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (size_t)totalSize { return [self oo_objectSize] + _count * 4 * (sizeof *_positions + sizeof *_texCoords + sizeof *_colors); diff --git a/src/Core/Octree.h b/src/Core/Octree.h index 20b192835..7ca87531b 100644 --- a/src/Core/Octree.h +++ b/src/Core/Octree.h @@ -30,7 +30,7 @@ MA 02110-1301, USA. #define OCTREE_MIN_HALF_WIDTH 1.0 -#if !defined(OODEBUGLDRAWING_DISABLE) && defined(NDEBUG) +#if !defined(OODEBUGLDRAWING_DISABLE) && !defined(OO_DEBUG_MONITOR_ENABLED) #define OODEBUGLDRAWING_DISABLE 1 #endif @@ -72,7 +72,7 @@ MA 02110-1301, USA. - (Vector)randomPoint; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (size_t)totalSize; #endif diff --git a/src/Core/Octree.m b/src/Core/Octree.m index 89e8065bd..956610179 100644 --- a/src/Core/Octree.m +++ b/src/Core/Octree.m @@ -32,7 +32,7 @@ #import "OOMaths.h" #import "OOOpenGL.h" -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #define OctreeDebugLog(format, ...) \ do { \ if (EXPECT_NOT(gDebugFlags & DEBUG_OCTREE_LOGGING)) \ @@ -718,7 +718,7 @@ - (Vector)randomPoint return randomFullNodeFrom([self octreeDetails], kZeroVector); } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (size_t)totalSize { return [self oo_objectSize] + _nodeCount * [_data oo_objectSize] + [_data length] + _nodeCount * sizeof *_collisionOctree; diff --git a/src/Core/Scripting/OOJSCall.h b/src/Core/Scripting/OOJSCall.h index fb5bee284..4e4be6417 100644 --- a/src/Core/Scripting/OOJSCall.h +++ b/src/Core/Scripting/OOJSCall.h @@ -24,7 +24,7 @@ MA 02110-1301, USA. */ -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #import #include diff --git a/src/Core/Scripting/OOJSCall.m b/src/Core/Scripting/OOJSCall.m index 5656bbab5..b46dadb2b 100644 --- a/src/Core/Scripting/OOJSCall.m +++ b/src/Core/Scripting/OOJSCall.m @@ -24,7 +24,7 @@ */ -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #import "OOJSCall.h" #import "OOJavaScriptEngine.h" diff --git a/src/Core/Scripting/OOJSEngineDebuggerHelpers.m b/src/Core/Scripting/OOJSEngineDebuggerHelpers.m index bf4f3fcf3..ec4150500 100644 --- a/src/Core/Scripting/OOJSEngineDebuggerHelpers.m +++ b/src/Core/Scripting/OOJSEngineDebuggerHelpers.m @@ -78,7 +78,7 @@ to use them in data formatters (by double-clicking the "Summary" field for Mac-specific/DataFormatters. */ -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #import "OOJavaScriptEngine.h" diff --git a/src/Core/Scripting/OOJSEngineTimeManagement.m b/src/Core/Scripting/OOJSEngineTimeManagement.m index 3e8304e77..d6d20c59f 100644 --- a/src/Core/Scripting/OOJSEngineTimeManagement.m +++ b/src/Core/Scripting/OOJSEngineTimeManagement.m @@ -216,7 +216,7 @@ static JSBool OperationCallback(JSContext* context) return YES; OOLogERR(@"script.javaScript.timeLimit", @"Script \"%@\" ran for %g seconds and has been terminated.", [[OOJSScript currentlyRunningScript] name], elapsed); -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED OOJSDumpStack(context); #endif diff --git a/src/Core/Scripting/OOJSEntity.m b/src/Core/Scripting/OOJSEntity.m index 1d56e0e51..12960642c 100644 --- a/src/Core/Scripting/OOJSEntity.m +++ b/src/Core/Scripting/OOJSEntity.m @@ -37,7 +37,7 @@ static JSBool EntityGetProperty(JSContext* context, JSObject* this, jsid propID, jsval* value); static JSBool EntitySetProperty(JSContext* context, JSObject* this, jsid propID, JSBool strict, jsval* value); -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static JSBool EntityDumpState(JSContext* context, uintN argc, jsval* vp); #endif @@ -118,7 +118,7 @@ static JSFunctionSpec sEntityMethods[] = { // JS name Function min args { "toString", OOJSObjectWrapperToString, 0 }, -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED { "dumpState", EntityDumpState, 0 }, #endif { 0 } @@ -372,7 +372,7 @@ static JSBool EntitySetProperty(JSContext* context, JSObject* this, jsid propID, OOJS_NATIVE_EXIT } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static JSBool EntityDumpState(JSContext* context, uintN argc, jsval* vp) { OOJS_PROFILE_ENTER diff --git a/src/Core/Scripting/OOJSGlobal.m b/src/Core/Scripting/OOJSGlobal.m index ac7d596bc..20c59afba 100644 --- a/src/Core/Scripting/OOJSGlobal.m +++ b/src/Core/Scripting/OOJSGlobal.m @@ -55,7 +55,7 @@ - (void)sendMonitorLogMessage:(NSString*)message static NSString* const kOOLogDebugMessage = @"script.debug.message"; static JSBool GlobalGetProperty(JSContext* context, JSObject* this, jsid propID, jsval* value); -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static JSBool GlobalSetProperty(JSContext* context, JSObject* this, jsid propID, JSBool strict, jsval* value); #endif @@ -78,7 +78,7 @@ - (void)sendMonitorLogMessage:(NSString*)message static JSBool GlobalSetExtraGuiScreenKeys(JSContext* context, uintN argc, jsval* vp); static JSBool GlobalClearExtraGuiScreenKeys(JSContext* context, uintN argc, jsval* vp); -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static JSBool GlobalTakeSnapShot(JSContext* context, uintN argc, jsval* vp); #endif @@ -89,7 +89,7 @@ - (void)sendMonitorLogMessage:(NSString*)message JS_PropertyStub, JS_PropertyStub, GlobalGetProperty, -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED GlobalSetProperty, #else // No writeable properties in non-debug builds @@ -106,7 +106,7 @@ - (void)sendMonitorLogMessage:(NSString*)message kGlobal_galaxyNumber, // galaxy number, integer, read-only kGlobal_global, // global.global.global.global, integer, read-only kGlobal_guiScreen, // current GUI screen, string, read-only -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED kGlobal_timeAccelerationFactor // time acceleration, float, read/write #endif }; @@ -115,7 +115,7 @@ - (void)sendMonitorLogMessage:(NSString*)message // JS name ID flags { "galaxyNumber", kGlobal_galaxyNumber, OOJS_PROP_READONLY_CB }, { "guiScreen", kGlobal_guiScreen, OOJS_PROP_READONLY_CB }, -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED { "timeAccelerationFactor", kGlobal_timeAccelerationFactor, OOJS_PROP_READWRITE_CB }, #endif { 0 } @@ -140,7 +140,7 @@ - (void)sendMonitorLogMessage:(NSString*)message { "setExtraGuiScreenKeys", GlobalSetExtraGuiScreenKeys, 2 }, { "clearExtraGuiScreenKeys", GlobalClearExtraGuiScreenKeys, 2 }, -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED { "takeSnapShot", GlobalTakeSnapShot, 1 }, { "quitGame", GlobalQuitGame, 0 }, #endif @@ -182,7 +182,7 @@ static JSBool GlobalGetProperty(JSContext* context, JSObject* this, jsid propID, *value = OOJSValueFromGUIScreenID(context, [player guiScreen]); return YES; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED case kGlobal_timeAccelerationFactor: return JS_NewNumberValue(context, [UNIVERSE timeAccelerationFactor], value); #endif @@ -195,7 +195,7 @@ static JSBool GlobalGetProperty(JSContext* context, JSObject* this, jsid propID, OOJS_NATIVE_EXIT } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static JSBool GlobalSetProperty(JSContext* context, JSObject* this, jsid propID, JSBool strict, jsval* value) { if (!JSID_IS_INT(propID)) @@ -688,7 +688,7 @@ static JSBool GlobalSetGuiColorSettingForKey(JSContext* context, uintN argc, jsv OOJS_NATIVE_EXIT } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED // takeSnapShot([name : alphanumeric String]) : Boolean static JSBool GlobalTakeSnapShot(JSContext* context, uintN argc, jsval* vp) { diff --git a/src/Core/Scripting/OOJSMissionVariables.m b/src/Core/Scripting/OOJSMissionVariables.m index 15c1b7cbd..6358fa63c 100644 --- a/src/Core/Scripting/OOJSMissionVariables.m +++ b/src/Core/Scripting/OOJSMissionVariables.m @@ -46,7 +46,7 @@ static JSBool MissionVariablesSetProperty(JSContext* context, JSObject* this, jsid propID, JSBool strict, jsval* value); static JSBool MissionVariablesEnumerate(JSContext* context, JSObject* object, JSIterateOp enumOp, jsval* state, jsid* idp); -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static id MissionVariablesConverter(JSContext* context, JSObject* object); #endif @@ -68,13 +68,13 @@ void InitOOJSMissionVariables(JSContext* context, JSObject* global) { JS_DefineObject(context, global, "missionVariables", &sMissionVariablesClass, NULL, OOJS_PROP_READONLY); -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED // Allow callObjC() on missionVariables to call methods on the mission variables dictionary. OOJSRegisterObjectConverter(&sMissionVariablesClass, MissionVariablesConverter); #endif } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static id MissionVariablesConverter(JSContext* context, JSObject* object) { return [PLAYER missionVariables]; diff --git a/src/Core/Scripting/OOJSOolite.m b/src/Core/Scripting/OOJSOolite.m index a938e41cb..32eaa9e56 100644 --- a/src/Core/Scripting/OOJSOolite.m +++ b/src/Core/Scripting/OOJSOolite.m @@ -68,7 +68,7 @@ JavaScript proxy for Oolite (for version checking and similar). kOolite_postFX, // current post processing effect, integer, read/write kOolite_hdrToneMapper, // currently active HDR tone mapper, string, read/write kOolite_sdrToneMapper, // currently active SDR tone mapper, string, read/write -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED kOolite_timeAccelerationFactor, // time acceleration, float, read/write #endif }; @@ -85,7 +85,7 @@ JavaScript proxy for Oolite (for version checking and similar). { "postFX", kOolite_postFX, OOJS_PROP_READWRITE_CB }, { "hdrToneMapper", kOolite_hdrToneMapper, OOJS_PROP_READWRITE_CB }, { "sdrToneMapper", kOolite_sdrToneMapper, OOJS_PROP_READWRITE_CB }, -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED { "timeAccelerationFactor", kOolite_timeAccelerationFactor, OOJS_PROP_READWRITE_CB }, #endif { 0 } @@ -166,7 +166,7 @@ static JSBool OoliteGetProperty(JSContext* context, JSObject* this, jsid propID, break; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED case kOolite_timeAccelerationFactor: return JS_NewNumberValue(context, [UNIVERSE timeAccelerationFactor], value); #endif @@ -239,7 +239,7 @@ static JSBool OoliteSetProperty(JSContext* context, JSObject* this, jsid propID, } break; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED case kOolite_timeAccelerationFactor: if (JS_ValueToNumber(context, *value, &fValue)) { [UNIVERSE setTimeAccelerationFactor:fValue]; diff --git a/src/Core/Scripting/OOJSSpecialFunctions.m b/src/Core/Scripting/OOJSSpecialFunctions.m index ad35487a2..27113812d 100644 --- a/src/Core/Scripting/OOJSSpecialFunctions.m +++ b/src/Core/Scripting/OOJSSpecialFunctions.m @@ -27,14 +27,14 @@ #include static JSBool SpecialJSWarning(JSContext* context, uintN argc, jsval* vp); -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static JSBool SpecialMarkConsoleEntryPoint(JSContext* context, uintN argc, jsval* vp); #endif static JSFunctionSpec sSpecialFunctionsMethods[] = { // JS name Function min args { "jsWarning", SpecialJSWarning, 1 }, -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED { "markConsoleEntryPoint", SpecialMarkConsoleEntryPoint, 0 }, #endif { 0 } @@ -86,7 +86,7 @@ static JSBool SpecialJSWarning(JSContext* context, uintN argc, jsval* vp) OOJS_PROFILE_EXIT } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static JSBool SpecialMarkConsoleEntryPoint(JSContext* context, uintN argc, jsval* vp) { // First stack frame will be in eval() in console.script.evaluate(), unless someone is playing silly buggers. diff --git a/src/Core/Scripting/OOJavaScriptEngine.h b/src/Core/Scripting/OOJavaScriptEngine.h index 298503b31..1d649de43 100644 --- a/src/Core/Scripting/OOJavaScriptEngine.h +++ b/src/Core/Scripting/OOJavaScriptEngine.h @@ -30,7 +30,7 @@ MA 02110-1301, USA. #import "Universe.h" #include -#define OOJSENGINE_MONITOR_SUPPORT OOLITE_DEBUG +#define OOJSENGINE_MONITOR_SUPPORT OO_DEBUG_MONITOR_ENABLED #import "OOJSPropID.h" @@ -48,7 +48,7 @@ MA 02110-1301, USA. JSClass* _numberClass; JSClass* _booleanClass; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED BOOL _dumpStackForErrors; BOOL _dumpStackForWarnings; #endif @@ -89,7 +89,7 @@ MA 02110-1301, USA. - (JSClass*)numberClass; - (JSClass*)booleanClass; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (BOOL)dumpStackForErrors; - (void)setDumpStackForErrors:(BOOL)value; @@ -124,7 +124,7 @@ OOINLINE JSContext* OOJSAcquireContext(void) // End a request on the main thread's context. OOINLINE void OOJSRelinquishContext(JSContext* context) { -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED extern JSContext* gOOJSMainThreadContext; NSCParameterAssert(context == gOOJSMainThreadContext && JS_IsInRequest(context)); #endif @@ -496,7 +496,7 @@ void OOJSRegisterObjectConverter(JSClass* theClass, OOJSClassConverterCallback c In debug builds, this will deliberately cause an error if name is not a string literal. */ -#ifdef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED #define OOJSAddGCValueRoot(context, root, name) JS_AddValueRoot((context), (root)) #define OOJSAddGCStringRoot(context, root, name) JS_AddStringRoot((context), (root)) #define OOJSAddGCObjectRoot(context, root, name) JS_AddObjectRoot((context), (root)) diff --git a/src/Core/Scripting/OOJavaScriptEngine.m b/src/Core/Scripting/OOJavaScriptEngine.m index 7d1ea59a2..95af360cb 100644 --- a/src/Core/Scripting/OOJavaScriptEngine.m +++ b/src/Core/Scripting/OOJavaScriptEngine.m @@ -206,7 +206,7 @@ static void ReportJSError(JSContext* context, const char* message, JSErrorReport } } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED BOOL dump; if (report->flags & JSREPORT_WARNING) dump = [jsEng dumpStackForWarnings]; @@ -258,7 +258,7 @@ - (id)init JS_SetCStringsAreUTF8(); NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED /* Set stack trace preferences from preferences. These will be overriden by the debug OXP script if installed, but being able to enable traces without setting up the debug console could be useful for debugging @@ -585,7 +585,7 @@ - (void)registerStandardObjectConverters OOJSRegisterObjectConverter([self booleanClass], JSBooleanConverter); } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED static JSTrapStatus DebuggerHook(JSContext* context, JSScript* script, jsbytecode* pc, jsval* rval, void* closure) { OOJSPauseTimeLimiter(); diff --git a/src/Core/Universe.h b/src/Core/Universe.h index 865b94534..3deb051db 100644 --- a/src/Core/Universe.h +++ b/src/Core/Universe.h @@ -299,7 +299,7 @@ enum { BOOL no_update; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED double timeAccelerationFactor; #endif @@ -393,7 +393,7 @@ enum { - (BOOL)doingStartUp; // True during initial game startup (not reset). - (NSUInteger)entityCount; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (void)debugDumpEntities; - (NSArray*)entityList; #endif diff --git a/src/Core/Universe.m b/src/Core/Universe.m index 3f2dd1480..308220e4f 100644 --- a/src/Core/Universe.m +++ b/src/Core/Universe.m @@ -947,7 +947,7 @@ - (NSUInteger)entityCount return [entities count]; } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (void)debugDumpEntities { int i; @@ -6655,7 +6655,7 @@ - (void)update:(OOTimeDelta)inDeltaT OOLog(@"universe.profile.update", @"%@", @"Update complete"); } -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED - (double)timeAccelerationFactor { return timeAccelerationFactor; @@ -9253,7 +9253,7 @@ - (void)setUpSettings // time_delta = 0.0; -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED [self setTimeAccelerationFactor:TIME_ACCELERATION_FACTOR_DEFAULT]; #endif universal_time = 0.0; diff --git a/src/SDL/main.m b/src/SDL/main.m index 1e85444e9..3899e85c2 100644 --- a/src/SDL/main.m +++ b/src/SDL/main.m @@ -46,7 +46,7 @@ GameController* controller; #endif -#ifndef NDEBUG +#ifdef OO_DEBUG_MONITOR_ENABLED uint32_t gDebugFlags = 0; #endif