Skip to content

ui: Add automatic update notification and allow playing with previous game code build (Fixes #606) - #653

Open
jfpaardoo wants to merge 1 commit into
Revivedx:testfrom
jfpaardoo:feat/update-check-and-gamelib-reuse
Open

jfpaardoo wants to merge 1 commit into
Revivedx:testfrom
jfpaardoo:feat/update-check-and-gamelib-reuse

Conversation

@jfpaardoo

Copy link
Copy Markdown
Contributor

Description

This PR addresses automatic update notifications and avoids forced 15–20 minute game recompilations when updating Savage Wind (Fixes #606):

  1. Automatic update check (runtime/updater.c, runtime/updater.h):

    • Spawns a detached background thread at boot (updater_init()) that queries GitHub Releases (https://api.github.com/repos/Revivedx/SavageWindRecomp/releases?per_page=1).
    • Uses zero external dependencies: dynamically loads wininet.dll (InternetOpenA, InternetOpenUrlA, InternetReadFile) on Windows, and invokes curl on Linux/macOS.
    • Compares the remote tag_name with SAVAGEWIND_VERSION (handling semantic versioning v prefixes and prerelease versions).
    • If a newer release is found, displays an update notification button on the start screen (Update available: <version>) right above the version watermark, which opens the release page directly via SDL_OpenURL().
  2. Game code reuse without forced recompilation (runtime/gamelib.c, runtime/gamelib.h, runtime/ui/launcher.mm):

    • take_sites() in runtime/gamelib.c was already designed to accept older game builds as long as all required symbols are present and clear optional ones. However, a strict t->id == gamelib_id() equality previously blocked loading and forced full re-extraction/recompilation even when the ABI was identical.
    • Adds gamelib_abi_compatible() and gamelib_exact_id(). When an existing swgame library matches GAMELIB_ABI and passes take_sites(), the game can be played immediately without forcing the player to recompile.
    • Can be opted out at any time with SAVAGEWIND_REUSE_GAMELIB=0.
    • The launcher status line marks this clearly (Game files ready (previous game build).) with a hint that players can rebuild anytime under Game Files if they wish to apply the latest patches.
    • All 13 language translation tables (runtime/ui/i18n/*.inc) updated and verified with tools/i18n_check.py.

Validation

  • make runtime-objs -j8 compiled cleanly.
  • make test-pc-controls passed.
  • make test-actions passed.
  • python tools/i18n_check.py passed with 0 missing, 0 unused across all 13 languages.
  • git diff --check passed cleanly.

Copilot AI balanced review requested due to automatic review settings November 9, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants