Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/test_builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -196,4 +196,4 @@ jobs:
msystem: UCRT64
PYTHONUTF8: "1"
run: |
./mk.sh test dev
./mk.sh test deployment
10 changes: 4 additions & 6 deletions ShellScripts/common/post_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
4 changes: 0 additions & 4 deletions mk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/Core/CollisionRegion.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Debug/OODebugFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Debug/OODebugMonitor.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -929,4 +929,4 @@ - (id)autorelease

@end

#endif /* NDEBUG */
#endif /* OO_DEBUG_MONITOR_ENABLED */
2 changes: 1 addition & 1 deletion src/Core/Debug/OODebugStandards.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Debug/OODebugSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SOFTWARE.

*/

#ifndef NDEBUG
#ifdef OO_DEBUG_MONITOR_ENABLED

void OOInitDebugSupport(void);

Expand Down
4 changes: 2 additions & 2 deletions src/Core/Debug/OODebugSupport.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -132,4 +132,4 @@ static id LoadDebugPlugIn()

#endif

#endif /* NDEBUG */
#endif /* OO_DEBUG_MONITOR_ENABLED */
4 changes: 2 additions & 2 deletions src/Core/Debug/OODebugTCPConsoleClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -671,4 +671,4 @@ static void LogSendPacket(NSDictionary* packet)
}
#endif

#endif /* NDEBUG */
#endif /* OO_DEBUG_MONITOR_ENABLED */
14 changes: 7 additions & 7 deletions src/Core/Debug/OOJSConsole.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -1050,4 +1050,4 @@ static JSBool PerformProfiling(JSContext* context, NSString* nominalFunction, ui

#endif // OOJS_PROFILE

#endif /* NDEBUG */
#endif /* OO_DEBUG_MONITOR_ENABLED */
4 changes: 2 additions & 2 deletions src/Core/Debug/OOTCPStreamDecoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SOFTWARE.

*/

#ifndef NDEBUG
#ifdef OO_DEBUG_MONITOR_ENABLED

#include "OOTCPStreamDecoder.h"
#include "OODebugTCPConsoleProtocol.h"
Expand Down Expand Up @@ -219,4 +219,4 @@ static void Error(OOTCPStreamDecoderRef decoder, OOALStringRef format, ...)
}
}

#endif /* NDEBUG */
#endif /* OO_DEBUG_MONITOR_ENABLED */
4 changes: 2 additions & 2 deletions src/Core/Debug/OOTCPStreamDecoderAbstractionLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Foundation implementation.
*/

#ifndef NDEBUG
#ifdef OO_DEBUG_MONITOR_ENABLED

#import "OOTCPStreamDecoderAbstractionLayer.h"
#import "OOFoundation.h"
Expand Down Expand Up @@ -109,4 +109,4 @@ OOALObjectRef OOALPropertyListFromData(OOALMutableDataRef data, OOALStringRef* e
return result;
}

#endif /* NDEBUG */
#endif /* OO_DEBUG_MONITOR_ENABLED */
2 changes: 1 addition & 1 deletion src/Core/Entities/DockEntity.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Entities/DustEntity.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Entities/Entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -284,7 +284,7 @@ enum OOScanClass {
- (void)setAtmosphereFogging:(OOColor*)fogging;
- (OOColor*)fogUniform;

#ifndef NDEBUG
#ifdef OO_DEBUG_MONITOR_ENABLED
- (NSString*)descriptionForObjDumpBasic;
- (NSString*)descriptionForObjDump;

Expand Down
Loading
Loading