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): clear direct3d 11 textures with the d3d9 cache on reset
Olcay Seyganffc6aeb51d7c
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0ac7db0ae..2cccce655 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1242,6 +1242,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same- Starting a match with the Direct3D 11 picture on took the game down. Both devices were presenting into the same window, the old one lost itself, and the fog texture then locked a surface that was never made.- A machine whose graphics stack faults while the Direct3D 11 picture is being set up starts the game anyway, on the Direct3D 9 picture. A player's report showed the fault happening inside Windows' own graphics library, before the game got an answer back, and it ended in "Uncaught Exception during initialization". An overlay hooking the graphics calls or a stray dxgi.dll in the game folder is the usual cause. Until now the only way past it was typing -d3d9.+- A campaign mission could crash on its very first frame with the Direct3D 11 picture on, if the screen had been reset before it by an alt-tab or a change on the display options page. The reset threw some textures away, the new picture kept drawing with them, and the first water reflection of the next map read freed memory. A reset now clears every texture from the new picture as well as the old one.- The opening movies froze on their first frame with that picture on. A movie writes a new image every frame into a texture the copy had already taken.- Opening Single Player could take the game down a quarter of a second in, as the buttons flashed in. The menu's animation list names a Custom Mission button that only the 1.04 patch's main menu has, and on an install whose menu lacks it, every step of the flash skipped the missing button except one, which tried to draw it. That step skips it now too.- A skirmish against the computer could crash when a fresh unit joined one of its teams. The newcomer copies what a teammate is doing, and when that teammate was following a road the map had drawn for it, the newcomer got the order without the road and the game fell over looking for its first stop. It now gets the road as well, and a unit handed that order with no road at all gives it up instead.diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cppindex b8c1089ca..d68b0d0a0 100644--- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp+++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp@@ -723,6 +723,10 @@ void DX8Wrapper::Invalidate_Cached_Render_States(void)Textures[a]->Release();}Textures[a]=NULL;+ // The Direct3D 11 backend borrows the view the D3D9 texture owns, and the release above can+ // be that texture's last reference: a reset drops the render targets first. Left bound, the+ // view dangles, and the next draw into a target (the water's reflection) reads it and dies.+ Direct3D11_Mirror_Texture(a, NULL);}ShaderClass::Invalidate();