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(gameclient): stretch match-dialog veils to the display
Olcay Seygan8b7cc7fadea1
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 50f041ef2..f36ac719f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -54,6 +54,7 @@ found and fixed — EA's own, not port damage.**- The choice between a Classic and a Reforged interface is gone. There is one, laid out the way Zero Hour shipped, and the orders Reforged added now live on the keys you already know: A attack-moves, holding Ctrl fires on whatever is under the cursor as it did in 2003, a guard order can cover a patch of ground instead of one spot, and orders queue up one after another. Everything your base is building stands on the screen as a line of text each, the six closest to done first and "+N more" for the rest. Superweapon countdowns are listed the same way, up to eighteen. Both lists are in bold type, the build list in white and each countdown in its owner's colour. The promotion screen no longer darkens the battlefield behind it. Whether the right button gives orders, or the left as in 1.04, is a setting in the launcher.- An attack move and a Ctrl attack fire on the left click in every mouse setup. With the right button giving orders, A then a right click attack-moved, and Ctrl fired only on a right click, so the same hands did different things depending on one checkbox. Now A, or Ctrl held, then a left click is the attack everywhere, and a right click with A armed puts the key down without an order. Ctrl with a right click gives none. Plain orders stay on whichever button your setup gives them.- Combat units that attack-move now have a Force Attack button on the command bar, under Attack Move and left of Stop. It arms the same fire-on-whatever-is-under-the-pointer mode holding Ctrl has always given, and the button wears Ctrl. This version's data checksum differs, so it cannot join a game hosted on an older one.+- The dark plate behind Exit, Restart and the options screen in a match covers the whole picture. It used to sit in a 4:3 frame in the middle, so a widescreen left the battlefield bright down both sides. The box itself keeps the shape it was drawn in.- Buildings select together again, which the one interface had taken away. Shift-click them, drag a box over them, or double-click one for every building of its kind on the screen; select four War Factories and each tank you click goes to whichever has the shortest queue. Double-click a unit and every one of that kind whose feet sit in the picture is taken, including the ones sitting past the camera's far clip that used to be skipped. A building and a unit still never share a selection.- Formation lines are back for everyone. With move, attack move or guard armed, a left drag spreads the selection along the line you draw again; since the one interface it drew a selection box instead, because the line was switched off for the Classic mouse that every player now runs. A drag with no order armed is still the selection box.- Every key is yours to move. The launcher's Hotkeys page draws the command bar of every building and unit each general can field, cameos and letters as the game shows them, and a click and a keypress gives any button a new letter or none. Two buttons on one bar that would share a letter are marked before you play. The keyboard commands are there too, from bookmarks and team keys to the camera, along with the ones Zero Hour never bound: select every fighting unit, vehicle or aircraft, every barracks, war factory or airfield, the next idle worker or unit, pause, the general's promotions, the three signals to your allies and the general's powers. Your keys are yours alone; the other players in a match keep theirs, and a match never refuses you for them. Every mod you install brings its own generals to the page, ShockWave's fifteen next to Zero Hour's thirteen, and a key you give a ShockWave button stays with ShockWave.@@ -1377,7 +1378,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same"leave now", and nothing was listening for it: the handler was switched off in 2003 and neverswitched back on, so the X in the corner did nothing and the only way out was the menus. A matchin progress stops recording its replay first.-- The menus fill the screen again, in both interfaces and at every resolution. For a while they stood in a 4:3 frame in the middle, and in Classic the screen past it was black: at 2560x1080 that was 560 pixels of nothing down each side of the main menu, and players read it as a game that had not found their monitor. The main menu, skirmish, LAN, options, the load screens and the score screen are stretched edge to edge the way Zero Hour always drew them. The dialogs a match opens over the battlefield, the Esc menu and the options and save screens among them, keep their drawn shape in the middle, with the battlefield showing round them.+- The menus fill the screen again, in both interfaces and at every resolution. For a while they stood in a 4:3 frame in the middle, and in Classic the screen past it was black: at 2560x1080 that was 560 pixels of nothing down each side of the main menu, and players read it as a game that had not found their monitor. The main menu, skirmish, LAN, options, the load screens and the score screen are stretched edge to edge the way Zero Hour always drew them. The dialogs a match opens over the battlefield, the Esc menu and the options and save screens among them, keep their drawn shape in the middle. The dark plate behind Exit, Restart and the options screen covers the whole picture.## Soldiers cast real shadowsdiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cppindex e1c4d7a4b..5275a3fee 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp@@ -517,7 +517,8 @@ static LayoutPlacement theLayoutPlacement = LAYOUT_STRETCH;static Coord2D theLayoutAnchor = { 0.5f, 0.5f };// The dialogs a match opens over the battlefield are fitted in both interfaces, centred on a 4:3 panel-// of their own; the shell's screens are stretched (layoutIsShellScreen). In Reforged the rest of+// of their own; a root authored as the whole 800x600 is that panel's veil and covers the display.+// The shell's screens are stretched (layoutIsShellScreen). In Reforged the rest of// Window/ is the battlefield's own furniture - the command bar, which scales itself// (ControlBarUniformScale), and windows that hold a screen edge (the general's powers bar, the build// tooltip) or follow the battlefield (chat, diplomacy, the general's promotion screen, replay@@ -638,19 +639,33 @@ static Bool parseScreenRect( char *token, char *buffer,//// Fit: one scale both ways, the smaller, with the layout's 4:3 area centred, so a- // panel, a logo or a medal keeps the shape it was drawn in. A match dialog's backdrop stays in the- // box with the rest, over the battlefield. At 4:3 the scales are equal and the offsets nothing,- // and this is the stretch to the pixel.+ // panel, a logo or a medal keeps the shape it was drawn in. A root authored as the+ // whole 800x600 is the veil behind that panel: stretch it to the display so a wide+ // screen is covered, while the children stay fitted. At 4:3 the scales are equal+ // and the offsets nothing, and this is the stretch to the pixel.//if( theLayoutPlacement == LAYOUT_FIT ){- const Real scale = min( xScale, yScale );- const Real left = ((Real)TheDisplay->getWidth() - (Real)createRes.x * scale) * theLayoutAnchor.x;- const Real top = ((Real)TheDisplay->getHeight() - (Real)createRes.y * scale) * theLayoutAnchor.y;- screenRegion.lo.x = (Int)((Real)screenRegion.lo.x * scale + left);- screenRegion.lo.y = (Int)((Real)screenRegion.lo.y * scale + top);- screenRegion.hi.x = (Int)((Real)screenRegion.hi.x * scale + left);- screenRegion.hi.y = (Int)((Real)screenRegion.hi.y * scale + top);+ const Bool fullAuthored = parent == NULL+ && screenRegion.lo.x <= 1 && screenRegion.lo.y <= 1+ && screenRegion.hi.x >= createRes.x - 2 && screenRegion.hi.y >= createRes.y - 2;+ if( fullAuthored )+ {+ screenRegion.lo.x = 0;+ screenRegion.lo.y = 0;+ screenRegion.hi.x = TheDisplay->getWidth();+ screenRegion.hi.y = TheDisplay->getHeight();+ }+ else+ {+ const Real scale = min( xScale, yScale );+ const Real left = ((Real)TheDisplay->getWidth() - (Real)createRes.x * scale) * theLayoutAnchor.x;+ const Real top = ((Real)TheDisplay->getHeight() - (Real)createRes.y * scale) * theLayoutAnchor.y;+ screenRegion.lo.x = (Int)((Real)screenRegion.lo.x * scale + left);+ screenRegion.lo.y = (Int)((Real)screenRegion.lo.y * scale + top);+ screenRegion.hi.x = (Int)((Real)screenRegion.hi.x * scale + left);+ screenRegion.hi.y = (Int)((Real)screenRegion.hi.y * scale + top);+ }}else{