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
feat(w3ddevice): draw a shield over guarding units instead of the G
Olcay Seygan7ec3e2e74f77
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 354ce36ed..f4f6b2427 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -283,7 +283,7 @@ found and fixed — EA's own, not port damage.**- A Chinook unloads its passengers one at a time, not stacked in one frame.- Campaign reinforcements flown in by Chinook land again. That one-at-a-time unloading sent a mission's scripted Chinooks home with their cargo still aboard, so on the second American mission the dozers announced at the docks never got off, and neither did the next one.- A guarding unit no longer fights itself between returning to post and shooting back.-- Guard covers the circle you choose. How far a guard reached used to come from each unit's own eyesight, so Rangers and Missile Defenders posted on the same spot held circles of 180 and 270 and a raider standing between the two was only shot by half the group. Now one guard order gives the whole group one circle, the widest any of them had. Roll the mouse wheel while the guard key or the guard button is armed and the circle grows or shrinks before you click, drawn on the ground under the pointer as you go. Select a guarding group and its circle is drawn round the post, and every unit of yours on guard carries the guard badge over its head, selected or not.+- Guard covers the circle you choose. How far a guard reached used to come from each unit's own eyesight, so Rangers and Missile Defenders posted on the same spot held circles of 180 and 270 and a raider standing between the two was only shot by half the group. Now one guard order gives the whole group one circle, the widest any of them had. Roll the mouse wheel while the guard key or the guard button is armed and the circle grows or shrinks before you click, drawn on the ground under the pointer as you go. Select a guarding group and its circle is drawn round the post, and every unit of yours on guard carries a small steel shield over its head, selected or not, in place of the blocky "G" it used to wear.- Two new orders on the command bar. Search and destroy, on F, sends the group round a circle you pick with the wheel, fighting everything it meets on the way, and leaves it guarding that circle when the lap is done. Scout, on G, walks the same lap without stopping to fight and brings the group back to the middle. The lap starts on the side the group is coming from and skips ground you can already see. Scout is offered to the units built to look around: Humvees, Pathfinders, Listening Outposts, Technicals, Combat Bikes and Radar Vans. Where those letters are taken by a unit's own buttons the keys move to the next free place, and a card says which is which when you point at them.- H now sets a stance for the group. Defensive is how your units have always behaved: they fire on what comes into range and stay put. Aggressive lets them go after anything they can see, the way the computer's own units do, so a group left on aggressive clears the ground around it without being told. The button shows the stance the selection holds.- A queued attack move finishes its fights before the next order on the list goes out. The first enemy it met used to count as arriving, so a list of attack moves round a town skipped ahead a step at every skirmish and the group was off to the last point while the first was still contested. Replays recorded before this version play back differently.diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cppindex d59fa35f7..461583c58 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp@@ -1390,23 +1390,40 @@ void W3DInGameUI::drawBuildPlanNumbers( void )} // end drawBuildPlanNumbers+//-------------------------------------------------------------------------------------------------+/** A heater shield filled one screen row at a time: straight sides for the upper part, then a+ * curve closing to the point at the bottom. */+//-------------------------------------------------------------------------------------------------+static void drawShieldShape( Int x, Int y, Int width, Int height, UnsignedInt color )+{+ const Real SHOULDER = 0.45f; // share of the height above the taper+ for( Int row = 0; row < height; ++row )+ {+ const Real t = ( row + 0.5f ) / height;+ Real half = width * 0.5f;+ if( t > SHOULDER )+ half *= sqrtf( ( 1.0f - t ) / ( 1.0f - SHOULDER ) );+ const Int span = REAL_TO_INT( half * 2.0f + 0.5f );+ if( span > 0 )+ TheDisplay->drawFillRect( x + ( width - span ) / 2, y + row, span, 1, color );+ }+}+//-------------------------------------------------------------------------------------------------/** A guarding unit looks like an idle one until something walks into its circle, so each of the- * local player's guards wears the guard button's own art over its head, selected or not. Two- * groups on overlapping posts can then be told apart from the ones simply standing about. */+ * local player's guards wears a small shield over its head, selected or not. Two groups on+ * overlapping posts can then be told apart from the ones simply standing about. *///-------------------------------------------------------------------------------------------------void W3DInGameUI::drawGuardMarkers( void ){const Real MARKER_HEIGHT = 14.0f;const Real MARKER_LIFT = 6.0f; // clear of the health bar's line over the model's top-- const Image *badge = TheMappedImageCollection->findImageByName( "SSGuard" );- if( badge == NULL )- return;+ const UnsignedInt EDGE_COLOR = 0xDD101418;+ const UnsignedInt FACE_COLOR = 0xDDC8D2DC; // the command bar's steelconst Real scale = orderStepScale();- const Int height = REAL_TO_INT( MARKER_HEIGHT * scale );- const Int width = height * badge->getImageWidth() / max( badge->getImageHeight(), 1 );+ const Int height = max( REAL_TO_INT( MARKER_HEIGHT * scale ), 6 );+ const Int width = height * 4 / 5;const Int lift = REAL_TO_INT( MARKER_LIFT * scale );// ponytail: walks every object each frame, like drawBuildPlanNumbers; share one walk if it shows@@ -1429,7 +1446,8 @@ void W3DInGameUI::drawGuardMarkers( void )const Int x = spot.x - width / 2;const Int y = spot.y - lift - height;- TheDisplay->drawImage( badge, x, y, x + width, y + height, 0xCCFFFFFF );+ drawShieldShape( x, y, width, height, EDGE_COLOR );+ drawShieldShape( x + 1, y + 1, width - 2, height - 3, FACE_COLOR );}} // end drawGuardMarkers