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(main): declare the process dpi aware so scaled displays do not stretch the window
Olcay Seygan457245651128
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e23eb509d..761446d89 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -258,6 +258,7 @@ found and fixed — EA's own, not port damage.**- The game draws its picture through Direct3D 11 now, and falls back to the old renderer on a machine that cannot make a Direct3D 11 device. Eight views over five maps come out within one step of one colour channel of the old picture, which is the smallest difference a screen can show.- The Direct3D 11 picture comes with its finishing passes on, no switch needed. Explosions glow past their own edges, because the battlefield is kept brighter than white until the glow is worked out; jagged edges are smoothed; and a light sharpening brings the 2003 textures back up after the smoothing. All three run over the battlefield only, before the health bars and the command bar go on top, so the lettering is untouched. In a screen of thirty inferno cannons firing the frame averaged 11.89ms with them against 11.82ms without. The antialiasing setting on the display page is for the old renderer; `-dx11post off` on the command line gives you the plain picture, and `-dx11post fxaa` picks effects one by one. The old renderer's rolling-wave sea never went missing in a real match either: both of the game's settings files turn it off, so no map ever drew it.- Fullscreen gets the Direct3D 11 picture too. The old renderer took the whole display for itself and refused the new one its window, so every fullscreen game quietly ran on Direct3D 9, and the DX9 in the corner readout was the only sign. Fullscreen is now your chosen resolution set on the monitor with the game's window over it: alt-tab drops you on the desktop at its own resolution and brightness, and coming back puts the game's on again. A 1280x720 match on a 1920x1080 screen drew 40.7 million times without one draw refused, before and after an alt-tab.+- The game fits the screen on a PC with Windows display scaling turned up. The game never told Windows it counts real pixels, so at 125% Windows blew the whole window up by a quarter: a 1920x1080 game on a 1920x1080 screen came out 2400x1350 and the right and bottom of it hung off the edge. Now the window is the size you picked.- Alt-tabbing out of a fullscreen match and back no longer leaves every building already on the map as a dark shadow with nothing standing in it. Coming back from the desktop switched the game over to Direct3D 11 halfway through the match, and the new picture only knew about what was built after the switch, so older buildings drew as their shadow alone while a new one beside them looked fine. A match keeps the picture it started with now.- 481 base-game textures at four times the resolution now beat Zero Hour's downscaled copies.- The ground is drawn at twice the detail. Every map square used to get a 64-pixel patch of its ground texture, squeezed into sixteen-bit colour; it gets 128 pixels now in full colour, so sand, gravel and tracks stop turning to blocks and bands when you zoom in, and a ground texture that ships at twice the size is shown at that size.diff --git a/GeneralsMD/Code/Main/WinMain.cpp b/GeneralsMD/Code/Main/WinMain.cppindex b936e7541..3dcec94fb 100644--- a/GeneralsMD/Code/Main/WinMain.cpp+++ b/GeneralsMD/Code/Main/WinMain.cpp@@ -1033,6 +1033,11 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,// for every machine; v1.1.4 was a 32-bit build and never had the choice._set_FMA3_enable( 0 );+ // Without this Windows scales the whole window by the display's scaling setting, so at 125% a+ // 1920x1080 game on a 1920x1080 screen is drawn 2400x1350 and hangs off the bottom right. The+ // game sizes everything in real pixels, which is what DPI awareness hands it.+ ::SetProcessDPIAware();+#ifdef _PROFILEProfile::StartRange("init");#endif