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(ww3d2): bind the scene target before clearing it
Olcay Seygan019ad20cf8c3
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5bcf2f6be..84b5ec526 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -3,7 +3,7 @@EA opened the source of Generals and Zero Hour, the game that is still on sale and still runs onSteam. This build is that source with the bugs the game shipped with fixed and everything below added.-**124 changes. ~580 engine source files ported. 14 automated test suites. Around 60 original bugs+**125 changes. ~580 engine source files ported. 14 automated test suites. Around 60 original bugsfound and fixed — EA's own, not port damage.**---@@ -728,6 +728,7 @@ found and fixed — EA's own, not port damage.**one" was set once and never cleared - so the first unit genuinely behind a wall made every unitchecked after it see-through too, wall or no wall. On a busy screen that was most of them.- Bloom and antialiasing work together. Turning bloom on with antialiasing on gave you a black battlefield under a live interface: the glow pass draws the world into its own picture first, and that picture came with a depth buffer nobody had cleared, so every triangle in the scene was rejected as being behind something that was not there.+- Lakes stop showing jagged bands of shore while you scroll. The glow and smoothing effects draw the world into a picture of their own, and that picture was never wiped between frames, so the water kept reading last frame's shoreline from wherever the camera had just been.- A switch you write in `Options.ini` by hand takes `yes`, `true`, `on` or `1` for on. Only theexact word `yes` used to count, so a line spelled any other way read as off and looked like asetting that did not work.diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cppindex a8d9cbc04..30ed154ee 100644--- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp+++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp@@ -848,6 +848,11 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, fWWASSERT(!IsRendering);IsRendering = true;+ // Bind the scene target before clearing it. The Direct3D 11 post-process pass+ // restores the back buffer at the end of each frame; clearing before Begin_Scene+ // left the offscreen scene's shoreline alpha mask from the previous camera view.+ DX8Wrapper::Begin_Scene();+// If we want to clear the screen, we need to set the viewport to include the entire screen:if (clear || clearz) {D3DVIEWPORT9 vp;@@ -864,9 +869,6 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, fDX8Wrapper::Clear(clear, clearz, color, dest_alpha);}- // Notify D3D that we are beginning to render the frame- DX8Wrapper::Begin_Scene();-return WW3D_ERROR_OK;}