Skip to content

feat(sagepatch): casual QoL patch for macOS + Linux + user-config-dir (Phase 1.5)#156

Merged
fbraz3 merged 31 commits into
mainfrom
feature/sagepatch-qol-v2
Jun 9, 2026
Merged

feat(sagepatch): casual QoL patch for macOS + Linux + user-config-dir (Phase 1.5)#156
fbraz3 merged 31 commits into
mainfrom
feature/sagepatch-qol-v2

Conversation

@fbraz3

@fbraz3 fbraz3 commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Supersedes #110

This PR carries forward ebellumat's feature/sagepatch-qol work and adds Phase 1.5: a per-user config dir + symlink pattern so the SagePatch override is editable outside the game data dir and the .app / install dir. The original PR's 9 commits are preserved intact at the bottom of the branch history; the 4 follow-up commits are mine.

What's in

Phase 1 (ebellumat, 9 commits, untouched)

  • Patches/SagePatch/ — optional, drop-in patch that adds quality-of-life
    features for casual play. Gated by the new CMake flag
    RTS_BUILD_OPTION_SAGE_PATCH (default OFF, ON in the macos-vulkan
    preset). Independently implemented from public GenTool docs + SDL3 /
    CoreGraphics / X11 docs. No code reverse-engineered from the original
    closed-source d3d8.dll.
Feature Trigger macOS Linux Windows
Screenshot F11 screencapture -l <id> import / gnome-screenshot stub
Cursor lock toggle Scroll Lock SDL3 SDL3 stub
Brightness up / down Ctrl + PageUp/Down CoreGraphics gamma XF86VidMode (X11) stub
Window snap (5 pos) Ctrl + 1..5 SDL3 SDL3 stub
Camera height range passive INI override INI override INI override
Camera pitch passive INI override INI override INI override
Keyboard scroll speed passive INI override INI override INI override
FPS counter passive DXVK_HUD=fps default in run.sh same n/a

Phase 1.5 (this PR, 4 commits)

  1. User-config-dir + symlink pattern — SagePatch Override.ini is
    seeded once to a per-user location on first launch, then symlinked
    from the engine's cwd path2 slot (Data/INI/GameData/SagePatch.ini)
    to that user file. Users can edit QoL settings (MaxCameraHeight,
    MinCameraHeight, KeyboardScrollSpeed, etc.) without touching the
    .app / install dir or the game data dir, and changes take effect on
    next launch.

    • macOS: ~/Library/Application Support/GeneralsX/SagePatch/SagePatch.ini
    • Linux: $XDG_CONFIG_HOME/GeneralsX/SagePatch/SagePatch.ini
      (fallback ~/.config/GeneralsX/SagePatch/SagePatch.ini)
    • Windows: stub (Phase 2, will use proxy d3d8.dll)
  2. path1 → path2 fix — Engine INI load order is path1 first
    (Data/INI/Default/GameData/, parsed first), then overwritten by the
    BIG-archived Data/INI/GameData.ini defaults. A user override in
    path1 is silently lost. ebellumat's PR commit 598d8fd fixed this on
    the deploy side; the bundle side still wrote to path1. Both sides
    now write to path2 (Data/INI/GameData/, parsed last, wins).

  3. Base-game deploy paritydeploy-linux.sh and
    deploy-macos-generals.sh had no SagePatch wiring at all (only
    the bundles did). A user running cmake --preset macos-vulkan && cmake --build && ./scripts/build/macos/deploy-macos-generals.sh
    got a vanilla game; a user running the bundle got SagePatch. Both
    base-game deploys now copy the dylib, set the preload env var,
    default DXVK_HUD=fps, cd to ${SCRIPT_DIR}, and apply the
    user-config-dir pattern — same behavior as the ZH deploys.

  4. Launchers self-heal on every run — Stale path1 copies from
    older deploys are removed, stale path2 files (left over from a
    previous non-symlink deploy) are removed before the symlink is
    recreated. Idempotent; safe to re-run.

Architecture

Game process (GeneralsX / GeneralsXZH)
    │
    ├── DYLD_INSERT_LIBRARIES (macOS) / LD_PRELOAD (Linux) → libsage_patch.{dylib,so}
    │       └── SDL_PollEvent gets replaced (interpose table on macOS,
    │           symbol override + dlsym RTLD_NEXT on Linux)
    │              └── F11 / Scroll Lock / Ctrl+PgUp/Dn / Ctrl+1..5 → SagePatch handlers
    │                      └── Per-platform: screencapture / ImageMagick,
    │                          CoreGraphics gamma / XF86VidMode, SDL_SetWindowPosition
    │
    └── Engine reads Data/INI/GameData/SagePatch.ini (symlink) →
            → ~/Library/Application Support/GeneralsX/SagePatch/SagePatch.ini (macOS)
            → $XDG_CONFIG_HOME/GeneralsX/SagePatch/SagePatch.ini (Linux)
                └── camera/scroll overrides

No D3D8 proxy, no Vulkan layer, no engine source modifications. Phase 1
patch source is ~600 lines C++ across common/, macos/, linux/,
windows/ (stubs).

What's intentionally not in scope

  • Anti-cheat (MDS, Game File Validator, version check, ergc) — explicit user decision; out of scope.
  • External-server features (CNC Online, GameRanger, Upload Mode, ticker, ladder, GenTool updater) — depend on third-party infrastructure SagePatch does not own.
  • Replay tools and competitive features (Money Display, Player Table, Random Balance, fog-of-war replay, frame stepping, controls bar) — focus is casual play.
  • Engine bug fixes (Scud bug, Tunnel bug, Building bug, multiplayer movement crash) — these are already handled upstream by TheSuperHackers/GeneralsGameCode, which is the parent of GeneralsX and is maintained by the same author who wrote GenTool. The codebase already carries 170+ @bugfix annotations including Tunnel System fixes by xezon. Duplicating them here would create merge conflicts on the next upstream sync.
  • In-game text overlay (clock, match timer, in-game settings menu) — would need a graphics-pipeline hook (D3D8 proxy or Vulkan layer); Phase 2 if there's appetite. The existing DXVK_HUD provides a basic FPS counter as a substitute.
  • Windows preload mechanism — Win32 has no LD_PRELOAD / __interpose equivalent; needs a proxy d3d8.dll like the original GenTool. Stubs are in place so the build still succeeds with RTS_BUILD_OPTION_SAGE_PATCH=ON on Windows, but the runtime is no-op until the proxy is implemented.

Already in the engine, no patch needed

These GenTool-era options are first-class engine flags in Common/CommandLine.cpp. Documented in the SAGEPATCH.md so users know they can call them directly via run.sh:

  • -nologo
  • -noShellAnim
  • -noshellmap
  • -quickstart
  • -xres N -yres N (resolution unlock — engine no longer locks the list)
  • -forcefullviewport
  • -noaudio, -nomusic, -novideo

Test plan

  • Builds on macOS arm64 (macos-vulkan preset, RTS_BUILD_OPTION_SAGE_PATCH=ON)
  • libsage_patch.dylib produced — 55 KB, arm64 native, dynamic SDL3 lookup
  • Deploy scripts (Linux + macOS, base + expansion) copy the dylib + Override.ini into the runtime dir
  • Generated run.sh wrapper sets DYLD_INSERT_LIBRARIES / LD_PRELOAD correctly (no trailing :)
  • User-config-dir pattern: pre-existing user override preserved, no-user→seed+symlink, stale path1 cleaned, user edits live via symlink
  • 4-scenario smoke test of the launcher pattern (functional, end-to-end)
  • All 4 deploy scripts + 4 bundle scripts: bash -n clean, generated run.sh blocks bash -n clean
  • bash -n on every deploy and bundle script
  • SAGE_PATCH_DISABLED=1 ./run.sh skips the preload as expected
  • GUI smoke launch of ZH + base game on actual hardware (user-actionable, pending)
  • Each individual feature manually validated (F11 / Scroll Lock / Ctrl+PgUp/Dn / Ctrl+1..5)
  • Linux build verification (no Linux host available in this session — config compiles, runtime path needs Linux tester)

Commits

Phase 1.5 — follow-up (this PR adds)

  • c36326f58docs(blog): 2026-06-06 SagePatch deploy/bundle user-config-dir continuation
  • 1e1beded9refactor(sagepatch): base game deploy parity with Zero Hour
  • 192b44643refactor(sagepatch): route deploy-zh run.sh through user-config-dir
  • 9023734e3refactor(sagepatch): user-config-dir + symlink pattern, fix path1→path2
  • 7328e0ab3merge(main): sync sagepatch-qol with origin/main (force-push + upstream 06-05-2026)

Phase 1 — original (ebellumat, preserved intact)

  • 508839d62tune(sagepatch): tone down camera defaults (500/80, drop pitch override)
  • 598d8fd57fix(sagepatch,deploy): drop Override.ini in path2 subdir so values stick
  • 535c8a12adocs(sagepatch): drop FPS-counter feature claim; engine already has one
  • 22d9696e1fix(deploy): cd to script dir in run.sh wrapper before exec
  • 55f06b77cfix(sagepatch,macos): default DXVK_HUD off; MoltenVK can't compile DrawIndex
  • 1cf944fdcfeat(sagepatch): wire SagePatch through every release bundle path
  • 3a87fa2cddocs(sagepatch): clarify scope vs. existing engine flags and upstream fixes
  • 3efaac65cfeat(sagepatch): make cross-platform (macOS + Linux), add window snaps + FPS
  • d42ef875cfeat(sagepatch): add casual QoL patch for macOS via DYLD interpose

Notes on naming

SagePatch is a placeholder picked at scaffolding time (the SAGE engine being what Generals runs on). Trivial to rename via:

git grep -l SagePatch | xargs sed -i '' 's/SagePatch/<NewName>/g; s/sage_patch/<new_name>/g; s/SAGE_PATCH/<NEW_NAME>/g'
mv Patches/SagePatch Patches/<NewName>
mv docs/PATCHES/SAGEPATCH.md docs/PATCHES/<NEWNAME>.md

Reference

Introduces an optional patch (Patches/SagePatch/) that adds quality-of-life
features for casual play without modifying the game source. Gated by the
new RTS_BUILD_OPTION_SAGE_PATCH cmake flag (default OFF, ON in macos-vulkan
preset).

Architecture: a separate dylib loaded via DYLD_INSERT_LIBRARIES that
replaces SDL_PollEvent at the dyld level (__DATA,__interpose) to capture
hot-keys, plus an engine-side INI override picked up automatically from
Data/INI/Default/GameData/SagePatch.ini. No D3D8 proxy, no Vulkan layer,
no engine source changes.

Features in this initial drop:
  F11           PNG screenshot via /usr/sbin/screencapture (window-only)
  Scroll Lock   cursor lock toggle (SDL_SetWindowMouseGrab)
  Ctrl+PgUp/Dn  display gamma adjustment, range -128..+128
  Override.ini  MaxCameraHeight=800, MinCameraHeight=60, ScrollSpeed=1.0,
                EnforceMaxCameraHeight=No

Anti-cheat features (MDS, Game File Validator, ergc, version validation)
and competitive/networking features (Money Display, Player Table, Random
Balance, replay tools, CNC Online, ticker, Upload Mode, Auto Updater) are
intentionally excluded — focus is casual QoL only.

Smoke test: dylib loads cleanly via DYLD_INSERT_LIBRARIES, engine reads
the INI override, GameMain returns code 0.
…s + FPS

GeneralsX is a multi-platform project; the Phase-1 SagePatch was macOS-only,
which broke the rule. Restructured src/ tree and added Linux backend.

Source tree:
  src/common/   SDL3-only code that works everywhere — Init, KeyHandler,
                CursorLock, WindowPosition.
  src/macos/    __DATA,__interpose hook, screencapture, CoreGraphics gamma.
  src/linux/    LD_PRELOAD + dlsym(RTLD_NEXT), ImageMagick `import` /
                gnome-screenshot, XF86VidMode (lazy dlopen, X11 only —
                no-op under Wayland).
  src/windows/  stubs only (Phase 2 — would need a proxy DLL).

New features in this iteration:
  * Window snap presets — Ctrl+1..5 (center / TL / TR / BL / BR), via
    SDL_SetWindowPosition. Cross-platform.
  * FPS counter — both macOS and Linux deploy scripts default DXVK_HUD=fps
    when SagePatch is active, so casual users get a frame counter without
    extra config. Override with DXVK_HUD=0 or any custom value.
  * Camera pitch override added to resources/Override.ini.

Linux deploy script (scripts/build/linux/deploy-linux-zh.sh) now copies
libsage_patch.so + Override.ini, and the generated run.sh sets LD_PRELOAD
when the library is present. SAGE_PATCH_DISABLED=1 still skips the preload.

Phase 1 complete. Phase 2 items intentionally deferred:
  - Engine bug fixes (scud / tunnel / building / multiplayer crash) require
    edits inside Generals*/Code, defeating SagePatch's "no source change"
    contract.
  - Windows preload is structurally different — needs a d3d8.dll proxy.
  - In-game overlay text (clock, match timer, in-game menu) needs a
    graphics hook (D3D8 proxy or Vulkan layer).
… fixes

Two important clarifications after a code-base inventory:

1. Engine already supports GenTool-style CLI flags natively. Document
   -nologo, -noShellAnim, -noshellmap, -quickstart, -xres/-yres,
   -forcefullviewport, -noaudio/-nomusic/-novideo so users do not assume
   they need SagePatch to get those. They have always been part of the
   engine's CommandLine.cpp; no patch required.

2. Engine bug fixes (scud / tunnel / building / multiplayer movement crash)
   are handled by the upstream TheSuperHackers/GeneralsGameCode project
   which is maintained by the same author who wrote GenTool (xezon). The
   codebase already carries 170+ @BugFix annotations including the
   Tunnel System fixes by xezon himself. SagePatch does not duplicate
   them — that would create merge conflicts on the next upstream sync.

This explicitly scopes SagePatch to QoL features that live outside the
engine source tree.
Local deploy already shipped SagePatch on the previous commit. This wires
the same artifacts (libsage_patch.{dylib,so} + Override.ini) into every
release bundle so users actually get the QoL features when they download
the official zip / tar / flatpak — not just when they build from source.

Touches:

- scripts/build/macos/bundle-macos-zh.sh
- scripts/build/macos/bundle-macos-generals.sh
- scripts/build/linux/bundle-linux-zh.sh
- scripts/build/linux/bundle-linux.sh
- flatpak/com.fbraz3.GeneralsXZH.yml
- flatpak/com.fbraz3.GeneralsX.yml

Each one now:
1. Copies libsage_patch.{dylib,so} into the bundle's lib path (guarded by
   `-f` so the build still succeeds when SAGE_PATCH=OFF).
2. Ships resources/Override.ini into the bundle's data path
   (Resources/Data/... on macOS, /app/share/... in flatpak,
   Data/... in the standalone Linux tar).
3. Generated wrapper scripts now set DYLD_INSERT_LIBRARIES / LD_PRELOAD
   when the lib is present, with a `:` guard so empty existing values do
   not break dyld.
4. Wrapper seeds the INI override into `${CNC_GENERALS_*_PATH}/Data/INI/Default/GameData/SagePatch.ini`
   on first launch (engine reads INIs from cwd, not from inside the bundle).
5. DXVK_HUD defaults to "fps" when SagePatch is active (was: "0").

Flatpak manifests also pick up `-DRTS_BUILD_OPTION_SAGE_PATCH=ON` and run
the `sage_patch` build target after `z_generals` / `g_generals`.

Verified on macOS by running bundle-macos-zh.sh end-to-end:
  GeneralsXZH.app/Contents/Resources/lib/libsage_patch.dylib (55 KB, arm64)
  GeneralsXZH.app/Contents/Resources/Data/INI/Default/GameData/SagePatch.ini
…awIndex

The wrapper scripts shipped DXVK_HUD=fps when SagePatch was active. On
macOS 26 (MoltenVK 1.4.1, current SDK), DXVK's HUD pipeline shader uses
gl_DrawID, which lowers to SPIR-V DrawIndex. SPIRV-Cross to MSL has no
equivalent for that decoration and aborts conversion:

  [mvk-error] SPIR-V to MSL conversion error: DrawIndex is not supported in MSL.
  err:   Failed to create swap chain blit pipeline: VK_ERROR_INITIALIZATION_FAILED

The blit pipeline failure means DXVK can never present a frame; the game
hangs at the EA Games logo (last thing the engine drew before DXVK started
needing the blit pipeline).

Revert the default to DXVK_HUD=0 on the three macOS wrapper scripts.
Users who want the FPS overlay can still opt in with DXVK_HUD=fps.

Linux and Flatpak wrappers are unchanged: native Vulkan drivers handle
DrawIndex correctly there.
The engine resolves Local FS lookups (Data/INI/Default/<subdir>/*.ini overrides,
loose Data/ assets, etc.) relative to the binary's cwd, never the binary's
location. Without an explicit cd, launching the wrapper via absolute path,
Finder, gtimeout, or any other invocation that does not happen to start in the
asset dir caused the engine to miss every loose INI on disk — including
SagePatch.ini — while still loading the BIG-archived defaults via the archive
file system. Symptom: the game runs but the override apparently does nothing.

Wrapper now cds to the script's own directory (which deploy puts the binary,
the dylibs, the override INI, and the .big assets into) and execs the binary
relative to that. Matches the bundle-script wrappers which already did this.
The engine ships a native FPS overlay at the top-left via
W3DDisplay::drawFPSStats(), gated by #ifdef RTS_DEBUG plus the runtime
-benchmark <seconds> CLI flag. The previous SagePatch revision defaulted
DXVK_HUD=fps in the run wrapper as a release-build alternative, but that
default was already reverted in 55f06b7 because MoltenVK on macOS 26
cannot compile DXVK's HUD pipeline shader (DrawIndex has no MSL equivalent)
and the resulting blit-pipeline failure hangs the game at the EA logo.

Removing the FPS row from the feature table and replacing it with a small
'About FPS counters' section that explains the native option and why our
DXVK_HUD shortcut is parked.
The engine subsystem init for TheWritableGlobalData scans two parent dirs:
path1 = Data/INI/Default/GameData (loaded first)
path2 = Data/INI/GameData         (loaded second)

Each parsed GameData block overwrites prior values in TheWritableGlobalData
(INI_LOAD_OVERWRITE semantics). The vanilla camera defaults
(MaxCameraHeight = 310, MinCameraHeight = 120, CameraPitch = 37.5) live in
the BIG-archived Data/INI/GameData.ini and are parsed in the SECOND pass,
so an override placed under Data/INI/Default/GameData/ — which is parsed
in the FIRST pass — is silently undone right after.

Verified via temporary instrumentation in parseGameDataDefinition:
  pass 1: file=Data/INI/Default/GameData.ini    max=300/min=100  (debug-only block)
  pass 2: file=Data/INI/GameData.ini line=464   max=310/min=120  (vanilla, was last-write)
  pass 3: file=Data/INI/GameData/SagePatch.ini  max=800/min=60   (now winning)

Deploy scripts on both platforms now write to Data/INI/GameData/SagePatch.ini
(path2 subdir, parsed last) instead of Data/INI/Default/GameData/SagePatch.ini,
and clean up any prior misplaced copy. SAGEPATCH.md gains a short section
explaining the load order so future contributors do not repeat the mistake.
MaxCameraHeight=800 was too aggressive — on small maps it pushed the
orthographic frustum past the playable border, exposing void/cull at the
screen edges. Drop to 500 (~1.6x vanilla 310) so the extra range is
useful without breaking small skirmish maps.

Also raise MinCameraHeight back to 80 (slightly closer than vanilla 120
but not as tight as the previous 60), and remove the CameraPitch override
entirely — letting the engine keep its vanilla ~37.5 pitch instead of
forcing 50, which was an arbitrary choice and not a published GenTool
default. Scroll factor stays at 1.0 (2x vanilla).

Reaffirms that no published GenTool tuning numbers are public; these are
conservative casual-friendly bumps.
Resolved conflicts in bundle scripts to keep both SagePatch and FFmpeg runtime libs
@fbraz3 fbraz3 force-pushed the feature/sagepatch-qol-v2 branch from c36326f to adcdff4 Compare June 7, 2026 20:19
@fbraz3

fbraz3 commented Jun 7, 2026

Copy link
Copy Markdown
Owner Author

@ebellumat FYI

fbraz3 added 11 commits June 7, 2026 20:05
- Change RTS_BUILD_OPTION_SAGE_PATCH default from OFF to ON
- Update comment to reflect Linux support (LD_PRELOAD) alongside macOS
- SagePatch is now built by default on feature/sagepatch-qol-v2 branch

GeneralsX @feature fbraz3 07/06/2026 Enable SagePatch by default
- Bundle scripts (macOS/Linux) now deploy SagePatch.ini to Data/INI/GameData/
  instead of Data/INI/Default/GameData/
- Flatpak run.sh wrappers seed override to correct path
- run.sh wrapper comments updated
- Docs updated to reflect correct path
- Deploy scripts keep cleanup of old misplaced path

GeneralsX @BugFix fbraz3 07/06/2026 Fix SagePatch INI path
- Move add_subdirectory(Patches/SagePatch) before game targets
- Add add_dependencies(z_generals sage_patch) so CI builds --target z_generals
  also triggers sage_patch build
- Same for g_generals (Generals Base)

Without this, CI 'cmake --build --target z_generals' skipped the
standalone sage_patch library, so libsage_patch.dylib never existed
in the build directory and the bundle script skipped it.

GeneralsX @BugFix fbraz3 07/06/2026 SagePatch dependency on game targets
…alse

SDL3 3.4.2 removed SDL_bool, SDL_TRUE, and SDL_FALSE. By default
(without SDL_ENABLE_OLD_NAMES), these names are #defined to
SDL_bool_renamed_bool / SDL_TRUE_renamed_true / SDL_FALSE_renamed_false
which cause intentional compile errors.

Replace with plain C++ bool/true/false in the interposer file.
macOS interposer already used bool/true/false correctly.

GeneralsX @BugFix fbraz3 07/06/2026 Fix SDL3 3.4.2 compat
BFD ld on Flatpak build ignores --unresolved-symbols=ignore-in-shared-libs,
causing undefined reference errors for SDL_GetWindowFromID, SDL_SetWindowMouseGrab,
SDL_GetDisplayForWindow, SDL_GetDisplayUsableBounds, SDL_GetWindowSize,
SDL_SetWindowPosition, SDL_GetWindowProperties, SDL_GetNumberProperty.

Link against SDL3::SDL3 on Linux (same as macOS uses -undefined dynamic_lookup).
At runtime sage_patch loads via LD_PRELOAD into a process that already has SDL3,
so symbols resolve from the host's libSDL3.so.

GeneralsX @BugFix fbraz3 07/06/2026 Fix Linux sage_patch linker error
Adds a new GlobalData INI parameter TerrainDrawDistanceScale (default 1.0)
that scales terrain draw dimensions at runtime. SagePatch Override.ini sets
it to 1.05 to fix terrain pop-in at max zoom out.

Changes:
- GlobalData.h: Add m_terrainDrawDistanceScale Real field
- GlobalData.cpp: Add INI parse entry and default init (1.0)
- W3DView.cpp: Apply scale factor to drawWidth/drawHeight before rendering
- Override.ini: Set TerrainDrawDistanceScale = 1.05 for ~5% increase
Replaces the run.sh/bundle script copy approach with engine-managed defaults.
On first launch, the engine checks if SagePatch.ini exists in the user data
directory and creates it with default QoL values if missing.

Changes:
- GameEngine.cpp: Auto-create SagePatch.ini with defaults if missing
- deploy-*.sh: Remove Override.ini copy (engine handles it now)
- bundle-*.sh: Remove Override.ini copy into bundle resources
- flatpak/*.yml: Remove SagePatch.ini install + run.sh seeding

User data dirs:
- macOS: ~/Library/Application Support/GeneralsX/GeneralsZH/
- Linux: ~/.local/share/GeneralsX/GeneralsZH/
New in-game Extras menu with sliders for:
- Max/Min Camera Height (100-1000 / 50-300)
- Camera Pitch (20-60 degrees)
- Keyboard Scroll Speed (1-200%)
- Terrain Draw Distance Scale (100-200%)

Files:
- ExtrasMenu.cpp: 5 callbacks (Init/Update/Shutdown/System/Input)
- ExtrasMenu.wnd: Basic layout with sliders and buttons
- OptionPreferences.h/.cpp: Getters for SagePatch fields
- FunctionLexicon.cpp: Registered in all 5 callback tables
- GUICallbacks.h: Declared externs
Adds ButtonExtras to OptionsMenu.wnd handler that pushes
Menus/ExtrasMenu.wnd onto the shell stack.
The engine's winCreateFromScript prepends 'Window\' to the path and opens
via TheFileSystem which checks local files before BIG archives. Copying the
.wnd to Window/Menus/ in the runtime dir makes it loadable at runtime.
….wnd

- Added ExtrasMenu.cpp to CMakeLists.txt Menus section
- Fixed includes: GameClient/GameClient.h, GameClient/Shell.h, etc
- Replaced MSG_NOT_HANDLED with MSG_IGNORED, GIM_KEYBOARD_KEY with GWM_CHAR
- Created ExtrasMenu.wnd with 5 sliders and 3 buttons matching the .wnd format
- Deploy scripts now copy the .wnd to runtime dir
fbraz3 added 9 commits June 8, 2026 18:08
OptionsMenu.wnd in WindowZH.big has no ButtonExtras. Create it at runtime
using gogoGadgetPushButton, positioned to the left of ButtonBack.
The button's system callback is set to OptionsMenuSystem so it matches
the GBM_SELECTED handler.
getDataTemplate only recognizes VERTSLIDER/HORZSLIDER, not SLIDER.
Using SLIDER left data pointer null causing segfault in parseSliderData.
- docs/HOWTO/README.md: Index of available tutorials
- docs/HOWTO/SAGEPATCH_CONFIGURATION.md: Guide for configuring QoL settings
- README.md: Added HOWTO section with link to SagePatch tutorial
- AGENTS.md: Added docs/HOWTO/ to Docs Workflow and Directories sections
- docs.instructions.md: Added docs/HOWTO/ section with naming conventions and guidelines
User-facing tutorials moved from docs/BUILD/ to docs/HOWTO/:
- GETTING_THE_GAME_FILES.md: How to obtain original game assets
- INSTALLATION.md: How to install GeneralsX on Linux/macOS

Updated cross-references:
- README.md: Links point to docs/HOWTO/
- RELEASE_PIPELINE.md: Updated URL
- release.yml: Updated GitHub URLs
- HOWTO/README.md: Added both tutorials to index
- HOWTO Tutorials section moved right after downloads (more prominent)
- Name origin section moved after HOWTO for better flow
- Removed duplicate HOWTO section from bottom of file
…lobalData

The Generals base game has its own GlobalData.h/cpp that didn't include
the new TerrainDrawDistanceScale field, causing OptionPreferences.cpp
(compiled from Core/) to fail with missing member error.

Changes:
- Generals/GlobalData.h: Add m_terrainDrawDistanceScale field
- Generals/GlobalData.cpp: Add INI parse entry + default init (1.0)
- Generals/GameEngine.cpp: Add SagePatch auto-creation (same as GeneralsMD)
@fbraz3 fbraz3 merged commit 921ef3b into main Jun 9, 2026
8 checks passed
@fbraz3 fbraz3 deleted the feature/sagepatch-qol-v2 branch June 9, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants