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(gameclient): draw only occupied garrison slots on buildings
Olcay Seygan1ab829a80cb2
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 96c5cf905..094bc9566 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -855,7 +855,7 @@ A third pass went through the generals' powers, promotions and unit abilities.- A slow gun shows when it can fire again. A Nuke Cannon sat still for ten seconds after every shell with nothing on screen to say when the next would come. Now an amber bar over the health bar fills through the reload, on your own unit while it is selected or under the pointer. Only a gun that fires slower than one shot in three seconds gets one: every tank gun in the game reloads in about two, and a bar that empties before you can read it is noise. The Nuke Cannon, the Inferno Cannon, the artillery platform, SCUD and Tomahawk launchers, the Scorpion's missile and the Comanche's anti-tank missiles wear it.- The reload bar stays off the quick shooters. It used to go up whenever a wait ran past three seconds, and a reload after a fast clip does that too: a Paladin that zapped one infantryman with its point defence laser wore the bar for the next four seconds, and so did a Rocket Buggy after every volley and a Comanche after its rocket pods. Those fire about as often as a tank does, so the bar now goes by how many shots a gun gets off in a minute, reload included.- A Dozer clearing mines no longer wears the reload bar. Its scoop takes four seconds between mines, which counted as a slow gun, so the bar came up over every Dozer sweeping a minefield as if it were waiting to fire. Clearing mines is not firing, and the Worker's clearing goes without the bar too.-- Every garrisonable building shows how full it is, whoever holds it. An empty one shows it too, and so does your own Barracks: ten grey boxes over it for the whole match, because soldiers can walk in to heal. Untick Empty Building Slots on Options > Interface and a building wears its row only while somebody is inside.+- Every garrisonable building shows how full it is, whoever holds it, with one box for each soldier inside and none for the empty rooms. A city block nobody holds wears nothing over it, where a map full of houses used to carry a row of grey boxes on every roof. Your own Barracks still shows ten grey boxes for the whole match, because soldiers can walk in to heal; untick Empty Building Slots on Options > Interface and it wears its row only while somebody is inside.- A vehicle's load stays private.- What you have selected wears a white frame just outside its bar, so a selection is still readable in a crowd where every unit carries a bar - and the bar itself keeps its owner colour all the way round.- Lamps, barrels, rocks and bushes no longer wear health bars.diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cppindex cd7b71c4c..1b7a89907 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp@@ -3385,11 +3385,10 @@ void Drawable::drawContained( const IRegion2D *healthBarRegion )return;//- // ...and a building you can garrison shows them whoever holds it. How many rooms are left in- // that civilian block is the question you ask before sending a squad at it, and how many are- // occupied is the question you ask before shooting at it - both were answerable only by- // garrisoning it yourself. A vehicle's load stays private: an enemy transport's contents are- // real intelligence, a building's occupancy is what you can already see out of its windows.+ // ...and a building you can garrison shows them whoever holds it. How many are occupied is the+ // question you ask before shooting at it, answerable before only by garrisoning it yourself.+ // A vehicle's load stays private: an enemy transport's contents are real intelligence, a+ // building's occupancy is what you can already see out of its windows.//if (obj->getControllingPlayer() != ThePlayerList->getLocalPlayer() &&!(obj->isKindOf( KINDOF_STRUCTURE ) && container->isGarrisonable()))@@ -3405,6 +3404,15 @@ void Drawable::drawContained( const IRegion2D *healthBarRegion )if (numFull == 0 && !TheGlobalData->m_showEmptyBuildingPips && obj->isKindOf( KINDOF_STRUCTURE ))return;+ // a garrisonable building draws only its occupied slots: a city full of empty rows over every+ // house is clutter, and an empty one draws nothing at all. Vehicles keep their empty boxes.+ if (obj->isKindOf( KINDOF_STRUCTURE ) && container->isGarrisonable())+ {+ if (numFull == 0)+ return;+ numTotal = numFull;+ }+Int numInfantry = 0;const ContainedItemsList* contained = container->getContainedItemsList();if (contained)