Skip to content

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.

feat(gameclient): wheel sizes the guard ring again, shield kept fixed

Olcay Seygane3ec9ff008ef
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e504e94e0..ed0c2622a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -690,7 +690,7 @@ found and fixed, EA's own, not port damage.**
- Selected units draw a line to wherever they are going, and it looks like a building's rally point: EA's blue rally line, with the rally flag in your colour planted on the ground they are headed for. A selected factory shows that one flag at the rally you set; a second disc used to sit at the door as well, so the path around the building read as two destinations. Every order draws one: move, attack move, attack, force fire, ground fire, enter, dock, repair, heal, capture, hack, guard, a waypoint path. An order aimed at something rather than somewhere, a tank to kill, a building to shoot, take or climb into, a unit to guard, ends on the line's joint instead of a flag, a small disc sitting just over the target and riding along with it while it drives, so a flag never stands on a tank. A shift list runs one line through all its stops, a joint on each and the flag on the last bit of ground. With order lines on, that last point gets a joint under its flag as well, so the end of the line reads the same as every stop before it. Units standing together and headed the same way share one thread, from the middle of the knot to the middle of where they are going, so twenty tanks sent across the map draw one line instead of twenty laid on top of each other; a selection spread over the map draws one per knot, and a flank sent on its own still shows. An angry mob draws one thread for the whole mob, not one per rioter. An attack move and a shot at the ground both point at the spot you clicked: the attack move's thread used to wander off to whichever free ground each unit was steering for, and ground fire pointed at the middle of the nearest map cell. An attack move stays pink from start to finish, too. A unit that stopped to fight used to swing its thread onto the enemy it was fighting, and only swung it back to your destination once the enemy was dead. It is not a flash at the moment of the order: the line is asked of the unit every frame, so it lasts until the unit gets there, changes its mind or leaves your selection, and it shows on the formation line while you are still drawing it. A unit that has walked off the edge of the screen still draws its line, which is how you see where the half of your army you cannot see is headed. The animated ring the ground used to sprout wherever you clicked is gone: it flashed for a second and told you nothing the flag on the destination does not, and the flag stays for as long as the order does. Aircraft draw their thread from the click, not from the moment they leave the runway. A plane parked on its airfield answers an order by starting its takeoff and puts the order itself aside until the wheels are up, so the taxi and the climb, which is exactly the stretch where you are wondering whether the strike went out at all, used to show nothing.
- A unit standing guard draws its marker on the ground it is guarding. A guard order clears the unit's goal on the way in, so every guard marker used to sit in the bottom left corner of the map with a thread running the whole way across it, whatever the unit was actually watching.
- A is attack and D is attack move, each arming the next order click. A click on the ground with A held down is a shot at that ground, on your own tank a shot at your own tank, and the mode drops again the moment the order goes out, so nothing stays armed behind your back. The click keeps your group, too: an attack click that was not a drag used to run the same deselect an ordinary left click runs, so the order arrived a moment after the units it was meant for had been dropped. Both orders are aimed with the left button, the way a special power is, and a right click puts the key down again without giving any order. Holding ctrl no longer forces fire: A is the one way to shoot the ground, and ctrl on a move is only the shared pace. The two keys turn each other off, and the letters they took were sitting on grid commands that moved. With A armed, pointing at something nothing in your selection can shoot shows the game's can't-do-that pointer: a Sentry Drone before its gun is researched has no weapon at all, and the pointer used to look ready while the click did nothing.
-- G is guard, armed the same way and aimed with the same left button. A left click posts the selection on that spot: they hold it, shoot what walks into range and do not chase it off the post you put them on. G looks the way Zero Hour's own guard button always looked: the targeting cross, with the guard range laid on the ground under it, and the mouse wheel still zooms the camera. The guard button on the command bar arms the same key, so it clicks and drags the same way. Drag the left button with G armed and they post along the line you draw, one unit per station, the way an attack move line spreads them, which is how a hill or a bridge approach gets covered in one gesture instead of a click per tank. A right click puts the key down again. Hold position, which posts every unit on the spot it is already standing on, has moved to H.
+- G is guard, armed the same way and aimed with the same left button. A left click posts the selection on that spot: they hold it, shoot what walks into range and do not chase it off the post you put them on. G looks the way Zero Hour's own guard button always looked: the targeting cross, with the guard range laid on the ground under it. Roll the mouse wheel while G is armed and the circle grows or shrinks before you click, from half the unit's own range out to 500, and the whole group then guards that one circle; leave the wheel alone and the click is the guard Zero Hour always had. Only the ring changes size: the shield in the middle stays as it is, where the old picture stretched it with the ring. The guard button on the command bar arms the same key, so it clicks and drags the same way. Drag the left button with G armed and they post along the line you draw, one unit per station, the way an attack move line spreads them, which is how a hill or a bridge approach gets covered in one gesture instead of a click per tank. A right click puts the key down again. Hold position, which posts every unit on the spot it is already standing on, has moved to H.
- With A armed, or with Ctrl held down, hold the left button and drag a circle instead: the enemies you can see inside it are split across the units that can shoot, as evenly as the numbers allow, in the order both sides stand around the circle. The tank on the left of your group takes the enemy on the left of theirs. Ten of yours against three of theirs put four guns on one and three on each of the others. Three of yours against ten of theirs each take a run of three or four and work down that run. One enemy, and every selected gun takes it. When a unit's target dies the next of its own goes out the same frame, so a strike group clears a circle without you clicking once per tank. It moves on from a target the group has stopped working on, too, rather than only from a dead one: something none of them can reach or hurt used to sit at the head of the list and hold every other target behind it for the rest of the match. That list is the same queue a shift-clicked attack builds, so you can see it: every target still owed has its own thread and marker, in the order they will be taken, instead of one line to whatever is being shot at this second. Hold Alt while you draw the circle and its targets go on the end of what the group is already working through; draw it without Alt and the circle replaces the lot. The circle's rim is red and the ground inside it is washed the same red while you drag it, painted on the map rather than over it, so it runs up the hills inside the circle and your own tanks stand on top of it. The rim sits in the plane of the press, so a hill or a building under the cursor no longer jumps the circle every frame. Any order you give by hand ends the list. Losing a unit does not: the list belongs to the group that was told and carries on with whoever is left, which is worth saying because for a while it did not, and one tank dying threw away every target still owed. Running out of ammo does not cost you the list either. A flight that empties its racks flies home, lands, rearms and comes back to the target it left, and the queue waits for it instead of counting the trip as the group giving up: a circle drawn for four planes used to be empty by the time they were back in the air, one entry lost every two seconds they were away. The threads stay on the ground for the whole trip, too. A plane flying home has no target and no order to read, so the list it was still holding used to vanish off the map the moment it turned for base and reappear only when it was shooting again, which looks exactly like the list being thrown away. What the circle picks up is what you can shoot: a shell or a missile crossing it is on the enemy's side like everything else and used to go on the list as a target, costing the group a two second stall on something that was about to stop existing. A target that has driven into the shroud since you picked it keeps its place in the list but stops drawing its thread, so the line cannot be used to trace it through the fog. An attack-move queued behind other orders keeps the force fire it was given rather than losing it when the attack key drops. A stroke drawn across or near enemies (Ctrl and Shift held, then drag) splits them across the units that can shoot, as evenly as the numbers allow, in the order both sides stand along the stroke. The unit nearest the start takes the enemy nearest the start. Ten guns on three enemies put four on one and three on each of the others. Three guns on ten each work down a run of three or four. The whole group used to walk one list and pour every gun into each enemy in turn. Before that the line poured fire into the ground under it and hit whatever happened to be standing there. A stroke that crosses nobody still fires on the ground along it.
- Shift queues a guard as well, and it is where the line of orders stops. Hold shift with G armed and click, and the group takes up its post once it has finished everything queued in front of it: clear that ridge, then sit on it, in one set of clicks instead of standing over the fight waiting to give the last order. Nothing goes behind a guard, because a posted unit has no next place to be. The thread to the post is drawn in the guard colour like any other guard.
- Shift queues an attack now, not only a move. A or F held down while you shift-click adds a force-attack or an attack-move to the line of orders a group is already holding, and it fires the moment the order in front of it is finished - a target dead, or nobody left chasing an attack-move point. The coloured thread that shows a queued order covers it too, so a queue of "go here, then attack that, then attack-move over there" reads as one continuous line in three colours. The game's own white waypoint markings, which used to draw over the same ground the moment shift went down, are gone - they only ever duplicated what the coloured thread already showed, and doing both left a queued attack sitting under two different pictures of itself.
diff --git a/GeneralsMD/Code/BuildFingerprint.manifest b/GeneralsMD/Code/BuildFingerprint.manifest
index 29e63d1de..578f224b8 100644
--- a/GeneralsMD/Code/BuildFingerprint.manifest
+++ b/GeneralsMD/Code/BuildFingerprint.manifest
@@ -15,6 +15,8 @@ Data/Art/Textures/ReforgedBarGLACenter.tga
Data/Art/Textures/ReforgedBarGLALeft.tga
Data/Art/Textures/ReforgedBarGLARight.tga
Data/Art/Textures/ReforgedForceAttack.tga
+Data/Art/Textures/ReforgedGuardCentre.tga
+Data/Art/Textures/ReforgedGuardRing.tga
Data/Art/Textures/ReforgedHudAmericaCommandBar.dds
Data/Art/Textures/ReforgedHudAmericaCommandBarWide.dds
Data/Art/Textures/ReforgedHudAmericaPowers.dds
@@ -4100,6 +4102,7 @@ Tools/gdi-font-metrics-header.py
Tools/gdi-font-metrics.ps1
Tools/generals-icon.py
Tools/gentrigtables.py
+Tools/guard_marker.py
Tools/include_case_check.py
Tools/install-guard.sh
Tools/license-headers.py
diff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedGuardCentre.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedGuardCentre.tga
new file mode 100644
index 000000000..ecef48cae
Binary files /dev/null and b/GeneralsMD/Code/Data/Art/Textures/ReforgedGuardCentre.tga differ
diff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedGuardRing.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedGuardRing.tga
new file mode 100644
index 000000000..b1fee23a0
Binary files /dev/null and b/GeneralsMD/Code/Data/Art/Textures/ReforgedGuardRing.tga differ
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
index 42543bdac..a298707e4 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
@@ -1137,6 +1137,12 @@ public: // ********************************************************************
Bool isGuardArmed( void ) const { return m_guardArmed; }
GuardMode getGuardArmedMode( void ) const { return m_guardArmedMode; } ///< what the armed guard's click gives: the key's, or the EA button's own
+ // While a guard is armed the wheel grows and shrinks the circle it will hold instead of zooming,
+ // the guard marker's ring follows it and the order carries it. 0 until the wheel has touched
+ // it: the click is then the retail guard, each unit on its own range
+ void adjustArmedGuardRadius( Real notches );
+ Real getArmedGuardRadius( void );
+
/** One of the page's keys past attack, hold position and move, an OrderKeyExtra (ControlBar.h),
* pressed with the mouse or its grid key: the stance key puts the selection on the other
* stance from the first unit's */
@@ -1555,6 +1561,7 @@ protected:
RadiusDecalTemplate m_radiusCursors[RADIUSCURSOR_COUNT];
RadiusDecal m_curRadiusCursor;
+ RadiusDecal m_curRadiusCursorCentre; ///< the guard marker's shield, apart from its ring so it never stretches
RadiusCursorType m_curRcType;
enum { AURA_RING_MAX = 256 }; // ponytail: past this many rings on the map the rest go undrawn; the slot match is n squared
@@ -1588,6 +1595,7 @@ protected:
Bool m_forceAttackArmed; ///< is the attack key holding force fire for the next click?
Bool m_guardArmed; ///< is the guard key holding a guard order for the next click?
GuardMode m_guardArmedMode; ///< the mode that guard order carries
+ Real m_guardRadiusScale; ///< what the wheel has made of the armed guard's range, 1 untouched
Bool m_moveArmed; ///< is the move key holding a move for the next click?
Bool m_orderKeyKeptByShift; ///< an armed key was clicked with under shift, and drops when shift comes up
Bool m_preferSelection; ///< the shift key has been depressed.
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/RadiusDecal.h b/GeneralsMD/Code/GameEngine/Include/GameClient/RadiusDecal.h
index 19ea36841..b7dcaa50b 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/RadiusDecal.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/RadiusDecal.h
@@ -118,12 +118,14 @@ public:
RadiusDecalTemplate();
Bool valid() const { return m_name.isNotEmpty(); }
+ const AsciiString& getTexture() const { return m_name; }
void xferRadiusDecalTemplate( Xfer *xfer );
// please note: it is very important, for game/net sync reasons, to ensure that
// a valid radiusdecal is created, even if will not be visible to the local player,
// since some logic makes decisions based on this.
- void createRadiusDecal(const Coord3D& pos, Real radius, const Player* owningPlayer, RadiusDecal& result) const;
+ // texture, when given, is drawn in place of the template's own, with the template's style and throb
+ void createRadiusDecal(const Coord3D& pos, Real radius, const Player* owningPlayer, RadiusDecal& result, const char* texture = NULL) const;
static void parseRadiusDecalTemplate(INI* ini, void *instance, void * store, const void* /*userData*/);
};
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index d320b00de..581cf7bd1 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -1256,6 +1256,7 @@ InGameUI::InGameUI()
m_forceAttackArmed = false;
m_guardArmed = false;
m_guardArmedMode = GUARDMODE_GUARD_WITHOUT_PURSUIT;
+ m_guardRadiusScale = 1.0f;
m_moveArmed = false;
m_orderKeyKeptByShift = false;
m_preferSelection = false;
@@ -1411,6 +1412,7 @@ void InGameUI::setRadiusCursor(RadiusCursorType cursorType, const SpecialPowerTe
return;
m_curRadiusCursor.clear();
+ m_curRadiusCursorCentre.clear();
m_curRcType = RADIUSCURSOR_NONE;
if (cursorType == RADIUSCURSOR_NONE)
@@ -1499,7 +1501,20 @@ void InGameUI::setRadiusCursor(RadiusCursorType cursorType, const SpecialPowerTe
return;
Coord3D pos = { 0, 0, 0 }; // will be updated right away
- m_radiusCursors[cursorType].createRadiusDecal(pos, radius, controller, m_curRadiusCursor);
+ const Real unwheeled = radius;
+ if (cursorType == RADIUSCURSOR_GUARD_AREA)
+ radius *= m_guardRadiusScale;
+ if (cursorType == RADIUSCURSOR_GUARD_AREA && m_radiusCursors[cursorType].getTexture().compareNoCase("SCCGuard_Generic") == 0)
+ {
+ // EA's guard marker is one picture, the ring with the shield in its middle, so sizing it to
+ // the wheeled radius stretched the shield too. The two are drawn apart (Tools/guard_marker.py):
+ // the ring at the radius, the shield, half the picture's width, at the size it has unwheeled.
+ // A mod's own marker stays one picture
+ m_radiusCursors[cursorType].createRadiusDecal(pos, radius, controller, m_curRadiusCursor, "ReforgedGuardRing");
+ m_radiusCursors[cursorType].createRadiusDecal(pos, unwheeled * 0.5f, controller, m_curRadiusCursorCentre, "ReforgedGuardCentre");
+ }
+ else
+ m_radiusCursors[cursorType].createRadiusDecal(pos, radius, controller, m_curRadiusCursor);
m_curRcType = cursorType;
handleRadiusCursor();
@@ -1718,12 +1733,16 @@ void InGameUI::handleRadiusCursor()
{
m_curRadiusCursor.setOpacity( m_duringDoubleClickAttackMoveGuardHintTimer * 0.1f );
m_curRadiusCursor.setPosition( m_duringDoubleClickAttackMoveGuardHintStashedPosition ); //world space position of center of decal
+ m_curRadiusCursorCentre.setOpacity( m_duringDoubleClickAttackMoveGuardHintTimer * 0.1f );
+ m_curRadiusCursorCentre.setPosition( m_duringDoubleClickAttackMoveGuardHintStashedPosition );
}
else if ( hasPos )
{
m_curRadiusCursor.setPosition(pos); //world space position of center of decal
m_curRadiusCursor.update();
+ m_curRadiusCursorCentre.setPosition(pos);
+ m_curRadiusCursorCentre.update();
}
}
@@ -2531,6 +2550,10 @@ void InGameUI::update( void )
updateReplaySeek();
+ // the wheeled radius belongs to the guard it was wheeled for; a shift-kept key keeps it
+ if( !m_guardArmed )
+ m_guardRadiusScale = 1.0f;
+
/// @todo make sure this code gets called even when the UI is not being drawn
if ( m_videoStream && m_videoBuffer )
{
@@ -2990,6 +3013,7 @@ void InGameUI::reset( void )
m_forceAttackArmed = false;
m_guardArmed = false;
m_guardArmedMode = GUARDMODE_GUARD_WITHOUT_PURSUIT;
+ m_guardRadiusScale = 1.0f;
m_moveArmed = false;
m_orderKeyKeptByShift = false;
m_preferSelection = false;
@@ -5888,6 +5912,55 @@ void InGameUI::adjustPlacementRowGap( Real spin )
} // end adjustPlacementRowGap
+static const Real GUARD_PICK_RADIUS_MIN = 50.0f;
+static const Real GUARD_PICK_STEP = 1.15f; ///< what one notch of the wheel multiplies the radius by
+// ponytail: under logic's GUARD_RADIUS_MAX of 800 because one ground decal draws at most 104 terrain
+// cells across (W3DProjectedShadow's index buffer clip), and a ring past about 515 came out squared
+// off. Raise both together if the decal buffers grow
+static const Real GUARD_PICK_RADIUS_MAX = 500.0f;
+
+//-------------------------------------------------------------------------------------------------
+/** The range the guard marker is drawn at before the wheel touches it, the one setRadiusCursor
+ * takes: the first selected unit's own guard range. */
+//-------------------------------------------------------------------------------------------------
+static Real guardMarkerBaseRadius( Drawable *draw )
+{
+ const Object *obj = draw ? draw->getObject() : NULL;
+ return obj ? AIGuardMachine::getStdGuardRange( obj ) : 0.0f;
+}
+
+//-------------------------------------------------------------------------------------------------
+Real InGameUI::getArmedGuardRadius( void )
+{
+ if( !m_guardArmed || m_guardRadiusScale == 1.0f )
+ return 0.0f;
+ return guardMarkerBaseRadius( getFirstSelectedDrawable() ) * m_guardRadiusScale;
+}
+
+//-------------------------------------------------------------------------------------------------
+/** A notch away from the player grows the circle by a fixed share, so the wheel feels the same on a
+ * small circle as on a big one. The scale stops where the radius does, so the wheel never winds
+ * up travel that has to be undone first. */
+//-------------------------------------------------------------------------------------------------
+void InGameUI::adjustArmedGuardRadius( Real notches )
+{
+ const Real base = guardMarkerBaseRadius( getFirstSelectedDrawable() );
+ if( base <= 0.0f )
+ return;
+
+ // half the unwheeled size at the least: the ring's inside edge is then still clear of the shield,
+ // which keeps its own size
+ m_guardRadiusScale *= (Real)pow( GUARD_PICK_STEP, notches );
+ m_guardRadiusScale = min( max( m_guardRadiusScale, max( 0.5f, GUARD_PICK_RADIUS_MIN / base ) ), max( 1.0f, GUARD_PICK_RADIUS_MAX / base ) );
+
+ // the ring is made at its size, so it is made again
+ if( m_curRcType == RADIUSCURSOR_GUARD_AREA )
+ {
+ setRadiusCursorNone();
+ setRadiusCursor( RADIUSCURSOR_GUARD_AREA, NULL, PRIMARY_WEAPON );
+ }
+}
+
//-------------------------------------------------------------------------------------------------
/** The first unit of the player's in the selection with a stance to read, for the stance key's face
* and for which stance a press switches the selection to. */
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
index 06ed40010..fc7d65124 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
@@ -1074,7 +1074,13 @@ GameMessage::Type CommandTranslator::issueMoveToLocationCommand( const Coord3D *
// a posted unit holds its spot and shoots what walks into range, rather than chasing it
// off the post the player put it on. EA's guard button armed it with its own mode
if (msgType == GameMessage::MSG_DO_GUARD_POSITION)
+ {
movemsg->appendIntegerArgument( TheInGameUI->getGuardArmedMode() );
+ // the circle the wheel set, one for the whole group; an untouched wheel sends none
+ const Real radius = TheInGameUI->getArmedGuardRadius();
+ if( radius > 0.0f )
+ movemsg->appendRealArgument( radius );
+ }
} // end if
}
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp
index 015db7819..26bb48702 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp
@@ -141,6 +141,12 @@ GameMessageDisposition PlaceEventTranslator::translateGameMessage(const GameMess
TheInGameUI->adjustPlacementRowGap( msg->getArgument( 1 )->real );
return DESTROY_MESSAGE;
}
+ // and while a guard is armed it sizes the circle the guard will hold
+ if( TheInGameUI->isGuardArmed() )
+ {
+ TheInGameUI->adjustArmedGuardRadius( msg->getArgument( 1 )->real );
+ return DESTROY_MESSAGE;
+ }
break;
}
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp
index d9c1bc33a..c914d7893 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp
@@ -91,7 +91,7 @@ Real RadiusDecalTemplate::lightScale() const
}
// ------------------------------------------------------------------------------------------------
-void RadiusDecalTemplate::createRadiusDecal(const Coord3D& pos, Real radius, const Player* owningPlayer, RadiusDecal& result) const
+void RadiusDecalTemplate::createRadiusDecal(const Coord3D& pos, Real radius, const Player* owningPlayer, RadiusDecal& result, const char* texture) const
{
result.clear();
@@ -121,7 +121,7 @@ void RadiusDecalTemplate::createRadiusDecal(const Coord3D& pos, Real radius, con
result.m_template = this;
// By value, not through this: a template can be a module's own copy (DeliverPayloadAIUpdate's),
// gone before the call runs when its object is made and destroyed in the same tick.
- const AsciiString name = m_name;
+ const AsciiString name = texture ? AsciiString(texture) : m_name;
const ShadowType shadowType = m_shadowType;
const Real size = radius*2;
const Color color = m_color == 0 ? clientPlayerColor(owningPlayer) : m_color;
diff --git a/GeneralsMD/Code/Tools/guard_marker.py b/GeneralsMD/Code/Tools/guard_marker.py
new file mode 100644
index 000000000..c1a575b6d
--- /dev/null
+++ b/GeneralsMD/Code/Tools/guard_marker.py
@@ -0,0 +1,54 @@
+"""EA's guard marker (SCCGuard_Generic, the GuardAreaRadiusCursor decal) cut into its two parts.
+
+The one picture holds the ring and the shield in the middle, so scaling it to the radius the wheel
+sets stretched the shield with the ring. InGameUI draws the parts as two decals instead: the ring at
+the radius, the shield at the size it has at the unwheeled one.
+
+ ReforgedGuardRing.tga the whole 256x256 picture with the shield cleared (it sits inside
+ r < 44 px; the ring is r 100-124, nothing lies between)
+ ReforgedGuardCentre.tga the middle 128x128, the shield alone: half the picture's width, so
+ InGameUI draws it at half the ring decal's size
+
+ python Tools/guard_marker.py <TexturesZH.big> # writes Data/Art/Textures/ReforgedGuard*.tga
+"""
+import io
+import os
+import sys
+
+import numpy as np
+from PIL import Image
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+import bigfile # noqa: E402
+
+MEMBER = "art/textures/sccguard_generic.dds"
+OUT_FOLDER = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "Data", "Art", "Textures")
+
+
+def main(archive):
+ with open(archive, "rb") as f:
+ for path, offset, size in list(bigfile._read_index(f)):
+ if path.lower().replace("\\", "/") == MEMBER:
+ f.seek(offset)
+ picture = np.array(Image.open(io.BytesIO(f.read(size))).convert("RGBA"))
+ break
+ else:
+ sys.exit("%s has no %s" % (archive, MEMBER))
+
+ assert picture.shape == (256, 256, 4), picture.shape
+ y, x = np.mgrid[0:256, 0:256]
+ r = np.hypot(x - 127.5, y - 127.5)
+
+ ring = picture.copy()
+ ring[r < 70, 3] = 0
+ Image.fromarray(ring).save(os.path.join(OUT_FOLDER, "ReforgedGuardRing.tga"), compression="tga_rle")
+
+ centre = picture[64:192, 64:192]
+ assert centre[..., 3][r[64:192, 64:192] > 60].max() == 0, "the ring reaches into the shield's square"
+ Image.fromarray(centre).save(os.path.join(OUT_FOLDER, "ReforgedGuardCentre.tga"), compression="tga_rle")
+
+
+if __name__ == "__main__":
+ if len(sys.argv) != 2:
+ sys.exit(__doc__)
+ main(sys.argv[1])