Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
fix(w3ddevice): pass the bridge slope bias as uint32 off windows
startupfoundryd17bf81e8131
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cppindex 0ce235fda..6a98e94ee 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp@@ -4390,7 +4390,7 @@ void W3DVolumetricShadowManager::renderShadowMap( CameraClass &sceneCamera )Nothing else in the game sets this state, so it goes back to zero rather than to thewrapper's cached value, which an invalidate leaves as a sentinel. */const float bridgeSlopeBias = SHADOW_MAP_BRIDGE_SLOPE_BIAS;- DX8Wrapper::Set_DX8_Render_State( D3DRS_SLOPESCALEDEPTHBIAS, *(const DWORD *)&bridgeSlopeBias );+ DX8Wrapper::Set_DX8_Render_State( D3DRS_SLOPESCALEDEPTHBIAS, *(const uint32 *)&bridgeSlopeBias );TheTerrainRenderObject->getBridgeBuffer()->drawBridgeShadowCasters();DX8Wrapper::Set_DX8_Render_State( D3DRS_SLOPESCALEDEPTHBIAS, 0 );diff --git a/docs/porting/windows-impact.md b/docs/porting/windows-impact.mdindex f9b1000cf..7d212d8e5 100644--- a/docs/porting/windows-impact.md+++ b/docs/porting/windows-impact.md@@ -426,6 +426,7 @@ Three things the checks found:| 2026-10-02 | Menu layout: Fit or Stretch | `GameClient/GUI/GameWindowManagerScript.cpp`, `Common/GlobalData.h`/`.cpp`, `Common/OptionsCatalog.h`/`.cpp`, `GUI/GUICallbacks/Menus/OptionsMenu.cpp`, `Data/Window/Menus/OptionsMenu.wnd`, `Data/Patch.str`, `Data/Turkish/Generals.str`, `Tools/optionsmenu_layout.py` (the contributor's `Tools/menufit-click-check.sh` and its ctest were not taken: they play their clicks through `ZH_INPUT_SCRIPT`, which went with the gamepad) | A new option, MenuLayout (Options > Display), that defaults to Stretch on Windows (`#if defined(_WIN32)` in GlobalData.cpp) and Fit elsewhere. `parseScreenRect`, the shared .wnd loader, gains a Fit branch for `Menus/` layouts: one scale, min(W/800, H/600), with the 4:3 area centred, except a window covering the whole layout (within 2 pixels), which still fills the screen. Stretch takes the old arithmetic unchanged. A new apply kind, `APPLY_SHELL_REBUILD`: changing the option on Accept rebuilds the shell, as a resolution change does. | With Stretch, Windows' default, every rectangle is the old expression; what differs is a branch on a flag that is false, one file-name test per layout and a new combo box. A Windows player who picks Fit gets the macOS and Linux layout, and the shell is rebuilt on Accept, which in a match is the path a resolution change already takes. If MSVC evaluated `min` differently from the POSIX builds here, Fit rectangles could be a pixel off, never Stretch's. No CRC is read from window geometry. | low | **Windows: VERIFIED** (2026-10-02, the merge gate's x64 and ARM64 runs: build, ctest 53/53 and 56/56 with the optionsmenu selfcheck, E1 as pinned. x64 under WARP at 1280x800 against v3.0.0: the default Stretch draws the main menu and the skirmish screen with 0 pixels different, and the options page differs only in the new row (15,551 px in x 63-421, y 469-570); `MenuLayout = 1` draws the Map Preview at 234x198, w/h 1.182, as macOS and Linux do. Those runs were the contributor's, on his tree with the gamepad and ARM64 still in; on this merge, x64 2026-10-02: `build.bat Release test`, ctest, `replay-check.ps1` and a default start. Left: no automated check of where a Fit click lands.) || 2026-10-02 | The in-game art download on macOS and Linux removed | `Tools/fetch-art.sh`, `Tests/test_fetch_art.sh` (both removed); `Main/PosixMain.cpp`, `CMakeLists.txt` (`ZH_ART_URL` and the `fetch_art_check` test), `Tools/make-macos-app.sh`, `Tools/linux-portable.sh`, `Tools/linux-packages.sh`, `Tools/linux-packages/` (CMakeLists.txt, PKGBUILD, the Flatpak manifest and metainfo), `Tests/test_macos_app.sh`, `Tests/test_linux_portable.sh`, `PORTING.md` | The game no longer starts `fetch-art.sh` on macOS and Linux, and the packages no longer carry it; `--art-url` is gone from the packaging scripts. The art release it fetched from was never published. `<user data>/ReforgedArt` is still read as an overlay after a package's own, so whatever installs the art later puts it there. | none on Windows: `PosixMain.cpp` and the packaging scripts are not built or run there, and the `CMakeLists.txt` lines removed were inside the macOS and POSIX test blocks | none | **Windows: done** (build.bat Release test on this branch.) || 2026-10-02 | Windows ARM64 loads its textures: the port's own D3DX | `WW3D2/d3dx9runtime.cpp`/`.h`, new `WW3D2/d3dx9portable_texture.cpp`/`.h` and `WW3D2/d3dx9texturerules.h`, `WW3D2/d3dx9posix_texture.cpp`; `PosixDevice/Render/PosixImage.cpp`/`.h` (moved out of `PosixResources9`), `PosixImageOps.h`, `PosixPixelCodec.h`; `W3DDevice/GameClient/W3DDisplay.cpp` (one log line); `CMakeLists.txt`; `Tests/test_d3dx9portable_oracle.cpp`; `tree-check.ps1`; `PORTING.md`, `README.md`, `CHANGELOG.md` | Without `d3dx9_43.dll` (ARM64 always, x64 with `ZH_D3DX_PORTABLE=1`), `Bind_D3DX9_Runtime` binds the port's own bodies and returns true: D3DXCreateTexture with D3DX's sizes and format substitution, D3DXLoadSurfaceFromSurface and D3DXFilterTexture through PosixImageOps (the macOS and Linux surface code) over the real device, reading a surface that will not lock through GetRenderTargetData and writing one through UpdateSurface, and the assembler, compiler and disassembler from `d3dcompiler_47.dll`'s D3DAssemble, D3DCompile and D3DDisassemble. The log says which: `W3DDisplay::init - D3DX: d3dx9_43.dll` or `the port's own, shaders by d3dcompiler_47.dll`. D3DX_DEFAULT as a texture dimension is 256 now, on macOS and Linux too, as the DLL makes it. `tree-check.ps1` takes `-NewEnv` and `-Extra`, uses a user data folder of its own and ends only the game it started: it took another checkout's screenshot once, and ended other checkouts' games by name. | x64 without the variable binds the DLL exactly as before (the `#else` side of the old ARM64 branch is the same code). With it, a texture can differ from the DLL's by one step of its narrowest channel, two down a 5-bit mip chain; the cases where the port and the DLL part further (luminance destinations, D3DX_FILTER_TRIANGLE, a box over more than 2:1, DXT3/5 blocks with c0 <= c1 decoded on the CPU, image files) are paths no game call takes. | low | **Windows: PARTLY VERIFIED** (x64, 2026-10-02: `build.bat Release test` 58/58, 0 C4311/C4312, `replay-check.ps1` seeds 0 and 1 the same at frame 6000; `test_d3dx9portable_oracle` on the real device: 55 results, 28 byte-identical, the rest within one step, two on R5G6B5 mip level 3, shader tokens equal; `tree-check.ps1 -NewEnv ZH_D3DX_PORTABLE=1` against the same exe on the DLL, Direct3D 11: all 8 views within their limits on the third run (worst 1.13% of 1.2%), the two runs before each had one view over, a shot taken 9 or 10 frames apart under another checkout's games' load; `-Extra -d3d9`: all 8 within, worst 0.6%; the logs confirm the renderer and the binding of each side.) Left: an ARM64 build and run; this machine has no ARM64 toolset or hardware. |+| 2026-10-08 | The bridge decks' slope bias spelled without DWORD | `W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp` | 9cc0c0b0 passed the bias's bits as `*(const DWORD *)&bridgeSlopeBias`, and DWORD is not a type off Windows (bittype.h removed it on purpose), so every macOS and Linux build stopped there. It is now `*(const uint32 *)`, as `dx8wrapper.h`'s fog states are. | None: DWORD and uint32 are both 32-bit unsigned under MSVC, so the call takes the same value. | low | **Windows: OPEN** (a Windows build; nothing else can differ.) |## Standing items