Skip to content

chore(generals-parity): complete wave 1-5 code parity baseline#139

Merged
fbraz3 merged 4 commits into
mainfrom
feature/generals-base-parity-issue-88
May 12, 2026
Merged

chore(generals-parity): complete wave 1-5 code parity baseline#139
fbraz3 merged 4 commits into
mainfrom
feature/generals-base-parity-issue-88

Conversation

@fbraz3

@fbraz3 fbraz3 commented May 12, 2026

Copy link
Copy Markdown
Owner

Summary

This PR consolidates the parity baseline work across Generals and Zero Hour for waves 1-5, focusing on shared code alignment and safer cross-platform progression.

Important Context

This PR is not the final fix for the user-visible bugs tracked in #88.
It is an enabling step to reduce divergence and make subsequent bugfixes safer and more targeted.

What was done

  • Added/aligned CompatLib headers for Generals base where needed for shared portability paths
  • Completed GameEngine parity alignment areas touched in the wave 1-5 audit
  • Updated shared WWVegas2/library-side alignment points
  • Included FPS initialization/validation consistency adjustments already validated in this branch
  • Added audit/support documentation under WORKDIR for traceability

Why this PR now

Even with outstanding runtime issues, this parity pass was required anyway to:

  • reduce code drift between Generals and ZH
  • improve confidence for upcoming focused fixes
  • simplify review and maintenance of cross-platform changes

Issue linkage

Relates #88

fbraz3 added 4 commits May 11, 2026 23:46
…s platforms

Resolve FPS uncapping and frame counter instability that affected both Generals
and Zero Hour on macOS and Linux.

Changes:
- protect timeBeginPeriod/timeEndPeriod Windows API calls with #ifdef _WIN32
  guards in FramePacer constructor/destructor
- add early-exit validation in FrameRateLimit::wait() to handle zero or invalid
  FPS limits without division-by-zero errors
- ensure uncapped mode (maxFps > 1000000) skips limiting gracefully

Shared Core/GameEngine fixes apply to both games automatically.
Both GeneralsX and GeneralsXZH build and launch successfully with stable frame pacing.

Fixes #132"
…flag state

Root cause analysis: Generals base had FPS uncapped while Zero Hour worked because
GameEngine.cpp was checking (m_useFpsLimit && m_framesPerSecondLimit <= 0) before
setting default FPS. When m_useFpsLimit=FALSE (default) and m_framesPerSecondLimit=0
(default from INI loading), the condition failed and FPS remained 0 (uncapped).

Changed initialization logic to always set BaseFps default when m_framesPerSecondLimit <= 0,
regardless of m_useFpsLimit flag state. This ensures stable frame pacing on startup.

Applied to both GeneralsX and GeneralsXZH for consistency.

Fixes #132 completely"
… headers and GameEngine alignment

Summary of changes:
- Added full CompatLib header suite to Generals base for Win32/COM compatibility
- Completed GeneralsMD GameLOD, Player, PlayerList, and UI alignments
- Updated WWVegas2 libraries for both games
- Fixed FPS initialization logic (previously: only reset FPS when m_useFpsLimit=TRUE, now always set default)
- Protected Windows timer APIs with #ifdef guards
- Added FPS limit validation for uncapped mode
- Comprehensive audit trails in docs/WORKDIR/audit/

Generals base now has feature parity with Zero Hour for core systems.
Both titles compile successfully with stable frame pacing on macOS/Linux.

Related commits:
- 62dab6f: fix(timing) - timer API guards and FPS limit validation
- c722ca1: fix(fps-init) - ensure valid FPS default independent of flag state
…als-base-parity-issue-88

# Conflicts:
#	docs/DEV_BLOG/2026-05-DIARY.md
@fbraz3 fbraz3 merged commit defdb6f into main May 12, 2026
12 checks passed
@fbraz3 fbraz3 deleted the feature/generals-base-parity-issue-88 branch May 12, 2026 21:52
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.

1 participant