Skip to content

bugfix: Remove superfluous CD checks and related code#2261

Merged
xezon merged 2 commits intoTheSuperHackers:mainfrom
githubawn:feature/no-cd-patch
Feb 14, 2026
Merged

bugfix: Remove superfluous CD checks and related code#2261
xezon merged 2 commits intoTheSuperHackers:mainfrom
githubawn:feature/no-cd-patch

Conversation

@githubawn
Copy link

@githubawn githubawn commented Feb 6, 2026

The Pull Request #2203 made by @fbraz3 inspired a deeper audit of the legacy CD requirements in the engine. Beyond merely skipping the startup prompt, it was discovered that large portions of the engine's CD-management infrastructure have become vestigial in modern execution environments.

This commit implements a comprehensive modernization by pruning approximately 2,000 lines of dead code across the Core, Generals, and Zero Hour variants.

Investigations (thanks to tomsons26) revealed that the Music.big handling was primarily a copy protection mechanism (SafeDisc) rather than for streaming audio. The engine attempted to read a specific file (often generalsa.sec) from the archive to verify a hash. Failure to read this file would trigger copy protection. This mechanism has been non-functional from the start and is now removed.

Tested all parts (init, singleplayer, skirmish) where this code was active, didn't find any problems.

@greptile-apps
Copy link

greptile-apps bot commented Feb 6, 2026

Greptile Overview

Greptile Summary

Removed ~2,000 lines of legacy CD management code that has been non-functional since the original release. The changes eliminate SafeDisc copy protection infrastructure, CD drive scanning, runtime Music.big loading from optical media, and user-facing "Insert CD" prompts.

Major Changes:

  • Deleted CD manager subsystem (CDManager, Win32CDManager) across Core, Generals, and GeneralsMD variants
  • Removed CD-based music loading loop from AudioManager::init() that previously blocked startup
  • Eliminated three FileSystem methods: areMusicFilesOnCD(), loadMusicFilesFromCD(), unloadMusicFilesFromCD()
  • Simplified campaign and skirmish game start flows by removing checkCDBeforeCampaign() and CheckForCDAtGameStart()
  • Removed device change handler that attempted to unload music when drives were ejected
  • Cleaned up includes and build system references across 32 files

Impact:
Music.big is now expected to be present at startup (loaded from local filesystem via standard BIG file mechanism). Games launch directly without CD prompts. The engine no longer monitors optical drives or attempts runtime CD operations.

Confidence Score: 5/5

  • This PR is safe to merge with no identified risks
  • The changes are pure deletions of dead code with no behavioral impact on functional systems. The CD management infrastructure was already non-functional (SafeDisc copy protection), and Music.big is now loaded through the existing standard BIG file system. All CD manager references have been cleanly removed with no orphaned calls. The changes are symmetric across Generals and Zero Hour variants, and the author reports successful testing of init, singleplayer, and skirmish modes. No logic errors, security issues, or incomplete cleanup detected.
  • No files require special attention

Important Files Changed

Filename Overview
Core/GameEngine/Source/Common/Audio/GameAudio.cpp Removed CD-based music loading loop and m_musicPlayingFromCD flag initialization
Core/GameEngine/Include/Common/GameAudio.h Removed isMusicPlayingFromCD() method and m_musicPlayingFromCD member variable
Core/GameEngine/Source/Common/System/FileSystem.cpp Removed implementations of three CD-related methods (79 lines of dead code)
Generals/Code/GameEngine/Source/Common/GameEngine.cpp Removed TheCDManager initialization and update calls
GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp Removed TheCDManager initialization and update calls, fixed perf comment to reference TheGlobalLanguageData
Generals/Code/GameEngine/Source/Common/System/CDManager.cpp Deleted entire CD manager implementation (294 lines)
Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp Removed CD check callbacks and replaced checkCDBeforeCampaign() calls with direct prepareCampaignGame() calls
Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp Removed IsFirstCDPresent() and CheckForCDAtGameStart() implementations, simplified game start flow
Generals/Code/GameEngineDevice/Source/Win32Device/Common/Win32CDManager.cpp Deleted Win32-specific CD manager implementation (236 lines)
GeneralsMD/Code/GameEngine/Source/Common/System/CDManager.cpp Deleted entire CD manager implementation (294 lines)

Flowchart

flowchart TD
    A[Game Initialization] --> B[FileSystem Init]
    A --> C[AudioManager Init]
    
    B -.->|REMOVED| D[CDManager Init]
    D -.->|REMOVED| E[Scan CD Drives]
    
    C --> F{Music Files<br/>Already Loaded?}
    F -->|No - OLD BEHAVIOR| G[Enter CD Check Loop]
    G -.->|REMOVED| H[Load Music from CD]
    H -.->|REMOVED| I{Music Found?}
    I -.->|No - REMOVED| J[Show Insert CD Dialog]
    J -.->|OK - REMOVED| G
    I -->|Yes - REMOVED| K[Create MusicManager]
    
    F -->|Yes - NEW BEHAVIOR| K
    F -->|No - NEW BEHAVIOR| L[setQuitting TRUE]
    
    K --> M[Game Running]
    
    M --> N[Game Update Loop]
    N -.->|REMOVED| O[CDManager UPDATE]
    
    P[Device Change Event] -.->|REMOVED| Q[unloadMusicFilesFromCD]
    
    R[Campaign Start] -.->|REMOVED| S[checkCDBeforeCampaign]
    S -.->|REMOVED| T{CD Present?}
    T -.->|No - REMOVED| U[Show CD Prompt]
    T -->|Yes - REMOVED| V[prepareCampaignGame]
    
    R -->|NEW BEHAVIOR| V
    
    style D fill:#f99,stroke:#f00
    style E fill:#f99,stroke:#f00
    style G fill:#f99,stroke:#f00
    style H fill:#f99,stroke:#f00
    style I fill:#f99,stroke:#f00
    style J fill:#f99,stroke:#f00
    style O fill:#f99,stroke:#f00
    style Q fill:#f99,stroke:#f00
    style S fill:#f99,stroke:#f00
    style T fill:#f99,stroke:#f00
    style U fill:#f99,stroke:#f00
Loading

Last reviewed commit: 3b0c6a8

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@fbraz3
Copy link

fbraz3 commented Feb 6, 2026

I believe the maintainers should decide whether it’s better for the project to completely remove the CD logic (this PR) or to keep it behind a feature flag (my PR).

IMHO, this PR might be better than mine, since CD is barely used nowadays.

@githubawn githubawn marked this pull request as draft February 6, 2026 03:07
@xezon
Copy link

xezon commented Feb 7, 2026

Ok I just realize this is the real pull... copying the texts:

Removing all the CD Check code around Campaign and Skirmish is good and correct.

As for Loading Music from CD, was that actually a supported Install option from CD? I cannot recall that the Music.big would have resided on the CD. It is copied to HDD, but perhaps there are exceptions when it detected very small HDD size?

I think we can split this change in 2.

1 for removing all the piracy CD checks
1 for removing the rest

@xezon xezon added the Refactor Edits the code with insignificant behavior changes, is never user facing label Feb 7, 2026
@xezon
Copy link

xezon commented Feb 8, 2026

Please also check MUSIC_BIG macro. I think that can also be removed.

@xezon
Copy link

xezon commented Feb 8, 2026

Please advance this Pull

@githubawn githubawn force-pushed the feature/no-cd-patch branch 2 times, most recently from b771edf to 39954bd Compare February 8, 2026 18:36
@githubawn
Copy link
Author

ignore this commit i pushed the wrong button sorry

@githubawn githubawn force-pushed the feature/no-cd-patch branch 2 times, most recently from f0980aa to db30f41 Compare February 8, 2026 20:05
@githubawn
Copy link
Author

changed the missing line:

sprintf(Buf,"----------------------------------------------------------------------------After TheCDManager = %f seconds",((double)(endTime64-startTime64)/(double)(freq64)));
sprintf(Buf,"----------------------------------------------------------------------------After TheGlobalLanguageData = %f seconds",((double)(endTime64-startTime64)/(double)(freq64)));

Thanks for the suggestion. I looked into MUSIC_BIG and while I agree it should be removed, it touches the audio system and core file closing logic which is outside the scope of my current changes. I'd prefer to handle that cleanup in a separate PR to ensure I can verify it properly without delaying this one.

@githubawn githubawn marked this pull request as ready for review February 8, 2026 20:16
@Caball009
Copy link

Please try to do the changes for Generals last, unless they're meaningfully different. This makes it easier to review, at least for me.

@stephanmeesters
Copy link

Looks good to me, one line extra that could be removed

diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt
index 9cf234c3a..c41ed211a 100644
--- a/Core/GameEngine/CMakeLists.txt
+++ b/Core/GameEngine/CMakeLists.txt
@@ -143,7 +143,6 @@ set(GAMEENGINE_SRC
 #    Include/GameClient/Anim2D.h
 #    Include/GameClient/AnimateWindowManager.h
 #    Include/GameClient/CampaignManager.h
-#    Include/GameClient/CDCheck.h
     Include/GameClient/ChallengeGenerals.h
 #    Include/GameClient/ClientInstance.h
     Include/GameClient/ClientRandomValue.h

The Pull Request TheSuperHackers#2203 made by @fbraz3 on the upstream repository inspired a deeper audit of the legacy CD requirements in the engine. Beyond merely skipping the startup prompt, it was discovered that large portions of the engine's CD-management infrastructure have become vestigial in modern execution environments.

This commit implements a comprehensive modernization by pruning approximately 2,000 lines of dead code across the Core, Generals, and Zero Hour variants.

Community investigations (thanks to tomsons26) revealed that the Music.big handling was primarily a copy protection mechanism (SafeDisc) rather than for streaming audio. The engine attempted to read a specific file (often generalsa.sec) from the archive to verify a hash. Failure to read this file would trigger copy protection. This mechanism has been non-functional from the start and is now removed.

Tested all parts (init, singleplayer, skirmish) where this code was active, didn't find any problems.
@githubawn githubawn force-pushed the feature/no-cd-patch branch from db30f41 to 765c35e Compare February 9, 2026 22:07
@githubawn
Copy link
Author

added #2261 (comment)

requesting review

@xezon
Copy link

xezon commented Feb 10, 2026

Curious why the commit shows xezon as author...

@xezon xezon changed the title feat: Remove CD management code refactor: Remove superfluous CD management code Feb 10, 2026
@xezon xezon added Major Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Feb 10, 2026
@xezon xezon changed the title refactor: Remove superfluous CD management code bugfix: Remove superfluous CD management code Feb 10, 2026
@xezon xezon added the Bug Something is not working right, typically is user facing label Feb 10, 2026
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@xezon xezon added this to the Major bug fixes milestone Feb 10, 2026
Copy link

@Caball009 Caball009 left a comment

Choose a reason for hiding this comment

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

Good effort.

I'm going to nitpick here for a moment and point out a bunch of blank lines that can be removed.

@Caball009
Copy link

Caball009 commented Feb 10, 2026

There's also this one:

EDIT, and these:
Core\GameEngineDevice\CMakeLists.txt: # Include/Win32Device/Common/Win32CDManager.h
Core\GameEngineDevice\CMakeLists.txt: # Source/Win32Device/Common/Win32CDManager.cpp

@MohmmadQunibi
Copy link

MohmmadQunibi commented Feb 12, 2026

why not merge this?

@xezon
Copy link

xezon commented Feb 13, 2026

There are outstanding comments.

@githubawn
Copy link
Author

resolved outstanding comments

@xezon xezon changed the title bugfix: Remove superfluous CD management code bugfix: Remove superfluous CD checks and related code Feb 14, 2026
@xezon xezon merged commit 182bf28 into TheSuperHackers:main Feb 14, 2026
25 checks passed
@githubawn githubawn deleted the feature/no-cd-patch branch February 14, 2026 21:19
Andreas-W added a commit to Andreas-W/GeneralsGameCode_Modding that referenced this pull request Feb 15, 2026
* bugfix(network): Assign disconnect frame when quitting the game via the disconnection menu (TheSuperHackers#2020)

* chore: Implement scripts for custom isEmpty() and singleton refs clang-tidy checks (TheSuperHackers#2010)

* bugfix(input): Replace frame-based timings with real-time timings in input system (TheSuperHackers#1835)

* bugfix(aiupdate): Repairing Chinooks and Helixes no longer take off after evacuating all passengers (TheSuperHackers#1762)

* bugfix(aiupdate): Chinooks and Helixes no longer take off after repair if passengers want to board or exit (TheSuperHackers#1787)

* refactor: Apply clang-tidy fixes for generals-use-this-instead-of-singleton (TheSuperHackers#2017)

* refactor: Apply clang-tidy fixes for generals-use-is-empty (TheSuperHackers#2018)

* fix(logic): Fix unexpected return in GameLogic::logicMessageDispatcher's switch case MSG_CANCEL_UNIT_CREATE (TheSuperHackers#1881)

* perf(audio): Optimize fail condition order in AudioManager::addAudioEvent (TheSuperHackers#1843)

* refactor(audio): Simplify volume related code in AudioManager and MilesAudioManager (TheSuperHackers#2030)

* ci(vcpkg): Stabilize vcpkg binary caching; add compiler-aware keys and explicit cache path (TheSuperHackers#2028)

* bugfix(aiupdate): Invalidate build task of Dozers and Workers if the assigned target scaffold no longer exists (TheSuperHackers#1868)

* perf(contain): Optimize Object::isHero with cached hero counter (TheSuperHackers#1841)

* refactor(network): Simplify error prone net packet size calculations with packed structs (TheSuperHackers#1675)

* refactor(logic): Simplify code in GameLogic's init, reset, startNewGame (TheSuperHackers#2027)

* bugfix(heightmap): Disable old uv adjument for cliffs (TheSuperHackers#2038)

* bugfix(heightmap): Fix dynamic lights on terrain (TheSuperHackers#2039)

* perf(weaponstore): Optimize WeaponStore::findWeaponTemplatePrivate with hash map lookup (TheSuperHackers#2042)

* bugfix(thingfactory): Reset next ThingTemplate ID after clearing custom map template overrides to avoid CRC mismatch in the next multiplayer game session (TheSuperHackers#2034)

* tweak(drawable): Set correct model tint color after loading a save game (TheSuperHackers#2025)

* bugfix(aiupdate): Prevent manually ejecting rappelling Rangers during Chinook Combat Drop (TheSuperHackers#1789)

* bugfix(ai): Undetected mines can now be approached when using a disarm weapon (TheSuperHackers#1883)

* bugfix(lobby): Properly sort CRC mismatched game rooms to the bottom of the lobby (TheSuperHackers#1845)

* perf(ai): Avoid a few std::vector copies when passing ai paths to functions (TheSuperHackers#1895)

* tweak(drawable): Decouple stealth detected opacity fade time step from render update (TheSuperHackers#2047)

* bugfix(audio): UI audio no longer plays at maximum volume for a single frame when navigating between shell map menus (TheSuperHackers#2019)

* bugfix(object): Do not apply veterancy bonuses and animations for dead units (TheSuperHackers#1968)

* fix(xfer): Fix xfer retail compatibility code (TheSuperHackers#2024)

* refactor(audio): Use MilesAudioManager::getEffectiveVolume consistently (TheSuperHackers#2058)

* bugfix(worldbuilder): Initialize boolean in ScriptConditionsDlg::OnEditCondition to show logical condition (TheSuperHackers#2062)

* bugfix(worldbuilder): Avoid taking action on cancel button for script conditions and actions (TheSuperHackers#2065)

* bugfix(network): Fix packet size setup mistakes (TheSuperHackers#2040)

* refactor(heightmap): Remove HALF_RES_MESH because it was never used and is broken (TheSuperHackers#2076)

* bugfix(actionmanager): Do not show false resume construction cursor for allied scaffolds (TheSuperHackers#2068)

* bugfix(render2d): Fix possible greyscale image rendering issues on hardware without DOT3 support (TheSuperHackers#2080)

* perf(heightmap): Reduce cost of min height loop in HeightMapRenderObjClass::updateCenter by 93% (TheSuperHackers#2077)

* fix(heightmap): Fix CENTER_LIMIT condition in HeightMapRenderObjClass::updateCenter (TheSuperHackers#2078)

* refactor(heightmap): Clarify magic numbers related to VERTEX_BUFFER_TILE_LENGTH (TheSuperHackers#2079)

* build(cmake): Move most CppMacros.h includes into precompiled headers and make them available in all build targets (TheSuperHackers#2090)

* refactor: Modernize NULL to nullptr (TheSuperHackers#1938)

* bugfix(scriptengine): Fix script dialog text spelling mistakes and errors in ScriptEngine (TheSuperHackers#2093)

* perf(heightmap): Optimize repeated calls to getXWithOrigin, getYWithOrigin in HeightMapRenderObjClass::updateVB (TheSuperHackers#2102)

* refactor(heightmap): Simplify functions getXWithOrigin(), getYWithOrigin() of HeightMapRenderObjClass (TheSuperHackers#2103)

* perf(heightmap): Optimize data locality for m_vertexBufferTiles and m_vertexBufferBackup in HeightMapRenderObjClass (TheSuperHackers#2104)

* refactor(gamelogic): Rearrange local variables in GameLogic::startNewGame() (TheSuperHackers#2115)

* refactor(cmake): Move core_config into corei_always for simplification (TheSuperHackers#2091)

* build(cmake): Expose source files of interface libraries core_utility, corei/gi/zi_libraries_include in Visual Studio solution (TheSuperHackers#2092)

* refactor(ww3dformat): Merge function PixelSize into Get_Bytes_Per_Pixel (TheSuperHackers#2072)

* perf(radar): Reduce cost of radar pixel draw in PartitionManager::refreshShroudForLocalPlayer by 96% (TheSuperHackers#2072)

* bugfix(actionmanager): Restore retail compatibility after construction cursor change in ActionManager (TheSuperHackers#2125)

* bugfix(buildassistant): Restore retail compatibility after build assistant shroud logic change (TheSuperHackers#2131)

* bugfix(dx8caps): Resolve greyscale texture rendering issues in VMWare environments (TheSuperHackers#2128)

* bugfix: Fix spelling errors in debug/diagnostic strings (TheSuperHackers#2108)

Co-authored-by: Stubbjax <stubbjax02@hotmail.com>

* fix: Rename misspelled identifiers (TheSuperHackers#2109)

* docs: Fix spelling errors in Core/Libraries comments (TheSuperHackers#2116)

* docs: Fix spelling errors in Core/Tools and Core/GameEngine comments (TheSuperHackers#2117)

* docs: Fix spelling errors in Generals Libraries, Tools, GameEngineDevice comments (TheSuperHackers#2120)

* docs: Fix spelling errors in GeneralsMD Libraries, Tools, GameEngineDevice comments (TheSuperHackers#2124)

* docs: Fix spelling errors in Generals/Code/GameEngine/Include comments (TheSuperHackers#2119)

* docs: Fix spelling errors in GeneralsMD/Code/GameEngine/Include comments (TheSuperHackers#2123)

* docs: Fix spelling errors in Generals/Code/GameEngine/Source comments (TheSuperHackers#2118)

* docs: Fix spelling errors in GeneralsMD/Code/GameEngine/Source/GameLogic comments (TheSuperHackers#2121)

* docs: Fix spelling errors in GeneralsMD/Code/GameEngine/Source/GameClient and Common comments (TheSuperHackers#2122)

* ci: Add workflow to trigger build from any commit for replay mismatch testing (TheSuperHackers#2114)

* bugfix(audio): Restore retail compatibility after optimization change in AudioManager::addAudioEvent (TheSuperHackers#2132)

* bugfix(script): Restore retail compatibility for sequential scripts in ScriptEngine (TheSuperHackers#2129)

* feat(build): Add new docker build and game install scripts for Linux (TheSuperHackers#2085)

Add convenience scripts for Linux users to build using Docker:

- scripts/build-linux.sh: Docker-based build script for Linux that wraps
  the existing Docker infrastructure with Wine and VC6 toolchain
- scripts/install-to-game.sh: Script to install built files to existing
  game installation with backup/restore support
- .gitignore: Add /tmp/, /.claude/, /CLAUDE.md to ignored paths
- README.md: Add quick start build section for Windows and Linux

The Linux build uses the existing Docker infrastructure in
resources/dockerbuild to produce Windows-compatible executables
that can run under Wine.

Usage:
  ./scripts/build-linux.sh # Build using Docker
  ./scripts/install-to-game.sh --detect # Install to your game

* bugfix(logic): Decouple scripted audio events from CRC computation (TheSuperHackers#2075)

* bugfix(ghostobject): Readd null check for 3DScene in W3DRenderObjectSnapshot::addToScene to prevent crash in headless replay playback (TheSuperHackers#2133)

* bugfix(heightmap): Revert optimization for m_vertexBufferTiles in HeightMapRenderObjClass because it does not work properly (TheSuperHackers#2135)

* bugfix(ai): Fix crash when AI player attempts to build a supply center with an invalid name (TheSuperHackers#2095)

* bugfix(object): Preserve unit behaviour when transferring assets to allies (TheSuperHackers#1885)

* bugfix(wbview3d): Fix crash on window resize in Generals World Builder (TheSuperHackers#2151)

* fix(debug): Fix spelling errors in DEBUG macro strings (TheSuperHackers#2148)

* fix: Fix spelling errors in code words (TheSuperHackers#2149)

* refactor(math): Implement Matrix4x4::Inverse, Matrix3D::Get_Inverse and replace unsafe Matrix4x4 to D3DMATRIX casts with conversion functions that apply the required transpose (TheSuperHackers#2052)

* perf(radar): Reduce cost of W3DRadar::renderObjectList (by 80%), W3DRadar::buildTerrainTexture (by 25%) and W3DRadar::clearShroud (TheSuperHackers#2138)

This is achieved by locking the radar surface only once instead of every pixel draw

* fix(tunnel): Fix undefined behavior in TunnelTracker::onTunnelDestroyed() and incomplete asset transfer in Team::setControllingPlayer() (TheSuperHackers#1958)

* build(cmake): Add MinGW-w64 toolchain and base configuration (TheSuperHackers#2067)

Add cross-compilation support for building with MinGW-w64 (GCC) on Linux
targeting 32-bit Windows executables. This enables building Generals and
Zero Hour without requiring MSVC or Windows.

Core components:
- Toolchain file for i686-w64-mingw32 cross-compiler
- MinGW-specific compiler flags and library linking
- MSVC compatibility macros (__forceinline, __int64, _int64)
- Math constants header (mingw.h) with MinGW-specific definitions
- Windows library dependencies (ole32, d3d8, dinput8, etc.)
- d3dx8 library aliasing for MinGW compatibility

The toolchain forces 32-bit compilation, disables MFC-dependent tools,
and configures proper search paths for cross-compilation environment.

Math constants are provided via mingw.h header (included through always.h)
rather than CMake compile definitions, allowing proper scoping and avoiding
global namespace pollution.

Build with: cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/mingw-w64-i686.cmake

Files:
- cmake/toolchains/mingw-w64-i686.cmake: Cross-compilation toolchain
- cmake/mingw.cmake: MinGW-specific build configuration
- Core/Libraries/Source/WWVegas/WWLib/mingw.h: Math constants header
- CMakeLists.txt: Include MinGW configuration when MINGW is detected

* build(cmake): Add widl integration for COM interface generation (TheSuperHackers#2067)

Add Wine IDL Compiler (widl) as a replacement for Microsoft's MIDL compiler
when building with MinGW-w64. This enables generation of COM interface code
from IDL files on Linux cross-compilation environments.

Features:
- Auto-detect widl executable (widl or widl-stable)
- Version detection and reporting
- Dynamic Wine include path detection via wineg++ preprocessor
- Configure Wine header paths for COM interface compilation
- Fallback to known Wine stable/development include paths
- IDL compilation function for generating headers and type libraries

The widl compiler generates compatible COM interface definitions required
for DirectX 8, Windows browser control, and other COM-based APIs used by
the game engine.

Files:
- cmake/widl.cmake: widl detection and configuration
- CMakeLists.txt: Include widl configuration for MinGW builds

* build(cmake): Add ReactOS ATL and PSEH compatibility layer (TheSuperHackers#2067)

Add ReactOS Active Template Library (ATL) support for MinGW-w64 builds,
enabling ATL/COM functionality without MSVC dependencies. This provides
the ATL headers needed for COM-based browser control integration.

Components:
- ReactOS ATL headers (v0.4.15) fetched from ReactOS project
- ReactOS PSEH (exception handling) in C++-compatible dummy mode
- ATL compatibility header with MinGW-specific macro definitions
- PSEH compatibility header ensuring proper exception handling

The implementation uses ReactOS PSEH in dummy mode (_USE_DUMMY_PSEH)
because MinGW-w64's native PSEH uses GNU C nested functions which are
incompatible with C++. This provides ATL functionality needed for:
- CComPtr and CComBSTR smart pointers
- ATL string conversion macros
- COM interface implementations

Files:
- cmake/reactos-atl.cmake: ReactOS ATL integration
- Dependencies/Utility/Utility/atl_compat.h: ATL compatibility layer
- Dependencies/Utility/Utility/pseh_compat.h: PSEH compatibility layer
- CMakeLists.txt: Include ReactOS ATL configuration

* build(cmake): Add ReactOS COM support utilities (comsupp) (TheSuperHackers#2067)

Add header-only implementation of COM support string conversion utilities
for MinGW-w64. These utilities are provided by comsuppw.lib in MSVC but
are not available in MinGW-w64's standard library.

Provides:
- _com_util::ConvertStringToBSTR(): Convert char* to BSTR
- _com_util::ConvertBSTRToString(): Convert BSTR to char*

These functions are essential for COM string handling in the browser
control integration and other COM-based APIs. The header-only approach
eliminates the need for linking against an external library and provides
a lightweight, portable solution compatible with both MSVC and MinGW-w64.

Implementation uses standard Windows APIs (SysAllocString, WideCharToMultiByte,
MultiByteToWideChar) to perform the conversions.

Files:
- Dependencies/Utility/Utility/comsupp_compat.h: COM string utilities

* build(deps): Update external dependencies for MinGW-w64 support (TheSuperHackers#2067)

Update DirectX 8, Miles Sound System, and Bink Video SDK to versions with MinGW-w64 compatibility fixes.

* build(cmake): Configure MinGW-specific compiler and linker settings (TheSuperHackers#2067)

Add MinGW-w64 detection and configure compiler flags to optimize build
output for cross-compilation:

- Detect MinGW-w64 compiler and set IS_MINGW_BUILD flag
- Skip debug symbols (-g) in MinGW Release builds to reduce executable size
  (MSVC Release builds already exclude debug info by default)
- Maintain debug symbols for MinGW Debug builds

This reduces the size of MinGW Release builds significantly while keeping
compatibility with MSVC build configurations. Debug builds still include
full debugging information for development.

Files:
- cmake/compilers.cmake: Add MinGW detection and conditional debug flags

* build(cmake): Add MinGW CMake presets for i686 (TheSuperHackers#2067)

Add configure, build, and workflow presets for MinGW-w64 32-bit (i686)
cross-compilation. Enables easy building with standardized configurations.

Presets:
- mingw-w64-i686: Release build (optimized, no debug symbols)
- mingw-w64-i686-debug: Debug build (with debugging symbols)
- mingw-w64-i686-profile: Profile build (optimized with profiling)

All presets:
- Use Unix Makefiles generator (as required for MinGW)
- Reference the mingw-w64-i686.cmake toolchain file
- Generate compile_commands.json for IDE integration
- Build to build/mingw-w64-i686 directory
- Include corresponding build and workflow presets

Usage:
  cmake --preset mingw-w64-i686
  cmake --build --preset mingw-w64-i686

Or use workflow preset:
  cmake --workflow --preset mingw-w64-i686

Files:
- CMakePresets.json: Add MinGW i686 configure/build/workflow presets

* fix(precompiled): Add ATL compatibility to precompiled headers (TheSuperHackers#2067)

Include ATL compatibility layer in precompiled headers for both Generals
and Zero Hour to enable MinGW-w64 builds with ReactOS ATL support.

Changes:
- Include atl_compat.h before atlbase.h for GCC/MinGW builds
- Add pragma pop at end of header to restore warnings
- Conditional compilation ensures MSVC builds remain unchanged

The ATL compatibility header must be included before ATL headers to:
- Define _USE_DUMMY_PSEH for C++-compatible exception handling
- Configure ReactOS ATL include paths
- Disable problematic GCC warnings for ATL code
- Define ATL-specific macros for MinGW compatibility

This change enables CComPtr, CComBSTR, and other ATL functionality
in MinGW-w64 builds while maintaining full MSVC compatibility.

Files:
- Generals/Code/GameEngine/Include/Precompiled/PreRTS.h
- GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h

* fix(cmake): Fix CMake dependencies and library linking for MinGW (TheSuperHackers#2067)

Update CMakeLists.txt files to fix library dependencies and ensure proper
linking for MinGW-w64 builds:

Core libraries:
- WW3D2: Add core_wwdebug, core_wwlib, core_wwmath dependencies
  Make comsuppw library MSVC-only (MinGW uses header-only comsupp_compat.h)
  Link WW3D2 libraries for core_wwdebug target
- WWMath: Add core_wwsaveload dependency
- GameEngine: Add widl support for browser control IDL compilation
- EABrowserDispatch/Engine: Include widl-generated headers

Game executables:
- Generals/GeneralsMD Main: Make NODEFAULTLIB and RC files MSVC-only
  (MinGW doesn't support /NODEFAULTLIB or .rc resource compilation via these paths)

These changes ensure:
- Proper link order and dependency resolution
- MSVC-specific features don't break MinGW builds
- COM interface code generation works with widl
- All required libraries are linked

Files:
- Core/GameEngine/CMakeLists.txt
- Core/Libraries/Source/EABrowserDispatch/CMakeLists.txt
- Core/Libraries/Source/EABrowserEngine/CMakeLists.txt
- Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt
- Core/Libraries/Source/WWVegas/WWMath/CMakeLists.txt
- Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt
- Generals/Code/Main/CMakeLists.txt
- GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt
- GeneralsMD/Code/Main/CMakeLists.txt

* fix(core): Add MinGW-w64 compatibility fixes to Core libraries (TheSuperHackers#2067)

Add comprehensive MinGW-w64 compatibility fixes to Core engine and library code:

Type definitions and compatibility (always.h, BaseTypeCore.h):
- Add __int64 and _int64 type definitions for MinGW
- Add NOMINMAX and min/max template handling
- Add __forceinline macro mapping

Calling conventions (wwstring, widestring, GameText, profile):
- Standardize Format() functions to __cdecl for cross-compiler compatibility
- Fix variadic macro handling for GCC
- Add explicit calling convention specifications where needed

Headers and forward declarations:
- Add missing forward declarations (WorldHeightMap.h, texture.h, textureloader.h)
- Fix include path case sensitivity (endian_compat.h, winsock.h)
- Include comsupp_compat.h before comutil.h for COM support

Compiler guards and compatibility:
- Guard MSVC SEH (MiniDumper.cpp) with _MSC_VER checks
- Guard inline assembly with compiler checks (debug_stack.cpp, debug_except.cpp)
- Add GCC inline assembly alternatives where needed
- Disable MSVC SEH for MinGW (thread.cpp, Except.cpp)

Linkage fixes:
- Remove inappropriate static qualifiers (W3DWaterTracks.cpp)
- Fix extern/static mismatches (missingtexture.cpp)
- Add explicit void* casts for function pointers

Includes and dependencies:
- Add stddef.h for size_t (wwmemlog.h)
- Add missing headers for MinGW compilation
- Fix COM browser header inclusion order

Audio and misc:
- Fix __stdcall in AudioEvents.h function pointer typedefs
- Fix volatile atomic operations (NoxCompress.cpp)
- Use portable sint64 types (wwprofile.cpp)

All changes are guarded with compiler checks to maintain MSVC compatibility.

Files: 31 Core library source and header files

* fix(headers): Add missing forward declarations for MinGW (TheSuperHackers#2067)

Add forward declarations for PathfindCell and Anim2DCollection classes
to resolve MinGW-w64 compilation errors due to incomplete types.

MinGW-w64 is stricter about forward declarations than MSVC, requiring
explicit forward declarations for classes used in header files before
their first usage.

Files modified:
- Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h
- Generals/Code/GameEngine/Include/GameClient/Anim2D.h
- GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h
- GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h

* fix(linkage): Fix static/extern linkage mismatches for MinGW (TheSuperHackers#2067)

Adjust function and variable linkage to resolve MinGW-w64 linker errors
caused by inconsistent static/extern declarations across translation units.

MinGW-w64 is stricter about ODR (One Definition Rule) violations and
requires consistent linkage specifications.

Changes - Arrays and data:
- Eva.cpp: Remove 'static' from TheEvaMessageNames array
- Scripts.cpp: Remove 'static' from TheShellHookNames array
- PopupPlayerInfo.cpp: Add 'static' to messageBoxYes to match definition

Changes - Helper functions:
- PartitionManager.cpp: Remove 'static' from hLine* functions

Changes - Callback functions:
- WOLBuddyOverlay.cpp: Remove 'static' from insertChat()
- WOLLobbyMenu.cpp: Remove 'static' from WOL helper functions
- W3DMainMenu.cpp: Remove 'static' from menu callback functions
- GameWindowTransitionsStyles.cpp: Remove 'static' from transition functions

All affected functions/variables are referenced from other translation units
and require external linkage to resolve correctly with MinGW-w64.

Files modified (8 files × 2 games = 16 total):
- Eva.cpp, Scripts.cpp, PartitionManager.cpp, PopupPlayerInfo.cpp
- WOLBuddyOverlay.cpp, WOLLobbyMenu.cpp
- W3DMainMenu.cpp, GameWindowTransitionsStyles.cpp

* fix(calling-convention): Standardize calling conventions and variadic macros (TheSuperHackers#2067)

Standardize function calling conventions and variadic macro definitions
for MinGW-w64 compatibility.

Changes:
- Add missing __cdecl to function pointers in GameText.h
- Fix VA_ARGS macro definitions to use __VA_ARGS__ properly
- Ensure consistent calling conventions across platforms

This resolves calling convention mismatches that could cause
undefined behavior when crossing DLL boundaries or using
variadic macros with MinGW-w64.

* fix(compatibility): Add compiler guards and GCC inline assembly for StackDump (TheSuperHackers#2067)

Add explicit compiler checks and GCC-specific inline assembly
implementation for the StackDump function to enable MinGW-w64 support.

Changes:
- Add #ifdef _MSC_VER guards around MSVC-specific inline assembly
- Implement GCC-compatible inline assembly version using __asm__ __volatile__
- Add #error directive for unsupported compilers
- Maintain identical functionality across compilers

This enables stack dumping functionality to work correctly with both
MSVC and MinGW-w64/GCC toolchains.

* fix(casts): Add explicit void* casts for function pointers (TheSuperHackers#2067)

Add explicit void* casts to function pointers in function tables and
callback registrations to resolve MinGW-w64 type-punning warnings.

Changes:
1. FunctionLexicon.cpp:
   - Cast all GameWindow callback functions to (void*) in:
     * gameWinDrawTable
     * gameWinSystemTable
     * gameWinInputTable
     * gameWinHelpBoxTable
     * gameWinTooltipTable

2. W3DFunctionLexicon.cpp:
   - Cast all W3D callback functions to (void*) in lexicon tables

3. SkirmishGameOptionsMenu.cpp:
   - Cast aiPlayerControlCallback to (void*) in window registrations

MinGW-w64 requires explicit casts when storing function pointers with
different signatures in void* fields, as the compiler is stricter about
type safety than MSVC in this context. These casts are safe because the
functions are later cast back to their correct types before invocation.

Files modified:
- FunctionLexicon.cpp (both games)
- W3DFunctionLexicon.cpp (both games)
- SkirmishGameOptionsMenu.cpp (both games)

* fix(debug): Simplify unconditional DEBUG_ASSERTCRASH to DEBUG_CRASH (TheSuperHackers#2067)

Replace DEBUG_ASSERTCRASH(nullptr, ...) with DEBUG_CRASH(...) for
unconditional crash assertions in MinGW-w64 debug builds.

Changes:
- PlayerTemplate.cpp: DEBUG_ASSERTCRASH(nullptr) → DEBUG_CRASH
- ChallengeGenerals.cpp: DEBUG_ASSERTCRASH(nullptr) → DEBUG_CRASH
- LoadScreen.cpp: 2× DEBUG_ASSERTCRASH(nullptr) → DEBUG_CRASH

Total: 4 instances simplified across GeneralsMD codebase

Rationale:
DEBUG_ASSERTCRASH(nullptr, ...) was causing compilation errors with
MinGW-w64 due to implicit nullptr-to-bool conversion. These instances
represent "unconditional crash" assertions (always false condition).

The DEBUG_CRASH macro is the semantically correct choice for this use
case, making the intent explicit and avoiding type conversion issues.

Error resolved:
  error: converting to 'bool' from 'std::nullptr_t' requires
  direct-initialization [-fpermissive]

Historical note: These instances were introduced by commit f891c5f
("refactor: Modernize NULL to nullptr"). The original NULL was
semantically 0 (false), not a null pointer check.

Affects: GeneralsMD debug builds only

* feat(cmake): Add debug symbol stripping for MinGW Release builds (TheSuperHackers#2067)

Implement complete debug symbol separation for MinGW-w64 Release builds,
matching MSVC PDB workflow. Debug symbols are now generated with -g and
then stripped to separate .debug files post-build.

Changes:
- cmake/debug_strip.cmake: New module with add_debug_strip_target() function
  - Automatically finds toolchain objcopy and strip tools
  - Three-step process: extract symbols, strip exe, add debug link
  - Only applies to Release builds (Debug keeps embedded symbols)
- cmake/compilers.cmake: Enable -g for all Release builds
  - Removed MinGW exception that was skipping debug symbols
  - Added comment explaining stripping workflow
- CMakeLists.txt: Include debug_strip.cmake module
- Generals/Code/Main/CMakeLists.txt: Apply stripping to g_generals
- GeneralsMD/Code/Main/CMakeLists.txt: Apply stripping to z_generals

Result files (Release):
- generalsv.exe (12 MB, stripped) + generalsv.exe.debug (231 MB, symbols)
- generalszh.exe (13 MB, stripped) + generalszh.exe.debug (250 MB, symbols)

Benefits:
- Crash dump analysis support (crashpad, breakpad)
- Post-mortem debugging with full symbols
- Performance profiling of optimized code
- Parity with MSVC (exe + pdb workflow)
- Smaller shipped binaries (symbols separate)

Debug builds keep symbols embedded for development convenience.

Tools used: GNU Binutils objcopy and strip

* refactor(bitflags): Simplify and improve setup for DAMAGE_TYPE_FLAGS_ALL, DISABLEDMASK_ALL, KINDOFMASK_FS (TheSuperHackers#2159)

* build(cmake): Dial back BINK upgrade to get the CMake INSTALL target to work again (TheSuperHackers#2167)

* unify(damage): Merge DamageTypeFlags from Zero Hour (TheSuperHackers#2141)

* refactor(pathfinder): Move obstacle handling functions from PathfindCell header to the cpp (TheSuperHackers#2140)

* bugfix(pathfinder): Fix late game unit lockups and erroneous impassable terrain (TheSuperHackers#2140)

* bugfix(aiupdate): Chinooks and Helixes now correctly wait for their passengers to disembark (TheSuperHackers#1792)

Adjusts Chinook and Helix behavior so that they evacuate their passengers with the correct timing. Originally, the ExitDelay INI field of the TransportContain module was ignored and all passengers were immediately evacuated - unless the aircraft was already landed. With this change, the ExitDelay field is always respected and remains consistent across all evacuation pathways. If the immediate evacuation behavior is preferred, then the ExitDelay can be tweaked to 0.

* fix(optionsmenu): Change incorrect OR/AND precedence of an unused condition in the OptionsMenu (TheSuperHackers#2164)

* refactor: Fix confusing use of logical AND and OR expressions (TheSuperHackers#954)

* perf(ini): Simplify, optimize and merge INI read line buffer implementation (TheSuperHackers#2143)

* fix(thingfactory): Prevent use-after-free from assert in ThingFactory::reset() (TheSuperHackers#2172)

* tweak(upgrade): Increase upgrade limit to 512 (TheSuperHackers#2162)

* bugfix(ai): Units located above the terrain can no longer teleport into airborne transports (TheSuperHackers#1794)

* unity(basetype): Merge Lib/BaseType.h code (TheSuperHackers#2180)

* unify(subsystem): Merge SubsystemInterface code (TheSuperHackers#2180)

* unify(ini): Merge INI and related code (TheSuperHackers#2180)

* unify(common): Merge GameCommon and related code (TheSuperHackers#2180)

* unify(userpreferences): Merge UserPreferences and related code (TheSuperHackers#2182)

* unify(userpreferences): Move UserPreferences files to Core (TheSuperHackers#2182)

* refactor(audioevent): Remove const casts for calling AudioEventRTS::setPlayingAudioIndex() (TheSuperHackers#2179)

* unify(common): Merge TerrainTypes from Zero Hour (TheSuperHackers#2196)

* unify(common): Merge PerfTimer, StackDump code from Zero Hour (TheSuperHackers#2195)

* unify(common): Merge CriticalSection, ScopedMutex code from Generals (TheSuperHackers#2194)

* unify(common): Merge Registry code (TheSuperHackers#2193)

* unify(lib): Move BaseType.h, trig.h to Core (TheSuperHackers#2185)

* unify(common): Move some common system files to Core (TheSuperHackers#2185)

All that is needed for ParticleEditor to move to Core

* bugfix(network): Revert changes to ConnectionManager::getMaximumLatency() to avoid a higher latency runahead than required (TheSuperHackers#2199)

* fix(network): Fix slightly unstable latency calculation in FrameMetrics::processLatencyResponse() (TheSuperHackers#2200)

* bugfix(dozeraiupdate): Builders now resume their task after having been disabled (TheSuperHackers#1870)

* bugfix(actionmanager): Allow immediate resumed construction of buildings if the existing builder dies (TheSuperHackers#1872)

* fix(activebody): Subdual damage can no longer go negative (TheSuperHackers#2184)

* fix(basetype): Add min/max template functions to BaseType.h (TheSuperHackers#2183)

Add lowercase min/max template functions to BaseType.h alongside existing
uppercase MIN/MAX macros from BaseTypeCore.h.

Problem: BitFlags.h and other GameEngine code needed readable min() calls,
but VC6's <algorithm> lacks std::min/std::max. GameEngine code cannot rely
on always.h (WWVegas layer).

Solution: Add min/max templates to BaseType.h with header guard to prevent
conflicts when GameEngine code includes both BaseType.h and WWVegas headers
(which also define min/max in always.h).

Implementation:
- Use same header guard as always.h (_MIN_MAX_TEMPLATES_DEFINED_)
- Templates coexist with uppercase MIN/MAX macros
- Works with VC6, MSVC, and MinGW-w64
- Follows existing BaseType.h pattern (sqr, clamp, sign templates)

* bugfix(ghostobject): Add Ghost Objects of the local player to the scene correctly after loading a savegame (TheSuperHackers#2186)

* bugfix(mouse): Make Cursor Capture opt-in to prevent capture in GUIEdit (TheSuperHackers#2187)

* unity(particlesys): Merge removal of Drawable Particle Attachments from Zero Hour (TheSuperHackers#2153)

* unify(particlesys): Merge addition of ParticleSystem::setSkipParentXfrm from Zero Hour (TheSuperHackers#2153)

* unify(particlesys): Compile out superfluous X and Y particle angles in Generals (TheSuperHackers#2153)

* unify(particlesys): Merge addition of SMUDGE particle type from Zero Hour (TheSuperHackers#2153)

* unify(particlesys): Merge optimization of alpha particle update from Zero Hour (TheSuperHackers#2153)

* unify(particlesys): Merge fix for erroneous particle visibility thresholds in Particle::isInvisible from Generals (TheSuperHackers#2153)

This merge fixes 13 broken particle effects in Zero Hour:

airCarrierExplosion2
airCarrierHotPillarArms
airCarrierJet01Explosion
airCarrierJetExplosion1
airCarrierJetExplosion2
airCarrierJetExplosion3
ArmExplosionSmall01
BarrelExplosion
BuggyNewExplosionArms
FireBaseHowitzerPillarArms
HotPillarArms
MammothTankExplosionArms
SpectreHotPillarArms

* unify(particlesys): Merge optimization for wind motion particle update when disabled from Zero Hour (TheSuperHackers#2153)

* unify(particlesys): Merge changes to math for aligning particle Z rotation with emitter direction from Zero Hour (TheSuperHackers#2153)

* unify(particlesys): Merge minor refactors in ParticleSystem (TheSuperHackers#2153)

* refactor(view): Fix variable names in View::getScreenCornerWorldPointsAtZ() (TheSuperHackers#2201)

* unify(particlesys): Move ParticleSys and ParticleEditor files to Core (TheSuperHackers#2212)

* fix(radar): Fix Radar pixel color format for non A8R8B8G8 surfaces (TheSuperHackers#2170)

* tweak(jetaiupdate): Defer offensive commands for parked jets without ammo (TheSuperHackers#2174)

* build(debug): Add CMake option RTS_DEBUG_CHEATS to enable debug cheats in release builds (TheSuperHackers#1842)

* bugfix(pathfinder): Fix some pinched cells being changed to impassable cells in internal_classifyObjectFootprint() (TheSuperHackers#2222)

* unify(w3ddraw): Merge W3DModelDraw, W3DDependencyModelDraw code (TheSuperHackers#2225)

* unify(w3ddraw): Move W3D Draw files to Core (TheSuperHackers#2225)

* fix(camera): Apply misc code type and comment fixes (TheSuperHackers#2227)

* refactor(basetype): Implement new functions Region3D::setFromPointsNoZ, Region3D::setFromPoints (TheSuperHackers#2228)

* fix(radar): Always keep Radar View Box in sync with the actual Camera View (TheSuperHackers#2229)

* fix(display): Polish the camera debug text in W3DDisplay::gatherDebugStats() (TheSuperHackers#2230)

* bugfix(aigroup): GLA Battle Bus can now respond to attack commands while in bunkered form (TheSuperHackers#2213)

* bugfix(gui): Fix game window animation movements to scale with display resolution (TheSuperHackers#2210)

* fix(shadow): Fix crash by initializing debris shadow name to an empty string (TheSuperHackers#2221)

* perf(particlesys): Reduce cost of ParticleSystemManager::findParticleSystem() by 80% (TheSuperHackers#2217)

* perf(particlesys): Optimize angleBetween() in Particle System (TheSuperHackers#2218)

* docs: Fix spelling errors in Generals/Code/GameEngine comments (2) (TheSuperHackers#2145)

* docs: Fix spelling errors in GeneralsMD/Code/GameEngine comments (2) (TheSuperHackers#2146)

* docs: Fix spelling errors in Core, GameEngineDevice, Libraries, Tools comments (2) (TheSuperHackers#2147)

* refactor(view): Remove unused functions in View class (TheSuperHackers#2232)

* refactor(view): Improve functions, variables, comments in View, W3DView (TheSuperHackers#2232)

* refactor(view): Split View::setAngleAndPitchToDefault into 2 separate functions (TheSuperHackers#2232)

* refactor(view): Simplify zoom adjustment code in W3DView::update() (TheSuperHackers#2232)

* refactor(view): Consolidate duplicate terrain render update logic into new function W3DView::updateTerrain() (TheSuperHackers#2232)

* refactor(view): Simplify Real Zoom Cam related code (TheSuperHackers#2232)

* refactor(view): Simplify position code in W3DView::buildCameraTransform() (TheSuperHackers#2232)

* refactor(view): Simplify Clip Planes related code in W3DView::setCameraTransform() (TheSuperHackers#2232)

* fix(draw): Fix illogical dirt effect update code in W3DTruckDraw::doDrawModule(), W3DTankTruckDraw::doDrawModule() (TheSuperHackers#2234)

* refactor(lanapi): Make LANMessage accessible in LANAPI (TheSuperHackers#2241)

* feat(version): Add functions to get Git short hash string (TheSuperHackers#2243)

* refactor(draw): Simplify particle effects code in W3DTankDraw, W3DTankTruckDraw, W3DTruckDraw (TheSuperHackers#2235)

* fix(draw): Replace ParticleSystem pointers with ParticleSystemID for safe particle lookups in W3DTrankDraw, W3DTankTruckDraw, W3DTruckDraw (TheSuperHackers#2235)

* fix(update): Fix value initialization of ProjectileStreamUpdate::m_projectileIDs (TheSuperHackers#2248)

* refactor(audio): Replace AudioManager's loseFocus/regainFocus with reason-based mute/unmute functions (TheSuperHackers#2236)

* tweak(pathfinder): Add audio event and message to announce pathfinding failover (TheSuperHackers#2242)

* fix(update): Extend the height of the USA Particle Cannon laser beam for enormous camera heights (TheSuperHackers#2220)

* feat(lanapi): Add LANAPI function to find LAN game with host IP address (TheSuperHackers#2249)

* fix(debug): Allocate enough terrain debug icons based on the map dimensions in W3DDebugIcons() (TheSuperHackers#2231)

* tweak(gui): Use default locale of user for listed replays and save games to match regional date time formats (TheSuperHackers#2254)

* build(cmake): Force include CppMacros.h globally for VC6 (TheSuperHackers#2252)

* fix: Replace sprintf with snprintf to prevent potential stack overflows (TheSuperHackers#2262)

* refactor(netpacket): Simplify packet serialization code by using packed structs (TheSuperHackers#1680)

* feat(gui): Implement Player Info List (TheSuperHackers#2136)

* fix(netpacket): Fix misplaced null test in NetPacket::addCommand() (TheSuperHackers#2272)

* fix(intro): Fix order of Display Update and Draw in intro loop (TheSuperHackers#2264)

* fix(display): Fix VideoBuffer format selection in W3DDisplay::createVideoBuffer (TheSuperHackers#2265)

* feat(gui): Add replay dates to replay list in Replay Menu (TheSuperHackers#2255)

* refactor(view): Simplify View angle normalization (TheSuperHackers#2271)

* fix(view): Prevent float division by zero in W3DView::setupWaypointPath() (TheSuperHackers#2274)

* bugfix(object): Cancel previous tasks for captured dozers (TheSuperHackers#2237)

* bugfix(cratecollide): Prevent crates from being collected multiple times in a single frame (TheSuperHackers#2279)

* feat(gui): Add support for extra column to separate time and date in Replay Menu (TheSuperHackers#2278)

To enable the fifth column, put COLUMNS: 5 in ReplayMenu.wnd:ListboxReplayFiles

* bugfix(gui): Fix application hang from scrolling a map list with arrow keys (TheSuperHackers#2281)

* perf(view): Optimize and simplify camera transform update logic (TheSuperHackers#2280)

* fix(comments): Use 2026 for this year's code comments (TheSuperHackers#2285)

* refactor(netpacket): Remove duplicate packed commands and cleanup code comments (TheSuperHackers#2283)

* refactor(netpacket): Use more consistent names for packed net packet structs (TheSuperHackers#2283)

* fix(netcommandmsg): Fix new/delete mismatch in NetWrapperCommandMsg (TheSuperHackers#2287)

* fix(netpacket): Protect text length value from overflowing in NetPacketChatCommand, NetPacketDisconnectChatCommand (TheSuperHackers#2284)

* bugfix(pathfinder): Fix uninitialized variable in Pathfinder::classifyFence() and possible source of mismatches in Retail-compatible builds (TheSuperHackers#1748)

* bugfix(projectile): Fix out-of-bounds access in DumbProjectile which causes mismatch with very high speed weapons at small hit distances (TheSuperHackers#2087)

* bugfix(ocl): Fix uninitialized variable in ObjectCreationList to avoid mismatches (TheSuperHackers#2096)

* bugfix(contain): Prevent undefined behaviour when a dead unit enters a container (TheSuperHackers#2258)

* chore(gui): Implement function GadgetTextEntrySetMaxLen() (TheSuperHackers#2290)

* bugfix(view): Recalculate camera area constraints when toggling Control Bar or changing Pitch, FOV (TheSuperHackers#2291)

* bugfix(worldbuilder): Fix script condition selection when editing newly created condition (TheSuperHackers#2289)

* refactor(draw): Rename emitters functions in W3DTankDraw, W3DTankTruckDraw, W3DTruckDraw (TheSuperHackers#2251)

* fix(draw): Recover tread debris effects for W3DTankTruckDraw (TheSuperHackers#2251)

Tread debris can be enabled in W3DTankTruckDraw INI modules by setting

TreadDebrisLeft=TrackDebrisDirtLeft
TreadDebrisRight=TrackDebrisDirtRight

* refactor(netpacket): Streamline order of net packet fields (TheSuperHackers#2288)

* refactor(netpacket): Simplify initialization of net packet field types (TheSuperHackers#2288)

* bugfix: Remove superfluous CD checks and related code (TheSuperHackers#2261)

Investigations revealed that the Music.big handling was primarily a copy protection mechanism (SafeDisc) rather than for streaming audio. The engine attempted to read a specific file (often generalsa.sec) from the archive to verify a hash. Failure to read this file would trigger copy protection. This mechanism has been non-functional from the start and is now removed.

* bugfix(network): Increase message buffer and max packet sizes to reduce connection issues (TheSuperHackers#2277)

* fix(netpacket): Fix undefined behavior with NetPacket buffer writes (TheSuperHackers#2304)

---------

Co-authored-by: Stubbjax <stubbjax02@hotmail.com>
Co-authored-by: Bobby Battista <bobtista@gmail.com>
Co-authored-by: xezon <4720891+xezon@users.noreply.github.com>
Co-authored-by: stm <14291421+stephanmeesters@users.noreply.github.com>
Co-authored-by: IamInnocent3X <i337y01_05vv4g@hotmail.com>
Co-authored-by: Caball009 <82909616+Caball009@users.noreply.github.com>
Co-authored-by: Sebyx07 <sebyx07@users.noreply.github.com>
Co-authored-by: SkyAero <21192585+Skyaero42@users.noreply.github.com>
Co-authored-by: Salem B. <46156444+jurassicLizard@users.noreply.github.com>
Co-authored-by: JohnsterID <69278611+JohnsterID@users.noreply.github.com>
Co-authored-by: Mauller <26652186+Mauller@users.noreply.github.com>
Co-authored-by: toph <tophroxx@outlook.com>
Co-authored-by: githubawn <115191165+githubawn@users.noreply.github.com>
Co-authored-by: abhatem <al.hatem.abdullah@gmail.com>
Co-authored-by: Lemon <100478094+L3-M@users.noreply.github.com>
Co-authored-by: helmutbuhler <buhler@8gadgetpack.net>
Co-authored-by: Mads Jans <90150876+ViTeXFTW@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Gen Relates to Generals Major Severity: Minor < Major < Critical < Blocker Refactor Edits the code with insignificant behavior changes, is never user facing ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants