Skip to content
Open
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
12 changes: 12 additions & 0 deletions .github/workflows/test_builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:
runs-on: ubuntu-latest
container:
image: ubuntu:26.04
options: >-
--cap-add SYS_ADMIN
--device /dev/fuse
--security-opt apparmor:unconfined
steps:
- name: Update Ubuntu
run: |
Expand Down Expand Up @@ -51,6 +55,10 @@ jobs:
runs-on: ubuntu-latest
container:
image: fedora:latest
options: >-
--cap-add SYS_ADMIN
--device /dev/fuse
--security-opt apparmor:unconfined
steps:
- name: Update Fedora
run: |
Expand Down Expand Up @@ -89,6 +97,10 @@ jobs:
runs-on: ubuntu-latest
container:
image: archlinux:latest
options: >-
--cap-add SYS_ADMIN
--device /dev/fuse
--security-opt apparmor:unconfined
steps:
- name: Update Arch
run: |
Expand Down
1 change: 1 addition & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ else
endif

ifeq ($(COMPILER_TYPE),gcc)
ADDITIONAL_OBJCFLAGS += -std=gnu99
ADDITIONAL_LDFLAGS += -fuse-ld=bfd
else
ADDITIONAL_LDFLAGS += -fuse-ld=lld
Expand Down
1 change: 0 additions & 1 deletion ShellScripts/Linux/install_freedesktop_fn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ install_freedesktop() {
install -D "$PROGDIR/oolite.debug" "$1/$2/oolite.debug" || { echo "$err_msg install oolite debug symbols" >&2; return 1; }
fi
install -D "$PROGDIR/run_oolite.sh" "$APPBIN/run_oolite.sh" || { echo "$err_msg install run_oolite.sh" >&2; return 1; }
install -D "$PROGDIR/splash-launcher" "$APPBIN/splash-launcher" || { echo "$err_msg install splash-launcher" >&2; return 1; }

# Resources copy
mkdir -p "$APPBIN/Resources"
Expand Down
6 changes: 3 additions & 3 deletions ShellScripts/Linux/install_package_fn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ install_package() {

"appimage")
case "$CURRENT_DISTRO" in
debian) PKG_NAME="NONE" ;;
redhat) PKG_NAME="desktop-file-utils which zsync" ;;
arch) PKG_NAME="desktop-file-utils zsync" ;;
debian) PKG_NAME="file fuse3" ;;
redhat) PKG_NAME="file fuse3 desktop-file-utils which zsync" ;;
arch) PKG_NAME="file fuse3 desktop-file-utils zsync" ;;
esac ;;

"flatpak") PKG_NAME="flatpak flatpak-builder" ;;
Expand Down
12 changes: 1 addition & 11 deletions ShellScripts/Linux/run_oolite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
HERE="$(dirname "$(readlink -f "$0")")"

DEBUG=false
SHOW_SPLASH=true
# Loop through all arguments
for arg in "$@"; do
case "$arg" in
-nosplash|--nosplash|-help|--help)
SHOW_SPLASH=false
;;
debug)
DEBUG=true
shift
Expand Down Expand Up @@ -55,13 +51,7 @@ launch_guarded() {
if [[ "$DEBUG" == true ]]; then
exec gdb --args "$OO_EXEDIR/oolite" "$@" -nosplash
fi
if [[ "$SHOW_SPLASH" == true ]]; then
"$OO_EXEDIR/splash-launcher" "$OO_EXEDIR/Resources/Images/splash.bmp" &
"$OO_EXEDIR/oolite" "$@" -nosplash
else
# already has -nosplash
"$OO_EXEDIR/oolite" "$@"
fi
"$OO_EXEDIR/oolite" "$@"
local EXIT_CODE=$?

if [ $EXIT_CODE -eq 0 ]; then
Expand Down
12 changes: 11 additions & 1 deletion installers/appimage/create_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ run_script() {
export DEPLOY_VULKAN
local DEPLOY_LOCALE=0
export DEPLOY_LOCALE
local STRACE_MODE=0
export STRACE_MODE

# install_metadatainfo_fn already put the files in the parameters below in the right place,
# but no harm putting again here
if ! $SHARUN_BIN "$APPBIN/oolite"; then
Expand All @@ -82,8 +85,15 @@ run_script() {
return 1
fi

APPIMAGETOOL_BIN="./appimagetool"
if [ ! -x "$APPIMAGETOOL_BIN" ]; then
echo "📥 appimagetool not found. Downloading..."
curl -o "$APPIMAGETOOL_BIN" -L https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$ARCH.AppImage || { echo "❌ appimagetool download failed" >&2; exit 1; }
chmod +x "$APPIMAGETOOL_BIN"
fi

echo "Creating AppImage $OUTNAME..."
if ! $SHARUN_BIN --make-appimage; then
if ! $APPIMAGETOOL_BIN "$ABS_APPDIR" "$OUTNAME"; then
echo "❌ AppImage creation failed!" >&2
return 1
fi
Expand Down
20 changes: 17 additions & 3 deletions installers/flatpak/create_flatpak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,35 @@ run_script() {
fi

# check manifest
LINT_EXCEPTIONS=$(mktemp /tmp/oolite-lint-XXXXXX.json)
cat <<EOF > "$LINT_EXCEPTIONS"
{
"space.oolite.Oolite": [
"finish-args-has-dev-input"
]
}
EOF
trap 'rm -f "$LINT_EXCEPTIONS"' RETURN EXIT

if command -v flatpak-builder-lint >/dev/null 2>&1; then
if ! flatpak-builder-lint manifest "$MANIFEST"; then
if ! flatpak-builder-lint manifest "$MANIFEST" --exceptions --user-exceptions="$LINT_EXCEPTIONS"; then
echo "❌ Flatpak manifest lint failed!" >&2
cat $MANIFEST
cat "$MANIFEST"
echo "❌ Flatpak manifest lint failed!" >&2
return 1
fi
else
echo "Native linter not found. Falling back to Flatpak container..."
if ! flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest "$MANIFEST"; then
if ! flatpak run --filesystem="$LINT_EXCEPTIONS" --command=flatpak-builder-lint org.flatpak.Builder manifest "$MANIFEST" --exceptions --user-exceptions="$LINT_EXCEPTIONS"; then
echo "❌ Flatpak manifest lint failed!" >&2
return 1
fi
fi

# 3. Clean up
rm -f "$LINT_EXCEPTIONS"
trap - RETURN EXIT

echo "Creating Flatpak..."
if ! flatpak remote-add \
--user \
Expand Down
2 changes: 2 additions & 0 deletions installers/flatpak/space.oolite.Oolite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ build-options:
prepend-ld-library-path: /usr/lib/sdk/llvm22/lib
command: run_oolite.sh
finish-args:
- --require-version=1.16.0
- --socket=wayland
- --socket=fallback-x11
- --share=ipc
- --share=network
- --socket=pulseaudio
- --device=dri
- --device=input
cleanup:
- /include
- /lib/pkgconfig
Expand Down
50 changes: 33 additions & 17 deletions src/SDL/MyOpenGLView.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,20 @@ - (void) createWindowWithSize: (NSSize) size
}

NSString *windowCaption = [self getWindowCaption];
int windowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY;
window = SDL_CreateWindow([windowCaption UTF8String], size.width, size.height, windowFlags);
Uint32 windowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY;

// Define modern SDL3 properties for window configuration
SDL_PropertiesID props = SDL_CreateProperties();
SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, [windowCaption UTF8String]);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, size.width);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, size.height);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER, windowFlags);

// Explicit centering properties setup for SDL3
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X_NUMBER, SDL_WINDOWPOS_CENTERED);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, SDL_WINDOWPOS_CENTERED);

window = SDL_CreateWindowWithProperties(props);
if (!window)
{
OOLog(@"display.initGL", @"%@", @"Trying 8-bpcc, 24-bit depth buffer");
Expand All @@ -203,7 +215,7 @@ - (void) createWindowWithSize: (NSSize) size
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
window = SDL_CreateWindow([windowCaption UTF8String], size.width, size.height, windowFlags);
window = SDL_CreateWindowWithProperties(props);
_hdrOutput = NO;
}

Expand All @@ -217,9 +229,12 @@ - (void) createWindowWithSize: (NSSize) size
// and if it's this bad, forget even trying to multisample!
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);
window = SDL_CreateWindow([windowCaption UTF8String], size.width, size.height, windowFlags);
window = SDL_CreateWindowWithProperties(props);
}

// Clean up properties block
SDL_DestroyProperties(props);

if (!window)
{
const char * errStr = SDL_GetError();
Expand Down Expand Up @@ -248,15 +263,15 @@ - (void) createWindowWithSize: (NSSize) size
OOLog(@"sdl.window_handle", @"%@", @"Failed to retrieve window handle");
exit(1);
}

// This must be inited after windowHandle has been set - we need the main window handle in order to get monitor info
if (![self getCurrentMonitorInfo:&monitorInfo])
{
OOLogWARN(@"display.initGL.monitorInfoWarning", @"Could not get current monitor information.");
}

atDesktopResolution = YES;

#if USE_UNDOCUMENTED_DARKMODE_API
// dark mode stuff - this is mainly for the winodw titlebar's context menu
HMODULE hUxTheme = LoadLibraryExW(L"uxtheme.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
Expand Down Expand Up @@ -285,18 +300,18 @@ - (void) createWindowWithSize: (NSSize) size
SDL_DestroySurface(icon);

_colorSaturation = 1.0f;

#if OOLITE_WINDOWS
_hdrMaxBrightness = [prefs oo_floatForKey:@"hdr-max-brightness" defaultValue:1000.0f];
_hdrPaperWhiteBrightness = [prefs oo_floatForKey:@"hdr-paperwhite-brightness" defaultValue:200.0f];
_hdrToneMapper = OOHDRToneMapperFromString([prefs oo_stringForKey:@"hdr-tone-mapper" defaultValue:@"OOHDR_TONEMAPPER_ACES_APPROX"]);
#endif

_sdrToneMapper = OOSDRToneMapperFromString([prefs oo_stringForKey:@"sdr-tone-mapper" defaultValue:@"OOSDR_TONEMAPPER_ACES"]);

SDL_SetWindowSurfaceVSync(window, vSyncPreference);
OOLog(@"display.initGL", @"V-Sync %@requested.", vSyncPreference ? @"" : @"not ");

int testAttrib = -1;
OOLog(@"display.initGL", @"%@", @"Achieved color / depth buffer sizes (bits):");
SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &testAttrib);
Expand All @@ -316,9 +331,9 @@ - (void) createWindowWithSize: (NSSize) size
#if OOLITE_WINDOWS
OOLog(@"display.initGL", @"Pixel format index: %d", GetPixelFormat(GetDC(windowHandle)));
#endif

// Verify V-sync successfully set - report it if not

int hasVsync;
if (vSyncPreference && (!SDL_GetWindowSurfaceVSync(window, &hasVsync) || !hasVsync))
{
Expand Down Expand Up @@ -376,10 +391,10 @@ - (id) init
{
showSplashScreen = YES;
}

// if V-sync is disabled at the command line, override the defaults file
if ([arg isEqual:@"-novsync"] || [arg isEqual:@"--novsync"]) vSyncPreference = NO;

if ([arg isEqual: @"-hdr"]) bitsPerColorComponent = 16;

// build the startup command string so that we can log it
Expand All @@ -401,7 +416,6 @@ - (id) init
}

[self populateFullScreenModelist];
SDL_SetEnvironmentVariable(SDL_GetEnvironment(), "SDL_VIDEO_WINDOW_POS", "center", YES);

// Find what the full screen and windowed settings are.
fullScreen = NO;
Expand Down Expand Up @@ -440,7 +454,7 @@ - (id) init

virtualJoystickPosition = NSMakePoint(0.0,0.0);
mouseWarped = NO;

_mouseVirtualStickSensitivityFactor = OOClamp_0_1_f([prefs oo_floatForKey:@"mouse-flight-sensitivity" defaultValue:0.95f]);
// ensure no chance of a divide by zero later on
if (_mouseVirtualStickSensitivityFactor < 0.005f) _mouseVirtualStickSensitivityFactor = 0.005f;
Expand All @@ -450,7 +464,7 @@ - (id) init
isAlphabetKeyDown = NO;

timeIntervalAtLastClick = timeSinceLastMouseWheel = [NSDate timeIntervalSinceReferenceDate];

_mouseWheelDelta = 0.0f;

m_glContextInitialized = NO;
Expand Down Expand Up @@ -482,8 +496,10 @@ - (void) endSplashScreen
#else
if (!showSplashScreen) return;

SDL_HideWindow(window);
SDL_SetWindowSize(window, firstScreen.width, firstScreen.height);
SDL_SetWindowFullscreen(window, fullScreen);
SDL_ShowWindow(window);

/* MKW 2011.11.11
* Eat all SDL events to gobble up any resize events while the
Expand Down
Loading