From 390e5d8319aa1bb0e05ac39432ff63a8a6c5b862 Mon Sep 17 00:00:00 2001 From: stm <14291421+stephanmeesters@users.noreply.github.com> Date: Mon, 6 Jul 2026 21:22:46 +0200 Subject: [PATCH] unify: Move various identical files to Core --- Core/GameEngine/CMakeLists.txt | 464 ++++----- .../Include/Common/BezFwdIterator.h | 0 .../GameEngine/Include/Common/BezierSegment.h | 0 .../Include/Common/CriticalSection.h | 0 .../GameEngine/Include/Common/DamageFX.h | 0 .../GameEngine/Include/Common/DataChunk.h | 0 .../GameEngine/Include/Common/Dict.h | 0 .../GameEngine/Include/Common/Directory.h | 0 .../GameEngine/Include/Common/DisabledTypes.h | 0 .../Include/Common/DiscreteCircle.h | 0 .../GameEngine/Include/Common/Geometry.h | 0 .../GameEngine/Include/Common/Handicap.h | 0 .../GameEngine/Include/Common/KindOf.h | 0 .../GameEngine/Include/Common/Language.h | 0 .../GameEngine/Include/Common/List.h | 0 .../GameEngine/Include/Common/MiniLog.h | 0 .../GameEngine/Include/Common/MissionStats.h | 0 .../GameEngine/Include/Common/PerfTimer.h | 0 .../GameEngine/Include/Common/PlayerList.h | 0 .../Include/Common/QuotedPrintable.h | 0 .../GameEngine/Include/Common/Science.h | 0 .../GameEngine/Include/Common/ScoreKeeper.h | 0 .../GameEngine/Include/Common/StackDump.h | 0 .../GameEngine/Include/Common/TerrainTypes.h | 0 .../GameEngine/Include/Common/Upgrade.h | 0 .../GameEngine/Include/Common/encrypt.h | 0 .../GameEngine/Include/Common/version.h | 0 .../GameEngine/Include/GameClient/Diplomacy.h | 0 .../GameClient/EstablishConnectionsMenu.h | 0 .../Include/GameClient/ExtendedMessageBox.h | 0 .../Include/GameClient/GameInfoWindow.h | 0 .../Include/GameClient/MessageBox.h | 0 .../Include/GameClient/ShellMenuScheme.h | 0 .../GameEngine/Include/GameLogic/AIDock.h | 0 .../GameLogic/Module/ActiveShroudUpgrade.h | 0 .../Include/GameLogic/Module/BoneFXDamage.h | 0 .../GameLogic/Module/BridgeScaffoldBehavior.h | 0 .../GameLogic/Module/BridgeTowerBehavior.h | 0 .../GameLogic/Module/CheckpointUpdate.h | 0 .../GameLogic/Module/CleanupHazardUpdate.h | 0 .../GameLogic/Module/CostModifierUpgrade.h | 0 .../Include/GameLogic/Module/CreateCrateDie.h | 0 .../Include/GameLogic/Module/CreateModule.h | 0 .../Include/GameLogic/Module/CrushDie.h | 0 .../Include/GameLogic/Module/DamDie.h | 0 .../Include/GameLogic/Module/DamageModule.h | 0 .../Include/GameLogic/Module/DeletionUpdate.h | 0 .../Include/GameLogic/Module/DestroyModule.h | 0 .../Include/GameLogic/Module/DieModule.h | 0 .../Module/DynamicGeometryInfoUpdate.h | 0 .../Include/GameLogic/Module/EjectPilotDie.h | 0 .../GameLogic/Module/EnemyNearUpdate.h | 0 .../Module/ExperienceScalarUpgrade.h | 0 .../GameLogic/Module/FireSpreadUpdate.h | 0 .../GameLogic/Module/FireWeaponCollide.h | 0 .../GameLogic/Module/FlammableUpdate.h | 0 .../Include/GameLogic/Module/FloatUpdate.h | 0 .../Include/GameLogic/Module/HealContain.h | 0 .../GameLogic/Module/HealCrateCollide.h | 0 .../GameLogic/Module/HeightDieUpdate.h | 0 .../Include/GameLogic/Module/HighlanderBody.h | 0 .../Include/GameLogic/Module/HijackerUpdate.h | 0 .../Include/GameLogic/Module/ImmortalBody.h | 0 .../GameLogic/Module/InstantDeathBehavior.h | 0 .../Include/GameLogic/Module/KeepObjectDie.h | 0 .../Include/GameLogic/Module/LifetimeUpdate.h | 0 .../GameLogic/Module/LocomotorSetUpgrade.h | 0 .../GameLogic/Module/MaxHealthUpgrade.h | 0 .../GameLogic/Module/MobMemberSlavedUpdate.h | 0 .../Module/NeutronMissileSlowDeathUpdate.h | 0 .../GameLogic/Module/ObjectCreationUpgrade.h | 0 .../GameLogic/Module/ObjectDefectionHelper.h | 0 .../Include/GameLogic/Module/ObjectHelper.h | 0 .../GameLogic/Module/ObjectRepulsorHelper.h | 0 .../GameLogic/Module/ObjectSMCHelper.h | 0 .../Module/ObjectWeaponStatusHelper.h | 0 .../GameLogic/Module/OverchargeBehavior.h | 0 .../GameLogic/Module/POWTruckAIUpdate.h | 0 .../GameLogic/Module/POWTruckBehavior.h | 0 .../GameLogic/Module/PilotFindVehicleUpdate.h | 0 .../GameLogic/Module/PowerPlantUpdate.h | 0 .../GameLogic/Module/PowerPlantUpgrade.h | 0 .../Include/GameLogic/Module/PreorderCreate.h | 0 .../GameLogic/Module/PrisonDockUpdate.h | 0 .../Include/GameLogic/Module/ProneUpdate.h | 0 .../Module/PropagandaCenterBehavior.h | 0 .../Module/QueueProductionExitUpdate.h | 0 .../Include/GameLogic/Module/RadarUpdate.h | 0 .../Include/GameLogic/Module/RadarUpgrade.h | 0 .../GameLogic/Module/RadiusDecalUpdate.h | 0 .../Module/RailedTransportAIUpdate.h | 0 .../GameLogic/Module/RailedTransportContain.h | 0 .../GameLogic/Module/RepairDockUpdate.h | 0 .../GameLogic/Module/ShroudCrateCollide.h | 0 .../Module/SpawnPointProductionExitUpdate.h | 0 .../Include/GameLogic/Module/SpecialAbility.h | 0 .../Module/SpecialPowerCompletionDie.h | 0 .../GameLogic/Module/SpecialPowerCreate.h | 0 .../GameLogic/Module/SpyVisionSpecialPower.h | 0 .../Include/GameLogic/Module/SquishCollide.h | 0 .../GameLogic/Module/StatusBitsUpgrade.h | 0 .../Include/GameLogic/Module/StructureBody.h | 0 .../GameLogic/Module/SubObjectsUpgrade.h | 0 .../GameLogic/Module/SupplyCenterCreate.h | 0 .../GameLogic/Module/SupplyWarehouseCreate.h | 0 .../Module/SupplyWarehouseCripplingBehavior.h | 0 .../Module/SupplyWarehouseDockUpdate.h | 0 .../GameLogic/Module/TensileFormationUpdate.h | 0 .../GameLogic/Module/UnitCrateCollide.h | 0 .../Module/UnpauseSpecialPowerUpgrade.h | 0 .../Include/GameLogic/Module/UpgradeDie.h | 0 .../GameLogic/Module/VeterancyCrateCollide.h | 0 .../GameLogic/Module/VeterancyGainCreate.h | 0 .../Include/GameLogic/Module/WanderAIUpdate.h | 0 .../GameLogic/Module/WeaponBonusUpgrade.h | 0 .../GameLogic/Module/WeaponSetUpgrade.h | 0 .../GameEngine/Include/GameLogic/Squad.h | 0 .../Source/Common/Bezier/BezFwdIterator.cpp | 0 .../Source/Common/Bezier/BezierSegment.cpp | 0 .../GameEngine/Source/Common/DamageFX.cpp | 0 .../GameEngine/Source/Common/Dict.cpp | 0 .../Source/Common/DiscreteCircle.cpp | 0 .../GameEngine/Source/Common/Language.cpp | 0 .../GameEngine/Source/Common/MiniLog.cpp | 0 .../GameEngine/Source/Common/PerfTimer.cpp | 0 .../GameEngine/Source/Common/RTS/Handicap.cpp | 0 .../Source/Common/RTS/MissionStats.cpp | 0 .../Source/Common/RTS/PlayerList.cpp | 0 .../GameEngine/Source/Common/RTS/Science.cpp | 0 .../Source/Common/RTS/ScoreKeeper.cpp | 0 .../Source/Common/System/CriticalSection.cpp | 0 .../Source/Common/System/DataChunk.cpp | 0 .../Source/Common/System/Directory.cpp | 0 .../Source/Common/System/DisabledTypes.cpp | 0 .../Source/Common/System/Geometry.cpp | 0 .../Source/Common/System/KindOf.cpp | 0 .../GameEngine/Source/Common/System/List.cpp | 0 .../Source/Common/System/QuotedPrintable.cpp | 0 .../Source/Common/System/StackDump.cpp | 0 .../Source/Common/System/Upgrade.cpp | 0 .../Source/Common/System/encrypt.cpp | 0 .../GameEngine/Source/Common/TerrainTypes.cpp | 0 .../GameEngine/Source/Common/version.cpp | 0 .../EstablishConnectionsMenu.cpp | 0 .../GameClient/GUI/GUICallbacks/Diplomacy.cpp | 0 .../GUI/GUICallbacks/ExtendedMessageBox.cpp | 0 .../GUI/GUICallbacks/Menus/GameInfoWindow.cpp | 0 .../GUI/GUICallbacks/MessageBox.cpp | 0 .../GameClient/GUI/Shell/ShellMenuScheme.cpp | 0 .../GameEngine/Source/GameLogic/AI/AIDock.cpp | 0 .../GameEngine/Source/GameLogic/AI/Squad.cpp | 0 .../Behavior/BridgeScaffoldBehavior.cpp | 0 .../Object/Behavior/BridgeTowerBehavior.cpp | 0 .../Object/Behavior/InstantDeathBehavior.cpp | 0 .../Object/Behavior/OverchargeBehavior.cpp | 0 .../Object/Behavior/POWTruckBehavior.cpp | 0 .../Behavior/PropagandaCenterBehavior.cpp | 0 .../SupplyWarehouseCripplingBehavior.cpp | 0 .../GameLogic/Object/Body/HighlanderBody.cpp | 0 .../GameLogic/Object/Body/ImmortalBody.cpp | 0 .../GameLogic/Object/Body/StructureBody.cpp | 0 .../Collide/CrateCollide/HealCrateCollide.cpp | 0 .../CrateCollide/ShroudCrateCollide.cpp | 0 .../Collide/CrateCollide/UnitCrateCollide.cpp | 0 .../CrateCollide/VeterancyCrateCollide.cpp | 0 .../Object/Collide/FireWeaponCollide.cpp | 0 .../Object/Collide/SquishCollide.cpp | 0 .../GameLogic/Object/Contain/HealContain.cpp | 0 .../Object/Contain/RailedTransportContain.cpp | 0 .../GameLogic/Object/Create/CreateModule.cpp | 0 .../Object/Create/PreorderCreate.cpp | 0 .../Object/Create/SpecialPowerCreate.cpp | 0 .../Object/Create/SupplyCenterCreate.cpp | 0 .../Object/Create/SupplyWarehouseCreate.cpp | 0 .../Object/Create/VeterancyGainCreate.cpp | 0 .../GameLogic/Object/Damage/BoneFXDamage.cpp | 0 .../GameLogic/Object/Damage/DamageModule.cpp | 0 .../Object/Destroy/DestroyModule.cpp | 0 .../GameLogic/Object/Die/CreateCrateDie.cpp | 0 .../Source/GameLogic/Object/Die/CrushDie.cpp | 0 .../Source/GameLogic/Object/Die/DamDie.cpp | 0 .../Source/GameLogic/Object/Die/DieModule.cpp | 0 .../GameLogic/Object/Die/EjectPilotDie.cpp | 0 .../GameLogic/Object/Die/KeepObjectDie.cpp | 0 .../Object/Die/SpecialPowerCompletionDie.cpp | 0 .../GameLogic/Object/Die/UpgradeDie.cpp | 0 .../Object/Helper/ObjectDefectionHelper.cpp | 0 .../GameLogic/Object/Helper/ObjectHelper.cpp | 0 .../Object/Helper/ObjectRepulsorHelper.cpp | 0 .../Object/Helper/ObjectSMCHelper.cpp | 0 .../Helper/ObjectWeaponStatusHelper.cpp | 0 .../Object/SpecialPower/SpecialAbility.cpp | 0 .../SpecialPower/SpyVisionSpecialPower.cpp | 0 .../Update/AIUpdate/POWTruckAIUpdate.cpp | 0 .../AIUpdate/RailedTransportAIUpdate.cpp | 0 .../Object/Update/AIUpdate/WanderAIUpdate.cpp | 0 .../Object/Update/CheckpointUpdate.cpp | 0 .../Object/Update/CleanupHazardUpdate.cpp | 0 .../Object/Update/DeletionUpdate.cpp | 0 .../Update/DockUpdate/PrisonDockUpdate.cpp | 0 .../Update/DockUpdate/RepairDockUpdate.cpp | 0 .../DockUpdate/SupplyWarehouseDockUpdate.cpp | 0 .../Update/DynamicGeometryInfoUpdate.cpp | 0 .../Object/Update/EnemyNearUpdate.cpp | 0 .../Object/Update/FireSpreadUpdate.cpp | 0 .../Object/Update/FlammableUpdate.cpp | 0 .../GameLogic/Object/Update/FloatUpdate.cpp | 0 .../Object/Update/HeightDieUpdate.cpp | 0 .../Object/Update/HijackerUpdate.cpp | 0 .../Object/Update/LifetimeUpdate.cpp | 0 .../Object/Update/MobMemberSlavedUpdate.cpp | 0 .../Update/NeutronMissileSlowDeathUpdate.cpp | 0 .../Object/Update/PilotFindVehicleUpdate.cpp | 0 .../Object/Update/PowerPlantUpdate.cpp | 0 .../QueueProductionExitUpdate.cpp | 0 .../SpawnPointProductionExitUpdate.cpp | 0 .../GameLogic/Object/Update/ProneUpdate.cpp | 0 .../GameLogic/Object/Update/RadarUpdate.cpp | 0 .../Object/Update/RadiusDecalUpdate.cpp | 0 .../Object/Update/TensileFormationUpdate.cpp | 0 .../Object/Upgrade/ActiveShroudUpgrade.cpp | 0 .../Object/Upgrade/CostModifierUpgrade.cpp | 0 .../Upgrade/ExperienceScalarUpgrade.cpp | 0 .../Object/Upgrade/LocomotorSetUpgrade.cpp | 0 .../Object/Upgrade/MaxHealthUpgrade.cpp | 0 .../Object/Upgrade/ObjectCreationUpgrade.cpp | 0 .../Object/Upgrade/PowerPlantUpgrade.cpp | 0 .../GameLogic/Object/Upgrade/RadarUpgrade.cpp | 0 .../Object/Upgrade/StatusBitsUpgrade.cpp | 0 .../Object/Upgrade/SubObjectsUpgrade.cpp | 0 .../Upgrade/UnpauseSpecialPowerUpgrade.cpp | 0 .../Object/Upgrade/WeaponBonusUpgrade.cpp | 0 .../Object/Upgrade/WeaponSetUpgrade.cpp | 0 Generals/Code/GameEngine/CMakeLists.txt | 464 ++++----- .../Include/Common/BezFwdIterator.h | 51 - .../GameEngine/Include/Common/BezierSegment.h | 69 -- .../Include/Common/CriticalSection.h | 101 -- .../Code/GameEngine/Include/Common/DamageFX.h | 165 --- .../GameEngine/Include/Common/DataChunk.h | 231 ----- .../Code/GameEngine/Include/Common/Dict.h | 361 ------- .../GameEngine/Include/Common/Directory.h | 91 -- .../GameEngine/Include/Common/DisabledTypes.h | 112 -- .../Include/Common/DiscreteCircle.h | 73 -- .../Code/GameEngine/Include/Common/Geometry.h | 190 ---- .../Code/GameEngine/Include/Common/Handicap.h | 116 --- .../Code/GameEngine/Include/Common/KindOf.h | 221 ---- .../Code/GameEngine/Include/Common/Language.h | 80 -- .../Code/GameEngine/Include/Common/List.h | 173 ---- .../Code/GameEngine/Include/Common/MiniLog.h | 48 - .../GameEngine/Include/Common/MissionStats.h | 84 -- .../GameEngine/Include/Common/PerfTimer.h | 320 ------ .../GameEngine/Include/Common/PlayerList.h | 170 --- .../Include/Common/QuotedPrintable.h | 36 - .../Code/GameEngine/Include/Common/Science.h | 133 --- .../GameEngine/Include/Common/ScoreKeeper.h | 140 --- .../GameEngine/Include/Common/StackDump.h | 68 -- .../GameEngine/Include/Common/TerrainTypes.h | 238 ----- .../Code/GameEngine/Include/Common/Upgrade.h | 268 ----- .../Code/GameEngine/Include/Common/encrypt.h | 36 - .../Code/GameEngine/Include/Common/version.h | 127 --- .../GameEngine/Include/GameClient/Diplomacy.h | 35 - .../GameClient/EstablishConnectionsMenu.h | 55 - .../Include/GameClient/ExtendedMessageBox.h | 69 -- .../Include/GameClient/GameInfoWindow.h | 40 - .../Include/GameClient/MessageBox.h | 46 - .../Include/GameClient/ShellMenuScheme.h | 152 --- .../GameEngine/Include/GameLogic/AIDock.h | 202 ---- .../GameLogic/Module/ActiveShroudUpgrade.h | 74 -- .../Include/GameLogic/Module/BoneFXDamage.h | 65 -- .../GameLogic/Module/BridgeScaffoldBehavior.h | 111 -- .../GameLogic/Module/BridgeTowerBehavior.h | 94 -- .../GameLogic/Module/CheckpointUpdate.h | 87 -- .../GameLogic/Module/CleanupHazardUpdate.h | 90 -- .../GameLogic/Module/CostModifierUpgrade.h | 114 -- .../Include/GameLogic/Module/CreateCrateDie.h | 93 -- .../Include/GameLogic/Module/CreateModule.h | 83 -- .../Include/GameLogic/Module/CrushDie.h | 100 -- .../Include/GameLogic/Module/DamDie.h | 63 -- .../Include/GameLogic/Module/DamageModule.h | 105 -- .../Include/GameLogic/Module/DeletionUpdate.h | 85 -- .../Include/GameLogic/Module/DestroyModule.h | 63 -- .../Include/GameLogic/Module/DieModule.h | 105 -- .../Module/DynamicGeometryInfoUpdate.h | 101 -- .../Include/GameLogic/Module/EjectPilotDie.h | 71 -- .../GameLogic/Module/EnemyNearUpdate.h | 83 -- .../Module/ExperienceScalarUpgrade.h | 71 -- .../GameLogic/Module/FireSpreadUpdate.h | 75 -- .../GameLogic/Module/FireWeaponCollide.h | 79 -- .../GameLogic/Module/FlammableUpdate.h | 113 -- .../Include/GameLogic/Module/FloatUpdate.h | 73 -- .../Include/GameLogic/Module/HealContain.h | 72 -- .../GameLogic/Module/HealCrateCollide.h | 55 - .../GameLogic/Module/HeightDieUpdate.h | 78 -- .../Include/GameLogic/Module/HighlanderBody.h | 56 - .../Include/GameLogic/Module/HijackerUpdate.h | 91 -- .../Include/GameLogic/Module/ImmortalBody.h | 56 - .../GameLogic/Module/InstantDeathBehavior.h | 75 -- .../Include/GameLogic/Module/KeepObjectDie.h | 55 - .../Include/GameLogic/Module/LifetimeUpdate.h | 84 -- .../GameLogic/Module/LocomotorSetUpgrade.h | 56 - .../GameLogic/Module/MaxHealthUpgrade.h | 73 -- .../GameLogic/Module/MobMemberSlavedUpdate.h | 132 --- .../Module/NeutronMissileSlowDeathUpdate.h | 111 -- .../GameLogic/Module/ObjectCreationUpgrade.h | 76 -- .../GameLogic/Module/ObjectDefectionHelper.h | 79 -- .../Include/GameLogic/Module/ObjectHelper.h | 60 -- .../GameLogic/Module/ObjectRepulsorHelper.h | 57 - .../GameLogic/Module/ObjectSMCHelper.h | 57 - .../Module/ObjectWeaponStatusHelper.h | 80 -- .../GameLogic/Module/OverchargeBehavior.h | 113 -- .../GameLogic/Module/POWTruckAIUpdate.h | 145 --- .../GameLogic/Module/POWTruckBehavior.h | 70 -- .../GameLogic/Module/PilotFindVehicleUpdate.h | 78 -- .../GameLogic/Module/PowerPlantUpdate.h | 98 -- .../GameLogic/Module/PowerPlantUpgrade.h | 61 -- .../Include/GameLogic/Module/PreorderCreate.h | 57 - .../GameLogic/Module/PrisonDockUpdate.h | 58 -- .../Include/GameLogic/Module/ProneUpdate.h | 77 -- .../Module/PropagandaCenterBehavior.h | 85 -- .../Module/QueueProductionExitUpdate.h | 125 --- .../Include/GameLogic/Module/RadarUpdate.h | 87 -- .../Include/GameLogic/Module/RadarUpgrade.h | 77 -- .../GameLogic/Module/RadiusDecalUpdate.h | 83 -- .../Module/RailedTransportAIUpdate.h | 95 -- .../GameLogic/Module/RailedTransportContain.h | 56 - .../GameLogic/Module/RepairDockUpdate.h | 75 -- .../GameLogic/Module/ShroudCrateCollide.h | 55 - .../Module/SpawnPointProductionExitUpdate.h | 99 -- .../Include/GameLogic/Module/SpecialAbility.h | 64 -- .../Module/SpecialPowerCompletionDie.h | 89 -- .../GameLogic/Module/SpecialPowerCreate.h | 56 - .../GameLogic/Module/SpyVisionSpecialPower.h | 72 -- .../Include/GameLogic/Module/SquishCollide.h | 57 - .../GameLogic/Module/StatusBitsUpgrade.h | 105 -- .../Include/GameLogic/Module/StructureBody.h | 78 -- .../GameLogic/Module/SubObjectsUpgrade.h | 87 -- .../GameLogic/Module/SupplyCenterCreate.h | 56 - .../GameLogic/Module/SupplyWarehouseCreate.h | 55 - .../Module/SupplyWarehouseCripplingBehavior.h | 89 -- .../Module/SupplyWarehouseDockUpdate.h | 77 -- .../GameLogic/Module/TensileFormationUpdate.h | 89 -- .../GameLogic/Module/UnitCrateCollide.h | 82 -- .../Module/UnpauseSpecialPowerUpgrade.h | 74 -- .../Include/GameLogic/Module/UpgradeDie.h | 77 -- .../GameLogic/Module/VeterancyCrateCollide.h | 92 -- .../GameLogic/Module/VeterancyGainCreate.h | 69 -- .../Include/GameLogic/Module/WanderAIUpdate.h | 62 -- .../GameLogic/Module/WeaponBonusUpgrade.h | 89 -- .../GameLogic/Module/WeaponSetUpgrade.h | 56 - .../Code/GameEngine/Include/GameLogic/Squad.h | 96 -- .../Source/Common/Bezier/BezFwdIterator.cpp | 120 --- .../Source/Common/Bezier/BezierSegment.cpp | 246 ----- .../GameEngine/Source/Common/DamageFX.cpp | 324 ------ .../Code/GameEngine/Source/Common/Dict.cpp | 549 ---------- .../Source/Common/DiscreteCircle.cpp | 114 -- .../GameEngine/Source/Common/Language.cpp | 69 -- .../Code/GameEngine/Source/Common/MiniLog.cpp | 88 -- .../GameEngine/Source/Common/PerfTimer.cpp | 663 ------------ .../GameEngine/Source/Common/RTS/Handicap.cpp | 126 --- .../Source/Common/RTS/MissionStats.cpp | 113 -- .../Source/Common/RTS/PlayerList.cpp | 484 --------- .../GameEngine/Source/Common/RTS/Science.cpp | 376 ------- .../Source/Common/RTS/ScoreKeeper.cpp | 565 ---------- .../Source/Common/System/CriticalSection.cpp | 39 - .../Source/Common/System/DataChunk.cpp | 980 ------------------ .../Source/Common/System/Directory.cpp | 135 --- .../Source/Common/System/DisabledTypes.cpp | 57 - .../Source/Common/System/Geometry.cpp | 600 ----------- .../Source/Common/System/KindOf.cpp | 187 ---- .../GameEngine/Source/Common/System/List.cpp | 451 -------- .../Source/Common/System/QuotedPrintable.cpp | 206 ---- .../Source/Common/System/StackDump.cpp | 640 ------------ .../Source/Common/System/Upgrade.cpp | 501 --------- .../Source/Common/System/encrypt.cpp | 104 -- .../GameEngine/Source/Common/TerrainTypes.cpp | 165 --- .../Code/GameEngine/Source/Common/version.cpp | 453 -------- .../EstablishConnectionsMenu.cpp | 144 --- .../GameClient/GUI/GUICallbacks/Diplomacy.cpp | 597 ----------- .../GUI/GUICallbacks/ExtendedMessageBox.cpp | 308 ------ .../GUI/GUICallbacks/Menus/GameInfoWindow.cpp | 290 ------ .../GUI/GUICallbacks/MessageBox.cpp | 265 ----- .../GameClient/GUI/Shell/ShellMenuScheme.cpp | 323 ------ .../GameEngine/Source/GameLogic/AI/AIDock.cpp | 819 --------------- .../GameEngine/Source/GameLogic/AI/Squad.cpp | 266 ----- .../Behavior/BridgeScaffoldBehavior.cpp | 366 ------- .../Object/Behavior/BridgeTowerBehavior.cpp | 335 ------ .../Object/Behavior/InstantDeathBehavior.cpp | 214 ---- .../Object/Behavior/OverchargeBehavior.cpp | 331 ------ .../Object/Behavior/POWTruckBehavior.cpp | 157 --- .../Behavior/PropagandaCenterBehavior.cpp | 282 ----- .../SupplyWarehouseCripplingBehavior.cpp | 184 ---- .../GameLogic/Object/Body/HighlanderBody.cpp | 101 -- .../GameLogic/Object/Body/ImmortalBody.cpp | 106 -- .../GameLogic/Object/Body/StructureBody.cpp | 108 -- .../Collide/CrateCollide/HealCrateCollide.cpp | 106 -- .../CrateCollide/ShroudCrateCollide.cpp | 105 -- .../Collide/CrateCollide/UnitCrateCollide.cpp | 132 --- .../CrateCollide/VeterancyCrateCollide.cpp | 210 ---- .../Object/Collide/FireWeaponCollide.cpp | 174 ---- .../Object/Collide/SquishCollide.cpp | 170 --- .../GameLogic/Object/Contain/HealContain.cpp | 222 ---- .../Object/Contain/RailedTransportContain.cpp | 158 --- .../GameLogic/Object/Create/CreateModule.cpp | 94 -- .../Object/Create/PreorderCreate.cpp | 109 -- .../Object/Create/SpecialPowerCreate.cpp | 113 -- .../Object/Create/SupplyCenterCreate.cpp | 119 --- .../Object/Create/SupplyWarehouseCreate.cpp | 110 -- .../Object/Create/VeterancyGainCreate.cpp | 139 --- .../GameLogic/Object/Damage/BoneFXDamage.cpp | 118 --- .../GameLogic/Object/Damage/DamageModule.cpp | 71 -- .../Object/Destroy/DestroyModule.cpp | 89 -- .../GameLogic/Object/Die/CreateCrateDie.cpp | 293 ------ .../Source/GameLogic/Object/Die/CrushDie.cpp | 248 ----- .../Source/GameLogic/Object/Die/DamDie.cpp | 149 --- .../Source/GameLogic/Object/Die/DieModule.cpp | 123 --- .../GameLogic/Object/Die/EjectPilotDie.cpp | 152 --- .../GameLogic/Object/Die/KeepObjectDie.cpp | 102 -- .../Object/Die/SpecialPowerCompletionDie.cpp | 131 --- .../GameLogic/Object/Die/UpgradeDie.cpp | 127 --- .../Object/Helper/ObjectDefectionHelper.cpp | 180 ---- .../GameLogic/Object/Helper/ObjectHelper.cpp | 99 -- .../Object/Helper/ObjectRepulsorHelper.cpp | 93 -- .../Object/Helper/ObjectSMCHelper.cpp | 93 -- .../Helper/ObjectWeaponStatusHelper.cpp | 80 -- .../Object/SpecialPower/SpecialAbility.cpp | 137 --- .../SpecialPower/SpyVisionSpecialPower.cpp | 167 --- .../Update/AIUpdate/POWTruckAIUpdate.cpp | 917 ---------------- .../AIUpdate/RailedTransportAIUpdate.cpp | 416 -------- .../Object/Update/AIUpdate/WanderAIUpdate.cpp | 103 -- .../Object/Update/CheckpointUpdate.cpp | 223 ---- .../Object/Update/CleanupHazardUpdate.cpp | 371 ------- .../Object/Update/DeletionUpdate.cpp | 150 --- .../Update/DockUpdate/PrisonDockUpdate.cpp | 129 --- .../Update/DockUpdate/RepairDockUpdate.cpp | 200 ---- .../DockUpdate/SupplyWarehouseDockUpdate.cpp | 229 ---- .../Update/DynamicGeometryInfoUpdate.cpp | 265 ----- .../Object/Update/EnemyNearUpdate.cpp | 153 --- .../Object/Update/FireSpreadUpdate.cpp | 220 ---- .../Object/Update/FlammableUpdate.cpp | 340 ------ .../GameLogic/Object/Update/FloatUpdate.cpp | 180 ---- .../Object/Update/HeightDieUpdate.cpp | 321 ------ .../Object/Update/HijackerUpdate.cpp | 261 ----- .../Object/Update/LifetimeUpdate.cpp | 133 --- .../Object/Update/MobMemberSlavedUpdate.cpp | 463 --------- .../Update/NeutronMissileSlowDeathUpdate.cpp | 528 ---------- .../Object/Update/PilotFindVehicleUpdate.cpp | 225 ---- .../Object/Update/PowerPlantUpdate.cpp | 161 --- .../QueueProductionExitUpdate.cpp | 349 ------- .../SpawnPointProductionExitUpdate.cpp | 241 ----- .../GameLogic/Object/Update/ProneUpdate.cpp | 163 --- .../GameLogic/Object/Update/RadarUpdate.cpp | 173 ---- .../Object/Update/RadiusDecalUpdate.cpp | 127 --- .../Object/Update/TensileFormationUpdate.cpp | 475 --------- .../Object/Upgrade/ActiveShroudUpgrade.cpp | 130 --- .../Object/Upgrade/CostModifierUpgrade.cpp | 213 ---- .../Upgrade/ExperienceScalarUpgrade.cpp | 127 --- .../Object/Upgrade/LocomotorSetUpgrade.cpp | 97 -- .../Object/Upgrade/MaxHealthUpgrade.cpp | 132 --- .../Object/Upgrade/ObjectCreationUpgrade.cpp | 139 --- .../Object/Upgrade/PowerPlantUpgrade.cpp | 181 ---- .../GameLogic/Object/Upgrade/RadarUpgrade.cpp | 183 ---- .../Object/Upgrade/StatusBitsUpgrade.cpp | 148 --- .../Object/Upgrade/SubObjectsUpgrade.cpp | 166 --- .../Upgrade/UnpauseSpecialPowerUpgrade.cpp | 134 --- .../Object/Upgrade/WeaponBonusUpgrade.cpp | 133 --- .../Object/Upgrade/WeaponSetUpgrade.cpp | 97 -- GeneralsMD/Code/GameEngine/CMakeLists.txt | 464 ++++----- scripts/cpp/unify_move_files.py | 235 ++++- 468 files changed, 930 insertions(+), 39024 deletions(-) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/BezFwdIterator.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/BezierSegment.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/CriticalSection.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/DamageFX.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/DataChunk.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/Dict.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/Directory.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/DisabledTypes.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/DiscreteCircle.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/Geometry.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/Handicap.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/KindOf.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/Language.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/List.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/MiniLog.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/MissionStats.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/PerfTimer.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/PlayerList.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/QuotedPrintable.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/Science.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/ScoreKeeper.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/StackDump.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/TerrainTypes.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/Upgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/encrypt.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/Common/version.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameClient/Diplomacy.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameClient/EstablishConnectionsMenu.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameClient/ExtendedMessageBox.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameClient/GameInfoWindow.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameClient/MessageBox.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameClient/ShellMenuScheme.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/AIDock.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/BoneFXDamage.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/BridgeScaffoldBehavior.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/CheckpointUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/CleanupHazardUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/CreateCrateDie.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/CreateModule.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/CrushDie.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/DamDie.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/DamageModule.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/DeletionUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/DestroyModule.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/DieModule.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/DynamicGeometryInfoUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/EjectPilotDie.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/EnemyNearUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/FireWeaponCollide.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/FlammableUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/FloatUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/HealContain.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/HealCrateCollide.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/HeightDieUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/HighlanderBody.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/HijackerUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/ImmortalBody.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/InstantDeathBehavior.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/KeepObjectDie.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/LifetimeUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/MobMemberSlavedUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/ObjectDefectionHelper.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/ObjectHelper.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/ObjectRepulsorHelper.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/ObjectSMCHelper.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/ObjectWeaponStatusHelper.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/OverchargeBehavior.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/POWTruckAIUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/POWTruckBehavior.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/PilotFindVehicleUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/PreorderCreate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/PrisonDockUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/ProneUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/RadarUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/RadarUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/RadiusDecalUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/RailedTransportAIUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/RailedTransportContain.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/RepairDockUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/ShroudCrateCollide.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/SpawnPointProductionExitUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/SpecialAbility.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/SpecialPowerCompletionDie.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/SpecialPowerCreate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/SpyVisionSpecialPower.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/SquishCollide.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/StructureBody.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/SupplyWarehouseCreate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/TensileFormationUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/UnitCrateCollide.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/UpgradeDie.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/VeterancyCrateCollide.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/VeterancyGainCreate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/WanderAIUpdate.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Include/GameLogic/Squad.h (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/Bezier/BezFwdIterator.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/Bezier/BezierSegment.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/DamageFX.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/Dict.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/DiscreteCircle.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/Language.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/MiniLog.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/PerfTimer.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/RTS/Handicap.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/RTS/MissionStats.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/RTS/PlayerList.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/RTS/Science.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/RTS/ScoreKeeper.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/CriticalSection.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/DataChunk.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/Directory.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/DisabledTypes.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/Geometry.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/KindOf.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/List.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/QuotedPrintable.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/StackDump.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/Upgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/System/encrypt.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/TerrainTypes.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/Common/version.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/AI/AIDock.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/AI/Squad.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Body/HighlanderBody.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Body/ImmortalBody.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Body/StructureBody.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Collide/SquishCollide.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Contain/HealContain.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Contain/RailedTransportContain.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Damage/BoneFXDamage.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Damage/DamageModule.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Destroy/DestroyModule.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Die/DamDie.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Die/DieModule.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Die/EjectPilotDie.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Die/KeepObjectDie.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Die/UpgradeDie.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Helper/ObjectHelper.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/CheckpointUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/DeletionUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/EnemyNearUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/FloatUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/HijackerUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/LifetimeUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/PowerPlantUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/ProneUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/RadarUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp (100%) rename {GeneralsMD/Code => Core}/GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp (100%) delete mode 100644 Generals/Code/GameEngine/Include/Common/BezFwdIterator.h delete mode 100644 Generals/Code/GameEngine/Include/Common/BezierSegment.h delete mode 100644 Generals/Code/GameEngine/Include/Common/CriticalSection.h delete mode 100644 Generals/Code/GameEngine/Include/Common/DamageFX.h delete mode 100644 Generals/Code/GameEngine/Include/Common/DataChunk.h delete mode 100644 Generals/Code/GameEngine/Include/Common/Dict.h delete mode 100644 Generals/Code/GameEngine/Include/Common/Directory.h delete mode 100644 Generals/Code/GameEngine/Include/Common/DisabledTypes.h delete mode 100644 Generals/Code/GameEngine/Include/Common/DiscreteCircle.h delete mode 100644 Generals/Code/GameEngine/Include/Common/Geometry.h delete mode 100644 Generals/Code/GameEngine/Include/Common/Handicap.h delete mode 100644 Generals/Code/GameEngine/Include/Common/KindOf.h delete mode 100644 Generals/Code/GameEngine/Include/Common/Language.h delete mode 100644 Generals/Code/GameEngine/Include/Common/List.h delete mode 100644 Generals/Code/GameEngine/Include/Common/MiniLog.h delete mode 100644 Generals/Code/GameEngine/Include/Common/MissionStats.h delete mode 100644 Generals/Code/GameEngine/Include/Common/PerfTimer.h delete mode 100644 Generals/Code/GameEngine/Include/Common/PlayerList.h delete mode 100644 Generals/Code/GameEngine/Include/Common/QuotedPrintable.h delete mode 100644 Generals/Code/GameEngine/Include/Common/Science.h delete mode 100644 Generals/Code/GameEngine/Include/Common/ScoreKeeper.h delete mode 100644 Generals/Code/GameEngine/Include/Common/StackDump.h delete mode 100644 Generals/Code/GameEngine/Include/Common/TerrainTypes.h delete mode 100644 Generals/Code/GameEngine/Include/Common/Upgrade.h delete mode 100644 Generals/Code/GameEngine/Include/Common/encrypt.h delete mode 100644 Generals/Code/GameEngine/Include/Common/version.h delete mode 100644 Generals/Code/GameEngine/Include/GameClient/Diplomacy.h delete mode 100644 Generals/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h delete mode 100644 Generals/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h delete mode 100644 Generals/Code/GameEngine/Include/GameClient/GameInfoWindow.h delete mode 100644 Generals/Code/GameEngine/Include/GameClient/MessageBox.h delete mode 100644 Generals/Code/GameEngine/Include/GameClient/ShellMenuScheme.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/AIDock.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/BoneFXDamage.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/BridgeScaffoldBehavior.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/CheckpointUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/CleanupHazardUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/CreateCrateDie.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/CreateModule.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/CrushDie.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/DamDie.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/DamageModule.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/DeletionUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/DestroyModule.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/DieModule.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/DynamicGeometryInfoUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/EjectPilotDie.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/EnemyNearUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/FireWeaponCollide.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/FlammableUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/FloatUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/HealContain.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/HealCrateCollide.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/HeightDieUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/HighlanderBody.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/HijackerUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/ImmortalBody.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/InstantDeathBehavior.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/KeepObjectDie.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/LifetimeUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/MobMemberSlavedUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/ObjectDefectionHelper.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/ObjectHelper.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/ObjectRepulsorHelper.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/ObjectSMCHelper.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/ObjectWeaponStatusHelper.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/OverchargeBehavior.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/POWTruckAIUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/POWTruckBehavior.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/PilotFindVehicleUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/PreorderCreate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/PrisonDockUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/ProneUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/RadarUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/RadarUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/RadiusDecalUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/RailedTransportAIUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/RailedTransportContain.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/RepairDockUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/ShroudCrateCollide.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/SpawnPointProductionExitUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/SpecialAbility.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCompletionDie.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCreate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/SpyVisionSpecialPower.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/SquishCollide.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/StructureBody.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCreate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/TensileFormationUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/UnitCrateCollide.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/UpgradeDie.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/VeterancyCrateCollide.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/VeterancyGainCreate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/WanderAIUpdate.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h delete mode 100644 Generals/Code/GameEngine/Include/GameLogic/Squad.h delete mode 100644 Generals/Code/GameEngine/Source/Common/Bezier/BezFwdIterator.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/Bezier/BezierSegment.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/DamageFX.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/Dict.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/DiscreteCircle.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/Language.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/MiniLog.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/PerfTimer.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/RTS/Handicap.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/RTS/MissionStats.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/RTS/Science.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/System/Directory.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/System/DisabledTypes.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/System/Geometry.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/System/KindOf.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/System/List.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/System/QuotedPrintable.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/System/StackDump.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/System/Upgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/System/encrypt.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/TerrainTypes.cpp delete mode 100644 Generals/Code/GameEngine/Source/Common/version.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/AI/AIDock.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/AI/Squad.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Body/HighlanderBody.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Body/ImmortalBody.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Body/StructureBody.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Collide/SquishCollide.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Contain/HealContain.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Contain/RailedTransportContain.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Damage/BoneFXDamage.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Damage/DamageModule.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Destroy/DestroyModule.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Die/DamDie.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Die/DieModule.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Die/EjectPilotDie.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Die/KeepObjectDie.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Die/UpgradeDie.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectHelper.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/CheckpointUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/DeletionUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/EnemyNearUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/FloatUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/HijackerUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/LifetimeUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/PowerPlantUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProneUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/RadarUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp delete mode 100644 Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt index 5b46ed92663..0ea82c0f04c 100644 --- a/Core/GameEngine/CMakeLists.txt +++ b/Core/GameEngine/CMakeLists.txt @@ -13,8 +13,8 @@ set(GAMEENGINE_SRC Include/Common/AudioRequest.h Include/Common/AudioSettings.h # Include/Common/BattleHonors.h -# Include/Common/BezFwdIterator.h -# Include/Common/BezierSegment.h + Include/Common/BezFwdIterator.h + Include/Common/BezierSegment.h # Include/Common/BitFlags.h # Include/Common/BitFlagsIO.h # Include/Common/BorderColors.h @@ -23,19 +23,19 @@ set(GAMEENGINE_SRC # Include/Common/CommandLine.h Include/Common/crc.h Include/Common/CRCDebug.h -# Include/Common/CriticalSection.h + Include/Common/CriticalSection.h # Include/Common/CustomMatchPreferences.h -# Include/Common/DamageFX.h -# Include/Common/DataChunk.h + Include/Common/DamageFX.h + Include/Common/DataChunk.h Include/Common/Debug.h Include/Common/Diagnostic/SimulationMathCrc.h -# Include/Common/Dict.h -# Include/Common/Directory.h -# Include/Common/DisabledTypes.h -# Include/Common/DiscreteCircle.h + Include/Common/Dict.h + Include/Common/Directory.h + Include/Common/DisabledTypes.h + Include/Common/DiscreteCircle.h # Include/Common/DrawModule.h Include/Common/DynamicAudioEventInfo.h -# Include/Common/encrypt.h + Include/Common/encrypt.h # Include/Common/Energy.h Include/Common/Errors.h Include/Common/file.h @@ -56,26 +56,26 @@ set(GAMEENGINE_SRC # Include/Common/GameStateMap.h Include/Common/GameType.h Include/Common/GameUtility.h -# Include/Common/Geometry.h + Include/Common/Geometry.h # Include/Common/GlobalData.h -# Include/Common/Handicap.h + Include/Common/Handicap.h # Include/Common/IgnorePreferences.h Include/Common/INI.h # Include/Common/INIException.h -# Include/Common/KindOf.h + Include/Common/KindOf.h # Include/Common/LadderPreferences.h -# Include/Common/Language.h + Include/Common/Language.h # Include/Common/LatchRestore.h -# Include/Common/List.h + Include/Common/List.h Include/Common/LocalFile.h Include/Common/LocalFileSystem.h Include/Common/MapObject.h # Include/Common/MapReaderWriterInfo.h # Include/Common/MessageStream.h Include/Common/MiniDumper.h -# Include/Common/MiniLog.h + Include/Common/MiniLog.h Include/Common/MiscAudio.h -# Include/Common/MissionStats.h + Include/Common/MissionStats.h # Include/Common/ModelState.h # Include/Common/Module.h # Include/Common/ModuleFactory.h @@ -89,13 +89,13 @@ set(GAMEENGINE_SRC # Include/Common/Override.h # Include/Common/PartitionSolver.h # Include/Common/PerfMetrics.h -# Include/Common/PerfTimer.h + Include/Common/PerfTimer.h # Include/Common/Player.h -# Include/Common/PlayerList.h + Include/Common/PlayerList.h # Include/Common/PlayerTemplate.h # Include/Common/ProductionPrerequisite.h # Include/Common/QuickmatchPreferences.h -# Include/Common/QuotedPrintable.h + Include/Common/QuotedPrintable.h Include/Common/Radar.h Include/Common/RAMFile.h Include/Common/RandomValue.h @@ -103,9 +103,9 @@ set(GAMEENGINE_SRC # Include/Common/Registry.h Include/Common/ReplaySimulation.h # Include/Common/ResourceGatheringManager.h -# Include/Common/Science.h + Include/Common/Science.h # Include/Common/ScopedMutex.h -# Include/Common/ScoreKeeper.h + Include/Common/ScoreKeeper.h #Include/Common/simpleplayer.h # unused # Include/Common/SkirmishBattleHonors.h # Include/Common/SkirmishPreferences.h @@ -114,7 +114,7 @@ set(GAMEENGINE_SRC # Include/Common/SpecialPower.h # Include/Common/SpecialPowerMaskType.h # Include/Common/SpecialPowerType.h -# Include/Common/StackDump.h + Include/Common/StackDump.h # Include/Common/StateMachine.h # Include/Common/StatsCollector.h Include/Common/STLTypedefs.h @@ -122,7 +122,7 @@ set(GAMEENGINE_SRC Include/Common/SubsystemInterface.h # Include/Common/Team.h # Include/Common/Terrain.h -# Include/Common/TerrainTypes.h + Include/Common/TerrainTypes.h # Include/Common/Thing.h # Include/Common/ThingFactory.h # Include/Common/ThingSort.h @@ -130,10 +130,10 @@ set(GAMEENGINE_SRC # Include/Common/TunnelTracker.h Include/Common/UnicodeString.h # Include/Common/UnitTimings.h -# Include/Common/Upgrade.h + Include/Common/Upgrade.h #Include/Common/urllaunch.h # unused Include/Common/UserPreferences.h -# Include/Common/version.h + Include/Common/version.h # Include/Common/WellKnownKeys.h Include/Common/WorkerProcess.h Include/Common/Xfer.h @@ -154,7 +154,7 @@ set(GAMEENGINE_SRC Include/GameClient/ControlBarScheme.h Include/GameClient/Credits.h Include/GameClient/DebugDisplay.h -# Include/GameClient/Diplomacy.h + Include/GameClient/Diplomacy.h # Include/GameClient/DisconnectMenu.h Include/GameClient/Display.h Include/GameClient/DisplayString.h @@ -162,9 +162,9 @@ set(GAMEENGINE_SRC # Include/GameClient/Drawable.h # Include/GameClient/DrawableInfo.h Include/GameClient/DrawGroupInfo.h -# Include/GameClient/EstablishConnectionsMenu.h + Include/GameClient/EstablishConnectionsMenu.h # Include/GameClient/Eva.h -# Include/GameClient/ExtendedMessageBox.h + Include/GameClient/ExtendedMessageBox.h # Include/GameClient/FontDesc.h Include/GameClient/FXList.h Include/GameClient/Gadget.h @@ -180,7 +180,7 @@ set(GAMEENGINE_SRC Include/GameClient/GadgetTextEntry.h # Include/GameClient/GameClient.h Include/GameClient/GameFont.h -# Include/GameClient/GameInfoWindow.h + Include/GameClient/GameInfoWindow.h Include/GameClient/GameText.h Include/GameClient/GameWindow.h Include/GameClient/GameWindowGlobal.h @@ -204,7 +204,7 @@ set(GAMEENGINE_SRC Include/GameClient/LoadScreen.h Include/GameClient/LookAtXlat.h Include/GameClient/MapUtil.h -# Include/GameClient/MessageBox.h + Include/GameClient/MessageBox.h Include/GameClient/MetaEvent.h Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h Include/GameClient/Module/BeaconClientUpdate.h @@ -221,7 +221,7 @@ set(GAMEENGINE_SRC # Include/GameClient/Shadow.h # Include/GameClient/Shell.h # Include/GameClient/ShellHooks.h -# Include/GameClient/ShellMenuScheme.h + Include/GameClient/ShellMenuScheme.h Include/GameClient/Smudge.h Include/GameClient/Snow.h Include/GameClient/Statistics.h @@ -235,7 +235,7 @@ set(GAMEENGINE_SRC Include/GameClient/WindowXlat.h Include/GameClient/WinInstanceData.h # Include/GameLogic/AI.h -# Include/GameLogic/AIDock.h + Include/GameLogic/AIDock.h # Include/GameLogic/AIGuard.h # Include/GameLogic/AIGuardRetaliate.h Include/GameLogic/AIPathfind.h @@ -257,7 +257,7 @@ set(GAMEENGINE_SRC # Include/GameLogic/LocomotorSet.h Include/GameLogic/LogicRandomValue.h # Include/GameLogic/Module/ActiveBody.h -# Include/GameLogic/Module/ActiveShroudUpgrade.h + Include/GameLogic/Module/ActiveShroudUpgrade.h # Include/GameLogic/Module/AIUpdate.h # Include/GameLogic/Module/AnimationSteeringUpdate.h # Include/GameLogic/Module/ArmorUpgrade.h @@ -272,64 +272,64 @@ set(GAMEENGINE_SRC # Include/GameLogic/Module/BattlePlanUpdate.h # Include/GameLogic/Module/BehaviorModule.h # Include/GameLogic/Module/BodyModule.h -# Include/GameLogic/Module/BoneFXDamage.h + Include/GameLogic/Module/BoneFXDamage.h # Include/GameLogic/Module/BoneFXUpdate.h # Include/GameLogic/Module/BridgeBehavior.h -# Include/GameLogic/Module/BridgeScaffoldBehavior.h -# Include/GameLogic/Module/BridgeTowerBehavior.h + Include/GameLogic/Module/BridgeScaffoldBehavior.h + Include/GameLogic/Module/BridgeTowerBehavior.h # Include/GameLogic/Module/BunkerBusterBehavior.h # Include/GameLogic/Module/CashBountyPower.h # Include/GameLogic/Module/CashHackSpecialPower.h # Include/GameLogic/Module/CaveContain.h -# Include/GameLogic/Module/CheckpointUpdate.h + Include/GameLogic/Module/CheckpointUpdate.h # Include/GameLogic/Module/ChinookAIUpdate.h # Include/GameLogic/Module/CleanupAreaPower.h -# Include/GameLogic/Module/CleanupHazardUpdate.h + Include/GameLogic/Module/CleanupHazardUpdate.h # Include/GameLogic/Module/CollideModule.h # Include/GameLogic/Module/CommandButtonHuntUpdate.h # Include/GameLogic/Module/CommandSetUpgrade.h # Include/GameLogic/Module/ContainModule.h # Include/GameLogic/Module/ConvertToCarBombCrateCollide.h # Include/GameLogic/Module/ConvertToHijackedVehicleCrateCollide.h -# Include/GameLogic/Module/CostModifierUpgrade.h + Include/GameLogic/Module/CostModifierUpgrade.h # Include/GameLogic/Module/CountermeasuresBehavior.h # Include/GameLogic/Module/CrateCollide.h -# Include/GameLogic/Module/CreateCrateDie.h -# Include/GameLogic/Module/CreateModule.h + Include/GameLogic/Module/CreateCrateDie.h + Include/GameLogic/Module/CreateModule.h # Include/GameLogic/Module/CreateObjectDie.h -# Include/GameLogic/Module/CrushDie.h -# Include/GameLogic/Module/DamageModule.h -# Include/GameLogic/Module/DamDie.h + Include/GameLogic/Module/CrushDie.h + Include/GameLogic/Module/DamageModule.h + Include/GameLogic/Module/DamDie.h # Include/GameLogic/Module/DefaultProductionExitUpdate.h # Include/GameLogic/Module/DefectorSpecialPower.h -# Include/GameLogic/Module/DeletionUpdate.h + Include/GameLogic/Module/DeletionUpdate.h # Include/GameLogic/Module/DeliverPayloadAIUpdate.h # Include/GameLogic/Module/DemoralizeSpecialPower.h # Include/GameLogic/Module/DemoTrapUpdate.h # Include/GameLogic/Module/DeployStyleAIUpdate.h # Include/GameLogic/Module/DestroyDie.h -# Include/GameLogic/Module/DestroyModule.h -# Include/GameLogic/Module/DieModule.h + Include/GameLogic/Module/DestroyModule.h + Include/GameLogic/Module/DieModule.h # Include/GameLogic/Module/DockUpdate.h # Include/GameLogic/Module/DozerAIUpdate.h # Include/GameLogic/Module/DumbProjectileBehavior.h -# Include/GameLogic/Module/DynamicGeometryInfoUpdate.h + Include/GameLogic/Module/DynamicGeometryInfoUpdate.h # Include/GameLogic/Module/DynamicShroudClearingRangeUpdate.h -# Include/GameLogic/Module/EjectPilotDie.h + Include/GameLogic/Module/EjectPilotDie.h # Include/GameLogic/Module/EMPUpdate.h -# Include/GameLogic/Module/EnemyNearUpdate.h -# Include/GameLogic/Module/ExperienceScalarUpgrade.h + Include/GameLogic/Module/EnemyNearUpdate.h + Include/GameLogic/Module/ExperienceScalarUpgrade.h # Include/GameLogic/Module/FireOCLAfterWeaponCooldownUpdate.h -# Include/GameLogic/Module/FireSpreadUpdate.h + Include/GameLogic/Module/FireSpreadUpdate.h # Include/GameLogic/Module/FirestormDynamicGeometryInfoUpdate.h -# Include/GameLogic/Module/FireWeaponCollide.h + Include/GameLogic/Module/FireWeaponCollide.h # Include/GameLogic/Module/FireWeaponPower.h # Include/GameLogic/Module/FireWeaponUpdate.h # Include/GameLogic/Module/FireWeaponWhenDamagedBehavior.h # Include/GameLogic/Module/FireWeaponWhenDeadBehavior.h -# Include/GameLogic/Module/FlammableUpdate.h + Include/GameLogic/Module/FlammableUpdate.h # Include/GameLogic/Module/FlightDeckBehavior.h -# Include/GameLogic/Module/FloatUpdate.h + Include/GameLogic/Module/FloatUpdate.h # Include/GameLogic/Module/FXListDie.h # Include/GameLogic/Module/GarrisonContain.h # Include/GameLogic/Module/GenerateMinefieldBehavior.h @@ -337,79 +337,79 @@ set(GAMEENGINE_SRC # Include/GameLogic/Module/GrantStealthBehavior.h # Include/GameLogic/Module/GrantUpgradeCreate.h # Include/GameLogic/Module/HackInternetAIUpdate.h -# Include/GameLogic/Module/HealContain.h -# Include/GameLogic/Module/HealCrateCollide.h -# Include/GameLogic/Module/HeightDieUpdate.h + Include/GameLogic/Module/HealContain.h + Include/GameLogic/Module/HealCrateCollide.h + Include/GameLogic/Module/HeightDieUpdate.h # Include/GameLogic/Module/HelicopterSlowDeathUpdate.h # Include/GameLogic/Module/HelixContain.h -# Include/GameLogic/Module/HighlanderBody.h -# Include/GameLogic/Module/HijackerUpdate.h + Include/GameLogic/Module/HighlanderBody.h + Include/GameLogic/Module/HijackerUpdate.h # Include/GameLogic/Module/HiveStructureBody.h # Include/GameLogic/Module/HordeUpdate.h -# Include/GameLogic/Module/ImmortalBody.h + Include/GameLogic/Module/ImmortalBody.h # Include/GameLogic/Module/InactiveBody.h -# Include/GameLogic/Module/InstantDeathBehavior.h + Include/GameLogic/Module/InstantDeathBehavior.h # Include/GameLogic/Module/InternetHackContain.h # Include/GameLogic/Module/JetAIUpdate.h # Include/GameLogic/Module/JetSlowDeathBehavior.h -# Include/GameLogic/Module/KeepObjectDie.h + Include/GameLogic/Module/KeepObjectDie.h # Include/GameLogic/Module/LaserUpdate.h -# Include/GameLogic/Module/LifetimeUpdate.h + Include/GameLogic/Module/LifetimeUpdate.h # Include/GameLogic/Module/LockWeaponCreate.h -# Include/GameLogic/Module/LocomotorSetUpgrade.h -# Include/GameLogic/Module/MaxHealthUpgrade.h + Include/GameLogic/Module/LocomotorSetUpgrade.h + Include/GameLogic/Module/MaxHealthUpgrade.h # Include/GameLogic/Module/MinefieldBehavior.h # Include/GameLogic/Module/MissileAIUpdate.h # Include/GameLogic/Module/MissileLauncherBuildingUpdate.h -# Include/GameLogic/Module/MobMemberSlavedUpdate.h + Include/GameLogic/Module/MobMemberSlavedUpdate.h # Include/GameLogic/Module/MobNexusContain.h # Include/GameLogic/Module/ModelConditionUpgrade.h # Include/GameLogic/Module/MoneyCrateCollide.h # Include/GameLogic/Module/NeutronBlastBehavior.h -# Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h + Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h # Include/GameLogic/Module/NeutronMissileUpdate.h -# Include/GameLogic/Module/ObjectCreationUpgrade.h -# Include/GameLogic/Module/ObjectDefectionHelper.h -# Include/GameLogic/Module/ObjectHelper.h -# Include/GameLogic/Module/ObjectRepulsorHelper.h -# Include/GameLogic/Module/ObjectSMCHelper.h -# Include/GameLogic/Module/ObjectWeaponStatusHelper.h + Include/GameLogic/Module/ObjectCreationUpgrade.h + Include/GameLogic/Module/ObjectDefectionHelper.h + Include/GameLogic/Module/ObjectHelper.h + Include/GameLogic/Module/ObjectRepulsorHelper.h + Include/GameLogic/Module/ObjectSMCHelper.h + Include/GameLogic/Module/ObjectWeaponStatusHelper.h # Include/GameLogic/Module/OCLSpecialPower.h # Include/GameLogic/Module/OCLUpdate.h # Include/GameLogic/Module/OpenContain.h -# Include/GameLogic/Module/OverchargeBehavior.h + Include/GameLogic/Module/OverchargeBehavior.h # Include/GameLogic/Module/OverlordContain.h # Include/GameLogic/Module/ParachuteContain.h # Include/GameLogic/Module/ParkingPlaceBehavior.h # Include/GameLogic/Module/ParticleUplinkCannonUpdate.h # Include/GameLogic/Module/PassengersFireUpgrade.h # Include/GameLogic/Module/PhysicsUpdate.h -# Include/GameLogic/Module/PilotFindVehicleUpdate.h + Include/GameLogic/Module/PilotFindVehicleUpdate.h # Include/GameLogic/Module/PointDefenseLaserUpdate.h # Include/GameLogic/Module/PoisonedBehavior.h -# Include/GameLogic/Module/PowerPlantUpdate.h -# Include/GameLogic/Module/PowerPlantUpgrade.h -# Include/GameLogic/Module/POWTruckAIUpdate.h -# Include/GameLogic/Module/POWTruckBehavior.h -# Include/GameLogic/Module/PreorderCreate.h + Include/GameLogic/Module/PowerPlantUpdate.h + Include/GameLogic/Module/PowerPlantUpgrade.h + Include/GameLogic/Module/POWTruckAIUpdate.h + Include/GameLogic/Module/POWTruckBehavior.h + Include/GameLogic/Module/PreorderCreate.h # Include/GameLogic/Module/PrisonBehavior.h -# Include/GameLogic/Module/PrisonDockUpdate.h + Include/GameLogic/Module/PrisonDockUpdate.h # Include/GameLogic/Module/ProductionUpdate.h # Include/GameLogic/Module/ProjectileStreamUpdate.h -# Include/GameLogic/Module/ProneUpdate.h -# Include/GameLogic/Module/PropagandaCenterBehavior.h + Include/GameLogic/Module/ProneUpdate.h + Include/GameLogic/Module/PropagandaCenterBehavior.h # Include/GameLogic/Module/PropagandaTowerBehavior.h -# Include/GameLogic/Module/QueueProductionExitUpdate.h -# Include/GameLogic/Module/RadarUpdate.h -# Include/GameLogic/Module/RadarUpgrade.h -# Include/GameLogic/Module/RadiusDecalUpdate.h -# Include/GameLogic/Module/RailedTransportAIUpdate.h -# Include/GameLogic/Module/RailedTransportContain.h + Include/GameLogic/Module/QueueProductionExitUpdate.h + Include/GameLogic/Module/RadarUpdate.h + Include/GameLogic/Module/RadarUpgrade.h + Include/GameLogic/Module/RadiusDecalUpdate.h + Include/GameLogic/Module/RailedTransportAIUpdate.h + Include/GameLogic/Module/RailedTransportContain.h # Include/GameLogic/Module/RailedTransportDockUpdate.h # Include/GameLogic/Module/RailroadGuideAIUpdate.h # Include/GameLogic/Module/RebuildHoleBehavior.h # Include/GameLogic/Module/RebuildHoleExposeDie.h -# Include/GameLogic/Module/RepairDockUpdate.h + Include/GameLogic/Module/RepairDockUpdate.h # Include/GameLogic/Module/ReplaceObjectUpgrade.h # Include/GameLogic/Module/RiderChangeContain.h # Include/GameLogic/Module/SabotageCommandCenterCrateCollide.h @@ -421,62 +421,62 @@ set(GAMEENGINE_SRC # Include/GameLogic/Module/SabotageSupplyCenterCrateCollide.h # Include/GameLogic/Module/SabotageSupplyDropzoneCrateCollide.h # Include/GameLogic/Module/SalvageCrateCollide.h -# Include/GameLogic/Module/ShroudCrateCollide.h + Include/GameLogic/Module/ShroudCrateCollide.h # Include/GameLogic/Module/SlavedUpdate.h # Include/GameLogic/Module/SlowDeathBehavior.h # Include/GameLogic/Module/SmartBombTargetHomingUpdate.h # Include/GameLogic/Module/SpawnBehavior.h -# Include/GameLogic/Module/SpawnPointProductionExitUpdate.h -# Include/GameLogic/Module/SpecialAbility.h + Include/GameLogic/Module/SpawnPointProductionExitUpdate.h + Include/GameLogic/Module/SpecialAbility.h # Include/GameLogic/Module/SpecialAbilityUpdate.h -# Include/GameLogic/Module/SpecialPowerCompletionDie.h -# Include/GameLogic/Module/SpecialPowerCreate.h + Include/GameLogic/Module/SpecialPowerCompletionDie.h + Include/GameLogic/Module/SpecialPowerCreate.h # Include/GameLogic/Module/SpecialPowerModule.h # Include/GameLogic/Module/SpecialPowerUpdateModule.h # Include/GameLogic/Module/SpectreGunshipDeploymentUpdate.h # Include/GameLogic/Module/SpectreGunshipUpdate.h -# Include/GameLogic/Module/SpyVisionSpecialPower.h + Include/GameLogic/Module/SpyVisionSpecialPower.h # Include/GameLogic/Module/SpyVisionUpdate.h -# Include/GameLogic/Module/SquishCollide.h -# Include/GameLogic/Module/StatusBitsUpgrade.h + Include/GameLogic/Module/SquishCollide.h + Include/GameLogic/Module/StatusBitsUpgrade.h # Include/GameLogic/Module/StatusDamageHelper.h # Include/GameLogic/Module/StealthDetectorUpdate.h # Include/GameLogic/Module/StealthUpdate.h # Include/GameLogic/Module/StealthUpgrade.h # Include/GameLogic/Module/StickyBombUpdate.h -# Include/GameLogic/Module/StructureBody.h + Include/GameLogic/Module/StructureBody.h # Include/GameLogic/Module/StructureCollapseUpdate.h # Include/GameLogic/Module/StructureToppleUpdate.h # Include/GameLogic/Module/SubdualDamageHelper.h -# Include/GameLogic/Module/SubObjectsUpgrade.h -# Include/GameLogic/Module/SupplyCenterCreate.h + Include/GameLogic/Module/SubObjectsUpgrade.h + Include/GameLogic/Module/SupplyCenterCreate.h # Include/GameLogic/Module/SupplyCenterDockUpdate.h # Include/GameLogic/Module/SupplyCenterProductionExitUpdate.h # Include/GameLogic/Module/SupplyTruckAIUpdate.h -# Include/GameLogic/Module/SupplyWarehouseCreate.h -# Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h -# Include/GameLogic/Module/SupplyWarehouseDockUpdate.h + Include/GameLogic/Module/SupplyWarehouseCreate.h + Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h + Include/GameLogic/Module/SupplyWarehouseDockUpdate.h # Include/GameLogic/Module/TechBuildingBehavior.h # Include/GameLogic/Module/TempWeaponBonusHelper.h -# Include/GameLogic/Module/TensileFormationUpdate.h + Include/GameLogic/Module/TensileFormationUpdate.h # Include/GameLogic/Module/ToppleUpdate.h # Include/GameLogic/Module/TransitionDamageFX.h # Include/GameLogic/Module/TransportAIUpdate.h # Include/GameLogic/Module/TransportContain.h # Include/GameLogic/Module/TunnelContain.h # Include/GameLogic/Module/UndeadBody.h -# Include/GameLogic/Module/UnitCrateCollide.h -# Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h + Include/GameLogic/Module/UnitCrateCollide.h + Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h # Include/GameLogic/Module/UpdateModule.h -# Include/GameLogic/Module/UpgradeDie.h + Include/GameLogic/Module/UpgradeDie.h # Include/GameLogic/Module/UpgradeModule.h -# Include/GameLogic/Module/VeterancyCrateCollide.h -# Include/GameLogic/Module/VeterancyGainCreate.h -# Include/GameLogic/Module/WanderAIUpdate.h + Include/GameLogic/Module/VeterancyCrateCollide.h + Include/GameLogic/Module/VeterancyGainCreate.h + Include/GameLogic/Module/WanderAIUpdate.h # Include/GameLogic/Module/WaveGuideUpdate.h # Include/GameLogic/Module/WeaponBonusUpdate.h -# Include/GameLogic/Module/WeaponBonusUpgrade.h -# Include/GameLogic/Module/WeaponSetUpgrade.h + Include/GameLogic/Module/WeaponBonusUpgrade.h + Include/GameLogic/Module/WeaponSetUpgrade.h # Include/GameLogic/Module/WorkerAIUpdate.h # Include/GameLogic/Object.h # Include/GameLogic/ObjectCreationList.h @@ -492,7 +492,7 @@ set(GAMEENGINE_SRC # Include/GameLogic/ScriptEngine.h # Include/GameLogic/Scripts.h # Include/GameLogic/SidesList.h -# Include/GameLogic/Squad.h + Include/GameLogic/Squad.h # Include/GameLogic/TerrainLogic.h # Include/GameLogic/TurretAI.h # Include/GameLogic/VictoryConditions.h @@ -565,16 +565,16 @@ set(GAMEENGINE_SRC Source/Common/Audio/GameSounds.cpp #Source/Common/Audio/simpleplayer.cpp # unused #Source/Common/Audio/urllaunch.cpp # unused -# Source/Common/Bezier/BezFwdIterator.cpp -# Source/Common/Bezier/BezierSegment.cpp + Source/Common/Bezier/BezFwdIterator.cpp + Source/Common/Bezier/BezierSegment.cpp # Source/Common/BitFlags.cpp # Source/Common/CommandLine.cpp Source/Common/crc.cpp Source/Common/CRCDebug.cpp -# Source/Common/DamageFX.cpp + Source/Common/DamageFX.cpp Source/Common/Diagnostic/SimulationMathCrc.cpp -# Source/Common/Dict.cpp -# Source/Common/DiscreteCircle.cpp + Source/Common/Dict.cpp + Source/Common/DiscreteCircle.cpp Source/Common/FramePacer.cpp Source/Common/FrameRateLimit.cpp # Source/Common/GameEngine.cpp @@ -610,30 +610,30 @@ set(GAMEENGINE_SRC # Source/Common/INI/INIWater.cpp # Source/Common/INI/INIWeapon.cpp # Source/Common/INI/INIWebpageURL.cpp -# Source/Common/Language.cpp + Source/Common/Language.cpp # Source/Common/MessageStream.cpp -# Source/Common/MiniLog.cpp + Source/Common/MiniLog.cpp # Source/Common/MultiplayerSettings.cpp # Source/Common/NameKeyGenerator.cpp Source/Common/OptionPreferences.cpp # Source/Common/PartitionSolver.cpp -# Source/Common/PerfTimer.cpp + Source/Common/PerfTimer.cpp Source/Common/RandomValue.cpp # Source/Common/Recorder.cpp Source/Common/ReplaySimulation.cpp Source/Common/RTS/AcademyStats.cpp # Source/Common/RTS/ActionManager.cpp # Source/Common/RTS/Energy.cpp -# Source/Common/RTS/Handicap.cpp -# Source/Common/RTS/MissionStats.cpp + Source/Common/RTS/Handicap.cpp + Source/Common/RTS/MissionStats.cpp # Source/Common/RTS/Money.cpp # Source/Common/RTS/Player.cpp -# Source/Common/RTS/PlayerList.cpp + Source/Common/RTS/PlayerList.cpp # Source/Common/RTS/PlayerTemplate.cpp # Source/Common/RTS/ProductionPrerequisite.cpp # Source/Common/RTS/ResourceGatheringManager.cpp -# Source/Common/RTS/Science.cpp -# Source/Common/RTS/ScoreKeeper.cpp + Source/Common/RTS/Science.cpp + Source/Common/RTS/ScoreKeeper.cpp # Source/Common/RTS/SpecialPower.cpp # Source/Common/RTS/Team.cpp # Source/Common/RTS/TunnelTracker.cpp @@ -644,12 +644,12 @@ set(GAMEENGINE_SRC Source/Common/System/ArchiveFileSystem.cpp Source/Common/System/AsciiString.cpp # Source/Common/System/BuildAssistant.cpp -# Source/Common/System/CriticalSection.cpp -# Source/Common/System/DataChunk.cpp + Source/Common/System/CriticalSection.cpp + Source/Common/System/DataChunk.cpp Source/Common/System/Debug.cpp -# Source/Common/System/Directory.cpp -# Source/Common/System/DisabledTypes.cpp -# Source/Common/System/encrypt.cpp + Source/Common/System/Directory.cpp + Source/Common/System/DisabledTypes.cpp + Source/Common/System/encrypt.cpp Source/Common/System/File.cpp Source/Common/System/FileSystem.cpp # Source/Common/System/FunctionLexicon.cpp @@ -657,31 +657,31 @@ set(GAMEENGINE_SRC #Source/Common/System/GameMemory.cpp # is conditionally appended #Source/Common/System/GameMemoryInit.cpp # is conditionally appended Source/Common/System/GameType.cpp -# Source/Common/System/Geometry.cpp -# Source/Common/System/KindOf.cpp -# Source/Common/System/List.cpp + Source/Common/System/Geometry.cpp + Source/Common/System/KindOf.cpp + Source/Common/System/List.cpp Source/Common/System/LocalFile.cpp Source/Common/System/LocalFileSystem.cpp Source/Common/System/MiniDumper.cpp Source/Common/System/ObjectStatusTypes.cpp -# Source/Common/System/QuotedPrintable.cpp + Source/Common/System/QuotedPrintable.cpp Source/Common/System/Radar.cpp Source/Common/System/RAMFile.cpp # Source/Common/System/registry.cpp # Source/Common/System/SaveGame/GameState.cpp # Source/Common/System/SaveGame/GameStateMap.cpp Source/Common/System/Snapshot.cpp -# Source/Common/System/StackDump.cpp + Source/Common/System/StackDump.cpp Source/Common/System/StreamingArchiveFile.cpp Source/Common/System/SubsystemInterface.cpp # Source/Common/System/Trig.cpp Source/Common/System/UnicodeString.cpp -# Source/Common/System/Upgrade.cpp + Source/Common/System/Upgrade.cpp Source/Common/System/Xfer.cpp Source/Common/System/XferCRC.cpp Source/Common/System/XferLoad.cpp Source/Common/System/XferSave.cpp -# Source/Common/TerrainTypes.cpp + Source/Common/TerrainTypes.cpp # Source/Common/Thing/DrawModule.cpp # Source/Common/Thing/Module.cpp # Source/Common/Thing/ModuleFactory.cpp @@ -689,7 +689,7 @@ set(GAMEENGINE_SRC # Source/Common/Thing/ThingFactory.cpp # Source/Common/Thing/ThingTemplate.cpp Source/Common/UserPreferences.cpp -# Source/Common/version.cpp + Source/Common/version.cpp Source/Common/WorkerProcess.cpp Source/GameClient/ClientInstance.cpp Source/GameClient/Color.cpp @@ -724,7 +724,7 @@ set(GAMEENGINE_SRC Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp # Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp -# Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp + Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp Source/GameClient/GUI/Gadget/GadgetComboBox.cpp Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp @@ -745,8 +745,8 @@ set(GAMEENGINE_SRC # Source/GameClient/GUI/GameWindowTransitionsStyles.cpp Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp -# Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp -# Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp + Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp + Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp # Source/GameClient/GUI/GUICallbacks/GeneralsExpPoints.cpp # Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp # Source/GameClient/GUI/GUICallbacks/InGameChat.cpp @@ -757,7 +757,7 @@ set(GAMEENGINE_SRC # Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp # Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp # Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp -# Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp + Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp # Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp # Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp # Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp @@ -792,14 +792,14 @@ set(GAMEENGINE_SRC # Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp # Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp # Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp -# Source/GameClient/GUI/GUICallbacks/MessageBox.cpp + Source/GameClient/GUI/GUICallbacks/MessageBox.cpp # Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp Source/GameClient/GUI/HeaderTemplate.cpp Source/GameClient/GUI/IMEManager.cpp Source/GameClient/GUI/LoadScreen.cpp Source/GameClient/GUI/ProcessAnimateWindow.cpp # Source/GameClient/GUI/Shell/Shell.cpp -# Source/GameClient/GUI/Shell/ShellMenuScheme.cpp + Source/GameClient/GUI/Shell/ShellMenuScheme.cpp Source/GameClient/GUI/WindowLayout.cpp Source/GameClient/GUI/WindowVideoManager.cpp Source/GameClient/GUI/WinInstanceData.cpp @@ -838,7 +838,7 @@ set(GAMEENGINE_SRC Source/GameClient/View.cpp Source/GameClient/Water.cpp # Source/GameLogic/AI/AI.cpp -# Source/GameLogic/AI/AIDock.cpp + Source/GameLogic/AI/AIDock.cpp # Source/GameLogic/AI/AIGroup.cpp # Source/GameLogic/AI/AIGuard.cpp # Source/GameLogic/AI/AIGuardRetaliate.cpp @@ -847,7 +847,7 @@ set(GAMEENGINE_SRC # Source/GameLogic/AI/AISkirmishPlayer.cpp # Source/GameLogic/AI/AIStates.cpp # Source/GameLogic/AI/AITNGuard.cpp -# Source/GameLogic/AI/Squad.cpp + Source/GameLogic/AI/Squad.cpp # Source/GameLogic/AI/TurretAI.cpp # Source/GameLogic/Map/PolygonTrigger.cpp # Source/GameLogic/Map/SidesList.cpp @@ -857,8 +857,8 @@ set(GAMEENGINE_SRC # Source/GameLogic/Object/Behavior/BattleBusSlowDeathBehavior.cpp # Source/GameLogic/Object/Behavior/BehaviorModule.cpp # Source/GameLogic/Object/Behavior/BridgeBehavior.cpp -# Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp -# Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp + Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp + Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp # Source/GameLogic/Object/Behavior/BunkerBusterBehavior.cpp # Source/GameLogic/Object/Behavior/CountermeasuresBehavior.cpp # Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp @@ -867,35 +867,35 @@ set(GAMEENGINE_SRC # Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp # Source/GameLogic/Object/Behavior/GenerateMinefieldBehavior.cpp # Source/GameLogic/Object/Behavior/GrantStealthBehavior.cpp -# Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp + Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp # Source/GameLogic/Object/Behavior/JetSlowDeathBehavior.cpp # Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp # Source/GameLogic/Object/Behavior/NeutonBlastBehavior.cpp -# Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp + Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp # Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp # Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp -# Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp + Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp # Source/GameLogic/Object/Behavior/PrisonBehavior.cpp -# Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp + Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp # Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp # Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp # Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp # Source/GameLogic/Object/Behavior/SpawnBehavior.cpp -# Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp + Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp # Source/GameLogic/Object/Behavior/TechBuildingBehavior.cpp # Source/GameLogic/Object/Body/ActiveBody.cpp # Source/GameLogic/Object/Body/BodyModule.cpp -# Source/GameLogic/Object/Body/HighlanderBody.cpp + Source/GameLogic/Object/Body/HighlanderBody.cpp # Source/GameLogic/Object/Body/HiveStructureBody.cpp -# Source/GameLogic/Object/Body/ImmortalBody.cpp + Source/GameLogic/Object/Body/ImmortalBody.cpp # Source/GameLogic/Object/Body/InactiveBody.cpp -# Source/GameLogic/Object/Body/StructureBody.cpp + Source/GameLogic/Object/Body/StructureBody.cpp # Source/GameLogic/Object/Body/UndeadBody.cpp # Source/GameLogic/Object/Collide/CollideModule.cpp # Source/GameLogic/Object/Collide/CrateCollide/ConvertToCarBombCrateCollide.cpp # Source/GameLogic/Object/Collide/CrateCollide/ConvertToHijackedVehicleCrateCollide.cpp # Source/GameLogic/Object/Collide/CrateCollide/CrateCollide.cpp -# Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp + Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp # Source/GameLogic/Object/Collide/CrateCollide/MoneyCrateCollide.cpp # Source/GameLogic/Object/Collide/CrateCollide/SabotageCommandCenterCrateCollide.cpp # Source/GameLogic/Object/Collide/CrateCollide/SabotageFakeBuilding.cpp @@ -906,56 +906,56 @@ set(GAMEENGINE_SRC # Source/GameLogic/Object/Collide/CrateCollide/SabotageSupplyCenterCrateCollide.cpp # Source/GameLogic/Object/Collide/CrateCollide/SabotageSupplyDropzoneCrateCollide.cpp # Source/GameLogic/Object/Collide/CrateCollide/SalvageCrateCollide.cpp -# Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp -# Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp -# Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp -# Source/GameLogic/Object/Collide/FireWeaponCollide.cpp -# Source/GameLogic/Object/Collide/SquishCollide.cpp + Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp + Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp + Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp + Source/GameLogic/Object/Collide/FireWeaponCollide.cpp + Source/GameLogic/Object/Collide/SquishCollide.cpp # Source/GameLogic/Object/Contain/CaveContain.cpp # Source/GameLogic/Object/Contain/GarrisonContain.cpp -# Source/GameLogic/Object/Contain/HealContain.cpp + Source/GameLogic/Object/Contain/HealContain.cpp # Source/GameLogic/Object/Contain/HelixContain.cpp # Source/GameLogic/Object/Contain/InternetHackContain.cpp # Source/GameLogic/Object/Contain/MobNexusContain.cpp # Source/GameLogic/Object/Contain/OpenContain.cpp # Source/GameLogic/Object/Contain/OverlordContain.cpp # Source/GameLogic/Object/Contain/ParachuteContain.cpp -# Source/GameLogic/Object/Contain/RailedTransportContain.cpp + Source/GameLogic/Object/Contain/RailedTransportContain.cpp # Source/GameLogic/Object/Contain/RiderChangeContain.cpp # Source/GameLogic/Object/Contain/TransportContain.cpp # Source/GameLogic/Object/Contain/TunnelContain.cpp -# Source/GameLogic/Object/Create/CreateModule.cpp + Source/GameLogic/Object/Create/CreateModule.cpp # Source/GameLogic/Object/Create/GrantUpgradeCreate.cpp # Source/GameLogic/Object/Create/LockWeaponCreate.cpp -# Source/GameLogic/Object/Create/PreorderCreate.cpp -# Source/GameLogic/Object/Create/SpecialPowerCreate.cpp -# Source/GameLogic/Object/Create/SupplyCenterCreate.cpp -# Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp -# Source/GameLogic/Object/Create/VeterancyGainCreate.cpp -# Source/GameLogic/Object/Damage/BoneFXDamage.cpp -# Source/GameLogic/Object/Damage/DamageModule.cpp + Source/GameLogic/Object/Create/PreorderCreate.cpp + Source/GameLogic/Object/Create/SpecialPowerCreate.cpp + Source/GameLogic/Object/Create/SupplyCenterCreate.cpp + Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp + Source/GameLogic/Object/Create/VeterancyGainCreate.cpp + Source/GameLogic/Object/Damage/BoneFXDamage.cpp + Source/GameLogic/Object/Damage/DamageModule.cpp # Source/GameLogic/Object/Damage/TransitionDamageFX.cpp -# Source/GameLogic/Object/Destroy/DestroyModule.cpp -# Source/GameLogic/Object/Die/CreateCrateDie.cpp + Source/GameLogic/Object/Destroy/DestroyModule.cpp + Source/GameLogic/Object/Die/CreateCrateDie.cpp # Source/GameLogic/Object/Die/CreateObjectDie.cpp -# Source/GameLogic/Object/Die/CrushDie.cpp -# Source/GameLogic/Object/Die/DamDie.cpp + Source/GameLogic/Object/Die/CrushDie.cpp + Source/GameLogic/Object/Die/DamDie.cpp # Source/GameLogic/Object/Die/DestroyDie.cpp -# Source/GameLogic/Object/Die/DieModule.cpp -# Source/GameLogic/Object/Die/EjectPilotDie.cpp + Source/GameLogic/Object/Die/DieModule.cpp + Source/GameLogic/Object/Die/EjectPilotDie.cpp # Source/GameLogic/Object/Die/FXListDie.cpp -# Source/GameLogic/Object/Die/KeepObjectDie.cpp + Source/GameLogic/Object/Die/KeepObjectDie.cpp # Source/GameLogic/Object/Die/RebuildHoleExposeDie.cpp -# Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp -# Source/GameLogic/Object/Die/UpgradeDie.cpp + Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp + Source/GameLogic/Object/Die/UpgradeDie.cpp # Source/GameLogic/Object/ExperienceTracker.cpp # Source/GameLogic/Object/FiringTracker.cpp # Source/GameLogic/Object/GhostObject.cpp -# Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp -# Source/GameLogic/Object/Helper/ObjectHelper.cpp -# Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp -# Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp -# Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp + Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp + Source/GameLogic/Object/Helper/ObjectHelper.cpp + Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp + Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp + Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp # Source/GameLogic/Object/Helper/StatusDamageHelper.cpp # Source/GameLogic/Object/Helper/SubdualDamageHelper.cpp # Source/GameLogic/Object/Helper/TempWeaponBonusHelper.cpp @@ -973,9 +973,9 @@ set(GAMEENGINE_SRC # Source/GameLogic/Object/SpecialPower/DemoralizeSpecialPower.cpp # Source/GameLogic/Object/SpecialPower/FireWeaponPower.cpp # Source/GameLogic/Object/SpecialPower/OCLSpecialPower.cpp -# Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp + Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp # Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp -# Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp + Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp # Source/GameLogic/Object/Update/AIUpdate.cpp # Source/GameLogic/Object/Update/AIUpdate/AssaultTransportAIUpdate.cpp # Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -985,12 +985,12 @@ set(GAMEENGINE_SRC # Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp # Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp # Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp -# Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp -# Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp + Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp + Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp # Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp # Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp # Source/GameLogic/Object/Update/AIUpdate/TransportAIUpdate.cpp -# Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp + Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp # Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp # Source/GameLogic/Object/Update/AnimationSteeringUpdate.cpp # Source/GameLogic/Object/Update/AssistedTargetingUpdate.cpp @@ -999,52 +999,52 @@ set(GAMEENGINE_SRC # Source/GameLogic/Object/Update/BaseRenerateUpdate.cpp # Source/GameLogic/Object/Update/BattlePlanUpdate.cpp # Source/GameLogic/Object/Update/BoneFXUpdate.cpp -# Source/GameLogic/Object/Update/CheckpointUpdate.cpp -# Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp + Source/GameLogic/Object/Update/CheckpointUpdate.cpp + Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp # Source/GameLogic/Object/Update/CommandButtonHuntUpdate.cpp -# Source/GameLogic/Object/Update/DeletionUpdate.cpp + Source/GameLogic/Object/Update/DeletionUpdate.cpp # Source/GameLogic/Object/Update/DemoTrapUpdate.cpp # Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp -# Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp + Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp # Source/GameLogic/Object/Update/DockUpdate/RailedTransportDockUpdate.cpp -# Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp + Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp # Source/GameLogic/Object/Update/DockUpdate/SupplyCenterDockUpdate.cpp -# Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp -# Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp + Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp + Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp # Source/GameLogic/Object/Update/DynamicShroudClearingRangeUpdate.cpp # Source/GameLogic/Object/Update/EMPUpdate.cpp -# Source/GameLogic/Object/Update/EnemyNearUpdate.cpp + Source/GameLogic/Object/Update/EnemyNearUpdate.cpp # Source/GameLogic/Object/Update/FireOCLAfterWeaponCooldownUpdate.cpp -# Source/GameLogic/Object/Update/FireSpreadUpdate.cpp + Source/GameLogic/Object/Update/FireSpreadUpdate.cpp # Source/GameLogic/Object/Update/FirestormDynamicGeometryInfoUpdate.cpp # Source/GameLogic/Object/Update/FireWeaponUpdate.cpp -# Source/GameLogic/Object/Update/FlammableUpdate.cpp -# Source/GameLogic/Object/Update/FloatUpdate.cpp -# Source/GameLogic/Object/Update/HeightDieUpdate.cpp + Source/GameLogic/Object/Update/FlammableUpdate.cpp + Source/GameLogic/Object/Update/FloatUpdate.cpp + Source/GameLogic/Object/Update/HeightDieUpdate.cpp # Source/GameLogic/Object/Update/HelicopterSlowDeathUpdate.cpp -# Source/GameLogic/Object/Update/HijackerUpdate.cpp + Source/GameLogic/Object/Update/HijackerUpdate.cpp # Source/GameLogic/Object/Update/HordeUpdate.cpp # Source/GameLogic/Object/Update/LaserUpdate.cpp -# Source/GameLogic/Object/Update/LifetimeUpdate.cpp + Source/GameLogic/Object/Update/LifetimeUpdate.cpp # Source/GameLogic/Object/Update/MissileLauncherBuildingUpdate.cpp -# Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp -# Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp + Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp + Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp # Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp # Source/GameLogic/Object/Update/OCLUpdate.cpp # Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp # Source/GameLogic/Object/Update/PhysicsUpdate.cpp -# Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp + Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp # Source/GameLogic/Object/Update/PointDefenseLaserUpdate.cpp -# Source/GameLogic/Object/Update/PowerPlantUpdate.cpp + Source/GameLogic/Object/Update/PowerPlantUpdate.cpp # Source/GameLogic/Object/Update/ProductionExitUpdate/DefaultProductionExitUpdate.cpp -# Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp -# Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp + Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp + Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp # Source/GameLogic/Object/Update/ProductionExitUpdate/SupplyCenterProductionExitUpdate.cpp # Source/GameLogic/Object/Update/ProductionUpdate.cpp # Source/GameLogic/Object/Update/ProjectileStreamUpdate.cpp -# Source/GameLogic/Object/Update/ProneUpdate.cpp -# Source/GameLogic/Object/Update/RadarUpdate.cpp -# Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp + Source/GameLogic/Object/Update/ProneUpdate.cpp + Source/GameLogic/Object/Update/RadarUpdate.cpp + Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp # Source/GameLogic/Object/Update/SlavedUpdate.cpp # Source/GameLogic/Object/Update/SmartBombTargetHomingUpdate.cpp # Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp @@ -1057,32 +1057,32 @@ set(GAMEENGINE_SRC # Source/GameLogic/Object/Update/StickyBombUpdate.cpp # Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp # Source/GameLogic/Object/Update/StructureToppleUpdate.cpp -# Source/GameLogic/Object/Update/TensileFormationUpdate.cpp + Source/GameLogic/Object/Update/TensileFormationUpdate.cpp # Source/GameLogic/Object/Update/ToppleUpdate.cpp # Source/GameLogic/Object/Update/UpdateModule.cpp # Source/GameLogic/Object/Update/WaveGuideUpdate.cpp # Source/GameLogic/Object/Update/WeaponBonusUpdate.cpp -# Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp + Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp # Source/GameLogic/Object/Upgrade/ArmorUpgrade.cpp # Source/GameLogic/Object/Upgrade/CommandSetUpgrade.cpp -# Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp -# Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp + Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp + Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp # Source/GameLogic/Object/Upgrade/GrantScienceUpgrade.cpp -# Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp -# Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp + Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp + Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp # Source/GameLogic/Object/Upgrade/ModelConditionUpgrade.cpp -# Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp + Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp # Source/GameLogic/Object/Upgrade/PassengersFireUpgrade.cpp -# Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp -# Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp + Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp + Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp # Source/GameLogic/Object/Upgrade/ReplaceObjectUpgrade.cpp -# Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp + Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp # Source/GameLogic/Object/Upgrade/StealthUpgrade.cpp -# Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp -# Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp + Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp + Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp # Source/GameLogic/Object/Upgrade/UpgradeModule.cpp -# Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp -# Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp + Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp + Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp # Source/GameLogic/Object/Weapon.cpp # Source/GameLogic/Object/WeaponSet.cpp # Source/GameLogic/ScriptEngine/ScriptActions.cpp diff --git a/GeneralsMD/Code/GameEngine/Include/Common/BezFwdIterator.h b/Core/GameEngine/Include/Common/BezFwdIterator.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/BezFwdIterator.h rename to Core/GameEngine/Include/Common/BezFwdIterator.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/BezierSegment.h b/Core/GameEngine/Include/Common/BezierSegment.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/BezierSegment.h rename to Core/GameEngine/Include/Common/BezierSegment.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h b/Core/GameEngine/Include/Common/CriticalSection.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h rename to Core/GameEngine/Include/Common/CriticalSection.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/DamageFX.h b/Core/GameEngine/Include/Common/DamageFX.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/DamageFX.h rename to Core/GameEngine/Include/Common/DamageFX.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/DataChunk.h b/Core/GameEngine/Include/Common/DataChunk.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/DataChunk.h rename to Core/GameEngine/Include/Common/DataChunk.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Dict.h b/Core/GameEngine/Include/Common/Dict.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/Dict.h rename to Core/GameEngine/Include/Common/Dict.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Directory.h b/Core/GameEngine/Include/Common/Directory.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/Directory.h rename to Core/GameEngine/Include/Common/Directory.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/DisabledTypes.h b/Core/GameEngine/Include/Common/DisabledTypes.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/DisabledTypes.h rename to Core/GameEngine/Include/Common/DisabledTypes.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/DiscreteCircle.h b/Core/GameEngine/Include/Common/DiscreteCircle.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/DiscreteCircle.h rename to Core/GameEngine/Include/Common/DiscreteCircle.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Geometry.h b/Core/GameEngine/Include/Common/Geometry.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/Geometry.h rename to Core/GameEngine/Include/Common/Geometry.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Handicap.h b/Core/GameEngine/Include/Common/Handicap.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/Handicap.h rename to Core/GameEngine/Include/Common/Handicap.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h b/Core/GameEngine/Include/Common/KindOf.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/KindOf.h rename to Core/GameEngine/Include/Common/KindOf.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Language.h b/Core/GameEngine/Include/Common/Language.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/Language.h rename to Core/GameEngine/Include/Common/Language.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/List.h b/Core/GameEngine/Include/Common/List.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/List.h rename to Core/GameEngine/Include/Common/List.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MiniLog.h b/Core/GameEngine/Include/Common/MiniLog.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/MiniLog.h rename to Core/GameEngine/Include/Common/MiniLog.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MissionStats.h b/Core/GameEngine/Include/Common/MissionStats.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/MissionStats.h rename to Core/GameEngine/Include/Common/MissionStats.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/PerfTimer.h b/Core/GameEngine/Include/Common/PerfTimer.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/PerfTimer.h rename to Core/GameEngine/Include/Common/PerfTimer.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/PlayerList.h b/Core/GameEngine/Include/Common/PlayerList.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/PlayerList.h rename to Core/GameEngine/Include/Common/PlayerList.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/QuotedPrintable.h b/Core/GameEngine/Include/Common/QuotedPrintable.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/QuotedPrintable.h rename to Core/GameEngine/Include/Common/QuotedPrintable.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Science.h b/Core/GameEngine/Include/Common/Science.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/Science.h rename to Core/GameEngine/Include/Common/Science.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/ScoreKeeper.h b/Core/GameEngine/Include/Common/ScoreKeeper.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/ScoreKeeper.h rename to Core/GameEngine/Include/Common/ScoreKeeper.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/StackDump.h b/Core/GameEngine/Include/Common/StackDump.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/StackDump.h rename to Core/GameEngine/Include/Common/StackDump.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/TerrainTypes.h b/Core/GameEngine/Include/Common/TerrainTypes.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/TerrainTypes.h rename to Core/GameEngine/Include/Common/TerrainTypes.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h b/Core/GameEngine/Include/Common/Upgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h rename to Core/GameEngine/Include/Common/Upgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/encrypt.h b/Core/GameEngine/Include/Common/encrypt.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/encrypt.h rename to Core/GameEngine/Include/Common/encrypt.h diff --git a/GeneralsMD/Code/GameEngine/Include/Common/version.h b/Core/GameEngine/Include/Common/version.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/Common/version.h rename to Core/GameEngine/Include/Common/version.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Diplomacy.h b/Core/GameEngine/Include/GameClient/Diplomacy.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/Diplomacy.h rename to Core/GameEngine/Include/GameClient/Diplomacy.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h b/Core/GameEngine/Include/GameClient/EstablishConnectionsMenu.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h rename to Core/GameEngine/Include/GameClient/EstablishConnectionsMenu.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h b/Core/GameEngine/Include/GameClient/ExtendedMessageBox.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h rename to Core/GameEngine/Include/GameClient/ExtendedMessageBox.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameInfoWindow.h b/Core/GameEngine/Include/GameClient/GameInfoWindow.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/GameInfoWindow.h rename to Core/GameEngine/Include/GameClient/GameInfoWindow.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/MessageBox.h b/Core/GameEngine/Include/GameClient/MessageBox.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/MessageBox.h rename to Core/GameEngine/Include/GameClient/MessageBox.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ShellMenuScheme.h b/Core/GameEngine/Include/GameClient/ShellMenuScheme.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/ShellMenuScheme.h rename to Core/GameEngine/Include/GameClient/ShellMenuScheme.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/AIDock.h b/Core/GameEngine/Include/GameLogic/AIDock.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/AIDock.h rename to Core/GameEngine/Include/GameLogic/AIDock.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/BoneFXDamage.h b/Core/GameEngine/Include/GameLogic/Module/BoneFXDamage.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/BoneFXDamage.h rename to Core/GameEngine/Include/GameLogic/Module/BoneFXDamage.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/BridgeScaffoldBehavior.h b/Core/GameEngine/Include/GameLogic/Module/BridgeScaffoldBehavior.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/BridgeScaffoldBehavior.h rename to Core/GameEngine/Include/GameLogic/Module/BridgeScaffoldBehavior.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h b/Core/GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h rename to Core/GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CheckpointUpdate.h b/Core/GameEngine/Include/GameLogic/Module/CheckpointUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CheckpointUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/CheckpointUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CleanupHazardUpdate.h b/Core/GameEngine/Include/GameLogic/Module/CleanupHazardUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CleanupHazardUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/CleanupHazardUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CreateCrateDie.h b/Core/GameEngine/Include/GameLogic/Module/CreateCrateDie.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CreateCrateDie.h rename to Core/GameEngine/Include/GameLogic/Module/CreateCrateDie.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CreateModule.h b/Core/GameEngine/Include/GameLogic/Module/CreateModule.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CreateModule.h rename to Core/GameEngine/Include/GameLogic/Module/CreateModule.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CrushDie.h b/Core/GameEngine/Include/GameLogic/Module/CrushDie.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/CrushDie.h rename to Core/GameEngine/Include/GameLogic/Module/CrushDie.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DamDie.h b/Core/GameEngine/Include/GameLogic/Module/DamDie.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DamDie.h rename to Core/GameEngine/Include/GameLogic/Module/DamDie.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DamageModule.h b/Core/GameEngine/Include/GameLogic/Module/DamageModule.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DamageModule.h rename to Core/GameEngine/Include/GameLogic/Module/DamageModule.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DeletionUpdate.h b/Core/GameEngine/Include/GameLogic/Module/DeletionUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DeletionUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/DeletionUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DestroyModule.h b/Core/GameEngine/Include/GameLogic/Module/DestroyModule.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DestroyModule.h rename to Core/GameEngine/Include/GameLogic/Module/DestroyModule.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DieModule.h b/Core/GameEngine/Include/GameLogic/Module/DieModule.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DieModule.h rename to Core/GameEngine/Include/GameLogic/Module/DieModule.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DynamicGeometryInfoUpdate.h b/Core/GameEngine/Include/GameLogic/Module/DynamicGeometryInfoUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DynamicGeometryInfoUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/DynamicGeometryInfoUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/EjectPilotDie.h b/Core/GameEngine/Include/GameLogic/Module/EjectPilotDie.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/EjectPilotDie.h rename to Core/GameEngine/Include/GameLogic/Module/EjectPilotDie.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/EnemyNearUpdate.h b/Core/GameEngine/Include/GameLogic/Module/EnemyNearUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/EnemyNearUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/EnemyNearUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h b/Core/GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FireWeaponCollide.h b/Core/GameEngine/Include/GameLogic/Module/FireWeaponCollide.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FireWeaponCollide.h rename to Core/GameEngine/Include/GameLogic/Module/FireWeaponCollide.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FlammableUpdate.h b/Core/GameEngine/Include/GameLogic/Module/FlammableUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FlammableUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/FlammableUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FloatUpdate.h b/Core/GameEngine/Include/GameLogic/Module/FloatUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/FloatUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/FloatUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HealContain.h b/Core/GameEngine/Include/GameLogic/Module/HealContain.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HealContain.h rename to Core/GameEngine/Include/GameLogic/Module/HealContain.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HealCrateCollide.h b/Core/GameEngine/Include/GameLogic/Module/HealCrateCollide.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HealCrateCollide.h rename to Core/GameEngine/Include/GameLogic/Module/HealCrateCollide.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HeightDieUpdate.h b/Core/GameEngine/Include/GameLogic/Module/HeightDieUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HeightDieUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/HeightDieUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HighlanderBody.h b/Core/GameEngine/Include/GameLogic/Module/HighlanderBody.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HighlanderBody.h rename to Core/GameEngine/Include/GameLogic/Module/HighlanderBody.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HijackerUpdate.h b/Core/GameEngine/Include/GameLogic/Module/HijackerUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/HijackerUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/HijackerUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ImmortalBody.h b/Core/GameEngine/Include/GameLogic/Module/ImmortalBody.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ImmortalBody.h rename to Core/GameEngine/Include/GameLogic/Module/ImmortalBody.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/InstantDeathBehavior.h b/Core/GameEngine/Include/GameLogic/Module/InstantDeathBehavior.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/InstantDeathBehavior.h rename to Core/GameEngine/Include/GameLogic/Module/InstantDeathBehavior.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/KeepObjectDie.h b/Core/GameEngine/Include/GameLogic/Module/KeepObjectDie.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/KeepObjectDie.h rename to Core/GameEngine/Include/GameLogic/Module/KeepObjectDie.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/LifetimeUpdate.h b/Core/GameEngine/Include/GameLogic/Module/LifetimeUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/LifetimeUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/LifetimeUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/MobMemberSlavedUpdate.h b/Core/GameEngine/Include/GameLogic/Module/MobMemberSlavedUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/MobMemberSlavedUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/MobMemberSlavedUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h b/Core/GameEngine/Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectDefectionHelper.h b/Core/GameEngine/Include/GameLogic/Module/ObjectDefectionHelper.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectDefectionHelper.h rename to Core/GameEngine/Include/GameLogic/Module/ObjectDefectionHelper.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectHelper.h b/Core/GameEngine/Include/GameLogic/Module/ObjectHelper.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectHelper.h rename to Core/GameEngine/Include/GameLogic/Module/ObjectHelper.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectRepulsorHelper.h b/Core/GameEngine/Include/GameLogic/Module/ObjectRepulsorHelper.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectRepulsorHelper.h rename to Core/GameEngine/Include/GameLogic/Module/ObjectRepulsorHelper.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectSMCHelper.h b/Core/GameEngine/Include/GameLogic/Module/ObjectSMCHelper.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectSMCHelper.h rename to Core/GameEngine/Include/GameLogic/Module/ObjectSMCHelper.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectWeaponStatusHelper.h b/Core/GameEngine/Include/GameLogic/Module/ObjectWeaponStatusHelper.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ObjectWeaponStatusHelper.h rename to Core/GameEngine/Include/GameLogic/Module/ObjectWeaponStatusHelper.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/OverchargeBehavior.h b/Core/GameEngine/Include/GameLogic/Module/OverchargeBehavior.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/OverchargeBehavior.h rename to Core/GameEngine/Include/GameLogic/Module/OverchargeBehavior.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/POWTruckAIUpdate.h b/Core/GameEngine/Include/GameLogic/Module/POWTruckAIUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/POWTruckAIUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/POWTruckAIUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/POWTruckBehavior.h b/Core/GameEngine/Include/GameLogic/Module/POWTruckBehavior.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/POWTruckBehavior.h rename to Core/GameEngine/Include/GameLogic/Module/POWTruckBehavior.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PilotFindVehicleUpdate.h b/Core/GameEngine/Include/GameLogic/Module/PilotFindVehicleUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PilotFindVehicleUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/PilotFindVehicleUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h b/Core/GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PreorderCreate.h b/Core/GameEngine/Include/GameLogic/Module/PreorderCreate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PreorderCreate.h rename to Core/GameEngine/Include/GameLogic/Module/PreorderCreate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PrisonDockUpdate.h b/Core/GameEngine/Include/GameLogic/Module/PrisonDockUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PrisonDockUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/PrisonDockUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ProneUpdate.h b/Core/GameEngine/Include/GameLogic/Module/ProneUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ProneUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/ProneUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h b/Core/GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h rename to Core/GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h b/Core/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RadarUpdate.h b/Core/GameEngine/Include/GameLogic/Module/RadarUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RadarUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/RadarUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RadarUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/RadarUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RadarUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/RadarUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RadiusDecalUpdate.h b/Core/GameEngine/Include/GameLogic/Module/RadiusDecalUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RadiusDecalUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/RadiusDecalUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RailedTransportAIUpdate.h b/Core/GameEngine/Include/GameLogic/Module/RailedTransportAIUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RailedTransportAIUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/RailedTransportAIUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RailedTransportContain.h b/Core/GameEngine/Include/GameLogic/Module/RailedTransportContain.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RailedTransportContain.h rename to Core/GameEngine/Include/GameLogic/Module/RailedTransportContain.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RepairDockUpdate.h b/Core/GameEngine/Include/GameLogic/Module/RepairDockUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RepairDockUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/RepairDockUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ShroudCrateCollide.h b/Core/GameEngine/Include/GameLogic/Module/ShroudCrateCollide.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ShroudCrateCollide.h rename to Core/GameEngine/Include/GameLogic/Module/ShroudCrateCollide.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpawnPointProductionExitUpdate.h b/Core/GameEngine/Include/GameLogic/Module/SpawnPointProductionExitUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpawnPointProductionExitUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/SpawnPointProductionExitUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpecialAbility.h b/Core/GameEngine/Include/GameLogic/Module/SpecialAbility.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpecialAbility.h rename to Core/GameEngine/Include/GameLogic/Module/SpecialAbility.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCompletionDie.h b/Core/GameEngine/Include/GameLogic/Module/SpecialPowerCompletionDie.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCompletionDie.h rename to Core/GameEngine/Include/GameLogic/Module/SpecialPowerCompletionDie.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCreate.h b/Core/GameEngine/Include/GameLogic/Module/SpecialPowerCreate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCreate.h rename to Core/GameEngine/Include/GameLogic/Module/SpecialPowerCreate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpyVisionSpecialPower.h b/Core/GameEngine/Include/GameLogic/Module/SpyVisionSpecialPower.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpyVisionSpecialPower.h rename to Core/GameEngine/Include/GameLogic/Module/SpyVisionSpecialPower.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SquishCollide.h b/Core/GameEngine/Include/GameLogic/Module/SquishCollide.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SquishCollide.h rename to Core/GameEngine/Include/GameLogic/Module/SquishCollide.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/StructureBody.h b/Core/GameEngine/Include/GameLogic/Module/StructureBody.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/StructureBody.h rename to Core/GameEngine/Include/GameLogic/Module/StructureBody.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h b/Core/GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h rename to Core/GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCreate.h b/Core/GameEngine/Include/GameLogic/Module/SupplyWarehouseCreate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCreate.h rename to Core/GameEngine/Include/GameLogic/Module/SupplyWarehouseCreate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h b/Core/GameEngine/Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h rename to Core/GameEngine/Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h b/Core/GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/TensileFormationUpdate.h b/Core/GameEngine/Include/GameLogic/Module/TensileFormationUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/TensileFormationUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/TensileFormationUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnitCrateCollide.h b/Core/GameEngine/Include/GameLogic/Module/UnitCrateCollide.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnitCrateCollide.h rename to Core/GameEngine/Include/GameLogic/Module/UnitCrateCollide.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UpgradeDie.h b/Core/GameEngine/Include/GameLogic/Module/UpgradeDie.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UpgradeDie.h rename to Core/GameEngine/Include/GameLogic/Module/UpgradeDie.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/VeterancyCrateCollide.h b/Core/GameEngine/Include/GameLogic/Module/VeterancyCrateCollide.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/VeterancyCrateCollide.h rename to Core/GameEngine/Include/GameLogic/Module/VeterancyCrateCollide.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/VeterancyGainCreate.h b/Core/GameEngine/Include/GameLogic/Module/VeterancyGainCreate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/VeterancyGainCreate.h rename to Core/GameEngine/Include/GameLogic/Module/VeterancyGainCreate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/WanderAIUpdate.h b/Core/GameEngine/Include/GameLogic/Module/WanderAIUpdate.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/WanderAIUpdate.h rename to Core/GameEngine/Include/GameLogic/Module/WanderAIUpdate.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h b/Core/GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h rename to Core/GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Squad.h b/Core/GameEngine/Include/GameLogic/Squad.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameLogic/Squad.h rename to Core/GameEngine/Include/GameLogic/Squad.h diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Bezier/BezFwdIterator.cpp b/Core/GameEngine/Source/Common/Bezier/BezFwdIterator.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/Bezier/BezFwdIterator.cpp rename to Core/GameEngine/Source/Common/Bezier/BezFwdIterator.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Bezier/BezierSegment.cpp b/Core/GameEngine/Source/Common/Bezier/BezierSegment.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/Bezier/BezierSegment.cpp rename to Core/GameEngine/Source/Common/Bezier/BezierSegment.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/DamageFX.cpp b/Core/GameEngine/Source/Common/DamageFX.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/DamageFX.cpp rename to Core/GameEngine/Source/Common/DamageFX.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Dict.cpp b/Core/GameEngine/Source/Common/Dict.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/Dict.cpp rename to Core/GameEngine/Source/Common/Dict.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/DiscreteCircle.cpp b/Core/GameEngine/Source/Common/DiscreteCircle.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/DiscreteCircle.cpp rename to Core/GameEngine/Source/Common/DiscreteCircle.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Language.cpp b/Core/GameEngine/Source/Common/Language.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/Language.cpp rename to Core/GameEngine/Source/Common/Language.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/MiniLog.cpp b/Core/GameEngine/Source/Common/MiniLog.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/MiniLog.cpp rename to Core/GameEngine/Source/Common/MiniLog.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp b/Core/GameEngine/Source/Common/PerfTimer.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp rename to Core/GameEngine/Source/Common/PerfTimer.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Handicap.cpp b/Core/GameEngine/Source/Common/RTS/Handicap.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/RTS/Handicap.cpp rename to Core/GameEngine/Source/Common/RTS/Handicap.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/MissionStats.cpp b/Core/GameEngine/Source/Common/RTS/MissionStats.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/RTS/MissionStats.cpp rename to Core/GameEngine/Source/Common/RTS/MissionStats.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp b/Core/GameEngine/Source/Common/RTS/PlayerList.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp rename to Core/GameEngine/Source/Common/RTS/PlayerList.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Science.cpp b/Core/GameEngine/Source/Common/RTS/Science.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/RTS/Science.cpp rename to Core/GameEngine/Source/Common/RTS/Science.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp b/Core/GameEngine/Source/Common/RTS/ScoreKeeper.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp rename to Core/GameEngine/Source/Common/RTS/ScoreKeeper.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/CriticalSection.cpp b/Core/GameEngine/Source/Common/System/CriticalSection.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/System/CriticalSection.cpp rename to Core/GameEngine/Source/Common/System/CriticalSection.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp b/Core/GameEngine/Source/Common/System/DataChunk.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp rename to Core/GameEngine/Source/Common/System/DataChunk.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Directory.cpp b/Core/GameEngine/Source/Common/System/Directory.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/System/Directory.cpp rename to Core/GameEngine/Source/Common/System/Directory.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/DisabledTypes.cpp b/Core/GameEngine/Source/Common/System/DisabledTypes.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/System/DisabledTypes.cpp rename to Core/GameEngine/Source/Common/System/DisabledTypes.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Geometry.cpp b/Core/GameEngine/Source/Common/System/Geometry.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/System/Geometry.cpp rename to Core/GameEngine/Source/Common/System/Geometry.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp b/Core/GameEngine/Source/Common/System/KindOf.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp rename to Core/GameEngine/Source/Common/System/KindOf.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/List.cpp b/Core/GameEngine/Source/Common/System/List.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/System/List.cpp rename to Core/GameEngine/Source/Common/System/List.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/QuotedPrintable.cpp b/Core/GameEngine/Source/Common/System/QuotedPrintable.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/System/QuotedPrintable.cpp rename to Core/GameEngine/Source/Common/System/QuotedPrintable.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp b/Core/GameEngine/Source/Common/System/StackDump.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp rename to Core/GameEngine/Source/Common/System/StackDump.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Upgrade.cpp b/Core/GameEngine/Source/Common/System/Upgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/System/Upgrade.cpp rename to Core/GameEngine/Source/Common/System/Upgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/encrypt.cpp b/Core/GameEngine/Source/Common/System/encrypt.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/System/encrypt.cpp rename to Core/GameEngine/Source/Common/System/encrypt.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/TerrainTypes.cpp b/Core/GameEngine/Source/Common/TerrainTypes.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/TerrainTypes.cpp rename to Core/GameEngine/Source/Common/TerrainTypes.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/Common/version.cpp b/Core/GameEngine/Source/Common/version.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/Common/version.cpp rename to Core/GameEngine/Source/Common/version.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp rename to Core/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp b/Core/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp rename to Core/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIDock.cpp b/Core/GameEngine/Source/GameLogic/AI/AIDock.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIDock.cpp rename to Core/GameEngine/Source/GameLogic/AI/AIDock.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/Squad.cpp b/Core/GameEngine/Source/GameLogic/AI/Squad.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/AI/Squad.cpp rename to Core/GameEngine/Source/GameLogic/AI/Squad.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp b/Core/GameEngine/Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp rename to Core/GameEngine/Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp b/Core/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp rename to Core/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp b/Core/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp rename to Core/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp b/Core/GameEngine/Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp rename to Core/GameEngine/Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp b/Core/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp rename to Core/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp b/Core/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp rename to Core/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp b/Core/GameEngine/Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp rename to Core/GameEngine/Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/HighlanderBody.cpp b/Core/GameEngine/Source/GameLogic/Object/Body/HighlanderBody.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/HighlanderBody.cpp rename to Core/GameEngine/Source/GameLogic/Object/Body/HighlanderBody.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ImmortalBody.cpp b/Core/GameEngine/Source/GameLogic/Object/Body/ImmortalBody.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ImmortalBody.cpp rename to Core/GameEngine/Source/GameLogic/Object/Body/ImmortalBody.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/StructureBody.cpp b/Core/GameEngine/Source/GameLogic/Object/Body/StructureBody.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/StructureBody.cpp rename to Core/GameEngine/Source/GameLogic/Object/Body/StructureBody.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp b/Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp rename to Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp b/Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp rename to Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp b/Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp rename to Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp b/Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp rename to Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp b/Core/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp rename to Core/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/SquishCollide.cpp b/Core/GameEngine/Source/GameLogic/Object/Collide/SquishCollide.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/SquishCollide.cpp rename to Core/GameEngine/Source/GameLogic/Object/Collide/SquishCollide.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/HealContain.cpp b/Core/GameEngine/Source/GameLogic/Object/Contain/HealContain.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/HealContain.cpp rename to Core/GameEngine/Source/GameLogic/Object/Contain/HealContain.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/RailedTransportContain.cpp b/Core/GameEngine/Source/GameLogic/Object/Contain/RailedTransportContain.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/RailedTransportContain.cpp rename to Core/GameEngine/Source/GameLogic/Object/Contain/RailedTransportContain.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp b/Core/GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp rename to Core/GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp b/Core/GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp b/Core/GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp b/Core/GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp b/Core/GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp b/Core/GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Damage/BoneFXDamage.cpp b/Core/GameEngine/Source/GameLogic/Object/Damage/BoneFXDamage.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Damage/BoneFXDamage.cpp rename to Core/GameEngine/Source/GameLogic/Object/Damage/BoneFXDamage.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Damage/DamageModule.cpp b/Core/GameEngine/Source/GameLogic/Object/Damage/DamageModule.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Damage/DamageModule.cpp rename to Core/GameEngine/Source/GameLogic/Object/Damage/DamageModule.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Destroy/DestroyModule.cpp b/Core/GameEngine/Source/GameLogic/Object/Destroy/DestroyModule.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Destroy/DestroyModule.cpp rename to Core/GameEngine/Source/GameLogic/Object/Destroy/DestroyModule.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp b/Core/GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp rename to Core/GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp b/Core/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp rename to Core/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/DamDie.cpp b/Core/GameEngine/Source/GameLogic/Object/Die/DamDie.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/DamDie.cpp rename to Core/GameEngine/Source/GameLogic/Object/Die/DamDie.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/DieModule.cpp b/Core/GameEngine/Source/GameLogic/Object/Die/DieModule.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/DieModule.cpp rename to Core/GameEngine/Source/GameLogic/Object/Die/DieModule.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/EjectPilotDie.cpp b/Core/GameEngine/Source/GameLogic/Object/Die/EjectPilotDie.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/EjectPilotDie.cpp rename to Core/GameEngine/Source/GameLogic/Object/Die/EjectPilotDie.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/KeepObjectDie.cpp b/Core/GameEngine/Source/GameLogic/Object/Die/KeepObjectDie.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/KeepObjectDie.cpp rename to Core/GameEngine/Source/GameLogic/Object/Die/KeepObjectDie.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp b/Core/GameEngine/Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp rename to Core/GameEngine/Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/UpgradeDie.cpp b/Core/GameEngine/Source/GameLogic/Object/Die/UpgradeDie.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/UpgradeDie.cpp rename to Core/GameEngine/Source/GameLogic/Object/Die/UpgradeDie.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp b/Core/GameEngine/Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp rename to Core/GameEngine/Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectHelper.cpp b/Core/GameEngine/Source/GameLogic/Object/Helper/ObjectHelper.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectHelper.cpp rename to Core/GameEngine/Source/GameLogic/Object/Helper/ObjectHelper.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp b/Core/GameEngine/Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp rename to Core/GameEngine/Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp b/Core/GameEngine/Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp rename to Core/GameEngine/Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp b/Core/GameEngine/Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp rename to Core/GameEngine/Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp b/Core/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp rename to Core/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp b/Core/GameEngine/Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp rename to Core/GameEngine/Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/CheckpointUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/CheckpointUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/CheckpointUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/CheckpointUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DeletionUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/DeletionUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DeletionUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/DeletionUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/EnemyNearUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/EnemyNearUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/EnemyNearUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/EnemyNearUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/FloatUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/FloatUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/FloatUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/FloatUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HijackerUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/HijackerUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HijackerUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/HijackerUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/LifetimeUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/LifetimeUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/LifetimeUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/LifetimeUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PowerPlantUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/PowerPlantUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PowerPlantUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/PowerPlantUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProneUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/ProneUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProneUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/ProneUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/RadarUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/RadarUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/RadarUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/RadarUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp b/Core/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp rename to Core/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp b/Core/GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp rename to Core/GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp diff --git a/Generals/Code/GameEngine/CMakeLists.txt b/Generals/Code/GameEngine/CMakeLists.txt index a5ceb7603de..4f16db08868 100644 --- a/Generals/Code/GameEngine/CMakeLists.txt +++ b/Generals/Code/GameEngine/CMakeLists.txt @@ -11,8 +11,8 @@ set(GAMEENGINE_SRC # Include/Common/AudioRequest.h # Include/Common/AudioSettings.h Include/Common/BattleHonors.h - Include/Common/BezFwdIterator.h - Include/Common/BezierSegment.h +# Include/Common/BezFwdIterator.h +# Include/Common/BezierSegment.h Include/Common/BitFlags.h Include/Common/BitFlagsIO.h Include/Common/BuildAssistant.h @@ -20,17 +20,17 @@ set(GAMEENGINE_SRC Include/Common/CommandLine.h # Include/Common/crc.h # Include/Common/CRCDebug.h - Include/Common/CriticalSection.h +# Include/Common/CriticalSection.h Include/Common/CustomMatchPreferences.h - Include/Common/DamageFX.h - Include/Common/DataChunk.h +# Include/Common/DamageFX.h +# Include/Common/DataChunk.h # Include/Common/Debug.h - Include/Common/Dict.h - Include/Common/Directory.h - Include/Common/DisabledTypes.h - Include/Common/DiscreteCircle.h +# Include/Common/Dict.h +# Include/Common/Directory.h +# Include/Common/DisabledTypes.h +# Include/Common/DiscreteCircle.h Include/Common/DrawModule.h - Include/Common/encrypt.h +# Include/Common/encrypt.h Include/Common/Energy.h # Include/Common/Errors.h # Include/Common/file.h @@ -48,25 +48,25 @@ set(GAMEENGINE_SRC Include/Common/GameState.h Include/Common/GameStateMap.h # Include/Common/GameType.h - Include/Common/Geometry.h +# Include/Common/Geometry.h Include/Common/GlobalData.h - Include/Common/Handicap.h +# Include/Common/Handicap.h Include/Common/IgnorePreferences.h # Include/Common/INI.h Include/Common/INIException.h - Include/Common/KindOf.h +# Include/Common/KindOf.h Include/Common/LadderPreferences.h - Include/Common/Language.h +# Include/Common/Language.h Include/Common/LatchRestore.h - Include/Common/List.h +# Include/Common/List.h # Include/Common/LocalFile.h # Include/Common/LocalFileSystem.h # Include/Common/MapObject.h Include/Common/MapReaderWriterInfo.h Include/Common/MessageStream.h - Include/Common/MiniLog.h +# Include/Common/MiniLog.h # Include/Common/MiscAudio.h - Include/Common/MissionStats.h +# Include/Common/MissionStats.h Include/Common/ModelState.h Include/Common/Module.h Include/Common/ModuleFactory.h @@ -79,13 +79,13 @@ set(GAMEENGINE_SRC Include/Common/Override.h Include/Common/PartitionSolver.h Include/Common/PerfMetrics.h - Include/Common/PerfTimer.h +# Include/Common/PerfTimer.h Include/Common/Player.h - Include/Common/PlayerList.h +# Include/Common/PlayerList.h Include/Common/PlayerTemplate.h Include/Common/ProductionPrerequisite.h Include/Common/QuickmatchPreferences.h - Include/Common/QuotedPrintable.h +# Include/Common/QuotedPrintable.h # Include/Common/Radar.h # Include/Common/RAMFile.h # Include/Common/RandomValue.h @@ -93,8 +93,8 @@ set(GAMEENGINE_SRC # Include/Common/ReplaySimulation.h Include/Common/Registry.h Include/Common/ResourceGatheringManager.h - Include/Common/Science.h - Include/Common/ScoreKeeper.h +# Include/Common/Science.h +# Include/Common/ScoreKeeper.h Include/Common/SkirmishBattleHonors.h Include/Common/SkirmishPreferences.h # Include/Common/Snapshot.h @@ -102,7 +102,7 @@ set(GAMEENGINE_SRC Include/Common/SpecialPower.h Include/Common/SpecialPowerMaskType.h Include/Common/SpecialPowerType.h - Include/Common/StackDump.h +# Include/Common/StackDump.h Include/Common/StateMachine.h Include/Common/StatsCollector.h # Include/Common/STLTypedefs.h @@ -110,7 +110,7 @@ set(GAMEENGINE_SRC # Include/Common/SubsystemInterface.h Include/Common/Team.h Include/Common/Terrain.h - Include/Common/TerrainTypes.h +# Include/Common/TerrainTypes.h Include/Common/Thing.h Include/Common/ThingFactory.h Include/Common/ThingSort.h @@ -118,9 +118,9 @@ set(GAMEENGINE_SRC Include/Common/TunnelTracker.h # Include/Common/UnicodeString.h Include/Common/UnitTimings.h - Include/Common/Upgrade.h +# Include/Common/Upgrade.h # Include/Common/UserPreferences.h - Include/Common/version.h +# Include/Common/version.h Include/Common/WellKnownKeys.h # Include/Common/WorkerProcess.h # Include/Common/Xfer.h @@ -141,7 +141,7 @@ set(GAMEENGINE_SRC # Include/GameClient/ControlBarScheme.h # Include/GameClient/Credits.h # Include/GameClient/DebugDisplay.h - Include/GameClient/Diplomacy.h +# Include/GameClient/Diplomacy.h Include/GameClient/DisconnectMenu.h # Include/GameClient/Display.h # Include/GameClient/DisplayString.h @@ -149,9 +149,9 @@ set(GAMEENGINE_SRC Include/GameClient/Drawable.h Include/GameClient/DrawableInfo.h # Include/GameClient/DrawGroupInfo.h - Include/GameClient/EstablishConnectionsMenu.h +# Include/GameClient/EstablishConnectionsMenu.h Include/GameClient/Eva.h - Include/GameClient/ExtendedMessageBox.h +# Include/GameClient/ExtendedMessageBox.h Include/GameClient/FontDesc.h # Include/GameClient/FXList.h # Include/GameClient/Gadget.h @@ -167,7 +167,7 @@ set(GAMEENGINE_SRC # Include/GameClient/GadgetTextEntry.h Include/GameClient/GameClient.h # Include/GameClient/GameFont.h - Include/GameClient/GameInfoWindow.h +# Include/GameClient/GameInfoWindow.h # Include/GameClient/GameText.h # Include/GameClient/GameWindow.h # Include/GameClient/GameWindowGlobal.h @@ -191,7 +191,7 @@ set(GAMEENGINE_SRC # Include/GameClient/LoadScreen.h # Include/GameClient/LookAtXlat.h # Include/GameClient/MapUtil.h - Include/GameClient/MessageBox.h +# Include/GameClient/MessageBox.h # Include/GameClient/MetaEvent.h # Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h # Include/GameClient/Module/BeaconClientUpdate.h @@ -207,7 +207,7 @@ set(GAMEENGINE_SRC Include/GameClient/Shadow.h Include/GameClient/Shell.h Include/GameClient/ShellHooks.h - Include/GameClient/ShellMenuScheme.h +# Include/GameClient/ShellMenuScheme.h # Include/GameClient/Statistics.h # Include/GameClient/TerrainRoads.h # Include/GameClient/TerrainVisual.h @@ -219,7 +219,7 @@ set(GAMEENGINE_SRC # Include/GameClient/WindowXlat.h # Include/GameClient/WinInstanceData.h Include/GameLogic/AI.h - Include/GameLogic/AIDock.h +# Include/GameLogic/AIDock.h Include/GameLogic/AIGuard.h # Include/GameLogic/AIPathfind.h Include/GameLogic/AIPlayer.h @@ -240,7 +240,7 @@ set(GAMEENGINE_SRC Include/GameLogic/LocomotorSet.h # Include/GameLogic/LogicRandomValue.h Include/GameLogic/Module/ActiveBody.h - Include/GameLogic/Module/ActiveShroudUpgrade.h +# Include/GameLogic/Module/ActiveShroudUpgrade.h Include/GameLogic/Module/AIUpdate.h Include/GameLogic/Module/ArmorUpgrade.h Include/GameLogic/Module/AssaultTransportAIUpdate.h @@ -253,183 +253,183 @@ set(GAMEENGINE_SRC Include/GameLogic/Module/BattlePlanUpdate.h Include/GameLogic/Module/BehaviorModule.h Include/GameLogic/Module/BodyModule.h - Include/GameLogic/Module/BoneFXDamage.h +# Include/GameLogic/Module/BoneFXDamage.h Include/GameLogic/Module/BoneFXUpdate.h Include/GameLogic/Module/BridgeBehavior.h - Include/GameLogic/Module/BridgeScaffoldBehavior.h - Include/GameLogic/Module/BridgeTowerBehavior.h +# Include/GameLogic/Module/BridgeScaffoldBehavior.h +# Include/GameLogic/Module/BridgeTowerBehavior.h Include/GameLogic/Module/CashBountyPower.h Include/GameLogic/Module/CashHackSpecialPower.h Include/GameLogic/Module/CaveContain.h - Include/GameLogic/Module/CheckpointUpdate.h +# Include/GameLogic/Module/CheckpointUpdate.h Include/GameLogic/Module/ChinookAIUpdate.h Include/GameLogic/Module/CleanupAreaPower.h - Include/GameLogic/Module/CleanupHazardUpdate.h +# Include/GameLogic/Module/CleanupHazardUpdate.h Include/GameLogic/Module/CollideModule.h Include/GameLogic/Module/CommandButtonHuntUpdate.h Include/GameLogic/Module/CommandSetUpgrade.h Include/GameLogic/Module/ContainModule.h Include/GameLogic/Module/ConvertToCarBombCrateCollide.h Include/GameLogic/Module/ConvertToHijackedVehicleCrateCollide.h - Include/GameLogic/Module/CostModifierUpgrade.h +# Include/GameLogic/Module/CostModifierUpgrade.h Include/GameLogic/Module/CrateCollide.h - Include/GameLogic/Module/CreateCrateDie.h - Include/GameLogic/Module/CreateModule.h +# Include/GameLogic/Module/CreateCrateDie.h +# Include/GameLogic/Module/CreateModule.h Include/GameLogic/Module/CreateObjectDie.h - Include/GameLogic/Module/CrushDie.h - Include/GameLogic/Module/DamageModule.h - Include/GameLogic/Module/DamDie.h +# Include/GameLogic/Module/CrushDie.h +# Include/GameLogic/Module/DamageModule.h +# Include/GameLogic/Module/DamDie.h Include/GameLogic/Module/DefaultProductionExitUpdate.h Include/GameLogic/Module/DefectorSpecialPower.h Include/GameLogic/Module/DelayedUpgrade.h Include/GameLogic/Module/DelayedWeaponSetUpgradeUpdate.h - Include/GameLogic/Module/DeletionUpdate.h +# Include/GameLogic/Module/DeletionUpdate.h Include/GameLogic/Module/DeliverPayloadAIUpdate.h Include/GameLogic/Module/DemoralizeSpecialPower.h Include/GameLogic/Module/DemoTrapUpdate.h Include/GameLogic/Module/DeployStyleAIUpdate.h Include/GameLogic/Module/DestroyDie.h - Include/GameLogic/Module/DestroyModule.h - Include/GameLogic/Module/DieModule.h +# Include/GameLogic/Module/DestroyModule.h +# Include/GameLogic/Module/DieModule.h Include/GameLogic/Module/DockUpdate.h Include/GameLogic/Module/DozerAIUpdate.h Include/GameLogic/Module/DumbProjectileBehavior.h - Include/GameLogic/Module/DynamicGeometryInfoUpdate.h +# Include/GameLogic/Module/DynamicGeometryInfoUpdate.h Include/GameLogic/Module/DynamicShroudClearingRangeUpdate.h - Include/GameLogic/Module/EjectPilotDie.h +# Include/GameLogic/Module/EjectPilotDie.h Include/GameLogic/Module/EMPUpdate.h - Include/GameLogic/Module/EnemyNearUpdate.h - Include/GameLogic/Module/ExperienceScalarUpgrade.h +# Include/GameLogic/Module/EnemyNearUpdate.h +# Include/GameLogic/Module/ExperienceScalarUpgrade.h Include/GameLogic/Module/FireOCLAfterWeaponCooldownUpdate.h - Include/GameLogic/Module/FireSpreadUpdate.h +# Include/GameLogic/Module/FireSpreadUpdate.h Include/GameLogic/Module/FirestormDynamicGeometryInfoUpdate.h - Include/GameLogic/Module/FireWeaponCollide.h +# Include/GameLogic/Module/FireWeaponCollide.h Include/GameLogic/Module/FireWeaponUpdate.h Include/GameLogic/Module/FireWeaponWhenDamagedBehavior.h Include/GameLogic/Module/FireWeaponWhenDeadBehavior.h - Include/GameLogic/Module/FlammableUpdate.h - Include/GameLogic/Module/FloatUpdate.h +# Include/GameLogic/Module/FlammableUpdate.h +# Include/GameLogic/Module/FloatUpdate.h Include/GameLogic/Module/FXListDie.h Include/GameLogic/Module/GarrisonContain.h Include/GameLogic/Module/GenerateMinefieldBehavior.h Include/GameLogic/Module/GrantUpgradeCreate.h Include/GameLogic/Module/HackInternetAIUpdate.h - Include/GameLogic/Module/HealContain.h - Include/GameLogic/Module/HealCrateCollide.h - Include/GameLogic/Module/HeightDieUpdate.h +# Include/GameLogic/Module/HealContain.h +# Include/GameLogic/Module/HealCrateCollide.h +# Include/GameLogic/Module/HeightDieUpdate.h Include/GameLogic/Module/HelicopterSlowDeathUpdate.h - Include/GameLogic/Module/HighlanderBody.h - Include/GameLogic/Module/HijackerUpdate.h +# Include/GameLogic/Module/HighlanderBody.h +# Include/GameLogic/Module/HijackerUpdate.h Include/GameLogic/Module/HiveStructureBody.h Include/GameLogic/Module/HordeUpdate.h - Include/GameLogic/Module/ImmortalBody.h +# Include/GameLogic/Module/ImmortalBody.h Include/GameLogic/Module/InactiveBody.h - Include/GameLogic/Module/InstantDeathBehavior.h +# Include/GameLogic/Module/InstantDeathBehavior.h Include/GameLogic/Module/JetAIUpdate.h Include/GameLogic/Module/JetSlowDeathBehavior.h - Include/GameLogic/Module/KeepObjectDie.h +# Include/GameLogic/Module/KeepObjectDie.h Include/GameLogic/Module/LaserUpdate.h - Include/GameLogic/Module/LifetimeUpdate.h - Include/GameLogic/Module/LocomotorSetUpgrade.h - Include/GameLogic/Module/MaxHealthUpgrade.h +# Include/GameLogic/Module/LifetimeUpdate.h +# Include/GameLogic/Module/LocomotorSetUpgrade.h +# Include/GameLogic/Module/MaxHealthUpgrade.h Include/GameLogic/Module/MinefieldBehavior.h Include/GameLogic/Module/MissileAIUpdate.h Include/GameLogic/Module/MissileLauncherBuildingUpdate.h - Include/GameLogic/Module/MobMemberSlavedUpdate.h +# Include/GameLogic/Module/MobMemberSlavedUpdate.h Include/GameLogic/Module/MobNexusContain.h Include/GameLogic/Module/MoneyCrateCollide.h - Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h +# Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h Include/GameLogic/Module/NeutronMissileUpdate.h - Include/GameLogic/Module/ObjectCreationUpgrade.h - Include/GameLogic/Module/ObjectDefectionHelper.h - Include/GameLogic/Module/ObjectHelper.h - Include/GameLogic/Module/ObjectRepulsorHelper.h - Include/GameLogic/Module/ObjectSMCHelper.h - Include/GameLogic/Module/ObjectWeaponStatusHelper.h +# Include/GameLogic/Module/ObjectCreationUpgrade.h +# Include/GameLogic/Module/ObjectDefectionHelper.h +# Include/GameLogic/Module/ObjectHelper.h +# Include/GameLogic/Module/ObjectRepulsorHelper.h +# Include/GameLogic/Module/ObjectSMCHelper.h +# Include/GameLogic/Module/ObjectWeaponStatusHelper.h Include/GameLogic/Module/OCLSpecialPower.h Include/GameLogic/Module/OCLUpdate.h Include/GameLogic/Module/OpenContain.h - Include/GameLogic/Module/OverchargeBehavior.h +# Include/GameLogic/Module/OverchargeBehavior.h Include/GameLogic/Module/OverlordContain.h Include/GameLogic/Module/ParachuteContain.h Include/GameLogic/Module/ParkingPlaceBehavior.h Include/GameLogic/Module/ParticleUplinkCannonUpdate.h Include/GameLogic/Module/PhysicsUpdate.h - Include/GameLogic/Module/PilotFindVehicleUpdate.h +# Include/GameLogic/Module/PilotFindVehicleUpdate.h Include/GameLogic/Module/PointDefenseLaserUpdate.h Include/GameLogic/Module/PoisonedBehavior.h - Include/GameLogic/Module/PowerPlantUpdate.h - Include/GameLogic/Module/PowerPlantUpgrade.h - Include/GameLogic/Module/POWTruckAIUpdate.h - Include/GameLogic/Module/POWTruckBehavior.h - Include/GameLogic/Module/PreorderCreate.h +# Include/GameLogic/Module/PowerPlantUpdate.h +# Include/GameLogic/Module/PowerPlantUpgrade.h +# Include/GameLogic/Module/POWTruckAIUpdate.h +# Include/GameLogic/Module/POWTruckBehavior.h +# Include/GameLogic/Module/PreorderCreate.h Include/GameLogic/Module/PrisonBehavior.h - Include/GameLogic/Module/PrisonDockUpdate.h +# Include/GameLogic/Module/PrisonDockUpdate.h Include/GameLogic/Module/ProductionUpdate.h Include/GameLogic/Module/ProjectileStreamUpdate.h - Include/GameLogic/Module/ProneUpdate.h - Include/GameLogic/Module/PropagandaCenterBehavior.h +# Include/GameLogic/Module/ProneUpdate.h +# Include/GameLogic/Module/PropagandaCenterBehavior.h Include/GameLogic/Module/PropagandaTowerBehavior.h - Include/GameLogic/Module/QueueProductionExitUpdate.h - Include/GameLogic/Module/RadarUpdate.h - Include/GameLogic/Module/RadarUpgrade.h - Include/GameLogic/Module/RadiusDecalUpdate.h - Include/GameLogic/Module/RailedTransportAIUpdate.h - Include/GameLogic/Module/RailedTransportContain.h +# Include/GameLogic/Module/QueueProductionExitUpdate.h +# Include/GameLogic/Module/RadarUpdate.h +# Include/GameLogic/Module/RadarUpgrade.h +# Include/GameLogic/Module/RadiusDecalUpdate.h +# Include/GameLogic/Module/RailedTransportAIUpdate.h +# Include/GameLogic/Module/RailedTransportContain.h Include/GameLogic/Module/RailedTransportDockUpdate.h Include/GameLogic/Module/RailroadGuideAIUpdate.h Include/GameLogic/Module/RebuildHoleBehavior.h Include/GameLogic/Module/RebuildHoleExposeDie.h - Include/GameLogic/Module/RepairDockUpdate.h +# Include/GameLogic/Module/RepairDockUpdate.h Include/GameLogic/Module/SalvageCrateCollide.h - Include/GameLogic/Module/ShroudCrateCollide.h +# Include/GameLogic/Module/ShroudCrateCollide.h Include/GameLogic/Module/SlavedUpdate.h Include/GameLogic/Module/SlowDeathBehavior.h Include/GameLogic/Module/SpawnBehavior.h - Include/GameLogic/Module/SpawnPointProductionExitUpdate.h - Include/GameLogic/Module/SpecialAbility.h +# Include/GameLogic/Module/SpawnPointProductionExitUpdate.h +# Include/GameLogic/Module/SpecialAbility.h Include/GameLogic/Module/SpecialAbilityUpdate.h - Include/GameLogic/Module/SpecialPowerCompletionDie.h - Include/GameLogic/Module/SpecialPowerCreate.h +# Include/GameLogic/Module/SpecialPowerCompletionDie.h +# Include/GameLogic/Module/SpecialPowerCreate.h Include/GameLogic/Module/SpecialPowerModule.h Include/GameLogic/Module/SpecialPowerUpdateModule.h - Include/GameLogic/Module/SpyVisionSpecialPower.h +# Include/GameLogic/Module/SpyVisionSpecialPower.h Include/GameLogic/Module/SpyVisionUpdate.h - Include/GameLogic/Module/SquishCollide.h - Include/GameLogic/Module/StatusBitsUpgrade.h +# Include/GameLogic/Module/SquishCollide.h +# Include/GameLogic/Module/StatusBitsUpgrade.h Include/GameLogic/Module/StealthDetectorUpdate.h Include/GameLogic/Module/StealthUpdate.h Include/GameLogic/Module/StealthUpgrade.h Include/GameLogic/Module/StickyBombUpdate.h - Include/GameLogic/Module/StructureBody.h +# Include/GameLogic/Module/StructureBody.h Include/GameLogic/Module/StructureCollapseUpdate.h Include/GameLogic/Module/StructureToppleUpdate.h - Include/GameLogic/Module/SubObjectsUpgrade.h - Include/GameLogic/Module/SupplyCenterCreate.h +# Include/GameLogic/Module/SubObjectsUpgrade.h +# Include/GameLogic/Module/SupplyCenterCreate.h Include/GameLogic/Module/SupplyCenterDockUpdate.h Include/GameLogic/Module/SupplyCenterProductionExitUpdate.h Include/GameLogic/Module/SupplyTruckAIUpdate.h - Include/GameLogic/Module/SupplyWarehouseCreate.h - Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h - Include/GameLogic/Module/SupplyWarehouseDockUpdate.h +# Include/GameLogic/Module/SupplyWarehouseCreate.h +# Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h +# Include/GameLogic/Module/SupplyWarehouseDockUpdate.h Include/GameLogic/Module/TechBuildingBehavior.h - Include/GameLogic/Module/TensileFormationUpdate.h +# Include/GameLogic/Module/TensileFormationUpdate.h Include/GameLogic/Module/ToppleUpdate.h Include/GameLogic/Module/TransitionDamageFX.h Include/GameLogic/Module/TransportAIUpdate.h Include/GameLogic/Module/TransportContain.h Include/GameLogic/Module/TunnelContain.h - Include/GameLogic/Module/UnitCrateCollide.h - Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h +# Include/GameLogic/Module/UnitCrateCollide.h +# Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h Include/GameLogic/Module/UpdateModule.h - Include/GameLogic/Module/UpgradeDie.h +# Include/GameLogic/Module/UpgradeDie.h Include/GameLogic/Module/UpgradeModule.h - Include/GameLogic/Module/VeterancyCrateCollide.h - Include/GameLogic/Module/VeterancyGainCreate.h - Include/GameLogic/Module/WanderAIUpdate.h +# Include/GameLogic/Module/VeterancyCrateCollide.h +# Include/GameLogic/Module/VeterancyGainCreate.h +# Include/GameLogic/Module/WanderAIUpdate.h Include/GameLogic/Module/WaveGuideUpdate.h - Include/GameLogic/Module/WeaponBonusUpgrade.h - Include/GameLogic/Module/WeaponSetUpgrade.h +# Include/GameLogic/Module/WeaponBonusUpgrade.h +# Include/GameLogic/Module/WeaponSetUpgrade.h Include/GameLogic/Module/WorkerAIUpdate.h Include/GameLogic/Object.h Include/GameLogic/ObjectCreationList.h @@ -445,7 +445,7 @@ set(GAMEENGINE_SRC Include/GameLogic/ScriptEngine.h Include/GameLogic/Scripts.h Include/GameLogic/SidesList.h - Include/GameLogic/Squad.h +# Include/GameLogic/Squad.h Include/GameLogic/TerrainLogic.h Include/GameLogic/TurretAI.h Include/GameLogic/VictoryConditions.h @@ -517,15 +517,15 @@ set(GAMEENGINE_SRC # Source/Common/Audio/GameSounds.cpp #Source/Common/Audio/simpleplayer.cpp # unused #Source/Common/Audio/urllaunch.cpp # unused - Source/Common/Bezier/BezFwdIterator.cpp - Source/Common/Bezier/BezierSegment.cpp +# Source/Common/Bezier/BezFwdIterator.cpp +# Source/Common/Bezier/BezierSegment.cpp Source/Common/BitFlags.cpp Source/Common/CommandLine.cpp # Source/Common/crc.cpp # Source/Common/CRCDebug.cpp - Source/Common/DamageFX.cpp - Source/Common/Dict.cpp - Source/Common/DiscreteCircle.cpp +# Source/Common/DamageFX.cpp +# Source/Common/Dict.cpp +# Source/Common/DiscreteCircle.cpp Source/Common/GameEngine.cpp Source/Common/GameLOD.cpp Source/Common/GameMain.cpp @@ -558,27 +558,27 @@ set(GAMEENGINE_SRC Source/Common/INI/INIWater.cpp Source/Common/INI/INIWeapon.cpp Source/Common/INI/INIWebpageURL.cpp - Source/Common/Language.cpp +# Source/Common/Language.cpp Source/Common/MessageStream.cpp - Source/Common/MiniLog.cpp +# Source/Common/MiniLog.cpp Source/Common/MultiplayerSettings.cpp Source/Common/NameKeyGenerator.cpp Source/Common/PartitionSolver.cpp - Source/Common/PerfTimer.cpp +# Source/Common/PerfTimer.cpp # Source/Common/RandomValue.cpp Source/Common/Recorder.cpp Source/Common/RTS/ActionManager.cpp Source/Common/RTS/Energy.cpp - Source/Common/RTS/Handicap.cpp - Source/Common/RTS/MissionStats.cpp +# Source/Common/RTS/Handicap.cpp +# Source/Common/RTS/MissionStats.cpp Source/Common/RTS/Money.cpp Source/Common/RTS/Player.cpp - Source/Common/RTS/PlayerList.cpp +# Source/Common/RTS/PlayerList.cpp Source/Common/RTS/PlayerTemplate.cpp Source/Common/RTS/ProductionPrerequisite.cpp Source/Common/RTS/ResourceGatheringManager.cpp - Source/Common/RTS/Science.cpp - Source/Common/RTS/ScoreKeeper.cpp +# Source/Common/RTS/Science.cpp +# Source/Common/RTS/ScoreKeeper.cpp Source/Common/RTS/SpecialPower.cpp Source/Common/RTS/Team.cpp Source/Common/RTS/TunnelTracker.cpp @@ -589,43 +589,43 @@ set(GAMEENGINE_SRC # Source/Common/System/ArchiveFileSystem.cpp # Source/Common/System/AsciiString.cpp Source/Common/System/BuildAssistant.cpp - Source/Common/System/CriticalSection.cpp - Source/Common/System/DataChunk.cpp +# Source/Common/System/CriticalSection.cpp +# Source/Common/System/DataChunk.cpp # Source/Common/System/Debug.cpp - Source/Common/System/Directory.cpp - Source/Common/System/DisabledTypes.cpp - Source/Common/System/encrypt.cpp +# Source/Common/System/Directory.cpp +# Source/Common/System/DisabledTypes.cpp +# Source/Common/System/encrypt.cpp # Source/Common/System/File.cpp # Source/Common/System/FileSystem.cpp Source/Common/System/FunctionLexicon.cpp # Source/Common/System/GameCommon.cpp #Source/Common/System/GameMemory.cpp # Source/Common/System/GameType.cpp - Source/Common/System/Geometry.cpp - Source/Common/System/KindOf.cpp - Source/Common/System/List.cpp +# Source/Common/System/Geometry.cpp +# Source/Common/System/KindOf.cpp +# Source/Common/System/List.cpp # Source/Common/System/LocalFile.cpp # Source/Common/System/LocalFileSystem.cpp #Source/Common/System/MemoryInit.cpp # Source/Common/System/ObjectStatusTypes.cpp - Source/Common/System/QuotedPrintable.cpp +# Source/Common/System/QuotedPrintable.cpp # Source/Common/System/Radar.cpp # Source/Common/System/RAMFile.cpp Source/Common/System/registry.cpp Source/Common/System/SaveGame/GameState.cpp Source/Common/System/SaveGame/GameStateMap.cpp # Source/Common/System/Snapshot.cpp - Source/Common/System/StackDump.cpp +# Source/Common/System/StackDump.cpp # Source/Common/System/StreamingArchiveFile.cpp # Source/Common/System/SubsystemInterface.cpp Source/Common/System/Trig.cpp # Source/Common/System/UnicodeString.cpp - Source/Common/System/Upgrade.cpp +# Source/Common/System/Upgrade.cpp # Source/Common/System/Xfer.cpp # Source/Common/System/XferCRC.cpp # Source/Common/System/XferLoad.cpp # Source/Common/System/XferSave.cpp - Source/Common/TerrainTypes.cpp +# Source/Common/TerrainTypes.cpp Source/Common/Thing/DrawModule.cpp Source/Common/Thing/Module.cpp Source/Common/Thing/ModuleFactory.cpp @@ -633,7 +633,7 @@ set(GAMEENGINE_SRC Source/Common/Thing/ThingFactory.cpp Source/Common/Thing/ThingTemplate.cpp # Source/Common/UserPreferences.cpp - Source/Common/version.cpp +# Source/Common/version.cpp # Source/Common/WorkerProcess.cpp # Source/GameClient/ClientInstance.cpp # Source/GameClient/Color.cpp @@ -668,7 +668,7 @@ set(GAMEENGINE_SRC # Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp # Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp - Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp +# Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp # Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp # Source/GameClient/GUI/Gadget/GadgetComboBox.cpp # Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp @@ -689,8 +689,8 @@ set(GAMEENGINE_SRC Source/GameClient/GUI/GameWindowTransitionsStyles.cpp # Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp # Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp - Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp - Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp +# Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp +# Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp Source/GameClient/GUI/GUICallbacks/GeneralsExpPoints.cpp Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp Source/GameClient/GUI/GUICallbacks/InGameChat.cpp @@ -700,7 +700,7 @@ set(GAMEENGINE_SRC Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp - Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp +# Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp @@ -735,14 +735,14 @@ set(GAMEENGINE_SRC Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp - Source/GameClient/GUI/GUICallbacks/MessageBox.cpp +# Source/GameClient/GUI/GUICallbacks/MessageBox.cpp Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp # Source/GameClient/GUI/HeaderTemplate.cpp # Source/GameClient/GUI/IMEManager.cpp # Source/GameClient/GUI/LoadScreen.cpp # Source/GameClient/GUI/ProcessAnimateWindow.cpp Source/GameClient/GUI/Shell/Shell.cpp - Source/GameClient/GUI/Shell/ShellMenuScheme.cpp +# Source/GameClient/GUI/Shell/ShellMenuScheme.cpp # Source/GameClient/GUI/WindowLayout.cpp # Source/GameClient/GUI/WindowVideoManager.cpp # Source/GameClient/GUI/WinInstanceData.cpp @@ -777,7 +777,7 @@ set(GAMEENGINE_SRC # Source/GameClient/View.cpp # Source/GameClient/Water.cpp Source/GameLogic/AI/AI.cpp - Source/GameLogic/AI/AIDock.cpp +# Source/GameLogic/AI/AIDock.cpp Source/GameLogic/AI/AIGroup.cpp Source/GameLogic/AI/AIGuard.cpp # Source/GameLogic/AI/AIPathfind.cpp @@ -785,7 +785,7 @@ set(GAMEENGINE_SRC Source/GameLogic/AI/AISkirmishPlayer.cpp Source/GameLogic/AI/AIStates.cpp Source/GameLogic/AI/AITNGuard.cpp - Source/GameLogic/AI/Squad.cpp +# Source/GameLogic/AI/Squad.cpp Source/GameLogic/AI/TurretAI.cpp Source/GameLogic/Map/PolygonTrigger.cpp Source/GameLogic/Map/SidesList.cpp @@ -794,87 +794,87 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/Behavior/AutoHealBehavior.cpp Source/GameLogic/Object/Behavior/BehaviorModule.cpp Source/GameLogic/Object/Behavior/BridgeBehavior.cpp - Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp - Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp +# Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp +# Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp Source/GameLogic/Object/Behavior/FireWeaponWhenDamagedBehavior.cpp Source/GameLogic/Object/Behavior/FireWeaponWhenDeadBehavior.cpp Source/GameLogic/Object/Behavior/GenerateMinefieldBehavior.cpp - Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp +# Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp Source/GameLogic/Object/Behavior/JetSlowDeathBehavior.cpp Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp - Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp +# Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp - Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp +# Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp Source/GameLogic/Object/Behavior/PrisonBehavior.cpp - Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp +# Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp Source/GameLogic/Object/Behavior/SpawnBehavior.cpp - Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp +# Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp Source/GameLogic/Object/Behavior/TechBuildingBehavior.cpp Source/GameLogic/Object/Body/ActiveBody.cpp Source/GameLogic/Object/Body/BodyModule.cpp - Source/GameLogic/Object/Body/HighlanderBody.cpp +# Source/GameLogic/Object/Body/HighlanderBody.cpp Source/GameLogic/Object/Body/HiveStructureBody.cpp - Source/GameLogic/Object/Body/ImmortalBody.cpp +# Source/GameLogic/Object/Body/ImmortalBody.cpp Source/GameLogic/Object/Body/InactiveBody.cpp - Source/GameLogic/Object/Body/StructureBody.cpp +# Source/GameLogic/Object/Body/StructureBody.cpp Source/GameLogic/Object/Collide/CollideModule.cpp Source/GameLogic/Object/Collide/CrateCollide/ConvertToCarBombCrateCollide.cpp Source/GameLogic/Object/Collide/CrateCollide/ConvertToHijackedVehicleCrateCollide.cpp Source/GameLogic/Object/Collide/CrateCollide/CrateCollide.cpp - Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp +# Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp Source/GameLogic/Object/Collide/CrateCollide/MoneyCrateCollide.cpp Source/GameLogic/Object/Collide/CrateCollide/SalvageCrateCollide.cpp - Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp - Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp - Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp - Source/GameLogic/Object/Collide/FireWeaponCollide.cpp - Source/GameLogic/Object/Collide/SquishCollide.cpp +# Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp +# Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp +# Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp +# Source/GameLogic/Object/Collide/FireWeaponCollide.cpp +# Source/GameLogic/Object/Collide/SquishCollide.cpp Source/GameLogic/Object/Contain/CaveContain.cpp Source/GameLogic/Object/Contain/GarrisonContain.cpp - Source/GameLogic/Object/Contain/HealContain.cpp +# Source/GameLogic/Object/Contain/HealContain.cpp Source/GameLogic/Object/Contain/MobNexusContain.cpp Source/GameLogic/Object/Contain/OpenContain.cpp Source/GameLogic/Object/Contain/OverlordContain.cpp Source/GameLogic/Object/Contain/ParachuteContain.cpp - Source/GameLogic/Object/Contain/RailedTransportContain.cpp +# Source/GameLogic/Object/Contain/RailedTransportContain.cpp Source/GameLogic/Object/Contain/TransportContain.cpp Source/GameLogic/Object/Contain/TunnelContain.cpp - Source/GameLogic/Object/Create/CreateModule.cpp +# Source/GameLogic/Object/Create/CreateModule.cpp Source/GameLogic/Object/Create/GrantUpgradeCreate.cpp - Source/GameLogic/Object/Create/PreorderCreate.cpp - Source/GameLogic/Object/Create/SpecialPowerCreate.cpp - Source/GameLogic/Object/Create/SupplyCenterCreate.cpp - Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp - Source/GameLogic/Object/Create/VeterancyGainCreate.cpp - Source/GameLogic/Object/Damage/BoneFXDamage.cpp - Source/GameLogic/Object/Damage/DamageModule.cpp +# Source/GameLogic/Object/Create/PreorderCreate.cpp +# Source/GameLogic/Object/Create/SpecialPowerCreate.cpp +# Source/GameLogic/Object/Create/SupplyCenterCreate.cpp +# Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp +# Source/GameLogic/Object/Create/VeterancyGainCreate.cpp +# Source/GameLogic/Object/Damage/BoneFXDamage.cpp +# Source/GameLogic/Object/Damage/DamageModule.cpp Source/GameLogic/Object/Damage/TransitionDamageFX.cpp - Source/GameLogic/Object/Destroy/DestroyModule.cpp - Source/GameLogic/Object/Die/CreateCrateDie.cpp +# Source/GameLogic/Object/Destroy/DestroyModule.cpp +# Source/GameLogic/Object/Die/CreateCrateDie.cpp Source/GameLogic/Object/Die/CreateObjectDie.cpp - Source/GameLogic/Object/Die/CrushDie.cpp - Source/GameLogic/Object/Die/DamDie.cpp +# Source/GameLogic/Object/Die/CrushDie.cpp +# Source/GameLogic/Object/Die/DamDie.cpp Source/GameLogic/Object/Die/DestroyDie.cpp - Source/GameLogic/Object/Die/DieModule.cpp - Source/GameLogic/Object/Die/EjectPilotDie.cpp +# Source/GameLogic/Object/Die/DieModule.cpp +# Source/GameLogic/Object/Die/EjectPilotDie.cpp Source/GameLogic/Object/Die/FXListDie.cpp - Source/GameLogic/Object/Die/KeepObjectDie.cpp +# Source/GameLogic/Object/Die/KeepObjectDie.cpp Source/GameLogic/Object/Die/RebuildHoleExposeDie.cpp - Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp - Source/GameLogic/Object/Die/UpgradeDie.cpp +# Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp +# Source/GameLogic/Object/Die/UpgradeDie.cpp Source/GameLogic/Object/ExperienceTracker.cpp Source/GameLogic/Object/FiringTracker.cpp Source/GameLogic/Object/GhostObject.cpp - Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp - Source/GameLogic/Object/Helper/ObjectHelper.cpp - Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp - Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp - Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp +# Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp +# Source/GameLogic/Object/Helper/ObjectHelper.cpp +# Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp +# Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp +# Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp Source/GameLogic/Object/Locomotor.cpp Source/GameLogic/Object/Object.cpp Source/GameLogic/Object/ObjectCreationList.cpp @@ -888,9 +888,9 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/SpecialPower/DefectorSpecialPower.cpp Source/GameLogic/Object/SpecialPower/DemoralizeSpecialPower.cpp Source/GameLogic/Object/SpecialPower/OCLSpecialPower.cpp - Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp +# Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp - Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp +# Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp Source/GameLogic/Object/Update/AIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/AssaultTransportAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -900,12 +900,12 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp - Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp - Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp +# Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp +# Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/TransportAIUpdate.cpp - Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp +# Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp Source/GameLogic/Object/Update/AssistedTargetingUpdate.cpp Source/GameLogic/Object/Update/AutoDepositUpdate.cpp @@ -913,53 +913,53 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/Update/BaseRenerateUpdate.cpp Source/GameLogic/Object/Update/BattlePlanUpdate.cpp Source/GameLogic/Object/Update/BoneFXUpdate.cpp - Source/GameLogic/Object/Update/CheckpointUpdate.cpp - Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp +# Source/GameLogic/Object/Update/CheckpointUpdate.cpp +# Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp Source/GameLogic/Object/Update/CommandButtonHuntUpdate.cpp Source/GameLogic/Object/Update/DelayedWeaponSetUpgradeUpdate.cpp - Source/GameLogic/Object/Update/DeletionUpdate.cpp +# Source/GameLogic/Object/Update/DeletionUpdate.cpp Source/GameLogic/Object/Update/DemoTrapUpdate.cpp Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp - Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp +# Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp Source/GameLogic/Object/Update/DockUpdate/RailedTransportDockUpdate.cpp - Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp +# Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp Source/GameLogic/Object/Update/DockUpdate/SupplyCenterDockUpdate.cpp - Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp - Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp +# Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp +# Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp Source/GameLogic/Object/Update/DynamicShroudClearingRangeUpdate.cpp Source/GameLogic/Object/Update/EMPUpdate.cpp - Source/GameLogic/Object/Update/EnemyNearUpdate.cpp +# Source/GameLogic/Object/Update/EnemyNearUpdate.cpp Source/GameLogic/Object/Update/FireOCLAfterWeaponCooldownUpdate.cpp - Source/GameLogic/Object/Update/FireSpreadUpdate.cpp +# Source/GameLogic/Object/Update/FireSpreadUpdate.cpp Source/GameLogic/Object/Update/FirestormDynamicGeometryInfoUpdate.cpp Source/GameLogic/Object/Update/FireWeaponUpdate.cpp - Source/GameLogic/Object/Update/FlammableUpdate.cpp - Source/GameLogic/Object/Update/FloatUpdate.cpp - Source/GameLogic/Object/Update/HeightDieUpdate.cpp +# Source/GameLogic/Object/Update/FlammableUpdate.cpp +# Source/GameLogic/Object/Update/FloatUpdate.cpp +# Source/GameLogic/Object/Update/HeightDieUpdate.cpp Source/GameLogic/Object/Update/HelicopterSlowDeathUpdate.cpp - Source/GameLogic/Object/Update/HijackerUpdate.cpp +# Source/GameLogic/Object/Update/HijackerUpdate.cpp Source/GameLogic/Object/Update/HordeUpdate.cpp Source/GameLogic/Object/Update/LaserUpdate.cpp - Source/GameLogic/Object/Update/LifetimeUpdate.cpp +# Source/GameLogic/Object/Update/LifetimeUpdate.cpp Source/GameLogic/Object/Update/MissileLauncherBuildingUpdate.cpp - Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp - Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp +# Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp +# Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp Source/GameLogic/Object/Update/OCLUpdate.cpp Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp Source/GameLogic/Object/Update/PhysicsUpdate.cpp - Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp +# Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp Source/GameLogic/Object/Update/PointDefenseLaserUpdate.cpp - Source/GameLogic/Object/Update/PowerPlantUpdate.cpp +# Source/GameLogic/Object/Update/PowerPlantUpdate.cpp Source/GameLogic/Object/Update/ProductionExitUpdate/DefaultProductionExitUpdate.cpp - Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp - Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp +# Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp +# Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp Source/GameLogic/Object/Update/ProductionExitUpdate/SupplyCenterProductionExitUpdate.cpp Source/GameLogic/Object/Update/ProductionUpdate.cpp Source/GameLogic/Object/Update/ProjectileStreamUpdate.cpp - Source/GameLogic/Object/Update/ProneUpdate.cpp - Source/GameLogic/Object/Update/RadarUpdate.cpp - Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp +# Source/GameLogic/Object/Update/ProneUpdate.cpp +# Source/GameLogic/Object/Update/RadarUpdate.cpp +# Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp Source/GameLogic/Object/Update/SlavedUpdate.cpp Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp Source/GameLogic/Object/Update/SpyVisionUpdate.cpp @@ -968,28 +968,28 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/Update/StickyBombUpdate.cpp Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp Source/GameLogic/Object/Update/StructureToppleUpdate.cpp - Source/GameLogic/Object/Update/TensileFormationUpdate.cpp +# Source/GameLogic/Object/Update/TensileFormationUpdate.cpp Source/GameLogic/Object/Update/ToppleUpdate.cpp Source/GameLogic/Object/Update/UpdateModule.cpp Source/GameLogic/Object/Update/WaveGuideUpdate.cpp - Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp +# Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp Source/GameLogic/Object/Upgrade/ArmorUpgrade.cpp Source/GameLogic/Object/Upgrade/CommandSetUpgrade.cpp - Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp +# Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp Source/GameLogic/Object/Upgrade/DelayedUpgrade.cpp - Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp - Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp - Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp - Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp - Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp - Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp - Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp +# Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp +# Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp +# Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp +# Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp +# Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp +# Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp +# Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp Source/GameLogic/Object/Upgrade/StealthUpgrade.cpp - Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp - Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp +# Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp +# Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp Source/GameLogic/Object/Upgrade/UpgradeModule.cpp - Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp - Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp +# Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp +# Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp Source/GameLogic/Object/Weapon.cpp Source/GameLogic/Object/WeaponSet.cpp Source/GameLogic/ScriptEngine/ScriptActions.cpp diff --git a/Generals/Code/GameEngine/Include/Common/BezFwdIterator.h b/Generals/Code/GameEngine/Include/Common/BezFwdIterator.h deleted file mode 100644 index 8ef83229de6..00000000000 --- a/Generals/Code/GameEngine/Include/Common/BezFwdIterator.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "Common/BezierSegment.h" - -class BezFwdIterator -{ - protected: - Int mStep; - Int mStepsDesired; - - BezierSegment mBezSeg; - Coord3D mCurrPoint; - - Coord3D mDq; // First Derivative - Coord3D mDDq; // Second Derivative - Coord3D mDDDq; // Third Derivative - - public: - BezFwdIterator(); - BezFwdIterator(Int stepsDesired, const BezierSegment *bezSeg); - - void start(); - Bool done(); - const Coord3D& getCurrent() const; - - void next(); -}; diff --git a/Generals/Code/GameEngine/Include/Common/BezierSegment.h b/Generals/Code/GameEngine/Include/Common/BezierSegment.h deleted file mode 100644 index b16df7d8cee..00000000000 --- a/Generals/Code/GameEngine/Include/Common/BezierSegment.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// BezierSegment.h //////////////////////////////////////////////////////////////////////////////// -// John K McDonald, Jr. -// September 2002 -// DO NOT DISTRIBUTE - -#pragma once - -#include -#include "Common/STLTypedefs.h" - -#define USUAL_TOLERANCE 1.0f - -class BezierSegment -{ - protected: - static const D3DXMATRIX s_bezBasisMatrix; - Coord3D m_controlPoints[4]; - - public: // Constructors - BezierSegment(); - BezierSegment(Real x0, Real y0, Real z0, - Real x1, Real y1, Real z1, - Real x2, Real y2, Real z2, - Real x3, Real y3, Real z3); - - BezierSegment(Real cp[12]); - - - BezierSegment(const Coord3D& cp0, - const Coord3D& cp1, - const Coord3D& cp2, - const Coord3D& cp3); - - BezierSegment(Coord3D cp[4]); - - public: - void evaluateBezSegmentAtT(Real tValue, Coord3D *outResult) const; - void getSegmentPoints(Int numSegments, VecCoord3D *outResult) const; - Real getApproximateLength(Real withinTolerance = USUAL_TOLERANCE) const; - - void splitSegmentAtT(Real tValue, BezierSegment &outSeg1, BezierSegment &outSeg2) const; - - public: // He get's friendly access. - friend class BezFwdIterator; -}; diff --git a/Generals/Code/GameEngine/Include/Common/CriticalSection.h b/Generals/Code/GameEngine/Include/Common/CriticalSection.h deleted file mode 100644 index 3d57ab06536..00000000000 --- a/Generals/Code/GameEngine/Include/Common/CriticalSection.h +++ /dev/null @@ -1,101 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// CriticalSection.h /////////////////////////////////////////////////////// -// Utility class to use critical sections in areas of code. -// Author: JohnM And MattC, August 13, 2002 - -#pragma once - -#include "Common/PerfTimer.h" - -#ifdef PERF_TIMERS -extern PerfGather TheCritSecPerfGather; -#endif - -class CriticalSection -{ - CRITICAL_SECTION m_windowsCriticalSection; - - public: - CriticalSection() - { - #ifdef PERF_TIMERS - AutoPerfGather a(TheCritSecPerfGather); - #endif - InitializeCriticalSection( &m_windowsCriticalSection ); - } - - virtual ~CriticalSection() - { - #ifdef PERF_TIMERS - AutoPerfGather a(TheCritSecPerfGather); - #endif - DeleteCriticalSection( &m_windowsCriticalSection ); - } - - public: // Use these when entering/exiting a critical section. - void enter() - { - #ifdef PERF_TIMERS - AutoPerfGather a(TheCritSecPerfGather); - #endif - EnterCriticalSection( &m_windowsCriticalSection ); - } - - void exit() - { - #ifdef PERF_TIMERS - AutoPerfGather a(TheCritSecPerfGather); - #endif - LeaveCriticalSection( &m_windowsCriticalSection ); - } -}; - -class ScopedCriticalSection -{ - private: - CriticalSection *m_cs; - - public: - ScopedCriticalSection( CriticalSection *cs ) : m_cs(cs) - { - if (m_cs) - m_cs->enter(); - } - - virtual ~ScopedCriticalSection() - { - if (m_cs) - m_cs->exit(); - } -}; - -// These should be null on creation then non-null in WinMain or equivalent. -// This allows us to be silently non-threadsafe for WB and other single-threaded apps. -extern CriticalSection *TheAsciiStringCriticalSection; -extern CriticalSection *TheUnicodeStringCriticalSection; -extern CriticalSection *TheDmaCriticalSection; -extern CriticalSection *TheMemoryPoolCriticalSection; -extern CriticalSection *TheDebugLogCriticalSection; diff --git a/Generals/Code/GameEngine/Include/Common/DamageFX.h b/Generals/Code/GameEngine/Include/Common/DamageFX.h deleted file mode 100644 index 2802db854bd..00000000000 --- a/Generals/Code/GameEngine/Include/Common/DamageFX.h +++ /dev/null @@ -1,165 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DamageFX.h ///////////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, November 2001 -// Desc: Damage Effects Descriptions -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/GameCommon.h" -#include "Common/NameKeyGenerator.h" -#include "Common/STLTypedefs.h" -#include "GameLogic/Damage.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class DamageFXStore; -class FXList; -class INI; - -//------------------------------------------------------------------------------------------------- -typedef const FXList* ConstFXListPtr; - -//------------------------------------------------------------------------------------------------- -/** - A DamageFX is an object used to describe how an object reacts to taking a particular type - of damage. (Note that "reacts" here implies only audio-video effects, not logic effects, - damage modifiers, etc.) - - Conceptually speaking, every unit with a Body module has a DamageFX object. When it receives damage, - it asks its DamageFX module to produce an appropriate a/v effect, which can vary by type of damage - (eg, explosion, armor-piercing, flame, etc) and amount ("minor" or "major"). - - Notes: - - -- Every particular damage-type within a DamageFX can have a "minor" and/or "major" effect; - basically, if the damage done exceeds a specified threshold (or if there isn't a "minor" - effect), the major effect is used. - - -- DamageFX is shared between multiple units; there should generally only be one instance - of any particular class. The implication is that it should not require private data storage - to do what it needs to do, aside from stuff initialized at object instantiation time. To help - enforce this, all it's methods are declared 'const'. If you can't implement the damage you - need within this framework, please *don't* simply de-const things, because it could lead to very - strange side-effects. Instead, the system will have to be enhanced to allow for multiple instances - of each DamageFX. -*/ -//------------------------------------------------------------------------------------------------- -class DamageFX -{ -public: - - DamageFX(); - - void clear(); - - /** - This is the main public access point to the system: when you want to execute the - a/v fx used for a specific damage type, call this method. (It is OK for source and/or - victim to be null, but you should pass them when available.) - */ - void doDamageFX(DamageType t, Real damageAmount, const Object* source, const Object* victim) const; - - UnsignedInt getDamageFXThrottleTime(DamageType t, const Object* source) const; - - const FieldParse* getFieldParse() const; - -private: - - ConstFXListPtr getDamageFXList(DamageType t, Real damageAmount, const Object* source) const; - - static void parseAmount( INI* ini, void *instance, void*, const void* ); - static void parseMajorFXList( INI* ini, void *instance, void*, const void* ); - static void parseMinorFXList( INI* ini, void *instance, void*, const void* ); - static void parseTime( INI* ini, void *instance, void*, const void* ); - - /* - this isn't terribly efficient since this is pretty sparsely populated - and with lots of redundancy, but since we allocate very few of these, - it's not worth more effort at this time... - */ - struct DFX - { - Real m_amountForMajorFX; ///< if damage done is >= this, use major fx - ConstFXListPtr m_majorDamageFXList; ///< fx to make - ConstFXListPtr m_minorDamageFXList; ///< fx to make - UnsignedInt m_damageFXThrottleTime; - - DFX() - { - clear(); - } - - void clear() - { - m_amountForMajorFX = 0.0f; - m_majorDamageFXList = nullptr; - m_minorDamageFXList = nullptr; - m_damageFXThrottleTime = 0; - } - }; - - DFX m_dfx[DAMAGE_NUM_TYPES][LEVEL_COUNT]; -}; - -//------------------------------------------------------------------------------------------------- -/** - The "store" used to hold all the DamageFXs in existence. This is usually used when creating - an Object (actually, a Body module), but can be used at any time after that. (It is explicitly - OK to swap an Object's DamageFX out at any given time.) -*/ -//------------------------------------------------------------------------------------------------- -class DamageFXStore : public SubsystemInterface -{ - -public: - - DamageFXStore(); - virtual ~DamageFXStore() override; - - virtual void init() override; - virtual void reset() override; - virtual void update() override; - - /** - Find the DamageFX with the given name. If no such DamageFX exists, return null. - */ - const DamageFX *findDamageFX( NameKeyType namekey ) const; - const DamageFX *findDamageFX( const AsciiString& name ) const; - const DamageFX *findDamageFX( const char* name ) const; - - static void parseDamageFXDefinition(INI* ini); - - -private: - - typedef std::hash_map< NameKeyType, DamageFX, rts::hash, rts::equal_to/**/> DamageFXMap; - DamageFXMap m_dfxmap; - -}; - -// EXTERNALS ////////////////////////////////////////////////////////////////////////////////////// -extern DamageFXStore *TheDamageFXStore; diff --git a/Generals/Code/GameEngine/Include/Common/DataChunk.h b/Generals/Code/GameEngine/Include/Common/DataChunk.h deleted file mode 100644 index b36ce6007b1..00000000000 --- a/Generals/Code/GameEngine/Include/Common/DataChunk.h +++ /dev/null @@ -1,231 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// DataChunk.h -// Data chunk classes for saving and loading -// Author: Michael S. Booth, October 2000 - -#pragma once - -#include "Common/GameMemory.h" -#include "Common/Dict.h" -#include "Common/MapReaderWriterInfo.h" - -typedef unsigned short DataChunkVersionType; - -// forward declarations -class DataChunkInput; -class DataChunkOutput; -class DataChunkTableOfContents; - -//---------------------------------------------------------------------- -// Mapping -//---------------------------------------------------------------------- -class Mapping : public MemoryPoolObject -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(Mapping, "Mapping") -public: - Mapping* next; - AsciiString name; - UnsignedInt id; -}; -EMPTY_DTOR(Mapping) - -//---------------------------------------------------------------------- -// OutputChunk -//---------------------------------------------------------------------- -class OutputChunk : public MemoryPoolObject -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(OutputChunk, "OutputChunk") -public: - OutputChunk* next; - UnsignedInt id; // chunk symbol type from table of contents - Int filepos; // position of file at start of data offset -}; -EMPTY_DTOR(OutputChunk) - -//---------------------------------------------------------------------- -// InputChunk -//---------------------------------------------------------------------- -class InputChunk : public MemoryPoolObject -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(InputChunk, "InputChunk") -public: - InputChunk* next; - UnsignedInt id; // chunk symbol type from table of contents - DataChunkVersionType version; // version of data - Int chunkStart; // tell position of the start of chunk data (past header). - Int dataSize; // total data size of chunk - Int dataLeft; // data left to read in this chunk -}; -EMPTY_DTOR(InputChunk) - -//---------------------------------------------------------------------- -// DataChunkTableOfContents -//---------------------------------------------------------------------- -class DataChunkTableOfContents -{ - Mapping* m_list; /// @TODO: This should be a hash table - Int m_listLength; - UnsignedInt m_nextID; // simple ID allocator - Bool m_headerOpened; - - Mapping *findMapping( const AsciiString& name ); // return mapping data - -public: - DataChunkTableOfContents(); - ~DataChunkTableOfContents(); - - UnsignedInt getID( const AsciiString& name ); // convert name to integer identifier - AsciiString getName( UnsignedInt id ); // convert integer identifier to name - UnsignedInt allocateID( const AsciiString& name ); // create new ID for given name or return existing mapping - - Bool isOpenedForRead() {return m_headerOpened;}; - - void write(OutputStream &out); - void read(ChunkInputStream &in); -}; - - -//---------------------------------------------------------------------- -// DataChunkOutput -//---------------------------------------------------------------------- -class DataChunkOutput -{ -protected: - OutputStream* m_pOut; // The actual output stream. - FILE * m_tmp_file; // tmp output file stream - DataChunkTableOfContents m_contents; // table of contents of data chunk types - OutputChunk* m_chunkStack; // current stack of open data chunks - -public: - DataChunkOutput( OutputStream *pOut ); - ~DataChunkOutput(); - - void openDataChunk( const char *name, DataChunkVersionType ver ); - void closeDataChunk(); - - void writeReal(Real r); - void writeInt(Int i); - void writeByte(Byte b); - void writeAsciiString(const AsciiString& string); - void writeUnicodeString(UnicodeString string); - void writeArrayOfBytes(char *ptr, Int len); - void writeDict(const Dict& d); - void writeNameKey(const NameKeyType key); -}; - -//---------------------------------------------------------------------- -// DataChunkInput -//---------------------------------------------------------------------- -struct DataChunkInfo -{ - AsciiString label; - AsciiString parentLabel; - DataChunkVersionType version; - Int dataSize; -}; - -typedef Bool (*DataChunkParserPtr)( DataChunkInput &file, DataChunkInfo *info, void *userData ); - -//---------------------------------------------------------------------- -// UserParser -//---------------------------------------------------------------------- -class UserParser : public MemoryPoolObject -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(UserParser, "UserParser") -public: - UserParser *next; - - DataChunkParserPtr parser; // the user parsing function - AsciiString label; // the data chunk label to match - AsciiString parentLabel; // the parent chunk's label (the scope) - void *userData; // user data pointer -}; -EMPTY_DTOR(UserParser) - -//---------------------------------------------------------------------- -// DataChunkInput -//---------------------------------------------------------------------- -class DataChunkInput -{ - enum {CHUNK_HEADER_BYTES = 4}; // 2 shorts in chunk file header. -protected: - ChunkInputStream* m_file; // input file stream - DataChunkTableOfContents m_contents; // table of contents of data chunk types - Int m_fileposOfFirstChunk; // seek position of first data chunk - UserParser* m_parserList; // list of all registered parsers for this input stream - InputChunk* m_chunkStack; // current stack of open data chunks - - void clearChunkStack(); // clear the stack - - void decrementDataLeft( int size ); // update data left in chunk(s) - -public: - void *m_currentObject; // user parse routines can use this to allow one chunk - // to create an object, and a subsequent chunk to - // parse values into that object. However, the second - // chunk parser could also create and parse an object - // of its own if this pointer is null. - // The parser of the base class should set this pointer to null. - void *m_userData; // user data hook - -public: - DataChunkInput( ChunkInputStream *pStream ); - ~DataChunkInput(); - - // register a parser function for data chunks with labels matching "label", whose parent - // chunks labels match "parentLabel" (or null for global scope) - void registerParser( const AsciiString& label, const AsciiString& parentLabel, DataChunkParserPtr parser, void *userData = nullptr ); - - Bool parse( void *userData = nullptr ); // parse the chunk stream using registered parsers - // assumed to be at the start of chunk when called - // can be called recursively - - Bool isValidFileType(); ///< Returns TRUE if it is our file format. - AsciiString openDataChunk(DataChunkVersionType *ver ); - void closeDataChunk(); // close chunk and move to start of next chunk - - Bool atEndOfFile() { return (m_file->eof()) ? true : false; } // return true if at end of file - Bool atEndOfChunk(); // return true if all data has been read from this chunk - - void reset(); // reset to just-opened state - - AsciiString getChunkLabel(); // return label of current data chunk - DataChunkVersionType getChunkVersion(); // return version of current data chunk - unsigned int getChunkDataSize(); // return size of data stored in this chunk - unsigned int getChunkDataSizeLeft(); // return size of data left to read in this chunk - - - Real readReal(); - Int readInt(); - Byte readByte(); - - AsciiString readAsciiString(); - UnicodeString readUnicodeString(); - Dict readDict(); - void readArrayOfBytes(char *ptr, Int len); - - NameKeyType readNameKey(); -}; diff --git a/Generals/Code/GameEngine/Include/Common/Dict.h b/Generals/Code/GameEngine/Include/Common/Dict.h deleted file mode 100644 index 9bc7ffb12b3..00000000000 --- a/Generals/Code/GameEngine/Include/Common/Dict.h +++ /dev/null @@ -1,361 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Dict.h -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: Dict.h -// -// Created: Steven Johnson, November 2001 -// -// Desc: General-purpose dictionary class -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "Common/Errors.h" -#include "Common/NameKeyGenerator.h" - -// ----------------------------------------------------- -/** - Dict provides a general utility class for maintaining - a sorted key-value pair list. Keys are currently required - to be of type NameKeyType, and data may be Bool, int, real, - or string. - - Current implementation keeps the pairs sorted by key, and - does a binary search for lookups; this might change in the future, - depending on usage and performance (e.g., to a hashtable). So - don't rely on the quirks of this implementation. -*/ -class Dict -{ -public: - enum - { - MAX_LEN = 32767 ///< max total len of any Dict, in Pairs - }; - - enum DataType - { - DICT_NONE = -1, // this is returned by getType and getNthType to indicate "invalid key/index" - DICT_BOOL = 0, // note, we rely on the fact that this constant is zero in the code. so don't change it. - DICT_INT, - DICT_REAL, - DICT_ASCIISTRING, - DICT_UNICODESTRING - }; - - /** - Default constructor -- construct a new, empty Dict. - */ - Dict(Int numPairsToPreAllocate = 0); - - /** - Copy constructor -- make this Dict identical to the - other Dict. (This is actually quite efficient, because - they will simply share the same data and increment the - refcount.) - */ - Dict(const Dict& src); - - /** - Destructor. Not too exciting... clean up the works and such. - */ - ~Dict(); - - /** - */ - Dict& operator=(const Dict& src); - - /** - remove all pairs. - */ - void clear(); - - /** - return the number of key-value pairs in the dict. - */ - Int getPairCount() const; - - /** - Return the key for the nth pair (0-based index). - return NAMEKEY_INVALID if n is out of range. - */ - NameKeyType getNthKey(Int n) const; - - /** - Return the datatype for the pair with the given key. - return DICT_NONE if no pair with the key exists. - */ - DataType getType(NameKeyType key) const; - - /** - Return there is a pair with the given key and datatype, return true. - */ - Bool known(NameKeyType key, DataType d) const - { - return getType(key) == d; - } - - /** - Return the datatype for the nth pair (0-based index). - return DICT_NONE if n is out of range. - */ - DataType getNthType(Int n) const; - - /** - return the value for the pair with the given key. - if there is no pair with the given key, or the value is - not of the correct type, 0 is returned. - */ - Bool getBool(NameKeyType key, Bool* exists = nullptr) const; - /** - return the value for the pair with the given key. - if there is no pair with the given key, or the value is - not of the correct type, 0 is returned. - */ - Int getInt(NameKeyType key, Bool* exists = nullptr) const; - /** - return the value for the pair with the given key. - if there is no pair with the given key, or the value is - not of the correct type, 0 is returned. - */ - Real getReal(NameKeyType key, Bool* exists = nullptr) const; - /** - return the value for the pair with the given key. - if there is no pair with the given key, or the value is - not of the correct type, "" is returned. - */ - AsciiString getAsciiString(NameKeyType key, Bool* exists = nullptr) const; - /** - return the value for the pair with the given key. - if there is no pair with the given key, or the value is - not of the correct type, "" is returned. - */ - UnicodeString getUnicodeString(NameKeyType key, Bool* exists = nullptr) const; - - /** - return the value for the pair with the given index. - if the index is out of range, or the value is - not of the correct type, 0 is returned. - */ - Bool getNthBool(Int n) const; - /** - return the value for the pair with the given index. - if the index is out of range, or the value is - not of the correct type, 0 is returned. - */ - Int getNthInt(Int n) const; - /** - return the value for the pair with the given index. - if the index is out of range, or the value is - not of the correct type, 0 is returned. - */ - Real getNthReal(Int n) const; - /** - return the value for the pair with the given index. - if the index is out of range, or the value is - not of the correct type, "" is returned. - */ - AsciiString getNthAsciiString(Int n) const; - /** - return the value for the pair with the given index. - if the index is out of range, or the value is - not of the correct type, "" is returned. - */ - UnicodeString getNthUnicodeString(Int n) const; - - /** - set the value for the pair with the given key. - if no such pair exists, it is created. - if such a pair exists, it is replaced. - note that when replacing a pair, the new and old - data types need not match. - */ - void setBool(NameKeyType key, Bool value); - /** - set the value for the pair with the given key. - if no such pair exists, it is created. - if such a pair exists, it is replaced. - note that when replacing a pair, the new and old - data types need not match. - */ - void setInt(NameKeyType key, Int value); - /** - set the value for the pair with the given key. - if no such pair exists, it is created. - if such a pair exists, it is replaced. - note that when replacing a pair, the new and old - data types need not match. - */ - void setReal(NameKeyType key, Real value); - /** - set the value for the pair with the given key. - if no such pair exists, it is created. - if such a pair exists, it is replaced. - note that when replacing a pair, the new and old - data types need not match. - */ - void setAsciiString(NameKeyType key, const AsciiString& value); - /** - set the value for the pair with the given key. - if no such pair exists, it is created. - if such a pair exists, it is replaced. - note that when replacing a pair, the new and old - data types need not match. - */ - void setUnicodeString(NameKeyType key, const UnicodeString& value); - - /** - remove the pair with the given key. if such a pair existed, return true. - if no such pair existed, return false. - */ - Bool remove(NameKeyType key); - - /** - copy the pair with the given key from 'that', replacing any such pair in 'this'. - if no such pair exists in 'that', any pair with that key will be removed from 'this'. - */ - void copyPairFrom(const Dict& that, NameKeyType key); - -private: - - struct DictPair; - struct DictPairData; - - DictPairData* m_data; // pointer to ref counted Pair data - - void sortPairs(); - Dict::DictPair *setPrep(NameKeyType key, Dict::DataType type); - DictPair* findPairByKey(NameKeyType key) const; - void releaseData(); - DictPair *ensureUnique(int numPairsNeeded, Bool preserveData, DictPair *pairToTranslate); - - enum DictPairKeyType - { - DICTPAIRKEY_ILLEGAL = 0 - }; - - // danger... this is Plain Old Data and allocated in a skanky way; - // and thus the ctor/dtor for DictPair will never be called. so don't - // bother writing one. - struct DictPair - { - private: - DictPairKeyType m_key; - void* m_value; - - static DictPairKeyType createKey(NameKeyType keyVal, DataType nt) - { - return (DictPairKeyType)((((UnsignedInt)(keyVal)) << 8) | ((UnsignedInt)nt)); - } - - static DataType getTypeFromKey(DictPairKeyType nk) - { - return (DataType)(((UnsignedInt)nk) & 0xff); - } - - static NameKeyType getNameFromKey(DictPairKeyType nk) - { - return (NameKeyType)(((UnsignedInt)nk) >> 8); - } - - - public: - void clear(); - void copyFrom(DictPair* that); - void setNameAndType(NameKeyType key, DataType type); - DataType getType() const { return getTypeFromKey(m_key); } - NameKeyType getName() const { return getNameFromKey(m_key); } - Bool* asBool() { return (Bool*)&m_value; } - Int* asInt() { return (Int*)&m_value; } - Real* asReal() { return (Real*)&m_value; } - AsciiString* asAsciiString() { return (AsciiString*)&m_value; } - UnicodeString* asUnicodeString() { return (UnicodeString*)&m_value; } - }; - - struct DictPairData - { - unsigned short m_refCount; // reference count - unsigned short m_numPairsAllocated; // length of data allocated - unsigned short m_numPairsUsed; // length of data allocated - //DictPair m_pairs[]; - - DictPair* peek() { return (DictPair*)(this+1); } - }; - - #ifdef RTS_DEBUG - void validate() const; - #else - void validate() const { } - #endif - -}; - -// ----------------------------------------------------- -inline Dict::Dict(const Dict& src) : m_data(src.m_data) -{ - if (m_data) - ++m_data->m_refCount; -} - -// ----------------------------------------------------- -inline Dict::~Dict() -{ - releaseData(); -} - -// ----------------------------------------------------- -inline Int Dict::getPairCount() const -{ - return m_data ? m_data->m_numPairsUsed : 0; -} - -// ----------------------------------------------------- -inline NameKeyType Dict::getNthKey(Int n) const -{ - if (!m_data || n < 0 || n >= m_data->m_numPairsUsed) - return NAMEKEY_INVALID; - return m_data->peek()[n].getName(); -} - -// ----------------------------------------------------- -inline Dict::DataType Dict::getNthType(Int n) const -{ - if (!m_data || n < 0 || n >= m_data->m_numPairsUsed) - return DICT_NONE; - return m_data->peek()[n].getType(); -} diff --git a/Generals/Code/GameEngine/Include/Common/Directory.h b/Generals/Code/GameEngine/Include/Common/Directory.h deleted file mode 100644 index 40ef4d43b3a..00000000000 --- a/Generals/Code/GameEngine/Include/Common/Directory.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Directory.h ////////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, August 2002 -// Desc: Directory info class -/////////////////////////////////////////////////////////////////////////////////////////////////// -#if (0) - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/AsciiString.h" -#include "Common/STLTypedefs.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// - -// TYPES ////////////////////////////////////////////////////////////////////////////////////////// - -class FileInfo -{ -public: - FileInfo() {} - ~FileInfo() {} - - void set( const WIN32_FIND_DATA& info ); - - AsciiString filename; - time_t creationTime; - time_t accessTime; - time_t modTime; - DWORD attributes; - DWORD filesize; // only care about 32 bits for our purposes - -protected: -}; - -struct FileInfoComparator -{ - bool operator()(const FileInfo& a, const FileInfo& b) const - { - return a.filename < b.filename; - } -}; - -//------------------------------------------------------------------------------------------------- - -typedef std::set FileInfoSet; - -//------------------------------------------------------------------------------------------------- - -class Directory -{ -public: - Directory(const AsciiString& dirPath); - ~Directory() {} - - FileInfoSet* getFiles(); - FileInfoSet* getSubdirs(); - -protected: - AsciiString m_dirPath; - - FileInfoSet m_files; - FileInfoSet m_subdirs; -}; - -//------------------------------------------------------------------------------------------------- - -#endif diff --git a/Generals/Code/GameEngine/Include/Common/DisabledTypes.h b/Generals/Code/GameEngine/Include/Common/DisabledTypes.h deleted file mode 100644 index e158c2a32a7..00000000000 --- a/Generals/Code/GameEngine/Include/Common/DisabledTypes.h +++ /dev/null @@ -1,112 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DisabledTypes.h ////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, September 2002 -// Desc: Defines all the types of disabled statii any given object can have. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Lib/BaseType.h" -#include "Common/BitFlags.h" -#include "Common/BitFlagsIO.h" - -//------------------------------------------------------------------------------------------------- -/** Kind of flags for determining groups of things that belong together - * NOTE: You *MUST* keep this in the same order as the DisabledNames[] below */ -//------------------------------------------------------------------------------------------------- -enum DisabledType CPP_11(: Int) -{ - DISABLED_DEFAULT, //Typical disable -- like systems, things that don't need to run. - DISABLED_HACKED, //This unit has been hacked - DISABLED_EMP, //This unit has been disabled via electro-magnetic-pulse. - DISABLED_HELD, //Special case -- held means it can fire and isHeld checks to make sure ONLY held is set! - DISABLED_PARALYZED, //Battle plans have changed, and unit is confused/paralyzed - DISABLED_UNMANNED, //Vehicle is unmanned - DISABLED_UNDERPOWERED,//Separate from ScriptUnderpowered, the owning player has insufficient power. Energy status controls this - DISABLED_FREEFALL, //This unit has been disabled via being in free fall - - DISABLED_AWESTRUCK, - DISABLED_BRAINWASHED, - DISABLED_SUBDUED, ///< Temporarily shut down by Subdual damage - //These ones are specifically for scripts to enable/reenable! - DISABLED_SCRIPT_DISABLED, - DISABLED_SCRIPT_UNDERPOWERED, - - DISABLED_COUNT, - - DISABLED_ANY = 65535 ///< Do not use this value for setting disabled types (read-only) -}; - -typedef BitFlags DisabledMaskType; - -#define MAKE_DISABLED_MASK(k) DisabledMaskType(DisabledMaskType::kInit, (k)) -#define MAKE_DISABLED_MASK2(k,a) DisabledMaskType(DisabledMaskType::kInit, (k), (a)) -#define MAKE_DISABLED_MASK3(k,a,b) DisabledMaskType(DisabledMaskType::kInit, (k), (a), (b)) -#define MAKE_DISABLED_MASK4(k,a,b,c) DisabledMaskType(DisabledMaskType::kInit, (k), (a), (b), (c)) -#define MAKE_DISABLED_MASK5(k,a,b,c,d) DisabledMaskType(DisabledMaskType::kInit, (k), (a), (b), (c), (d)) - -inline Bool TEST_DISABLEDMASK(const DisabledMaskType& m, DisabledType t) -{ - return m.test(t); -} - -inline Bool TEST_DISABLEDMASK_ANY(const DisabledMaskType& m, const DisabledMaskType& mask) -{ - return m.anyIntersectionWith(mask); -} - -inline Bool TEST_DISABLEDMASK_MULTI(const DisabledMaskType& m, const DisabledMaskType& mustBeSet, const DisabledMaskType& mustBeClear) -{ - return m.testSetAndClear(mustBeSet, mustBeClear); -} - -inline Bool DISABLEDMASK_ANY_SET(const DisabledMaskType& m) -{ - return m.any(); -} - -inline void CLEAR_DISABLEDMASK(DisabledMaskType& m) -{ - m.clear(); -} - -inline void SET_ALL_DISABLEDMASK_BITS(DisabledMaskType& m) -{ - m.clear(); - m.flip(); -} - -inline void FLIP_DISABLEDMASK(DisabledMaskType& m) -{ - m.flip(); -} - - - -// defined in Common/System/DisabledTypes.cpp -extern DisabledMaskType DISABLEDMASK_NONE; // inits to all zeroes -extern DisabledMaskType DISABLEDMASK_ALL; // inits to all bits set. diff --git a/Generals/Code/GameEngine/Include/Common/DiscreteCircle.h b/Generals/Code/GameEngine/Include/Common/DiscreteCircle.h deleted file mode 100644 index a57877b9f98..00000000000 --- a/Generals/Code/GameEngine/Include/Common/DiscreteCircle.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// DiscreteCircle.h /////////////////////////////////////////////////////////////////////////////// -// John K McDonald, Jr. -// September 2002 -// DO NOT DISTRIBUTE - -#pragma once - -//------------------------------------------------------------------------------------------------- -/** - One horizontal line of the circle we are going to generate, the points drawn should be from - (xStart, yPos)-(xEnd, yPos), inclusive. -*/ -struct HorzLine -{ - Int yPos; - Int xStart; - Int xEnd; -}; - -// Vector and Iterators for the HorzLine struct. -typedef std::vector VecHorzLine; -typedef VecHorzLine::iterator VecHorzLineIt; - -//------------------------------------------------------------------------------------------------- - -// Useful if you'd like to not have to deal with the logic of drawing the circle. -typedef void (*ScanlineDrawFunc)(Int xStart, Int xEnd, Int yPos, void *otherParms); - -/** - DiscreteCircle generates a circle centered at xCenter, yCenter, including radius. It generates - horizontal segments for the top half of the circle only, so they need to be duplicated for the - bottom half. -*/ -class DiscreteCircle -{ - VecHorzLine m_edges; // Should be HorzLines - Int m_yPos; // Used to know when to draw the bottom scanline - Int m_yPosDoubled; // Used to draw the bottom half of the circle. - - public: - DiscreteCircle(Int xCenter, Int yCenter, Int radius); - __inline const VecHorzLine &getEdges() const { return m_edges; } - __inline Int getEdgeCount() const { return m_edges.size(); } - void drawCircle(ScanlineDrawFunc functionToDrawWith, void *parmToPass); - - protected: - void generateEdgePairs(Int xCenter, Int yCenter, Int radius); - void removeDuplicates(); -}; diff --git a/Generals/Code/GameEngine/Include/Common/Geometry.h b/Generals/Code/GameEngine/Include/Common/Geometry.h deleted file mode 100644 index e743afa1672..00000000000 --- a/Generals/Code/GameEngine/Include/Common/Geometry.h +++ /dev/null @@ -1,190 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Geometry.h /////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, November 2001 -// Desc: Geometry descriptions -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "Lib/BaseType.h" -#include "Common/AsciiString.h" -#include "Common/RandomValue.h" -#include "Common/Snapshot.h" - -class INI; - -//------------------------------------------------------------------------------------------------- -/** Geometry type descriptions, keep this in the same order as GeometryNames[] below - * - * NOTE: Do *NOT* change the order of these defines unless you update the - * partition manager ... in particular theCollideTestProcs depend on the - * order of this geometry and the fact that the values start at 1 - */ -//------------------------------------------------------------------------------------------------- -enum GeometryType CPP_11(: Int) -{ - GEOMETRY_SPHERE, ///< partition/collision testing as sphere. (majorRadius = radius) - GEOMETRY_CYLINDER, ///< partition/collision testing as cylinder. (majorRadius = radius, height = height) - GEOMETRY_BOX, ///< partition/collision testing as rectangular box (majorRadius = half len in forward dir; minorRadius = half len in side dir; height = height) - - GEOMETRY_NUM_TYPES, - GEOMETRY_FIRST = 0 -}; - -#ifdef DEFINE_GEOMETRY_NAMES -static const char *const GeometryNames[] = -{ - "SPHERE", - "CYLINDER", - "BOX", - nullptr -}; -static_assert(ARRAY_SIZE(GeometryNames) == GEOMETRY_NUM_TYPES + 1, "Incorrect array size"); -#endif // end DEFINE_GEOMETRY_NAMES - -//------------------------------------------------------------------------------------------------- -#if defined(RTS_DEBUG) -enum ExtentModType CPP_11(: Int) -{ - EXTENTMOD_INVALID = 0, - EXTENTMOD_TYPE = 1, - EXTENTMOD_MAJOR = 2, - EXTENTMOD_MINOR = 3, - EXTENTMOD_HEIGHT = 4, -}; -static const Real EXTENT_BIG_CHANGE = 10.0f; -#endif - -//------------------------------------------------------------------------------------------------- -/** Geometry information */ -//------------------------------------------------------------------------------------------------- -class GeometryInfo : public Snapshot -{ -private: - GeometryType m_type; - Bool m_isSmall; ///< if true, geometry is assumed to fit in a single partition cell - Real m_height; - Real m_majorRadius; - Real m_minorRadius; - - Real m_boundingCircleRadius; ///< not in INI file -- size of bounding circle (2d) - Real m_boundingSphereRadius; ///< not in INI -- size of bounding sphere (3d) - - void calcBoundingStuff(); - -protected: - - // snapshot methods - virtual void crc( Xfer *xfer ) override; - virtual void xfer( Xfer *xfer ) override; - virtual void loadPostProcess() override; - -public: - - static void parseGeometryType( INI* ini, void * /*instance*/, void *store, const void* /*userData*/ ); - static void parseGeometryIsSmall( INI* ini, void * /*instance*/, void *store, const void* /*userData*/ ); - static void parseGeometryHeight( INI* ini, void * /*instance*/, void *store, const void* /*userData*/ ); - static void parseGeometryMajorRadius( INI* ini, void * /*instance*/, void *store, const void* /*userData*/ ); - static void parseGeometryMinorRadius( INI* ini, void * /*instance*/, void *store, const void* /*userData*/ ); - - GeometryInfo(GeometryType type, Bool isSmall, Real height, Real majorRadius, Real minorRadius) - { - m_boundingCircleRadius = 0.0f; - m_boundingSphereRadius = 0.0f; - set(type, isSmall, height, majorRadius, minorRadius); - } - - void set(GeometryType type, Bool isSmall, Real height, Real majorRadius, Real minorRadius); - - // bleah, icky but needed for legacy code - void setMajorRadius(Real majorRadius) - { - m_majorRadius = majorRadius; - calcBoundingStuff(); - } - - // bleah, icky but needed for legacy code - void setMinorRadius(Real minorRadius) - { - m_minorRadius = minorRadius; - calcBoundingStuff(); - } - - GeometryType getGeomType() const { return m_type; } - Bool getIsSmall() const { return m_isSmall; } - Real getMajorRadius() const { return m_majorRadius; } // x-axis - Real getMinorRadius() const { return m_minorRadius; } // y-axis - - // this has been removed and should never need to be called... - // you should generally call getMaxHeightAbovePosition() instead. (srj) - //inline Real getGeomHeight() const { return m_height; } // z-axis - - Real getBoundingCircleRadius() const { return m_boundingCircleRadius; } - Real getBoundingSphereRadius() const { return m_boundingSphereRadius; } - - Bool isIntersectedByLineSegment(const Coord3D& loc, const Coord3D& from, const Coord3D& to) const; - - Real getFootprintArea() const; - - // given an object with this geom, how far above the object's canonical position does its max z extend? - Real getMaxHeightAbovePosition() const; - - // given an object with this geom, how far below the object's canonical position does its max z extend? - Real getMaxHeightBelowPosition() const; - - // given an object with this geom, how far above/below the object's canonical position is its center? - Real getZDeltaToCenterPosition() const; - - // given an object with this geom, located at 'pos', where is the "center" of the geometry? - void getCenterPosition(const Coord3D& pos, Coord3D& center) const; - - // given an object with this geom, located at 'pos', and another obj with the given - // pos & geom, calc the min and max pitches from this to that. - void calcPitches(const Coord3D& thisPos, const GeometryInfo& that, const Coord3D& thatPos, - Real& minPitch, Real& maxPitch) const; - - /// expand the 2d footprint - void expandFootprint(Real radius); - - /// get the 2d bounding box - void get2DBounds(const Coord3D& geomCenter, Real angle, Region2D& bounds ) const; - - void makeRandomOffsetWithinFootprint(Coord3D& pt, const RandomValueClass& random = LogicRandomValueClass()) const; - void makeRandomOffsetOnPerimeter(Coord3D& pt) const; ///< Chooses a random point on the extent border. Uses game logic random! - - void clipPointToFootprint(const Coord3D& geomCenter, Coord3D& ptToClip) const; - - Bool isPointInFootprint(const Coord3D& geomCenter, const Coord3D& pt) const; - - // given an object with this geom, SET how far above the object's canonical position its max z should extend. - void setMaxHeightAbovePosition(Real z); - -#if defined(RTS_DEBUG) - void tweakExtents(ExtentModType extentModType, Real extentModAmount); - AsciiString getDescriptiveString() const; -#endif - -}; diff --git a/Generals/Code/GameEngine/Include/Common/Handicap.h b/Generals/Code/GameEngine/Include/Common/Handicap.h deleted file mode 100644 index 2ffabc9458e..00000000000 --- a/Generals/Code/GameEngine/Include/Common/Handicap.h +++ /dev/null @@ -1,116 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Handicap.h //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: Handicap.h -// -// Created: Steven Johnson, October 2001 -// -// Desc: @todo -// -//----------------------------------------------------------------------------- - -#pragma once - -#include "Lib/BaseType.h" - -// ---------------------------------------------------------------------------------------------- -class Object; -class Dict; -class ThingTemplate; - -// ---------------------------------------------------------------------------------------------- -/** - Handicap encapsulates the sets of modifiers to abilities used to balance - the game and give different abilities to different Players. - Conceptually, it's a large set of coefficients (typically, but not necessarily, - in the range of 0.0...1.0). - - Usage example (conceptual): - - Real armorCoef = this->m_handicap->getHandicap(ARMOR, this); - Real actualArmor = this->getArmorValue() * armorCoef; -*/ -class Handicap -{ -public: - - // NOTE: if you ever add/remove/change the enums in HandicapType, - // you must also modify initFromDict()! - enum HandicapType - { - BUILDCOST, - BUILDTIME, - - HANDICAP_TYPE_COUNT - }; - - Handicap(); - - /// reset all handicaps to a default value. - void init(); - - /** - initialize from the fields in the Dict. Note that this does NOT call init() - internally, so only those fields that are present in the dict will be set. - if you want to ensure all fields are something reasonable, you should call init() - prior to calling this. - */ - void readFromDict(const Dict* d); - - /** - return the multiplier for the given Handicap type on the given Object. - The Object's type (unit, building, etc.) will generally be examined - to determine what value to return. - */ - Real getHandicap(HandicapType t, const ThingTemplate *tmpl) const; - -protected: -private: - - // NOTE: if you ever add/remove/change the enums in ThingType, - // you must also modify initFromDict()! - enum ThingType - { - GENERIC, // if a thing is nothing else, it's generic. - BUILDINGS, - - THING_TYPE_COUNT - }; - - Real m_handicaps[HANDICAP_TYPE_COUNT][THING_TYPE_COUNT]; - - static ThingType getBestThingType(const ThingTemplate *tmpl); -}; diff --git a/Generals/Code/GameEngine/Include/Common/KindOf.h b/Generals/Code/GameEngine/Include/Common/KindOf.h deleted file mode 100644 index a7563273efa..00000000000 --- a/Generals/Code/GameEngine/Include/Common/KindOf.h +++ /dev/null @@ -1,221 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: KindOf.h ////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, Dec 2001 -// Desc: -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Lib/BaseType.h" -#include "Common/BitFlags.h" -#include "Common/BitFlagsIO.h" - -//------------------------------------------------------------------------------------------------- -/** Kind of flags for determining groups of things that belong together - * NOTE: You *MUST* keep this in the same order as the KindOfNames[] below */ -//------------------------------------------------------------------------------------------------- -enum KindOfType CPP_11(: Int) -{ - KINDOF_INVALID = -1, - - KINDOF_OBSTACLE, ///< an obstacle to land-based pathfinders - KINDOF_SELECTABLE, ///< Actually means MOUSE-INTERACTABLE (doesn't mean you can select it!) - KINDOF_IMMOBILE, ///< fixed in location - KINDOF_CAN_ATTACK, ///< can attack - KINDOF_STICK_TO_TERRAIN_SLOPE, ///< should be stuck at ground level, aligned to terrain slope. requires that IMMOBILE bit is also set. - KINDOF_CAN_CAST_REFLECTIONS, ///< can cast reflections in water - KINDOF_SHRUBBERY, ///< tree, bush, etc. - KINDOF_STRUCTURE, ///< structure of some sort (buildable or not) - KINDOF_INFANTRY, ///< unit like soldier etc - KINDOF_VEHICLE, ///< unit like tank, jeep, plane, helicopter, etc. - KINDOF_AIRCRAFT, ///< unit like plane, helicopter, etc., that is predominantly a flyer. (hovercraft are NOT aircraft) - KINDOF_HUGE_VEHICLE, ///< unit that is, technically, a vehicle, but WAY larger than normal (eg, Overlord) - KINDOF_DOZER, ///< a dozer - KINDOF_HARVESTER, ///< a harvester - KINDOF_COMMANDCENTER, ///< a command center -#ifdef ALLOW_SURRENDER - KINDOF_PRISON, ///< a prison detention center kind of thing - KINDOF_COLLECTS_PRISON_BOUNTY, ///< when prisoners are delivered to these, the player gets money - KINDOF_POW_TRUCK, ///< a pow truck can pick up and return prisoners -#endif - KINDOF_LINEBUILD, ///< wall-type thing that is built in a line - KINDOF_SALVAGER, ///< something that can create and use Salvage Crates - KINDOF_WEAPON_SALVAGER, ///< subset of salvager that can get weapon upgrades from salvage - KINDOF_TRANSPORT, ///< a true transport (has TransportContain) - KINDOF_BRIDGE, ///< a Bridge. (special structure) - KINDOF_LANDMARK_BRIDGE, ///< a landmark bridge (special bridge that isn't resizable) - KINDOF_BRIDGE_TOWER, ///< a bridge tower that we can target for bridge destruction - KINDOF_PROJECTILE, ///< Instead of being a ground or air unit, this object is special - KINDOF_PRELOAD, ///< all model data will be preloaded even if not on map - KINDOF_NO_GARRISON, ///< unit may not garrison bldgs, even if infantry bit is set - KINDOF_WAVEGUIDE, ///< water wave object - KINDOF_WAVE_EFFECT, ///< wave effect point - KINDOF_NO_COLLIDE, ///< Never collide with or be collided with - KINDOF_REPAIR_PAD, ///< is a repair pad object that can repair other machines - KINDOF_HEAL_PAD, ///< is a heal pad object that can heal flesh and bone units - KINDOF_STEALTH_GARRISON, /** enemy teams can't tell that unit is in building.. and if they - garrison that building, they stealth unit will eject. */ - KINDOF_CASH_GENERATOR, ///< used to check if the unit generates cash... checked by cash hackers and whatever else comes up -#if RTS_GENERALS - KINDOF_AIRFIELD, ///< unit has a runway that planes can takeoff/land on -#endif - KINDOF_DRAWABLE_ONLY, ///< template is used only to create drawables (not Objects) - KINDOF_MP_COUNT_FOR_VICTORY, ///< If a player loses all his buildings that have this kindof in a multiplayer game, he loses. - KINDOF_REBUILD_HOLE, ///< a GLA rebuild hole - KINDOF_SCORE, ///< Object counts for Multiplayer scores, and short-game calculations (for buildings) - KINDOF_SCORE_CREATE, ///< Object only counts for multiplayer score for creation. - KINDOF_SCORE_DESTROY, ///< Object only counts for multiplayer score for destruction. - KINDOF_NO_HEAL_ICON, ///< do not ever display healing icons on these objects - KINDOF_CAN_RAPPEL, ///< can rappel. duh. - KINDOF_PARACHUTABLE, ///< parachutable object -#ifdef ALLOW_SURRENDER - KINDOF_CAN_SURRENDER, ///< object that can surrender -#endif - KINDOF_CAN_BE_REPULSED, ///< object that runs away from a repulsor object. - KINDOF_MOB_NEXUS, ///< object that coordinates the members of a mob (i.e. GLAInfantryAngryMob) - KINDOF_IGNORED_IN_GUI, ///< object that is the members of a mob (i.e. GLAInfantryAngryMob) - KINDOF_CRATE, ///< a bonus crate - KINDOF_CAPTURABLE, ///< is "capturable" even if not an enemy (should generally be used only for structures, eg, Tech bldgs) - KINDOF_CLEARED_BY_BUILD, ///< is auto-cleared from the map when built over via construction - KINDOF_SMALL_MISSILE, ///< Missile object: ONLY USED FOR ANTI-MISSILE TARGETING PURPOSES! Keep using PROJECTILE! - KINDOF_ALWAYS_VISIBLE, ///< is never obscured by fog of war or shroud. mostly for UI feedback objects. - KINDOF_UNATTACKABLE, ///< You cannot target this thing, it probably doesn't really exist - KINDOF_MINE, ///< a landmine. (possibly also extend to Col. Burton timed charges?) - KINDOF_CLEANUP_HAZARD, ///< radiation and bio-poison are samples of area conditions that can be cleaned up (or avoided) - KINDOF_PORTABLE_STRUCTURE, ///< Flag to identify building like subobjects an Overlord is allowed to Contain. - KINDOF_ALWAYS_SELECTABLE, ///< is never unselectable (even if effectively dead). mostly for UI feedback objects. - KINDOF_ATTACK_NEEDS_LINE_OF_SIGHT, ///< Unit has to have clear line of sight (los) to attack. - KINDOF_WALK_ON_TOP_OF_WALL, ///< Units can walk on top of a wall made of these kind of objects. - KINDOF_DEFENSIVE_WALL, ///< wall can't be driven thru, even if crusher, so pathfinder must path around it - KINDOF_FS_POWER, ///< Faction structure power building - KINDOF_FS_FACTORY, ///< Faction structure power building - KINDOF_FS_BASE_DEFENSE, ///< Faction structure base defense - KINDOF_FS_TECHNOLOGY, ///< Faction structure technology building - KINDOF_AIRCRAFT_PATH_AROUND, ///< Tall enough that aircraft need to path around this. - KINDOF_LOW_OVERLAPPABLE, ///< When overlapped, things always overlap at a 'low' height rather than our object geom - KINDOF_FORCEATTACKABLE, ///< unit is always attackable via force-attack, even if not selectable - KINDOF_AUTO_RALLYPOINT, ///< When immobile-structure-object is selected, left clicking on ground will set new rally point without requiring command button. - KINDOF_TECH_BUILDING, ///< Neutral tech building - Oil derrick, Hospital, Radio Station, Refinery. - KINDOF_POWERED, ///< This object gets the Underpowered disabled condition when its owning player has power consumption exceed supply - KINDOF_PRODUCED_AT_HELIPAD, ///< ugh... hacky fix for comanche. (srj) - KINDOF_DRONE, ///< Object drone type -- used for filtering them out of battle plan bonuses, making un-snipable, and whatever else may come up. - KINDOF_CAN_SEE_THROUGH_STRUCTURE,///< Structure does not block line of sight. - KINDOF_BALLISTIC_MISSILE, ///< Large ballistic missiles that are specifically large enough to be targetted by base defenses. - KINDOF_CLICK_THROUGH, ///< Objects with this will never be picked by mouse interactions! - KINDOF_SUPPLY_SOURCE_ON_PREVIEW,///< Any thing that we can get "supplies" from that we want to show up on the map preview - KINDOF_PARACHUTE, ///< it's a parachute - KINDOF_GARRISONABLE_UNTIL_DESTROYED, ///< Object is capable of garrisoning troops until completely destroyed. - KINDOF_BOAT, ///< It's a boat! - KINDOF_IMMUNE_TO_CAPTURE, ///< Under no circumstances can this building ever be captured. - KINDOF_HULK, ///< Hulk types so we can do special things to them via scripts or other things that may come up. - KINDOF_SHOW_PORTRAIT_WHEN_CONTROLLED, ///< Only shows portraits when controlled. - KINDOF_SPAWNS_ARE_THE_WEAPONS, ///< Evaluate the spawn slaves as this object's weapons. - KINDOF_CANNOT_BUILD_NEAR_SUPPLIES, ///< you can't be built "too close" to anything that provides supplies - KINDOF_SUPPLY_SOURCE, ///< this object provides supplies - KINDOF_REVEAL_TO_ALL, ///< this object reveals shroud for all players - KINDOF_DISGUISER, ///< This object has the ability to disguise. - KINDOF_INERT, ///< this object shouldn't be considered for any sort of interaction with any player. - KINDOF_HERO, ///< Any of the single-instance infantry, JarmenKell, BlackLotus, ColonelBurton - KINDOF_IGNORES_SELECT_ALL, ///< Too late to figure out intelligently if something should respond to a Select All command - KINDOF_DONT_AUTO_CRUSH_INFANTRY, ///< These units don't try to crush the infantry if ai. - // TheSuperHackers @info Added in Zero Hour: - KINDOF_CLIFF_JUMPER, ///< Can't climb cliffs, but can jump off of them. - KINDOF_FS_SUPPLY_DROPZONE, ///< A supply dropzone. - KINDOF_FS_SUPERWEAPON, ///< A superweapon structure like a nuke silo, particle uplink cannon, scudstorm. - KINDOF_FS_BLACK_MARKET, ///< Is this object a black market? - KINDOF_FS_SUPPLY_CENTER, ///< Is this object a supply center? - KINDOF_FS_STRATEGY_CENTER, ///< Is this object a strategy center? - KINDOF_MONEY_HACKER, ///< Unit that generates money from air. Needed for things that directly power them up. - KINDOF_ARMOR_SALVAGER, ///< subset of salvager that can get armor upgrades from salvage - KINDOF_REVEALS_ENEMY_PATHS, ///< like the listening outpost... when selected, any enemy drawable will draw show paths when moused over - KINDOF_BOOBY_TRAP, ///< A sticky bomb that gets set off by 5 random and unrelated events. - KINDOF_FS_FAKE, ///< Fake structure! - KINDOF_FS_INTERNET_CENTER, ///< Internet Center. - KINDOF_BLAST_CRATER, ///< deeply gouges out the terrain under object footprint - KINDOF_PROP, ///< A prop, visual only, doesn't interact with other objects (rock, street sign, inert fire hydrant) - KINDOF_OPTIMIZED_TREE, ///< An optimized, client side only tree. (The only good kind of tree. jba) - KINDOF_FS_ADVANCED_TECH, ///< Represents each faction's advanced techtree building -- strategy center, propaganda center, and palace. - KINDOF_FS_BARRACKS, ///< A barracks - KINDOF_FS_WARFACTORY, ///< A war factory or arms dealer. - KINDOF_FS_AIRFIELD, ///< An airfield. - KINDOF_AIRCRAFT_CARRIER, ///< An aircraft carrier. - KINDOF_NO_SELECT, ///< Can't select it but you can mouse over it to see it's health (drones!) - KINDOF_REJECT_UNMANNED, ///< Unit cannot enter an unmanned vehicle. - KINDOF_CANNOT_RETALIATE, ///< Unit will not retaliate if asked. - KINDOF_TECH_BASE_DEFENSE, ///< Tech Building that acts as base defence when captured - KINDOF_EMP_HARDENED, ///< Like a delivery plane (B52, B3, CargoPlane,etc.) or a SpectreGunship, which sort-of IS the weapon... - KINDOF_DEMOTRAP, ///< Added strictly only for disarming purposes. They don't act like mines which have rendering and selection implications! - KINDOF_CONSERVATIVE_BUILDING, ///< Conservative structures aren't considered part of your base for sneak attack boundary calculations... - KINDOF_IGNORE_DOCKING_BONES, ///< Structure will not look up docking bones. Patch 1.03 hack. - - KINDOF_COUNT, // total number of kindofs - KINDOF_FIRST = 0, -}; - -typedef BitFlags KindOfMaskType; - -#define MAKE_KINDOF_MASK(k) KindOfMaskType(KindOfMaskType::kInit, (k)) - -inline Bool TEST_KINDOFMASK(const KindOfMaskType& m, KindOfType t) -{ - return m.test(t); -} - -inline Bool TEST_KINDOFMASK_ANY(const KindOfMaskType& m, const KindOfMaskType& mask) -{ - return m.anyIntersectionWith(mask); -} - -inline Bool TEST_KINDOFMASK_MULTI(const KindOfMaskType& m, const KindOfMaskType& mustBeSet, const KindOfMaskType& mustBeClear) -{ - return m.testSetAndClear(mustBeSet, mustBeClear); -} - -inline Bool KINDOFMASK_ANY_SET(const KindOfMaskType& m) -{ - return m.any(); -} - -inline void CLEAR_KINDOFMASK(KindOfMaskType& m) -{ - m.clear(); -} - -inline void SET_ALL_KINDOFMASK_BITS(KindOfMaskType& m) -{ - m.clear(); - m.flip(); -} - -inline void FLIP_KINDOFMASK(KindOfMaskType& m) -{ - m.flip(); -} - -// defined in Common/System/Kindof.cpp -extern KindOfMaskType KINDOFMASK_NONE; // inits to all zeroes -extern KindOfMaskType KINDOFMASK_FS; // Initializes all FS types for faction structures. diff --git a/Generals/Code/GameEngine/Include/Common/Language.h b/Generals/Code/GameEngine/Include/Common/Language.h deleted file mode 100644 index 1a25b2cef2a..00000000000 --- a/Generals/Code/GameEngine/Include/Common/Language.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Language.h /////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: Language.h -// -// Created: Colin Day, June 2001 -// -// Desc: Header for dealing with multiple languages -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////// - -// FORWARD REFERENCES ///////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// TYPE DEFINES /////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -// IMPORTANT: Make sure this enum is identical to the one in Noxstring tool -typedef enum -{ - - LANGUAGE_ID_US = 0, - LANGUAGE_ID_UK, - LANGUAGE_ID_GERMAN, - LANGUAGE_ID_FRENCH, - LANGUAGE_ID_SPANISH, - LANGUAGE_ID_ITALIAN, - LANGUAGE_ID_JAPANESE, - LANGUAGE_ID_JABBER, - LANGUAGE_ID_KOREAN, - LANGUAGE_ID_UNKNOWN - -} LanguageID; - -#define GameArrayEnd(array) (array)[(sizeof(array)/sizeof((array)[0]))-1] = 0 - -// INLINING /////////////////////////////////////////////////////////////////// - -// EXTERNALS ////////////////////////////////////////////////////////////////// -extern LanguageID OurLanguage; ///< our current language definition diff --git a/Generals/Code/GameEngine/Include/Common/List.h b/Generals/Code/GameEngine/Include/Common/List.h deleted file mode 100644 index 7bf417c09bd..00000000000 --- a/Generals/Code/GameEngine/Include/Common/List.h +++ /dev/null @@ -1,173 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//----------------------------------------------------------------------------= -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright(C) 2001 - All Rights Reserved -// -//---------------------------------------------------------------------------- -// -// Project: WSYS Library -// -// Module: -// -// File name: wsys/List.h -// -// Created: 10/31/01 -// -//---------------------------------------------------------------------------- - -#pragma once - -//---------------------------------------------------------------------------- -// Includes -//---------------------------------------------------------------------------- - -#include - -//---------------------------------------------------------------------------- -// Forward References -//---------------------------------------------------------------------------- - - -//---------------------------------------------------------------------------- -// Type Defines -//---------------------------------------------------------------------------- - -//================================ -// LLNode -//================================ -/** - * Link list node abstraction for WSYS. -*/ -//================================ - -class LListNode -{ - friend class LList; - - protected: - - LListNode *m_next; ///< Next node in list - LListNode *m_prev; ///< Previous node in list - Int m_pri; ///< Node's priority, used for sorting - void *m_item; ///< Item we are referencing if any - Bool m_autoDelete; ///< destroy() should call delete - - public: - - LListNode(); ///< Constructor - void remove(); ///< Removes node from list - void insert( LListNode *new_node ); ///< Inserts new_node infront of itself - void append( LListNode *new_node ); ///< Appends new node after itself - LListNode* next(); ///< Returns next node in list - LListNode* prev(); ///< Returns previous node in list - LListNode* loopNext(); ///< Returns next node in list, wrapping round to start of list if necessary - LListNode* loopPrev(); ///< Returns previous node in list, wrapping round to end of list if necessary - Bool inList(); ///< Returns whether or not node in list - Bool isHead(); ///< Returns whether or not this node is the head/tail node - Int priority(); ///< Returns node's priority - void setPriority( Int new_pri ); ///< Sets node's priority - void* item(); ///< Returns the item this links to, if any - void setItem( void *item ); ///< Make node point to an item - void destroy(); ///< Delete node - void autoDelete(); -} ; - -//================================ -// LList -//================================ -/** - * Linked list abstraction. -*/ -//================================ - - -class LList -{ - public: - - /// Enumeration of list sorting methods - enum SortMode - { - ASCENDING, ///< Lower priority numbers to front of list - DESCENDING ///< Higher priority numbers to front of list - }; - - protected: - - LListNode m_head; ///< List head node - SortMode m_sortMode; ///< What sorting method to use for this list's Add() operation - Bool m_addToEndOfGroup; ///< Add nodes to end of group of nodes with same priority - - - public: - - LList(); - void addToHead( LListNode *new_node ); ///< Adds new node to the front of the list - void addToTail( LListNode *new_node ); ///< Adds new node to the end of the list - void add( LListNode *new_node ); ///< Adds new node to list sorted by priority - - void addItemToHead( void *item ); ///< Adds new item to the front of the list - void addItemToTail( void *item ); ///< Adds new item to the end of the list - void addItem( Int pri, void *item ); ///< Adds new item to list sorted by priority - - Int nodeCount(); ///< Returns number of nodes currently in list - LListNode* firstNode(); ///< Returns first node in list - LListNode* lastNode(); ///< Returns last node in list - LListNode* getNode( Int index ); ///< Returns node in list addressed by the zero-based index passed - void setSortMode( SortMode new_mode ); ///< Sets the sorting mode for the Add() operation - void addToEndOfGroup( Bool yes = TRUE ); ///< Add node to end or start of group with same priority - Bool isEmpty(); ///< Returns whether or not the the list is empty - void clear(); ///< Deletes all items in the list. Use with care!! - void merge( LList *list ); ///< Move the contents of the specified list in to this list - Bool hasItem( void *item ); ///< Tests if list has the specified item - LListNode* findItem( void *item ); ///< Returns the LListNode that references item - void destroy(); ///< Free up the list items - -} ; - -//---------------------------------------------------------------------------- -// Inlining -//---------------------------------------------------------------------------- - -inline Bool LListNode::inList() { return m_prev != this; }; -inline Bool LListNode::isHead() { return ( m_item == (void*)&this->m_item ); }; -inline Int LListNode::priority() { return m_pri; }; -inline void LListNode::setPriority( Int new_pri ) { m_pri = new_pri; }; -inline void LListNode::autoDelete() { m_autoDelete = TRUE; }; -inline void* LListNode::item() { return m_item; }; -inline void LListNode::setItem( void *item ) { m_item = item; }; - - -inline void LList::addToHead( LListNode *new_node ) { m_head.append( new_node); }; -inline void LList::addToTail( LListNode *new_node ) { m_head.insert( new_node); }; -inline LListNode* LList::firstNode() { return m_head.next();} ; -inline LListNode* LList::lastNode() { return m_head.prev();} ; -inline void LList::setSortMode( SortMode new_mode ) { m_sortMode = new_mode; }; -inline Bool LList::isEmpty() { return !m_head.inList(); }; -inline void LList::destroy() { clear();}; diff --git a/Generals/Code/GameEngine/Include/Common/MiniLog.h b/Generals/Code/GameEngine/Include/Common/MiniLog.h deleted file mode 100644 index cdf8b910d38..00000000000 --- a/Generals/Code/GameEngine/Include/Common/MiniLog.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: MiniLog.h ///////////////////////////////////////////////////////////// -// Alternative logging -// Author: Matthew D. Campbell, January 2003 -//////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#ifdef DEBUG_LOGGING - -#include "Lib/BaseType.h" -#include "GameLogic/GameLogic.h" -#include -class LogClass -{ -public: - LogClass(const char *fname); - ~LogClass(); - void log(const char *fmt, ...); - -protected: - FILE *m_fp; -}; - -#endif // DEBUG_LOGGING diff --git a/Generals/Code/GameEngine/Include/Common/MissionStats.h b/Generals/Code/GameEngine/Include/Common/MissionStats.h deleted file mode 100644 index 711e2de5104..00000000000 --- a/Generals/Code/GameEngine/Include/Common/MissionStats.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: MissionStats.h //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: MissionStats.h -// -// Created: Steven Johnson, October 2001 -// -// Desc: @todo -// -//----------------------------------------------------------------------------- - -#pragma once - -#include "Lib/BaseType.h" -#include "Common/GameCommon.h" -#include "Common/Snapshot.h" - -// ---------------------------------------------------------------------------------------------- -/** - Class that accumulates stats during a mission. Some of this will be for scoring purposes, - and some will probably be used by AI to determine future moves. - - @todo: not sure what need to be here. Alas. For now, I have just put in the fields from RA2 - that are indicated as being used for scoring in multiplayer games, so this will certainly - increase. -*/ -class MissionStats : public Snapshot -{ - -public: - - MissionStats(); - - /// reset all stats to "nothing". - void init(); - -protected: - - // snapshot methods - virtual void crc( Xfer *xfer ) override; - virtual void xfer( Xfer *xfer ) override; - virtual void loadPostProcess() override; - -private: - - Int m_unitsKilled[MAX_PLAYER_COUNT]; ///< how many units for each Player were killed by us? - Int m_unitsLost; ///< how many of our units were destroyed? - Int m_buildingsKilled[MAX_PLAYER_COUNT]; ///< how many buildings for each Player were killed by us? - Int m_buildingsLost; ///< how many of our buildings were destroyed? - //Int m_whoLastHurtMe; ///< last Player to destroy one of my units -}; diff --git a/Generals/Code/GameEngine/Include/Common/PerfTimer.h b/Generals/Code/GameEngine/Include/Common/PerfTimer.h deleted file mode 100644 index effaac47d1c..00000000000 --- a/Generals/Code/GameEngine/Include/Common/PerfTimer.h +++ /dev/null @@ -1,320 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// PerfTimer.h //////////////////////////////////////////////////////////////////////////////////// -// John McDonald -// July 2002 - -#pragma once - -#include "Utility/intrin_compat.h" - -#if defined(RTS_DEBUG) - /* - NOTE NOTE NOTE: never check this in with this enabled, since there is a nonzero time penalty - for running in this mode. Only enable it for local builds for testing purposes! (srj) - */ - #define NO_PERF_TIMERS -#else - #define NO_PERF_TIMERS -#endif - -#include "Common/GameCommon.h" // ensure we get DUMP_PERF_STATS, or not - -#ifdef PERF_TIMERS -#include "GameLogic/GameLogic.h" -#include "Common/PerfMetrics.h" -#include "Common/GlobalData.h" -#endif - -// Forward Declarations -class DebugDisplayInterface; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -#define NO_USE_QPF // non-QPF is much faster. - -#if defined(PERF_TIMERS) || defined(DUMP_PERF_STATS) -//------------------------------------------------------------------------------------------------- -void InitPrecisionTimer(); - -//------------------------------------------------------------------------------------------------- -void GetPrecisionTimerTicksPerSec(Int64* t); - -//------------------------------------------------------------------------------------------------- -__forceinline void GetPrecisionTimer(Int64* t) -{ -#ifdef USE_QPF - QueryPerformanceCounter((LARGE_INTEGER*)t); -#else - *t = _rdtsc(); -#endif -} -#endif - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -#ifdef PERF_TIMERS - -//------------------------------------------------------------------------------------------------- -class PerfGather -{ -public: - // If net only (default), subtract perf timers running inside. [8/12/2003] - PerfGather( const char *identifier, Bool netOnly=true ); - virtual ~PerfGather( ); - - __forceinline void startTimer(); - __forceinline void stopTimer(); - - enum - { - PERF_GROSSTIME = 0x01, - PERF_NETTIME = 0x02, - PERF_CALLCOUNT = 0x04 - }; - - static void resetAll(); - static void initPerfDump(const char* fname, Int options); - static void termPerfDump(); - static void dumpAll(UnsignedInt frame); - static void displayGraph(UnsignedInt frame); - - void reset(); - -private: - - enum { MAX_ACTIVE_STACK = 256 }; - static PerfGather* m_active[MAX_ACTIVE_STACK]; - static PerfGather** m_activeHead; - static Int64 s_stopStartOverhead; // overhead for stop+start a timer - - static PerfGather*& getHeadPtr(); - - void addToList(); - void removeFromList(); - - const char* m_identifier; - Int64 m_startTime; - Int64 m_runningTimeGross; - Int64 m_runningTimeNet; - Int m_callCount; - PerfGather* m_next; - PerfGather* m_prev; - Bool m_ignore; - Bool m_netTimeOnly; -}; - -//------------------------------------------------------------------------------------------------- -void PerfGather::startTimer() -{ - *++m_activeHead = this; - GetPrecisionTimer(&m_startTime); -} - -//------------------------------------------------------------------------------------------------- -void PerfGather::stopTimer() -{ - DEBUG_ASSERTCRASH(this != nullptr, ("I am null, uh oh")); - - Int64 runTime; - GetPrecisionTimer(&runTime); - - runTime -= m_startTime; - - m_runningTimeGross += runTime; - m_runningTimeNet += runTime; - - ++m_callCount; - -#ifdef RTS_DEBUG - DEBUG_ASSERTCRASH(*m_activeHead != nullptr, ("m_activeHead is null, uh oh")); - DEBUG_ASSERTCRASH(*m_activeHead == this, ("I am not the active timer, uh oh")); - DEBUG_ASSERTCRASH(m_activeHead >= &m_active[0] && m_activeHead <= &m_active[MAX_ACTIVE_STACK-1], ("active under/over flow")); -#endif - --m_activeHead; - - if (*m_activeHead) - { - // don't add the time it took for us to actually get the ticks (in startTimer) to our parent... - (*m_activeHead)->m_runningTimeGross -= (s_stopStartOverhead); - if ((*m_activeHead)->m_netTimeOnly) { - (*m_activeHead)->m_runningTimeNet -= (runTime + s_stopStartOverhead); - } - } -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -class AutoPerfGather -{ -private: - PerfGather& m_g; -public: - __forceinline AutoPerfGather(PerfGather& g); - __forceinline ~AutoPerfGather(); -}; - -//------------------------------------------------------------------------------------------------- -AutoPerfGather::AutoPerfGather(PerfGather& g) : m_g(g) -{ - m_g.startTimer(); -} - -//------------------------------------------------------------------------------------------------- -AutoPerfGather::~AutoPerfGather() -{ - m_g.stopTimer(); -} - -//------------------------------------------------------------------------------------------------- -class AutoPerfGatherIgnore -{ -private: - static Bool s_ignoring; - PerfGather& m_g; - Bool m_oldIgnore; -public: - __forceinline AutoPerfGatherIgnore(PerfGather& g); - __forceinline ~AutoPerfGatherIgnore(); -}; - -//------------------------------------------------------------------------------------------------- -AutoPerfGatherIgnore::AutoPerfGatherIgnore(PerfGather& g) : m_g(g) -{ - m_oldIgnore = s_ignoring; - s_ignoring = true; - - m_g.startTimer(); -} - -//------------------------------------------------------------------------------------------------- -AutoPerfGatherIgnore::~AutoPerfGatherIgnore() -{ - m_g.stopTimer(); - - if (s_ignoring) - m_g.reset(); - - s_ignoring = m_oldIgnore; -} - -//------------------------------------------------------------------------------------------------- -#define DECLARE_TOTAL_PERF_TIMER(id) static PerfGather s_##id(#id, false); -#define DECLARE_PERF_TIMER(id) static PerfGather s_##id(#id); -#define USE_PERF_TIMER(id) AutoPerfGather a_##id(s_##id); -#define IGNORE_PERF_TIMER(id) AutoPerfGatherIgnore a_##id(s_##id); - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -class PerfTimer -{ -public: - PerfTimer( const char *identifier, Bool crashWithInfo = true, Int startFrame = 0, Int endFrame = -1); - virtual ~PerfTimer( ); - __forceinline void startTimer(); - __forceinline void stopTimer(); - -protected: - Int64 m_startTime; - -protected: - void outputInfo(); - void showMetrics(); - -protected: - const char *m_identifier; - Bool m_crashWithInfo; - UnsignedInt m_startFrame; - UnsignedInt m_endFrame; - UnsignedInt m_lastFrame; // last frame we got data from - Bool m_outputInfo; - - // total running time so far. - Int64 m_runningTime; - Int m_callCount; - - friend void StatMetricsDisplay( DebugDisplayInterface *dd, void *, FILE *fp ); - friend void EndStatMetricsDisplay( DebugDisplayInterface *dd, void *, FILE *fp ); -}; - -//------------------------------------------------------------------------------------------------- -void PerfTimer::startTimer() -{ - UnsignedInt frm = (TheGameLogic ? TheGameLogic->getFrame() : m_startFrame); - if (frm >= m_startFrame && (m_endFrame == -1 || frm <= m_endFrame)) - { - GetPrecisionTimer(&m_startTime); - } -} - -//------------------------------------------------------------------------------------------------- -void PerfTimer::stopTimer() -{ - UnsignedInt frm = (TheGameLogic ? TheGameLogic->getFrame() : m_startFrame); - if (frm >= m_startFrame && (m_endFrame == -1 || frm <= m_endFrame)) - { - Int64 tmp; - GetPrecisionTimer(&tmp); - m_runningTime += (tmp - m_startTime); - ++m_callCount; - m_lastFrame = frm; - } - - - if (TheGlobalData && TheGlobalData->m_showMetrics && m_endFrame > m_startFrame + PERFMETRICS_BETWEEN_METRICS) { - m_endFrame = m_startFrame + PERFMETRICS_BETWEEN_METRICS; - } - - if (m_endFrame > 0 && frm >= m_endFrame) { - if (TheGlobalData->m_showMetrics) { - showMetrics(); - } - - outputInfo(); - } -} - - -//------------------------------------------------------------------------------------------------- -extern void StatMetricsDisplay( DebugDisplayInterface *dd, void *, FILE *fp ); - -#else // PERF_TIMERS - - #define DECLARE_PERF_TIMER(id) - #define DECLARE_TOTAL_PERF_TIMER(id) - #define USE_PERF_TIMER(id) - #define IGNORE_PERF_TIMER(id) - -#endif // PERF_TIMERS diff --git a/Generals/Code/GameEngine/Include/Common/PlayerList.h b/Generals/Code/GameEngine/Include/Common/PlayerList.h deleted file mode 100644 index f2c2b3622f7..00000000000 --- a/Generals/Code/GameEngine/Include/Common/PlayerList.h +++ /dev/null @@ -1,170 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PlayerList.h //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: PlayerList.h -// -// Created: Steven Johnson, October 2001 -// -// Desc: @todo -// -//----------------------------------------------------------------------------- - -#pragma once - -#include "Common/SubsystemInterface.h" -#include "Common/GameCommon.h" -#include "Common/NameKeyGenerator.h" -#include "Common/Snapshot.h" - -class DataChunkInput; -struct DataChunkInfo; -class DataChunkOutput; -class Player; -class Team; -class TeamFactory; - -//------------------------------------------------------------------------------------------------- -enum AllowPlayerRelationship CPP_11(: Int) -{ - ALLOW_SAME_PLAYER = 0x01, ///< allow only objects of the same player as m_obj - ALLOW_ALLIES = 0x02, ///< allow objects that m_obj considers allies - ALLOW_ENEMIES = 0x04, ///< allow objects that m_obj considers enemy - ALLOW_NEUTRAL = 0x08 ///< allow objects that m_obj considers neutral -}; - - -//------------------------------------------------------------------------------------------------- -/** - This is a singleton class that maintains the list of Players. -*/ -class PlayerList : public SubsystemInterface, - public Snapshot -{ - -public: - - PlayerList(); - virtual ~PlayerList() override; - - // subsystem methods - virtual void init() override; - virtual void reset() override; - virtual void update() override; - - virtual void newGame(); // called during GameLogic::startNewGame() - virtual void newMap(); // Called after a new map is loaded. - - void teamAboutToBeDeleted(Team* team); - - /** - return the total number of players (including the neutral player). - */ - inline Int getPlayerCount() { return m_playerCount; } - - /** - return the nth player. Note that players are in an arbitrary order. - you should generally only use this if you want to iterate thru - all players, NOT to get a specific player! - */ - Player *getNthPlayer(Int i); - - /** - return the "neutral" Player. there is always a player that is "neutral" wrt - all other players (this is so that everything can be associated with a nonnull - Player, to simplify the universe). This will never return null. - */ - Player *getNeutralPlayer() { DEBUG_ASSERTCRASH(m_players[0] != nullptr, ("null neutral")); return m_players[0]; } - - /** - return the Player with the given internal name, or null if none found. - */ - Player *findPlayerWithNameKey(NameKeyType key); - - /** - Return the "local" player (ie, the human playing the game). - This will never return null. - */ - inline Player *getLocalPlayer() { DEBUG_ASSERTCRASH(m_local != nullptr, ("null m_local")); return m_local; } - - /** - Set the local player. You cannot set it to null; if you pass null, you'll - end up setting the local player to be the neutral player. - */ - void setLocalPlayer(Player *player); - - /** - Return the player matching the player mask - */ - Player *getPlayerFromMask( PlayerMaskType mask ); - - /** - Get each player in numerical order that this mask represents. - Note that maskToAdjust will be adjusted by removing the associated player's mask from it. - */ - Player *getEachPlayerFromMask( PlayerMaskType& maskToAdjust ); - - Team *validateTeam( AsciiString owner ); - - /** - a convenience routine to quickly clear the entered/exited flags on all teams. - */ - void updateTeamStates(); - - /** - a convenience routine to return the players who srcPlayer considers to have one of the - relationships specified in allowedRelationships. Note that allowedRelationships should be - a bitwise OR of AllowPlayerRelationship flags. - */ - PlayerMaskType getPlayersWithRelationship( Int srcPlayerIndex, UnsignedInt allowedRelationships ); - -protected: - - // snapshot methods - virtual void crc( Xfer *xfer ) override; - virtual void xfer( Xfer *xfer ) override; - virtual void loadPostProcess() override; - -private: - - Player *m_local; - Int m_playerCount; - Player *m_players[MAX_PLAYER_COUNT]; - -}; - - -// ---------------------------------------------------------------------------------------------- -extern PlayerList *ThePlayerList; ///< singleton instance of PlayerList diff --git a/Generals/Code/GameEngine/Include/Common/QuotedPrintable.h b/Generals/Code/GameEngine/Include/Common/QuotedPrintable.h deleted file mode 100644 index af373e9bb6a..00000000000 --- a/Generals/Code/GameEngine/Include/Common/QuotedPrintable.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: QuotedPrintable.h ///////////////////////////////////////////////////////// -// Author: Matt Campbell, February 2002 -// Description: Quoted-printable encode/decode -//////////////////////////////////////////////////////////////////////////// - -#pragma once - -UnicodeString QuotedPrintableToUnicodeString(AsciiString original); -AsciiString UnicodeStringToQuotedPrintable(UnicodeString original); - -AsciiString QuotedPrintableToAsciiString(AsciiString original); -AsciiString AsciiStringToQuotedPrintable(AsciiString original); diff --git a/Generals/Code/GameEngine/Include/Common/Science.h b/Generals/Code/GameEngine/Include/Common/Science.h deleted file mode 100644 index ac1f6014f97..00000000000 --- a/Generals/Code/GameEngine/Include/Common/Science.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Science.h //////////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, Colin Day November 2001 -// Desc: Science descriptions -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/Overridable.h" -#include "Common/NameKeyGenerator.h" -#include "Common/UnicodeString.h" - -class Player; - -//------------------------------------------------------------------------------------------------- -enum ScienceType CPP_11(: Int) -{ - SCIENCE_INVALID = -1 -}; - -//------------------------------------------------------------------------------------------------- -typedef std::vector ScienceVec; - -//------------------------------------------------------------------------------------------------- -class ScienceInfo : public Overridable -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( ScienceInfo, "ScienceInfo" ) - - friend class ScienceStore; - -private: - ScienceType m_science; - UnicodeString m_name; - UnicodeString m_description; - ScienceVec m_rootSciences; // this is calced at runtime, NOT read from INI - ScienceVec m_prereqSciences; - Int m_sciencePurchasePointCost; - Bool m_grantable; - - ScienceInfo() : - m_science(SCIENCE_INVALID), - m_sciencePurchasePointCost(0), // 0 means "cannot be purchased" - m_grantable(true) - { - } - - void addRootSciences(ScienceVec& v) const; -}; -EMPTY_DTOR(ScienceInfo); - -//------------------------------------------------------------------------------------------------- -class ScienceStore : public SubsystemInterface -{ - friend class ScienceInfo; - -public: - virtual ~ScienceStore() override; - - virtual void init() override; - virtual void reset() override; - virtual void update() override { } - - Bool isValidScience(ScienceType st) const; - - Bool isScienceGrantable(ScienceType st) const; - - Bool getNameAndDescription(ScienceType st, UnicodeString& name, UnicodeString& description) const; - - Bool playerHasPrereqsForScience(const Player* player, ScienceType st) const; - - /** - this is a subtle call, and should ALMOST NEVER be called by external code... - this is used to determine if you have the "root" requirements for a given science, - and thus could *potentially* obtain it if you got extra prereqs. - - Generally, you should call getPurchasableSciences() instead of this! - */ - Bool playerHasRootPrereqsForScience(const Player* player, ScienceType st) const; - - Int getSciencePurchaseCost(ScienceType science) const; - - ScienceType getScienceFromInternalName(const AsciiString& name) const; - AsciiString getInternalNameForScience(ScienceType science) const; - - /** return a list of the sciences the given player can purchase now, and a list he might be able to purchase in the future, - but currently lacks prereqs or points for. (either might be an empty list) */ - void getPurchasableSciences(const Player* player, ScienceVec& purchasable, ScienceVec& potentiallyPurchasable) const; - - // this is intended ONLY for use by INI::scanScience. - // Don't use it anywhere else. In particular, never, ever, ever - // call this with a hardcoded science name. (srj) - ScienceType friend_lookupScience(const char* scienceName) const; - static void friend_parseScienceDefinition(INI* ini); - - // return a vector of all the currently-known science names - // NOTE: this is really only for use by WorldBuilder! Please - // do not use it in RTS! - std::vector friend_getScienceNames() const; - - -private: - - const ScienceInfo* findScienceInfo(ScienceType st) const; - - typedef std::vector ScienceInfoVec; - ScienceInfoVec m_sciences; -}; - -extern ScienceStore* TheScienceStore; diff --git a/Generals/Code/GameEngine/Include/Common/ScoreKeeper.h b/Generals/Code/GameEngine/Include/Common/ScoreKeeper.h deleted file mode 100644 index 3f01a0f511c..00000000000 --- a/Generals/Code/GameEngine/Include/Common/ScoreKeeper.h +++ /dev/null @@ -1,140 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ScoreKeeper.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Jun 2002 -// -// Filename: ScoreKeeper.h -// -// author: Chris Huybregts -// -// purpose: Header file for the scorekeeper class -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "Common/Snapshot.h" - -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class Object; -class ThingTemplate; -//----------------------------------------------------------------------------- -// TYPE DEFINES /////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class ScoreKeeper : public Snapshot -{ -public: - ScoreKeeper(); - ~ScoreKeeper(); - - void reset( Int playerIdx ); ///< Zero out the variables - Int calculateScore(); ///< Performs the equation to calculate the score - - void addMoneySpent( Int money ); ///< Adds money to the amount spent - void addMoneyEarned( Int money ); ///< Adds money to the earned amount - - void addObjectBuilt( const Object *o ); - void addObjectDestroyed( const Object *o ); - void addObjectLost( const Object *o ); - void addObjectCaptured( const Object *o ); - - void removeObjectBuilt( const Object *o ); - - Int getTotalMoneyEarned() { return m_totalMoneyEarned; } - Int getTotalMoneySpent() { return m_totalMoneySpent; } - Int getTotalUnitsDestroyed(); - Int getTotalUnitsBuilt() { return m_totalUnitsBuilt; } - Int getTotalUnitsLost() { return m_totalUnitsLost; } - Int getTotalBuildingsDestroyed(); - Int getTotalBuildingsBuilt() { return m_totalBuildingsBuilt; } - Int getTotalBuildingsLost() { return m_totalBuildingsLost; } - Int getTotalTechBuildingsCaptured() { return m_totalTechBuildingsCaptured; } - Int getTotalFactionBuildingsCaptured() { return m_totalFactionBuildingsCaptured; } - Int getTotalObjectsBuilt( const ThingTemplate *pTemplate ); // get a count of objects built matching a specific thing template - - // for battle honor calculation. done once at the end of each online game - Int getTotalUnitsBuilt( KindOfMaskType validMask, KindOfMaskType invalidMask ); - -protected: - - // snapshot methods - virtual void crc( Xfer *xfer ) override; - virtual void xfer( Xfer *xfer ) override; - virtual void loadPostProcess() override; - -private: - - Int m_totalMoneyEarned; ///< The total money that was harvested, refined, received in crates - Int m_totalMoneySpent; ///< The total money spent on units, buildings, repairs - Int m_totalUnitsDestroyed[MAX_PLAYER_COUNT]; ///< The total number of enemies that we've killed - Int m_totalUnitsBuilt; ///< The total number of units we've created (created meaning that we built from a building) - Int m_totalUnitsLost; ///< The total number of our units lost - Int m_totalBuildingsDestroyed[MAX_PLAYER_COUNT]; ///< The total number of Buildings we've destroyed - Int m_totalBuildingsBuilt; ///< The total number of buildings we've constructed - Int m_totalBuildingsLost; ///< The total number of our buildings lost - Int m_totalTechBuildingsCaptured; ///< The total number of tech buildings captured - Int m_totalFactionBuildingsCaptured; ///< The total number of faction buildings captured - Int m_currentScore; ///< Based off the stats, this is the current score - - Int m_myPlayerIdx; ///< We need to not score kills on ourselves... so we need to know who we are - - typedef std::map ObjectCountMap; - typedef ObjectCountMap::iterator ObjectCountMapIt; - ObjectCountMap m_objectsBuilt; ///< How many and what kinds of objects did we build - ObjectCountMap m_objectsDestroyed[MAX_PLAYER_COUNT]; ///< How many and what kinds and who's did we kill - ObjectCountMap m_objectsLost; ///< how many and what kinds of objects did we loose - ObjectCountMap m_objectsCaptured; - void xferObjectCountMap( Xfer *xfer, ObjectCountMap *map ); - -}; - -//----------------------------------------------------------------------------- -// INLINING /////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -inline void ScoreKeeper::addMoneySpent( Int money ) { m_totalMoneySpent += money; } -inline void ScoreKeeper::addMoneyEarned( Int money ) { m_totalMoneyEarned += money; } - -//----------------------------------------------------------------------------- -// EXTERNALS ////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/Common/StackDump.h b/Generals/Code/GameEngine/Include/Common/StackDump.h deleted file mode 100644 index 2d11b754b94..00000000000 --- a/Generals/Code/GameEngine/Include/Common/StackDump.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#ifndef IG_DEBUG_STACKTRACE -#define IG_DEBUG_STACKTRACE 1 -#endif // Unsure about this one -ML 3/25/03 -#if defined(RTS_DEBUG) || defined(IG_DEBUG_STACKTRACE) - -// Writes a stackdump (provide a callback : gets called per line) -// If callback is nullptr then will write using OuputDebugString -void StackDump(void (*callback)(const char*)); - -// Writes a stackdump (provide a callback : gets called per line) -// If callback is nullptr then will write using OuputDebugString -void StackDumpFromContext(DWORD eip,DWORD esp,DWORD ebp, void (*callback)(const char*)); - -// Gets count* addresses from the current stack -void FillStackAddresses(void**addresses, unsigned int count, unsigned int skip = 0); - -// Do full stack dump using an address array -void StackDumpFromAddresses(void**addresses, unsigned int count, void (*callback)(const char*)); - -void GetFunctionDetails(void *pointer, char*name, char*filename, unsigned int* linenumber, unsigned int* address); - -// Dumps out the exception info and stack trace. -void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ); - -#else - -__inline void StackDump(void (*callback)(const char*)) {}; - -// Gets count* addresses from the current stack -__inline void FillStackAddresses(void**addresses, unsigned int count, unsigned int skip = 0) {} - -// Do full stack dump using an address array -__inline void StackDumpFromAddresses(void**addresses, unsigned int count, void (*callback)(const char*)) {} - -__inline void GetFunctionDetails(void *pointer, char*name, char*filename, unsigned int* linenumber, unsigned int* address) {} - -// Dumps out the exception info and stack trace. -__inline void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) {}; - -#endif - -extern AsciiString g_LastErrorDump; diff --git a/Generals/Code/GameEngine/Include/Common/TerrainTypes.h b/Generals/Code/GameEngine/Include/Common/TerrainTypes.h deleted file mode 100644 index 839d381fa32..00000000000 --- a/Generals/Code/GameEngine/Include/Common/TerrainTypes.h +++ /dev/null @@ -1,238 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: TerrainTypes.h /////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, December 2001 -// Desc: Terrain type descriptions -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/GameMemory.h" -#include "Common/SubsystemInterface.h" - -// FORWARD DECLARATIONS /////////////////////////////////////////////////////////////////////////// -struct FieldParse; - -//------------------------------------------------------------------------------------------------- -/** Type classification, keep this in sync with terrainTypeNames[] */ -//------------------------------------------------------------------------------------------------- -typedef enum -{ - TERRAIN_NONE = 0, - TERRAIN_DESERT_1, - TERRAIN_DESERT_2, - TERRAIN_DESERT_3, - TERRAIN_EASTERN_EUROPE_1, - TERRAIN_EASTERN_EUROPE_2, - TERRAIN_EASTERN_EUROPE_3, - TERRAIN_SWISS_1, - TERRAIN_SWISS_2, - TERRAIN_SWISS_3, - TERRAIN_SNOW_1, - TERRAIN_SNOW_2, - TERRAIN_SNOW_3, - - // remove all the terrain types below when Todd says he's redone them all - TERRAIN_DIRT, - TERRAIN_GRASS, - TERRAIN_TRANSITION, - TERRAIN_ROCK, - TERRAIN_SAND, - TERRAIN_CLIFF, - TERRAIN_WOOD, - TERRAIN_BLEND_EDGES, - - // New terrain types (for Samm Ivri) - TERRAIN_LIVE_DESERT, - TERRAIN_DRY_DESERT, - TERRAIN_ACCENT_SAND, - TERRAIN_TROPICAL_BEACH, - TERRAIN_BEACH_PARK, - TERRAIN_RUGGED_MOUNTAIN, - TERRAIN_COBBLESTONE_GRASS, - TERRAIN_ACCENT_GRASS, - TERRAIN_RESIDENTIAL, - TERRAIN_RUGGED_SNOW, - TERRAIN_FLAT_SNOW, - TERRAIN_FIELD, - TERRAIN_ASPHALT, - TERRAIN_CONCRETE, - TERRAIN_CHINA, - TERRAIN_ACCENT_ROCK, - TERRAIN_URBAN, - - TERRAIN_NUM_CLASSES - -} TerrainClass; -#ifdef DEFINE_TERRAIN_TYPE_NAMES -static const char *const terrainTypeNames[] = -{ - "NONE", - "DESERT_1", - "DESERT_2", - "DESERT_3", - "EASTERN_EUROPE_1", - "EASTERN_EUROPE_2", - "EASTERN_EUROPE_3", - "SWISS_1", - "SWISS_2", - "SWISS_3", - "SNOW_1", - "SNOW_2", - "SNOW_3", - - // remove all the terrain types below when Todd says he's redone them all - "DIRT", - "GRASS", - "TRANSITION", - "ROCK", - "SAND", - "CLIFF", - "WOOD", - "BLEND_EDGE", - - // New terrain types (for Samm Ivri) - "DESERT_LIVE", - "DESERT_DRY", - "SAND_ACCENT", - "BEACH_TROPICAL", - "BEACH_PARK", - "MOUNTAIN_RUGGED", - "GRASS_COBBLESTONE", - "GRASS_ACCENT", - "RESIDENTIAL", - "SNOW_RUGGED", - "SNOW_FLAT", - "FIELD", - "ASPHALT", - "CONCRETE", - "CHINA", - "ROCK_ACCENT", - "URBAN", - - nullptr -}; -static_assert(ARRAY_SIZE(terrainTypeNames) == TERRAIN_NUM_CLASSES + 1, "Incorrect array size"); -#endif // end DEFINE_TERRAIN_TYPE_NAMES - -//------------------------------------------------------------------------------------------------- -/** A terrain type definition */ -//------------------------------------------------------------------------------------------------- -class TerrainType : public MemoryPoolObject -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( TerrainType, "TerrainType" ) - -public: - - TerrainType(); - // destructor prototype defined by memory pool glue - - /// get the name for this terrain - AsciiString getName() { return m_name; } - - /// get whether this terrain is blend edge terrain. - Bool isBlendEdge() { return m_blendEdgeTexture; } - - /// get the type of this terrain - TerrainClass getClass() { return m_class; } - - /// get the construction restrictions - Bool getRestrictConstruction() { return m_restrictConstruction; } - - /// get the texture file for this terrain - AsciiString getTexture() { return m_texture; } - - /// get next terrain in list, only for use by the terrain collection - TerrainType *friend_getNext() { return m_next; } - - /// set the name for this terrain, for use by terrain collection only - void friend_setName( AsciiString name ) { m_name = name; } - - /// set the next pointer for the terrain list, for use by terrain collection only - void friend_setNext( TerrainType *next ) { m_next = next; } - - /// set the texture, for use by terrain collection only - void friend_setTexture( AsciiString texture ) { m_texture = texture; } - - /// set the class, for use by terrain collection only - void friend_setClass( TerrainClass terrainClass ) { m_class = terrainClass; } - - /// set the restrict construction flag, for use by terrain collection only - void friend_setRestrictConstruction( Bool restrict ) { m_restrictConstruction = restrict; } - - /// set whether this terrain is blend edge terrain, for use by terrain collection only - void friend_setBlendEdge( Bool isBlend ) { m_blendEdgeTexture = isBlend; } - - /// get the parsing table for INI - const FieldParse *getFieldParse() { return m_terrainTypeFieldParseTable; } - -protected: - - AsciiString m_name; ///< terrain entry name - AsciiString m_texture; ///< texture.tga file for terrain - Bool m_blendEdgeTexture; ///< contains custom blend edges - TerrainClass m_class; ///< type classification of name - Bool m_restrictConstruction; ///< do not allow construction on this terrain tile - TerrainType *m_next; ///< next in terrain list - - // for parsing from INI - static const FieldParse m_terrainTypeFieldParseTable[]; ///< the parse table for INI definition - -}; - -//------------------------------------------------------------------------------------------------- -/** The collection of all terrain types */ -//------------------------------------------------------------------------------------------------- -class TerrainTypeCollection : public SubsystemInterface -{ - -public: - - TerrainTypeCollection(); - virtual ~TerrainTypeCollection() override; - - virtual void init() override { } - virtual void reset() override { } - virtual void update() override { } - - TerrainType *findTerrain( AsciiString name ); ///< find terrain by name - TerrainType *newTerrain( AsciiString name ); ///< allocate a new terrain - - /// get first terrain in list - TerrainType *firstTerrain() { return m_terrainList; } - - /// get next terrain in list - TerrainType *nextTerrain( TerrainType *terrainType ) { return terrainType->friend_getNext(); } - -protected: - - TerrainType *m_terrainList; ///< list of available terrain types - -}; - -// EXTERNAL /////////////////////////////////////////////////////////////////////////////////////// -extern TerrainTypeCollection *TheTerrainTypes; diff --git a/Generals/Code/GameEngine/Include/Common/Upgrade.h b/Generals/Code/GameEngine/Include/Common/Upgrade.h deleted file mode 100644 index a847abed5b0..00000000000 --- a/Generals/Code/GameEngine/Include/Common/Upgrade.h +++ /dev/null @@ -1,268 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Upgrade.h //////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, March 2002 -// Desc: Upgrade system for players -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "Common/AudioEventRTS.h" -#include "Common/INI.h" -#include "Common/Snapshot.h" -#include "Common/BitFlags.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Player; -class UpgradeTemplate; -enum NameKeyType CPP_11(: Int); -class Image; -enum AcademyClassificationType CPP_11(: Int); - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -enum UpgradeStatusType CPP_11(: Int) -{ - UPGRADE_STATUS_INVALID = 0, - UPGRADE_STATUS_IN_PRODUCTION, - UPGRADE_STATUS_COMPLETE -}; - -//The maximum number of upgrades. -// TheSuperHackers @tweak Stubbjax 22/01/2026 Increases max upgrade count from Generals:64, Zero Hour:128 to allow for more upgrades. -// A value of 512 was chosen to allow room for plenty of upgrades while also conserving memory. -#define UPGRADE_MAX_COUNT 512 - -typedef BitFlags UpgradeMaskType; - -#define MAKE_UPGRADE_MASK(k) UpgradeMaskType(UpgradeMaskType::kInit, (k)) -#define MAKE_UPGRADE_MASK2(k,a) UpgradeMaskType(UpgradeMaskType::kInit, (k), (a)) -#define MAKE_UPGRADE_MASK3(k,a,b) UpgradeMaskType(UpgradeMaskType::kInit, (k), (a), (b)) -#define MAKE_UPGRADE_MASK4(k,a,b,c) UpgradeMaskType(UpgradeMaskType::kInit, (k), (a), (b), (c)) -#define MAKE_UPGRADE_MASK5(k,a,b,c,d) UpgradeMaskType(UpgradeMaskType::kInit, (k), (a), (b), (c), (d)) - -inline Bool TEST_UPGRADE_MASK( const UpgradeMaskType& m, Int index ) -{ - return m.test( index ); -} - -inline Bool TEST_UPGRADE_MASK_ANY( const UpgradeMaskType& m, const UpgradeMaskType& mask ) -{ - return m.anyIntersectionWith( mask ); -} - -inline Bool TEST_UPGRADE_MASK_MULTI( const UpgradeMaskType& m, const UpgradeMaskType& mustBeSet, const UpgradeMaskType& mustBeClear ) -{ - return m.testSetAndClear( mustBeSet, mustBeClear ); -} - -inline Bool UPGRADE_MASK_ANY_SET( const UpgradeMaskType& m) -{ - return m.any(); -} - -inline void CLEAR_UPGRADE_MASK( UpgradeMaskType& m ) -{ - m.clear(); -} - -inline void SET_ALL_UPGRADE_MASK_BITS( UpgradeMaskType& m ) -{ - m.clear(); - m.flip(); -} - -inline void FLIP_UPGRADE_MASK( UpgradeMaskType& m ) -{ - m.flip(); -} - - -//------------------------------------------------------------------------------------------------- -/** A single upgrade *INSTANCE* */ -//------------------------------------------------------------------------------------------------- -class Upgrade : public MemoryPoolObject, - public Snapshot -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( Upgrade, "Upgrade" ) - -public: - - Upgrade( const UpgradeTemplate *upgradeTemplate ); - // virtual destructor prototypes provided by memory pool object - - /// get the upgrade template for this instance - const UpgradeTemplate *getTemplate() const { return m_template; } - - // status access - UpgradeStatusType getStatus() const { return m_status; } ///< get status - void setStatus( UpgradeStatusType status ) { m_status = status; } ///< set the status - - // friend access methods - void friend_setNext( Upgrade *next ) { m_next = next; } - void friend_setPrev( Upgrade *prev ) { m_prev = prev; } - Upgrade *friend_getNext() { return m_next; } - Upgrade *friend_getPrev() { return m_prev; } - -protected: - - // snapshot methods - virtual void crc( Xfer *xfer ) override; - virtual void xfer( Xfer *xfer ) override; - virtual void loadPostProcess() override; - - const UpgradeTemplate *m_template; ///< template this upgrade instance is based on - UpgradeStatusType m_status; ///< status of upgrade - Upgrade *m_next; ///< next - Upgrade *m_prev; ///< prev - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -enum UpgradeType CPP_11(: Int) -{ - UPGRADE_TYPE_PLAYER = 0, // upgrade applies to a player as a whole - UPGRADE_TYPE_OBJECT, // upgrade applies to an object instance only - - NUM_UPGRADE_TYPES -}; -extern const char *const TheUpgradeTypeNames[]; //Change above, change this! - -//------------------------------------------------------------------------------------------------- -/** A single upgrade template definition */ -//------------------------------------------------------------------------------------------------- -class UpgradeTemplate : public MemoryPoolObject -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( UpgradeTemplate, "UpgradeTemplate" ) - -public: - - UpgradeTemplate(); - // virtual destructor defined by memory pool object - - Int calcTimeToBuild( Player *player ) const; ///< time in logic frames it will take this player to "build" this UpgradeTemplate - Int calcCostToBuild( Player *player ) const; ///< calc the cost to build this upgrade - - // field access - void setUpgradeName( const AsciiString& name ) { m_name = name; } - const AsciiString& getUpgradeName() const { return m_name; } - void setUpgradeNameKey( NameKeyType key ) { m_nameKey = key; } - NameKeyType getUpgradeNameKey() const { return m_nameKey; } - const AsciiString& getDisplayNameLabel() const { return m_displayNameLabel; } - const UpgradeMaskType& getUpgradeMask() const { return m_upgradeMask; } - UpgradeType getUpgradeType() const { return m_type; } - const AudioEventRTS* getResearchCompleteSound() const { return &m_researchSound; } - const AudioEventRTS* getUnitSpecificSound() const { return &m_unitSpecificSound; } - AcademyClassificationType getAcademyClassificationType() const { return m_academyClassificationType; } - - /// inventory pictures - void cacheButtonImage(); - const Image* getButtonImage() const { return m_buttonImage; } - - /// INI parsing - const FieldParse *getFieldParse() const { return m_upgradeFieldParseTable; } - - // friend access methods for the UpgradeCenter ONLY - void friend_setNext( UpgradeTemplate *next ) { m_next = next; } - void friend_setPrev( UpgradeTemplate *prev ) { m_prev = prev; } - UpgradeTemplate *friend_getNext() { return m_next; } - UpgradeTemplate *friend_getPrev() { return m_prev; } - const UpgradeTemplate *friend_getNext() const { return m_next; } - const UpgradeTemplate *friend_getPrev() const { return m_prev; } - void friend_setUpgradeMask( UpgradeMaskType mask ) { m_upgradeMask = mask; } - void friend_makeVeterancyUpgrade(VeterancyLevel v); - -protected: - - UpgradeType m_type; ///< upgrade type (PLAYER or OBJECT) - AsciiString m_name; ///< upgrade name - NameKeyType m_nameKey; ///< name key - AsciiString m_displayNameLabel; ///< String manager label for UI display name - Real m_buildTime; ///< database # for how long it takes to "build" this - Int m_cost; ///< cost for production - UpgradeMaskType m_upgradeMask; ///< Unique bitmask for this upgrade template - AudioEventRTS m_researchSound; ///< Sound played when upgrade researched. - AudioEventRTS m_unitSpecificSound; ///< Secondary sound played when upgrade researched. - AcademyClassificationType m_academyClassificationType; ///< A value used by the academy to evaluate advice based on what players do. - - UpgradeTemplate *m_next; ///< next - UpgradeTemplate *m_prev; ///< prev - - AsciiString m_buttonImageName; ///< "Queue" images to show in the build queue - const Image *m_buttonImage; - - /// INI field table - static const FieldParse m_upgradeFieldParseTable[]; ///< the parse table - -}; - -//------------------------------------------------------------------------------------------------- -/** The upgrade center keeps some basic information about the possible upgrades */ -//------------------------------------------------------------------------------------------------- -class UpgradeCenter : public SubsystemInterface -{ - -public: - - UpgradeCenter(); - virtual ~UpgradeCenter() override; - - virtual void init() override; ///< subsystem interface - virtual void reset() override; ///< subsystem interface - virtual void update() override { } ///< subsystem interface - - UpgradeTemplate *firstUpgradeTemplate(); ///< return the first upgrade template - const UpgradeTemplate *findUpgradeByKey( NameKeyType key ) const; ///< find upgrade by name key - const UpgradeTemplate *findUpgrade( const AsciiString& name ) const; ///< find and return upgrade by name - const UpgradeTemplate *findUpgrade( const char* name ) const; ///< find and return upgrade by name - const UpgradeTemplate *findVeterancyUpgrade(VeterancyLevel level) const; ///< find and return upgrade by veterancy level - - UpgradeTemplate *newUpgrade( const AsciiString& name ); ///< allocate, link, and return new upgrade - - /// does this player have all the necessary things to make this upgrade - Bool canAffordUpgrade( Player *player, const UpgradeTemplate *upgradeTemplate, Bool displayReason = FALSE ) const; - std::vector getUpgradeNames() const; // For WorldBuilder only!!! - - static void parseUpgradeDefinition( INI *ini ); - -protected: - - UpgradeTemplate *findNonConstUpgradeByKey( NameKeyType key ); ///< find upgrade by name key - - void linkUpgrade( UpgradeTemplate *upgrade ); ///< link upgrade to list - void unlinkUpgrade( UpgradeTemplate *upgrade ); ///< remove upgrade from list - - UpgradeTemplate *m_upgradeList; ///< list of all upgrades we can have - Int m_nextTemplateMaskBit; ///< Each instantiated UpgradeTemplate will be given a Int64 bit as an identifier - Bool buttonImagesCached; - -}; - -// EXTERNALS ////////////////////////////////////////////////////////////////////////////////////// -extern UpgradeCenter *TheUpgradeCenter; diff --git a/Generals/Code/GameEngine/Include/Common/encrypt.h b/Generals/Code/GameEngine/Include/Common/encrypt.h deleted file mode 100644 index e441432f9e6..00000000000 --- a/Generals/Code/GameEngine/Include/Common/encrypt.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Encrypt.h ////////////////////////////////////////////////////// -// Ancient Westwood Online password encryption (obfuscation?) code -// Author: Anonymous - -#pragma once - -// This routine is non-reentrant, as it returns a static buffer!!! -// Valid input is 4-8 characters, and can contain letters and numbers and '.' and '/' - -#define MAX_ENCRYPTED_STRING 8 - -const char *EncryptString(const char *); diff --git a/Generals/Code/GameEngine/Include/Common/version.h b/Generals/Code/GameEngine/Include/Common/version.h deleted file mode 100644 index e4ea743336e..00000000000 --- a/Generals/Code/GameEngine/Include/Common/version.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: version.h ////////////////////////////////////////////////////// -// Generals version number class -// Author: Matthew D. Campbell, November 2001 - -#pragma once - -#include - -/** - * The Version class formats the version number into integer and string - * values for different parts of the game. - * @todo: increment build number on compile, and stamp exe with username - */ -// TheSuperHackers @tweak The Version class now also provides Git information -// alongside the original Version information. -class Version -{ -public: - Version(); - - UnsignedInt getVersionNumber() const; ///< Return a 4-byte integer suitable for WOLAPI - - AsciiString getAsciiVersion() const; ///< Return a human-readable game version number - UnicodeString getUnicodeVersion() const; ///< Return a human-readable game version number. Is decorated with localized string - - AsciiString getAsciiBuildTime() const; ///< Return a formatted date/time string for build time - UnicodeString getUnicodeBuildTime() const; ///< Return a formatted date/time string for build time. Is decorated with localized string - - AsciiString getAsciiBuildLocation() const; ///< Return a string with the build location - UnicodeString getUnicodeBuildLocation() const; ///< Return a string with the build location. Is decorated with localized string - - AsciiString getAsciiBuildUser() const; ///< Return a string with the build user - UnicodeString getUnicodeBuildUser() const; ///< Return a string with the build user. Is decorated with localized string - - static Int getGitCommitCount(); ///< Returns the git commit count as a number - static time_t getGitCommitTime(); ///< Returns the git head commit time as a UTC timestamp - static const char* getGitCommitAuthorName(); ///< Returns the git head commit author name - - AsciiString getAsciiGitCommitCount() const; ///< Returns the git commit count. Is prefixed with ~ if there were uncommitted changes. - UnicodeString getUnicodeGitCommitCount() const; ///< Returns the git commit count. Is prefixed with ~ if there were uncommitted changes. - - AsciiString getAsciiGitTagOrHash() const; ///< Returns the git head commit tag or hash. Is prefixed with ~ if there were uncommitted changes. - UnicodeString getUnicodeGitTagOrHash() const; ///< Returns the git head commit tag or hash. Is prefixed with ~ if there were uncommitted changes. - - AsciiString getAsciiGitShortHash() const; ///< Returns the git head commit short hash. Is prefixed with ~ if there were uncommitted changes. - UnicodeString getUnicodeGitShortHash() const; ///< Returns the git head commit short hash. Is prefixed with ~ if there were uncommitted changes. - - AsciiString getAsciiGitCommitTime() const; ///< Returns the git head commit time in YYYY-mm-dd HH:MM:SS format - UnicodeString getUnicodeGitCommitTime() const; ///< Returns the git head commit time in YYYY-mm-dd HH:MM:SS format - - AsciiString getAsciiGitVersion() const; ///< Returns the git version - UnicodeString getUnicodeGitVersion() const; ///< Returns the git version - - AsciiString getAsciiBuildUserOrGitCommitAuthorName() const; - UnicodeString getUnicodeBuildUserOrGitCommitAuthorName() const; ///< Is decorated with localized string - - UnicodeString getUnicodeProductTitle() const; - UnicodeString getUnicodeProductVersion() const; - UnicodeString getUnicodeProductAuthor() const; ///< Is decorated with localized string - UnicodeString getUnicodeProductString() const; ///< Returns a string that contains product title, version and other, if specified. Is decorated with localized string - UnicodeString getUnicodeProductVersionHashString() const; ///< Returns a string that contains the product string, game version and hashes. Is decorated with localized string - - Bool showFullVersion() const { return m_showFullVersion; } - void setShowFullVersion( Bool val ) { m_showFullVersion = val; } - - void setVersion(Int major, Int minor, Int buildNum, - Int localBuildNum, AsciiString user, AsciiString location, - AsciiString buildTime, AsciiString buildDate); - -private: - static AsciiString buildAsciiGitCommitCount(); - static UnicodeString buildUnicodeGitCommitCount(); - - static AsciiString buildAsciiGitTagOrHash(); - static UnicodeString buildUnicodeGitTagOrHash(); - - static AsciiString buildAsciiGitShortHash(); - static UnicodeString buildUnicodeGitShortHash(); - - static AsciiString buildAsciiGitCommitTime(); - static UnicodeString buildUnicodeGitCommitTime(); - -private: - Int m_major; - Int m_minor; - Int m_buildNum; - Int m_localBuildNum; - AsciiString m_buildLocation; - AsciiString m_buildUser; - AsciiString m_buildTime; - AsciiString m_buildDate; - AsciiString m_asciiGitCommitCount; - AsciiString m_asciiGitTagOrHash; - AsciiString m_asciiGitShortHash; - AsciiString m_asciiGitCommitTime; - UnicodeString m_unicodeGitCommitCount; - UnicodeString m_unicodeGitTagOrHash; - UnicodeString m_unicodeGitShortHash; - UnicodeString m_unicodeGitCommitTime; - Bool m_showFullVersion; -}; - -extern Version *TheVersion; diff --git a/Generals/Code/GameEngine/Include/GameClient/Diplomacy.h b/Generals/Code/GameEngine/Include/GameClient/Diplomacy.h deleted file mode 100644 index 7f2aa04f987..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/Diplomacy.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Diplomacy.h ///////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, Sept 2002 -////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -void PopulateInGameDiplomacyPopup(); -void UpdateDiplomacyBriefingText(AsciiString newText, Bool clear); - -typedef std::list BriefingList; -BriefingList* GetBriefingTextList(); diff --git a/Generals/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h b/Generals/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h deleted file mode 100644 index 50351552e09..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//// EstablishConnectionsMenu.h ///////////////////////// - -#include "GameNetwork/NetworkDefs.h" -#include "GameNetwork/NAT.h" - -enum EstablishConnectionsMenuStateType CPP_11(: Int) { - ESTABLISHCONNECTIONSMENUSTATETYPE_SCREENON, - ESTABLISHCONNECTIONSMENUSTATETYPE_SCREENOFF -}; - -class EstablishConnectionsMenu { -public: - EstablishConnectionsMenu(); - virtual ~EstablishConnectionsMenu(); - - void initMenu(); - void endMenu(); - void abortGame(); - - void setPlayerName(Int slot, UnicodeString name); - void setPlayerStatus(Int slot, NATConnectionState state); - -protected: - EstablishConnectionsMenuStateType m_menuState; - - static const char *const m_playerReadyControlNames[MAX_SLOTS]; - static const char *const m_playerNameControlNames[MAX_SLOTS]; - static const char *const m_playerStatusControlNames[MAX_SLOTS]; -}; - -extern EstablishConnectionsMenu *TheEstablishConnectionsMenu; diff --git a/Generals/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h b/Generals/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h deleted file mode 100644 index 25c13a718f8..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ExtendedMessageBox.h ///////////////////////////////////////////////////////////////////// -// Author: Matt Campbell, January 2003 -// Description: We go quiet in 1 day, gold in 15. Poor time to rewrite message boxes, so -// we get this file instead. Phooey. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "GameClient/GameWindowManager.h" - -// return codes for message box callbacks -enum MessageBoxReturnType CPP_11(: Int) { - MB_RETURN_CLOSE, - MB_RETURN_KEEPOPEN -}; - -typedef MessageBoxReturnType (* MessageBoxFunc)( void *userData ); - -// WindowExMessageBoxData --------------------------------------------------------- -/** Data attached to each extended Message box window */ -//----------------------------------------------------------------------------- -struct WindowExMessageBoxData -{ - MessageBoxFunc yesCallback; ///. -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: GameInfoWindow.h /////////////////////////////////////////////////////////////////////////// -// Created: Chris Huybregts, Feb 2002 -// Desc: Game Info Window Header -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameClient/GameWindow.h" -#include "GameNetwork/LANGameInfo.h" - -// Function Stubs for GameInfoWindow -extern void CreateLANGameInfoWindow( GameWindow *sizeAndPosWin ); -extern void DestroyGameInfoWindow(); -extern void RefreshGameInfoWindow(GameInfo *gameInfo, UnicodeString gameName); -extern void HideGameInfoWindow(Bool hide); diff --git a/Generals/Code/GameEngine/Include/GameClient/MessageBox.h b/Generals/Code/GameEngine/Include/GameClient/MessageBox.h deleted file mode 100644 index cf5951e0990..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/MessageBox.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: MessageBox.h ///////////////////////////////////////////////////////////////////////////// -// Author: Chris Huybregts, November 2001 -// Description: Message Box file containing user aliases -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "GameClient/GameWindowManager.h" - -GameWindow *MessageBoxYesNo(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc yesCallback,GameWinMsgBoxFunc noCallback); ///< convenience function for displaying a Message box with Yes and No buttons -GameWindow *QuitMessageBoxYesNo(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc yesCallback,GameWinMsgBoxFunc noCallback); ///< convenience function for displaying a Message box with Yes and No buttons - - -GameWindow *MessageBoxYesNoCancel(UnicodeString titleString,UnicodeString bodyString, GameWinMsgBoxFunc yesCallback, GameWinMsgBoxFunc noCallback, GameWinMsgBoxFunc cancelCallback);///< convenience function for displaying a Message box with Yes,No and Cancel buttons - - -GameWindow *MessageBoxOkCancel(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc okCallback,GameWinMsgBoxFunc cancelCallback);///< convenience function for displaying a Message box with Ok and Cancel buttons - -GameWindow *MessageBoxOk(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc okCallback);///< convenience function for displaying a Message box with Ok button - - -GameWindow *MessageBoxCancel(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc cancelCallback);///< convenience function for displaying a Message box with Cancel button diff --git a/Generals/Code/GameEngine/Include/GameClient/ShellMenuScheme.h b/Generals/Code/GameEngine/Include/GameClient/ShellMenuScheme.h deleted file mode 100644 index b5d17347b46..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/ShellMenuScheme.h +++ /dev/null @@ -1,152 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ShellMenuScheme.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Jul 2002 -// -// Filename: ShellMenuScheme.h -// -// author: Chris Huybregts -// -// purpose: -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "GameClient/Color.h" - -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class Image; - -//----------------------------------------------------------------------------- -// TYPE DEFINES /////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class ShellMenuSchemeLine -{ -public: - ShellMenuSchemeLine(); - ~ShellMenuSchemeLine(); - - ICoord2D m_startPos; - ICoord2D m_endPos; - Int m_width; - Color m_color; - -}; - -class ShellMenuSchemeImage -{ -public: - ShellMenuSchemeImage(); - ~ShellMenuSchemeImage(); - - AsciiString m_name; ///< Name of the image - ICoord2D m_position; ///< the position we'll draw it at - ICoord2D m_size; ///< the size of the image needed when we draw it - Image *m_image; ///< the actual pointer to the mapped image -}; - -class ShellMenuScheme -{ -public: - ShellMenuScheme(); - ~ShellMenuScheme(); - - void draw(); - void addImage( ShellMenuSchemeImage* schemeImage ); - void addLine( ShellMenuSchemeLine* schemeLine ); - - - AsciiString m_name; - - typedef std::list< ShellMenuSchemeImage* > ShellMenuSchemeImageList; - typedef ShellMenuSchemeImageList::iterator ShellMenuSchemeImageListIt; - ShellMenuSchemeImageList m_imageList; - - typedef std::list< ShellMenuSchemeLine* > ShellMenuSchemeLineList; - typedef ShellMenuSchemeLineList::iterator ShellMenuSchemeLineListIt; - ShellMenuSchemeLineList m_lineList; - - - - -}; - -class ShellMenuSchemeManager -{ -public: - ShellMenuSchemeManager(); - ~ShellMenuSchemeManager(); - - void init(); - void update(); - - void setShellMenuScheme( AsciiString name ); - - void draw(); - - // parse Functions for the INI file - const FieldParse *getFieldParse() const { return m_shellMenuSchemeFieldParseTable; } ///< returns the parsing fields - static const FieldParse m_shellMenuSchemeFieldParseTable[]; ///< the parse table - static void parseImagePart( INI* ini, void *instance, void *store, const void *userData ); ///< Parse the image part of the INI file - static void parseLinePart( INI* ini, void *instance, void *store, const void *userData ); ///< Parse the line part of the INI file - - ShellMenuScheme *newShellMenuScheme(AsciiString name); - -private: - typedef std::list< ShellMenuScheme* > ShellMenuSchemeList; ///< list of Shell Menu schemes - typedef ShellMenuSchemeList::iterator ShellMenuSchemeListIt; - ShellMenuSchemeList m_schemeList; - ShellMenuScheme *m_currentScheme; - -}; - - -//----------------------------------------------------------------------------- -// INLINING /////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// EXTERNALS ////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameLogic/AIDock.h b/Generals/Code/GameEngine/Include/GameLogic/AIDock.h deleted file mode 100644 index 74f3397dd80..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/AIDock.h +++ /dev/null @@ -1,202 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// AIDock.h -// Docking behavior -// Author: Michael S. Booth, February 2002 - -#pragma once - -#include "Common/GameMemory.h" -#include "GameLogic/AIStateMachine.h" - -/** - * The states of the Docking state machine. - */ -enum -{ - AI_DOCK_APPROACH, ///< given a queue pos, move to it - AI_DOCK_WAIT_FOR_CLEARANCE, ///< wait for dock to give us enter clearance - AI_DOCK_ADVANCE_POSITION, ///< Advance in approach position as line moves forward - AI_DOCK_MOVE_TO_ENTRY, ///< move to the dock entrance - AI_DOCK_MOVE_TO_DOCK, ///< move to the actual dock position - AI_DOCK_PROCESS_DOCK, ///< invoke the dock's action until it is done - AI_DOCK_MOVE_TO_EXIT, ///< move to the dock exit, can exit the dock machine - AI_DOCK_MOVE_TO_RALLY ///< Move to rally if desired, exit the dock machine no matter what -}; - -//----------------------------------------------------------------------------------------------------------- -/** - * The docking state machine. - */ -class AIDockMachine : public StateMachine -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( AIDockMachine, "AIDockMachinePool" ); - -public: - /** - * The implementation of this constructor defines the states - * used by this machine. - */ - AIDockMachine( Object *owner ); - - static Bool ableToAdvance( State *thisState, void* userData ); // Condition for scooting forward in line while waiting - virtual void halt() override; ///< Stops the state machine & disables it in preparation for deleting it. - - Int m_approachPosition; ///< The Approach Position I am holding, to make scoot forward checks quicker. - -protected: - // snapshot interface - virtual void crc( Xfer *xfer ) override; - virtual void xfer( Xfer *xfer ) override; - virtual void loadPostProcess() override; - -}; - -// Please do not use these states in some other machine. I know that wouldn't even make sense, but they -// cast their getMachine to an AIDock machine to store stuff across states so you'd crash. -//----------------------------------------------------------------------------------------------------------- -class AIDockApproachState : public AIInternalMoveToState -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AIDockApproachState, "AIDockApproachState") -public: - AIDockApproachState( StateMachine *machine ) : AIInternalMoveToState( machine, "AIDockApproachState" ) { } - virtual StateReturnType onEnter() override; - virtual void onExit( StateExitType status ) override; - virtual StateReturnType update() override; -protected: - // snapshot interface STUBBED. - virtual void crc( Xfer *xfer ) override {}; - virtual void xfer( Xfer *xfer ) override; - virtual void loadPostProcess() override {}; -}; -EMPTY_DTOR(AIDockApproachState) - -//----------------------------------------------------------------------------------------------------------- -class AIDockWaitForClearanceState : public State -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AIDockWaitForClearanceState, "AIDockWaitForClearanceState") -public: - AIDockWaitForClearanceState( StateMachine *machine ) : State( machine, "AIDockWaitForClearanceState" ), m_enterFrame(0) { } - virtual StateReturnType onEnter() override; - virtual StateReturnType update() override; - virtual void onExit( StateExitType status ) override; -protected: - UnsignedInt m_enterFrame; -protected: - // snapshot interface STUBBED. - virtual void crc( Xfer *xfer ) override {}; - virtual void xfer( Xfer *xfer ) override; - virtual void loadPostProcess() override {}; -}; -EMPTY_DTOR(AIDockWaitForClearanceState) - -//----------------------------------------------------------------------------------------------------------- -class AIDockAdvancePositionState : public AIInternalMoveToState -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AIDockAdvancePositionState, "AIDockAdvancePositionState") -public: - AIDockAdvancePositionState( StateMachine *machine ) : AIInternalMoveToState( machine, "AIDockApproachState" ) { } - virtual StateReturnType onEnter() override; - virtual void onExit( StateExitType status ) override; - virtual StateReturnType update() override; -}; -EMPTY_DTOR(AIDockAdvancePositionState) - -//----------------------------------------------------------------------------------------------------------- -class AIDockMoveToEntryState : public AIInternalMoveToState -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AIDockMoveToEntryState, "AIDockMoveToEntryState") -public: - AIDockMoveToEntryState( StateMachine *machine ) : AIInternalMoveToState( machine, "AIDockMoveToEntryState" ) { } - virtual StateReturnType onEnter() override; - virtual void onExit( StateExitType status ) override; - virtual StateReturnType update() override; -}; -EMPTY_DTOR(AIDockMoveToEntryState) - -//----------------------------------------------------------------------------------------------------------- -class AIDockMoveToDockState : public AIInternalMoveToState -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AIDockMoveToDockState, "AIDockMoveToDockState") -public: - AIDockMoveToDockState( StateMachine *machine ) : AIInternalMoveToState( machine, "AIDockMoveToDockState" ) { } - virtual StateReturnType onEnter() override; - virtual void onExit( StateExitType status ) override; - virtual StateReturnType update() override; -}; -EMPTY_DTOR(AIDockMoveToDockState) - -//----------------------------------------------------------------------------------------------------------- -class AIDockMoveToRallyState : public AIInternalMoveToState -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AIDockMoveToRallyState, "AIDockMoveToRallyState") -public: - AIDockMoveToRallyState( StateMachine *machine ) : AIInternalMoveToState( machine, "AIDockMoveToRallyState" ) { } - virtual StateReturnType onEnter() override; - virtual void onExit( StateExitType status ) override; - virtual StateReturnType update() override; -}; -EMPTY_DTOR(AIDockMoveToRallyState) - -//----------------------------------------------------------------------------------------------------------- -class AIDockProcessDockState : public State -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AIDockProcessDockState, "AIDockProcessDockState") -public: - AIDockProcessDockState( StateMachine *machine ); - virtual StateReturnType onEnter() override; - virtual void onExit( StateExitType status ) override; - virtual StateReturnType update() override; - - void setNextDockActionFrame();//This puts a delay between callings of Action to tweak the speed of docking. - UnsignedInt m_nextDockActionFrame;// In the unlikely event of saving a game in the middle of docking, you may - // complete a Action a few frames sooner than you would have: It does not need to be saved. - Object* findMyDrone(); - -protected: - // snapshot interface STUBBED. - virtual void crc( Xfer *xfer ) override {}; - virtual void xfer( Xfer *xfer ) override {XferVersion cv = 1; XferVersion v = cv; xfer->xferVersion( &v, cv );} - virtual void loadPostProcess() override {}; - -private: - ObjectID m_droneID; ///< If I have a drone, the drone will get repaired too. - -}; -EMPTY_DTOR(AIDockProcessDockState) - -//----------------------------------------------------------------------------------------------------------- -class AIDockMoveToExitState : public AIInternalMoveToState -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AIDockMoveToExitState, "AIDockMoveToExitState") -public: - AIDockMoveToExitState( StateMachine *machine ) : AIInternalMoveToState( machine, "AIDockMoveToExitState" ) { } - virtual StateReturnType onEnter() override; - virtual void onExit( StateExitType status ) override; - virtual StateReturnType update() override; -}; -EMPTY_DTOR(AIDockMoveToExitState) - -//----------------------------------------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h deleted file mode 100644 index ca89b9064ad..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ActiveShroudUpgrade.h /////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, July 2002 -// Desc: An upgrade that modifies the object's ShroudRange. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpgradeModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; -class Player; -class ObjectCreationList; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class ActiveShroudUpgradeModuleData : public UpgradeModuleData -{ - -public: - - ActiveShroudUpgradeModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - Real m_newShroudRange; - -}; - -//------------------------------------------------------------------------------------------------- -/** An upgrade that modifies the object's ShroudRange */ -//------------------------------------------------------------------------------------------------- -class ActiveShroudUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( ActiveShroudUpgrade, "ActiveShroudUpgrade" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( ActiveShroudUpgrade, ActiveShroudUpgradeModuleData ); - -public: - - ActiveShroudUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - -protected: - - virtual void upgradeImplementation() override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/BoneFXDamage.h b/Generals/Code/GameEngine/Include/GameLogic/Module/BoneFXDamage.h deleted file mode 100644 index ebe6a5d7017..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/BoneFXDamage.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: BoneFXDamage.h ///////////////////////////////////////////////////////////////////// -// Author: Bryan Cleveland, April 2002 -// Desc: Damage module for the boneFX update module -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// - -#include "GameLogic/Module/DamageModule.h" - -//#include "GameLogic/Module/BodyModule.h" -- Yikes... not necessary to include this! (KM) -enum BodyDamageType CPP_11(: Int); //Ahhhh much better! - - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -class BoneFXDamage : public DamageModule -{ - - MAKE_STANDARD_MODULE_MACRO( BoneFXDamage ); - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BoneFXDamage, "BoneFXDamage" ) - -public: - - BoneFXDamage( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - // damage module methods - virtual void onDamage( DamageInfo *damageInfo ) override { } - virtual void onHealing( DamageInfo *damageInfo ) override { } - virtual void onBodyDamageStateChange( const DamageInfo* damageInfo, - BodyDamageType oldState, - BodyDamageType newState ) override; - -protected: - - virtual void onObjectCreated() override; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/BridgeScaffoldBehavior.h b/Generals/Code/GameEngine/Include/GameLogic/Module/BridgeScaffoldBehavior.h deleted file mode 100644 index dbe0a7fd89e..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/BridgeScaffoldBehavior.h +++ /dev/null @@ -1,111 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: BridgeScaffoldBehavior.h ///////////////////////////////////////////////////////////////// -// Author: Colin Day, September 2002 -// Desc: Bridge scaffold -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/BehaviorModule.h" -#include "GameLogic/Module/UpdateModule.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -enum ScaffoldTargetMotion CPP_11(: Int) -{ - STM_STILL, - STM_RISE, - STM_BUILD_ACROSS, - STM_TEAR_DOWN_ACROSS, - STM_SINK, -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class BridgeScaffoldBehaviorInterface -{ - -public: - - virtual void setPositions( const Coord3D *createPos, - const Coord3D *riseToPos, - const Coord3D *buildPos ) = 0; - virtual void setMotion( ScaffoldTargetMotion targetMotion ) = 0; - virtual ScaffoldTargetMotion getCurrentMotion() = 0; - virtual void reverseMotion() = 0; - virtual void setLateralSpeed( Real lateralSpeed ) = 0; - virtual void setVerticalSpeed( Real verticalSpeed ) = 0; - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class BridgeScaffoldBehavior : public UpdateModule, - public BridgeScaffoldBehaviorInterface -{ - - MAKE_STANDARD_MODULE_MACRO( BridgeScaffoldBehavior ); - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BridgeScaffoldBehavior, "BridgeScaffoldBehavior" ) - -public: - - BridgeScaffoldBehavior( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - // behavior module methods - virtual BridgeScaffoldBehaviorInterface* getBridgeScaffoldBehaviorInterface() override { return this; } - - // update methods - virtual UpdateSleepTime update() override; - - // bridge scaffold interface methods - virtual void setPositions( const Coord3D *createPos, - const Coord3D *riseToPos, - const Coord3D *buildPos ) override; - virtual void setMotion( ScaffoldTargetMotion targetMotion ) override; - virtual ScaffoldTargetMotion getCurrentMotion() override { return m_targetMotion; } - virtual void reverseMotion() override; - virtual void setLateralSpeed( Real lateralSpeed ) override { m_lateralSpeed = lateralSpeed; } - virtual void setVerticalSpeed( Real verticalSpeed ) override { m_verticalSpeed = verticalSpeed; } - - // public interface acquisition - static BridgeScaffoldBehaviorInterface *getBridgeScaffoldBehaviorInterfaceFromObject( Object *obj ); - -protected: - - void doVerticalMotion(); ///< do rise/sink vertical motion - void doLateralmotion(); ///< do lateral motion - - ScaffoldTargetMotion m_targetMotion; ///< which way our motion should be going (build up, still, tear down etc) - Coord3D m_createPos; ///< initial position of object creation (in ground) - Coord3D m_riseToPos; ///< position we "rise to" out of the ground - Coord3D m_buildPos; ///< position we move to and stop at on the bridge surface - Real m_lateralSpeed; ///< speed for lateral motions - Real m_verticalSpeed; ///< speed for vertical motions - Coord3D m_targetPos; ///< current target position for our motion type - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h b/Generals/Code/GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h deleted file mode 100644 index 6574318a7c8..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h +++ /dev/null @@ -1,94 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: BridgeTowerBehavior.h //////////////////////////////////////////////////////////////////// -// Author: Colin Day, July 2002 -// Desc: Behavior module for the towers attached to bridges that can be targeted -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/BehaviorModule.h" -#include "GameLogic/Module/DamageModule.h" -#include "GameLogic/Module/DieModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class BridgeTowerBehaviorInterface -{ - -public: - - virtual void setBridge( Object *bridge ) = 0; - virtual ObjectID getBridgeID() = 0; - virtual void setTowerType( BridgeTowerType type ) = 0; - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class BridgeTowerBehavior : public BehaviorModule, - public BridgeTowerBehaviorInterface, - public DieModuleInterface, - public DamageModuleInterface -{ - - MAKE_STANDARD_MODULE_MACRO( BridgeTowerBehavior ); - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BridgeTowerBehavior, "BridgeTowerBehavior" ) - -public: - - BridgeTowerBehavior( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - static Int getInterfaceMask() { return (MODULEINTERFACE_DAMAGE) | (MODULEINTERFACE_DIE); } - virtual BridgeTowerBehaviorInterface* getBridgeTowerBehaviorInterface() override { return this; } - - virtual void setBridge( Object *bridge ) override; - virtual ObjectID getBridgeID() override; - virtual void setTowerType( BridgeTowerType type ) override; - - static BridgeTowerBehaviorInterface *getBridgeTowerBehaviorInterfaceFromObject( Object *obj ); - - // Damage methods - virtual DamageModuleInterface* getDamage() override { return this; } - virtual void onDamage( DamageInfo *damageInfo ) override; - virtual void onHealing( DamageInfo *damageInfo ) override; - virtual void onBodyDamageStateChange( const DamageInfo* damageInfo, - BodyDamageType oldState, - BodyDamageType newState ) override; - - // Die methods - virtual DieModuleInterface* getDie() override { return this; } - virtual void onDie( const DamageInfo *damageInfo ) override; - -protected: - - ObjectID m_bridgeID; ///< the bridge we're a part of - BridgeTowerType m_type; ///< type of tower (positioning) we are - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/CheckpointUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/CheckpointUpdate.h deleted file mode 100644 index 99228c6c19f..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/CheckpointUpdate.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CheckpointUpdate.h ///////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, April 2002 -// Desc: Reacts when an enemy is within range -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" -#include "Common/KindOf.h" - - -//------------------------------------------------------------------------------------------------- -/** Checkpoint update */ -//------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -class CheckpointUpdateModuleData : public UpdateModuleData -{ -public: - UnsignedInt m_enemyScanDelayTime; - - CheckpointUpdateModuleData() - { - m_enemyScanDelayTime = LOGICFRAMES_PER_SECOND; - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - UpdateModuleData::buildFieldParse(p); - static const FieldParse dataFieldParse[] = - { - { "ScanDelayTime", INI::parseDurationUnsignedInt, nullptr, offsetof( CheckpointUpdateModuleData, m_enemyScanDelayTime ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class CheckpointUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( CheckpointUpdate, "CheckpointUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( CheckpointUpdate, CheckpointUpdateModuleData ) - -public: - - CheckpointUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual UpdateSleepTime update() override; - -protected: - Bool m_enemyNear; - Bool m_allyNear; - Real m_maxMinorRadius; - - UnsignedInt m_enemyScanDelay; - void checkForAlliesAndEnemies(); - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/CleanupHazardUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/CleanupHazardUpdate.h deleted file mode 100644 index a275b9b4b77..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/CleanupHazardUpdate.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CleanupHazardUpdate.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, August 2002 -// Desc: Update module to handle independent targeting of hazards to cleanup. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/KindOf.h" -#include "GameLogic/Module/UpdateModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class ThingTemplate; -class WeaponTemplate; - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class CleanupHazardUpdateModuleData : public ModuleData -{ -public: - WeaponSlotType m_weaponSlot; - UnsignedInt m_scanFrames; - Real m_scanRange; - - CleanupHazardUpdateModuleData(); - static void buildFieldParse(MultiIniFieldParse& p); - -private: - -}; - -//------------------------------------------------------------------------------------------------- -/** The default update module */ -//------------------------------------------------------------------------------------------------- -class CleanupHazardUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( CleanupHazardUpdate, "CleanupHazardUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( CleanupHazardUpdate, CleanupHazardUpdateModuleData ); - -public: - - CleanupHazardUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onObjectCreated() override; - virtual UpdateSleepTime update() override; - - Object* scanClosestTarget(); - void fireWhenReady(); - - void setCleanupAreaParameters( const Coord3D *pos, Real range ); //This allows the unit to cleanup an area until clean, then the AI goes idle. - -protected: - - ObjectID m_bestTargetID; - Bool m_inRange; - Int m_nextScanFrames; - Int m_nextShotAvailableInFrames; - const WeaponTemplate *m_weaponTemplate; - - //Cleanup area (temporary values). - Coord3D m_pos; - Real m_moveRange; -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h deleted file mode 100644 index b062d4690d6..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h +++ /dev/null @@ -1,114 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CostModifierUpgrade.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Aug 2002 -// -// Filename: CostModifierUpgrade.h -// -// author: Chris Huybregts -// -// purpose: -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "GameLogic/Module/UpgradeModule.h" -#include "Common/KindOf.h" -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class Thing; -class Player; - -//----------------------------------------------------------------------------- -// TYPE DEFINES /////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// INLINING /////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// EXTERNALS ////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class CostModifierUpgradeModuleData : public UpgradeModuleData -{ - -public: - - CostModifierUpgradeModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - Real m_percentage; - KindOfMaskType m_kindOf; -}; - -//------------------------------------------------------------------------------------------------- -/** The OCL upgrade module */ -//------------------------------------------------------------------------------------------------- -class CostModifierUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( CostModifierUpgrade, "CostModifierUpgrade" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( CostModifierUpgrade, CostModifierUpgradeModuleData ); - -public: - - CostModifierUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - - virtual void onDelete() override; ///< we have some work to do when this module goes away - virtual void onCapture( Player *oldOwner, Player *newOwner ) override; - -protected: - - virtual void upgradeImplementation() override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/CreateCrateDie.h b/Generals/Code/GameEngine/Include/GameLogic/Module/CreateCrateDie.h deleted file mode 100644 index 5a047c96b64..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/CreateCrateDie.h +++ /dev/null @@ -1,93 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CreateCrateDie.h ///////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, February 2002 -// Desc: A chance to create a crate on death according to certain condition checks -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/INI.h" -#include "GameLogic/Module/DieModule.h" -#include "Common/STLTypedefs.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class CrateTemplate; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class CreateCrateDieModuleData : public DieModuleData -{ -public: - AsciiStringList m_crateNameList; - - CreateCrateDieModuleData() - { - m_crateNameList.clear(); - } - virtual ~CreateCrateDieModuleData() override - { - m_crateNameList.clear(); - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - DieModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "CrateData", CreateCrateDieModuleData::parseCrateData, nullptr, 0 }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } - - static void parseCrateData( INI* ini, void *instance, void * /*store*/, const void* /*userData*/ ); -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class CreateCrateDie : public DieModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( CreateCrateDie, "CreateCrateDie" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( CreateCrateDie, CreateCrateDieModuleData ) - -public: - - CreateCrateDie( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onDie( const DamageInfo *damageInfo ) override; - -private: - Bool testCreationChance( CrateTemplate const *currentCrateData ); - Bool testVeterancyLevel( CrateTemplate const *currentCrateData ); - Bool testKillerType( CrateTemplate const *currentCrateData, Object *killer ); - Bool testKillerScience( CrateTemplate const *currentCrateData, Object *killer ); - - Object *createCrate( CrateTemplate const *currentCrateData ); -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/CreateModule.h b/Generals/Code/GameEngine/Include/GameLogic/Module/CreateModule.h deleted file mode 100644 index 5653e86e79b..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/CreateModule.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CreateModule.h ///////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, September 2001 -// Desc: -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "Common/Module.h" -#include "GameLogic/Module/BehaviorModule.h" - -//------------------------------------------------------------------------------------------------- -/** OBJECT CREATE MODULE base class */ -//------------------------------------------------------------------------------------------------- -class CreateModuleInterface -{ -public: - virtual void onCreate() = 0; ///< This is called when you become a code Object - virtual void onBuildComplete() = 0; ///< This is called when you are a finished game object - virtual Bool shouldDoOnBuildComplete() const = 0; - -}; - -//------------------------------------------------------------------------------------------------- -class CreateModuleData : public BehaviorModuleData -{ -public: - - static void buildFieldParse(MultiIniFieldParse& p) - { - BehaviorModuleData::buildFieldParse(p); - } -}; - -//------------------------------------------------------------------------------------------------- -class CreateModule : public BehaviorModule, public CreateModuleInterface -{ - - MEMORY_POOL_GLUE_ABC( CreateModule ) - MAKE_STANDARD_MODULE_MACRO_ABC( CreateModule ) - //MAKE_STANDARD_MODULE_DATA_MACRO_ABC(CreateModule, CreateModuleData) - -public: - - CreateModule( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - - static Int getInterfaceMask() { return MODULEINTERFACE_CREATE; } - - // BehaviorModule - virtual CreateModuleInterface* getCreate() override { return this; } - - virtual void onBuildComplete() override { m_needToRunOnBuildComplete = FALSE; } ///< This is called when you are a finished game object - virtual Bool shouldDoOnBuildComplete() const override { return m_needToRunOnBuildComplete; } - -private: - - Bool m_needToRunOnBuildComplete; ///< Prevent the multiple calling of onBuildComplete - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/CrushDie.h b/Generals/Code/GameEngine/Include/GameLogic/Module/CrushDie.h deleted file mode 100644 index 4d0010ba812..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/CrushDie.h +++ /dev/null @@ -1,100 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CrushDie.h ///////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, November 2001 -// Desc: Default die module -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/AudioEventRTS.h" -#include "Common/INI.h" - -#include "GameLogic/Module/DieModule.h" - - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -enum CrushEnum CPP_11(: Int) -{ - TOTAL_CRUSH, - BACK_END_CRUSH, - FRONT_END_CRUSH, - NO_CRUSH, - - CRUSH_COUNT -}; - -//------------------------------------------------------------------------------------------------- -class CrushDieModuleData : public DieModuleData -{ -public: - AudioEventRTS m_crushSounds[CRUSH_COUNT]; - Int m_crushSoundPercent[CRUSH_COUNT]; - - CrushDieModuleData() - { - for (int i = 0; i < CRUSH_COUNT; i++) - { - m_crushSoundPercent[i] = 100; - } - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - DieModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "TotalCrushSound", INI::parseAudioEventRTS, nullptr, offsetof( CrushDieModuleData, m_crushSounds[TOTAL_CRUSH] ) }, - { "BackEndCrushSound", INI::parseAudioEventRTS, nullptr, offsetof( CrushDieModuleData, m_crushSounds[BACK_END_CRUSH] ) }, - { "FrontEndCrushSound", INI::parseAudioEventRTS, nullptr, offsetof( CrushDieModuleData, m_crushSounds[FRONT_END_CRUSH] ) }, - { "TotalCrushSoundPercent", INI::parseInt, nullptr, offsetof( CrushDieModuleData, m_crushSoundPercent[TOTAL_CRUSH] ) }, - { "BackEndCrushSoundPercent", INI::parseInt, nullptr, offsetof( CrushDieModuleData, m_crushSoundPercent[BACK_END_CRUSH] ) }, - { "FrontEndCrushSoundPercent",INI::parseInt, nullptr, offsetof( CrushDieModuleData, m_crushSoundPercent[FRONT_END_CRUSH] ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } -}; - -//------------------------------------------------------------------------------------------------- -class CrushDie : public DieModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( CrushDie, "CrushDie" ) - - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( CrushDie, CrushDieModuleData ); - -public: - - CrushDie( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onDie( const DamageInfo *damageInfo ) override; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/DamDie.h b/Generals/Code/GameEngine/Include/GameLogic/Module/DamDie.h deleted file mode 100644 index 56d592ed9cf..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/DamDie.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DamDie.h ///////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, April 2002 -// Desc: The big water dam dying -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/DieModule.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class DamDieModuleData : public DieModuleData -{ - -public: - - DamDieModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class DamDie : public DieModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DamDie, "DamDie" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( DamDie, DamDieModuleData ) - -public: - - DamDie( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by MemoryPoolObject - - virtual void onDie( const DamageInfo *damageInfo ) override; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/DamageModule.h b/Generals/Code/GameEngine/Include/GameLogic/Module/DamageModule.h deleted file mode 100644 index e749ff2589d..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/DamageModule.h +++ /dev/null @@ -1,105 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DamageModule.h ///////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, September 2001 -// Desc: -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "Common/Module.h" -#include "GameLogic/Damage.h" -#include "GameLogic/Module/BehaviorModule.h" - -enum BodyDamageType CPP_11(: Int); - -//------------------------------------------------------------------------------------------------- -/** OBJECT DAMAGE MODULE base class */ -//------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -class DamageModuleInterface -{ - -public: - - virtual void onDamage( DamageInfo *damageInfo ) = 0; ///< damage callback - virtual void onHealing( DamageInfo *damageInfo ) = 0; ///< healing callback - virtual void onBodyDamageStateChange( const DamageInfo* damageInfo, - BodyDamageType oldState, - BodyDamageType newState) = 0; ///< state change callback - -}; - -//------------------------------------------------------------------------------------------------- -class DamageModuleData : public BehaviorModuleData -{ -public: -// DamageTypeFlags m_damageTypes; - - DamageModuleData() -// : m_damageTypes(DAMAGE_TYPE_FLAGS_ALL) - { - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - BehaviorModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { -// { "DamageTypes", INI::parseDamageTypeFlags, nullptr, offsetof( DamageModuleData, m_damageTypes ) }, - { 0, 0, 0, 0 } - }; - - p.add(dataFieldParse); - } -}; - -//------------------------------------------------------------------------------------------------- -class DamageModule : public BehaviorModule, public DamageModuleInterface -{ - - MEMORY_POOL_GLUE_ABC( DamageModule ) - MAKE_STANDARD_MODULE_MACRO_ABC( DamageModule ) - MAKE_STANDARD_MODULE_DATA_MACRO_ABC( DamageModule, DamageModuleData ) - -public: - - DamageModule( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - - // module methods - static Int getInterfaceMask() { return MODULEINTERFACE_DAMAGE; } - - // BehaviorModule - virtual DamageModuleInterface* getDamage() override { return this; } - -protected: - -}; -inline DamageModule::DamageModule( Thing *thing, const ModuleData* moduleData ) : BehaviorModule( thing, moduleData ) { } -inline DamageModule::~DamageModule() { } -//------------------------------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/DeletionUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/DeletionUpdate.h deleted file mode 100644 index bde4064038f..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/DeletionUpdate.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DeletionUpdate.h ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, August 2002 -// Desc: Update that will count down a lifetime and destroy object when it reaches zero -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" - -//------------------------------------------------------------------------------------------------- -class DeletionUpdateModuleData : public UpdateModuleData -{ -public: - UnsignedInt m_minFrames; - UnsignedInt m_maxFrames; - - DeletionUpdateModuleData() - { - m_minFrames = 0.0f; - m_maxFrames = 0.0f; - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - UpdateModuleData::buildFieldParse(p); - static const FieldParse dataFieldParse[] = - { - { "MinLifetime", INI::parseDurationUnsignedInt, nullptr, offsetof( DeletionUpdateModuleData, m_minFrames ) }, - { "MaxLifetime", INI::parseDurationUnsignedInt, nullptr, offsetof( DeletionUpdateModuleData, m_maxFrames ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class DeletionUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DeletionUpdate, "DeletionUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( DeletionUpdate, DeletionUpdateModuleData ) - -public: - - DeletionUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - void setLifetimeRange( UnsignedInt minFrames, UnsignedInt maxFrames ); - UnsignedInt getDieFrame() { return m_dieFrame; } - - virtual UpdateSleepTime update() override; - -protected: - - UnsignedInt calcSleepDelay(UnsignedInt minFrames, UnsignedInt maxFrames); - - UnsignedInt m_dieFrame; ///< frame we die on - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/DestroyModule.h b/Generals/Code/GameEngine/Include/GameLogic/Module/DestroyModule.h deleted file mode 100644 index c9a450c27cd..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/DestroyModule.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DestroyModule.h ///////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, September 2001 -// Desc: -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "Common/Module.h" -#include "GameLogic/Module/BehaviorModule.h" - -//------------------------------------------------------------------------------------------------- -/** OBJECT DESTROY MODULE base class */ -//------------------------------------------------------------------------------------------------- -class DestroyModuleInterface -{ -public: - virtual void onDestroy() = 0; -}; - -//------------------------------------------------------------------------------------------------- -class DestroyModule : public BehaviorModule, public DestroyModuleInterface -{ - - MEMORY_POOL_GLUE_ABC( DestroyModule ) - MAKE_STANDARD_MODULE_MACRO_ABC( DestroyModule ) - -public: - - DestroyModule( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - - static Int getInterfaceMask() { return MODULEINTERFACE_DESTROY; } - - // BehaviorModule - virtual DestroyModuleInterface* getDestroy() override { return this; } - -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/DieModule.h b/Generals/Code/GameEngine/Include/GameLogic/Module/DieModule.h deleted file mode 100644 index e81cd9ac748..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/DieModule.h +++ /dev/null @@ -1,105 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DieModule.h ///////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, September 2001 -// Desc: -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "Common/Module.h" -#include "GameLogic/Damage.h" -#include "GameLogic/Module/BehaviorModule.h" -#include "Common/ObjectStatusTypes.h" - -//------------------------------------------------------------------------------------------------- -/** OBJECT DIE MODULE base class */ -//------------------------------------------------------------------------------------------------- - - -//------------------------------------------------------------------------------------------------- -class DieModuleInterface -{ -public: - virtual void onDie( const DamageInfo *damageInfo ) = 0; -}; - -//------------------------------------------------------------------------------------------------- -class DieMuxData // does NOT inherit from ModuleData. -{ -public: - DeathTypeFlags m_deathTypes; - VeterancyLevelFlags m_veterancyLevels; - ObjectStatusMaskType m_exemptStatus; ///< die module is ignored if any of these status bits are set - ObjectStatusMaskType m_requiredStatus; ///< die module is ignored if any of these status bits are clear - - DieMuxData(); - static const FieldParse* getFieldParse(); - - Bool isDieApplicable(const Object* obj, const DamageInfo *damageInfo) const; -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -class DieModuleData : public BehaviorModuleData -{ -public: - DieMuxData m_dieMuxData; - - static void buildFieldParse(MultiIniFieldParse& p) - { - BehaviorModuleData::buildFieldParse(p); - p.add(DieMuxData::getFieldParse(), offsetof( DieModuleData, m_dieMuxData )); - } - - Bool isDieApplicable(const Object* obj, const DamageInfo *damageInfo) const { return m_dieMuxData.isDieApplicable(obj, damageInfo); } -}; - -//------------------------------------------------------------------------------------------------- -class DieModule : public BehaviorModule, public DieModuleInterface -{ - - MEMORY_POOL_GLUE_ABC( DieModule ) - MAKE_STANDARD_MODULE_MACRO_ABC( DieModule ) - MAKE_STANDARD_MODULE_DATA_MACRO_ABC(DieModule, DieModuleData) - -public: - - DieModule( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - - static Int getInterfaceMask() { return MODULEINTERFACE_DIE; } - - // BehaviorModule - virtual DieModuleInterface* getDie() override { return this; } - -protected: - Bool isDieApplicable(const DamageInfo *damageInfo) const { return getDieModuleData()->isDieApplicable(getObject(), damageInfo); } - -}; -inline DieModule::DieModule( Thing *thing, const ModuleData* moduleData ) : BehaviorModule( thing, moduleData ) { } -inline DieModule::~DieModule() { } diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/DynamicGeometryInfoUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/DynamicGeometryInfoUpdate.h deleted file mode 100644 index e78c2b6785b..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/DynamicGeometryInfoUpdate.h +++ /dev/null @@ -1,101 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DynamicGeometryInfoUpdate.h ////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, April 2002 -// Desc: Update module that changes the object's GeometryInfo -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/Geometry.h" -#include "GameLogic/Module/UpdateModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class DynamicGeometryInfoUpdateModuleData : public ModuleData -{ -public: - - UnsignedInt m_initialDelay; - - Real m_initialHeight; - Real m_initialMajorRadius; - Real m_initialMinorRadius; - - Real m_finalHeight; - Real m_finalMajorRadius; - Real m_finalMinorRadius; - - UnsignedInt m_transitionTime; - - Bool m_reverseAtTransitionTime; ///< reverse directions once transition time is reached - - // I will go from initial to final in transitionTime frames, smoothly. - // I won't change type until that is actually needed as a task. - - DynamicGeometryInfoUpdateModuleData(); - static void buildFieldParse(MultiIniFieldParse& p); - -private: - -}; - -//------------------------------------------------------------------------------------------------- -/** The default update module */ -//------------------------------------------------------------------------------------------------- -class DynamicGeometryInfoUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DynamicGeometryInfoUpdate, "DynamicGeometryInfoUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( DynamicGeometryInfoUpdate, DynamicGeometryInfoUpdateModuleData ); - -public: - - DynamicGeometryInfoUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual UpdateSleepTime update() override; - -protected: - - UnsignedInt m_startingDelayCountdown; - UnsignedInt m_timeActive; - - Bool m_started; - Bool m_finished; - - Bool m_reverseAtTransitionTime; ///< do a reverse at transition time - enum DynamicGeometryDirection { FORWARD = 1, BACKWARD = -1 }; - DynamicGeometryDirection m_direction; ///< direction we're growing/shrinking - Bool m_switchedDirections; ///< TRUE once we've switched directions - - Real m_initialHeight; - Real m_initialMajorRadius; - Real m_initialMinorRadius; - Real m_finalHeight; - Real m_finalMajorRadius; - Real m_finalMinorRadius; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/EjectPilotDie.h b/Generals/Code/GameEngine/Include/GameLogic/Module/EjectPilotDie.h deleted file mode 100644 index ec12757ca32..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/EjectPilotDie.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: EjectPilotDie.h ///////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, April 2002 -// Desc: Create object at current object's death -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/DieModule.h" -#include "Common/INI.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; -class ObjectCreationList; - -//------------------------------------------------------------------------------------------------- -class EjectPilotDieModuleData : public DieModuleData -{ -public: - const ObjectCreationList* m_oclInAir; - const ObjectCreationList* m_oclOnGround; - UnsignedInt m_invulnerableTime; - - EjectPilotDieModuleData(); - static void buildFieldParse(MultiIniFieldParse& p); -}; - -//------------------------------------------------------------------------------------------------- -/** When this object dies, create another object in its place */ -//------------------------------------------------------------------------------------------------- -class EjectPilotDie : public DieModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( EjectPilotDie, "EjectPilotDie" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( EjectPilotDie, EjectPilotDieModuleData ); - -public: - - EjectPilotDie( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - static void ejectPilot(const ObjectCreationList* ocl, const Object* dyingObject, const Object* damageDealer); - - virtual void onDie( const DamageInfo *damageInfo ) override; - virtual DieModuleInterface* getEjectPilotDieInterface() override {return this; } - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/EnemyNearUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/EnemyNearUpdate.h deleted file mode 100644 index 5e8075ca8fb..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/EnemyNearUpdate.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: EnemyNearUpdate.h ///////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, April 2002 -// Desc: Reacts when an enemy is within range -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" -#include "Common/KindOf.h" - -//------------------------------------------------------------------------------------------------- -// ------------------------------------------------------------------------------------------------ -class EnemyNearUpdateModuleData : public UpdateModuleData -{ -public: - UnsignedInt m_enemyScanDelayTime; - - EnemyNearUpdateModuleData() - { - m_enemyScanDelayTime = LOGICFRAMES_PER_SECOND; - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - UpdateModuleData::buildFieldParse(p); - static const FieldParse dataFieldParse[] = - { - { "ScanDelayTime", INI::parseDurationUnsignedInt, nullptr, offsetof( EnemyNearUpdateModuleData, m_enemyScanDelayTime ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } -}; - -//------------------------------------------------------------------------------------------------- -/** EnemyNear update */ -//------------------------------------------------------------------------------------------------- -class EnemyNearUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( EnemyNearUpdate, "EnemyNearUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( EnemyNearUpdate, EnemyNearUpdateModuleData ) - -public: - - EnemyNearUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual UpdateSleepTime update() override; - -protected: - - UnsignedInt m_enemyScanDelay; - Bool m_enemyNear; - - void checkForEnemies(); - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h deleted file mode 100644 index a4bb8c7dea0..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ExperienceScalarUpgrade.h ///////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, September 2002 -// Desc: UpgradeModule that adds a scalar to the object's experience gain. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpgradeModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class ExperienceScalarUpgradeModuleData: public UpgradeModuleData -{ - -public: - - ExperienceScalarUpgradeModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - Real m_addXPScalar; - -}; - -//------------------------------------------------------------------------------------------------- -// ------------------------------------------------------------------------------------------------ -class ExperienceScalarUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( ExperienceScalarUpgrade, "ExperienceScalarUpgrade" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( ExperienceScalarUpgrade, ExperienceScalarUpgradeModuleData ); - -public: - - ExperienceScalarUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - -protected: - - virtual void upgradeImplementation() override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h deleted file mode 100644 index e636edc17c2..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: FireSpreadUpdate.h ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, April 2002 -// Desc: Update looks for ::Aflame and explicitly ignites someone nearby if set -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" - -class ObjectCreationList; - -//------------------------------------------------------------------------------------------------- -class FireSpreadUpdateModuleData : public UpdateModuleData -{ -public: - const ObjectCreationList *m_oclEmbers; - UnsignedInt m_minSpreadTryDelayData; - UnsignedInt m_maxSpreadTryDelayData; - Real m_spreadTryRange; - - FireSpreadUpdateModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - -private: - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class FireSpreadUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FireSpreadUpdate, "FireSpreadUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( FireSpreadUpdate, FireSpreadUpdateModuleData ) - -public: - - FireSpreadUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual UpdateSleepTime update() override; - - void startFireSpreading(); - -protected: - - UnsignedInt calcNextSpreadDelay(); - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/FireWeaponCollide.h b/Generals/Code/GameEngine/Include/GameLogic/Module/FireWeaponCollide.h deleted file mode 100644 index f4d121adf86..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/FireWeaponCollide.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: FireWeaponCollide.h /////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood April 2002 -// Desc: Shoot something that collides with me every frame with my weapon -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/CollideModule.h" -#include "GameLogic/Weapon.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Object; - -//------------------------------------------------------------------------------------------------- -class FireWeaponCollideModuleData : public CollideModuleData -{ -public: - const WeaponTemplate* m_collideWeaponTemplate; - ObjectStatusMaskType m_requiredStatus; - ObjectStatusMaskType m_forbiddenStatus; - Bool m_fireOnce; - - FireWeaponCollideModuleData() - { - m_collideWeaponTemplate = nullptr; - m_fireOnce = FALSE; - } - - static void buildFieldParse(MultiIniFieldParse& p); -}; - -//------------------------------------------------------------------------------------------------- -class FireWeaponCollide : public CollideModule -{ - - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( FireWeaponCollide, FireWeaponCollideModuleData ); - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FireWeaponCollide, "FireWeaponCollide" ) - -public: - - FireWeaponCollide( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - -protected: - - virtual void onCollide( Object *other, const Coord3D *loc, const Coord3D *normal ) override; - - virtual Bool shouldFireWeapon(); - -private: - Weapon* m_collideWeapon; - Bool m_everFired; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/FlammableUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/FlammableUpdate.h deleted file mode 100644 index 9b0b2f3774c..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/FlammableUpdate.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: FlammableUpdate.h ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, April 2002 -// Desc: Update that manages Aflame and Burned statuses and their effects -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/AudioEventRTS.h" -#include "GameLogic/Module/DamageModule.h" -#include "GameLogic/Module/UpdateModule.h" - - -//------------------------------------------------------------------------------------------------- -enum FlammabilityStatusType CPP_11(: Int) -{ - // These show the state I last noticed my object was in. - FS_NORMAL = 0, - FS_AFLAME, - FS_BURNED, -}; - -//------------------------------------------------------------------------------------------------- -class FlammableUpdateModuleData : public UpdateModuleData -{ -public: - UnsignedInt m_burnedDelay; ///< How long before I am ::Burned. 0 means never - UnsignedInt m_aflameDuration; ///< How long I stay ::Aflame. Independent of Burned. - // When aflame wears out is when I check to be normal or burned, So my model can - // change to burned while I am still aflame. - UnsignedInt m_aflameDamageDelay; ///< While ::Aflame, I take damage this often. If 0, never. - Int m_aflameDamageAmount; ///< And this is how much I take. - AsciiString m_burningSoundName; ///< Sound to loop-play while burning (Not an AudioEventRTS here, since that belongs to the module) - Real m_flameDamageLimitData; - UnsignedInt m_flameDamageExpirationDelay; - - FlammableUpdateModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - -private: - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class FlammableUpdate : public UpdateModule, public DamageModuleInterface -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FlammableUpdate, "FlammableUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( FlammableUpdate, FlammableUpdateModuleData ) - -public: - - FlammableUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - static Int getInterfaceMask() { return UpdateModule::getInterfaceMask() | (MODULEINTERFACE_DAMAGE); } - virtual DamageModuleInterface* getDamage() override { return this; } - - void tryToIgnite(); ///< FlammabeDamage uses this. It is up to me to decide if I am burnable - Bool wouldIgnite(); ///< Since we need to cheat sometimes and light something directly, ask if this would light - - //UpdateModuleInterface - virtual UpdateSleepTime update() override; - - //DamageModuleInterface - virtual void onDamage( DamageInfo *damageInfo ) override; - virtual void onHealing( DamageInfo *damageInfo ) override { } - virtual void onBodyDamageStateChange( const DamageInfo *damageInfo, - BodyDamageType oldState, - BodyDamageType newState ) override { } - -protected: - - UpdateSleepTime calcSleepTime(); - void doAflameDamage(); - void startBurningSound(); - void stopBurningSound(); - - FlammabilityStatusType m_status; - UnsignedInt m_aflameEndFrame; - UnsignedInt m_burnedEndFrame; - UnsignedInt m_damageEndFrame; - AudioHandle m_audioHandle; - Real m_flameDamageLimit; - ObjectID m_flameSource; - UnsignedInt m_lastFlameDamageDealt; -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/FloatUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/FloatUpdate.h deleted file mode 100644 index f67356a3fb0..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/FloatUpdate.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: FloatUpdate.h //////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, May 2002 -// Desc: Floating on water update -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -struct FieldParse; - -//------------------------------------------------------------------------------------------------- -class FloatUpdateModuleData: public UpdateModuleData -{ - -public: - - FloatUpdateModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - Bool m_enabled; ///< enabled - -}; - -//------------------------------------------------------------------------------------------------- -class FloatUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FloatUpdate, "FloatUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( FloatUpdate, FloatUpdateModuleData ) - -public: - - FloatUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - void setEnabled( Bool enabled ) { m_enabled = enabled; } ///< enable/disable floating - - virtual UpdateSleepTime update() override; ///< Deciding whether or not to make new guys - -protected: - - - Bool m_enabled; ///< enabled - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/HealContain.h b/Generals/Code/GameEngine/Include/GameLogic/Module/HealContain.h deleted file mode 100644 index 4ff851e8d50..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/HealContain.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: HealContain.h //////////////////////////////////////////////////////////////////////////// -// Author: Colin Day -// Desc: Objects that are contained inside a heal contain ... get healed! oh my! -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/OpenContain.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class HealContainModuleData : public OpenContainModuleData -{ - -public: - - HealContainModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - UnsignedInt m_framesForFullHeal; ///< time (in frames) something becomes fully healed - -}; - -//------------------------------------------------------------------------------------------------- -/** The healing container ... bright white light ahhhhh goes here */ -//------------------------------------------------------------------------------------------------- -class HealContain : public OpenContain -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( HealContain, "HealContain" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( HealContain, HealContainModuleData ) - -public: - - HealContain( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual UpdateSleepTime update() override; ///< called once per frame - virtual Bool isHealContain() const override { return true; } ///< true when container only contains units while healing (not a transport!) - virtual Bool isTunnelContain() const override { return FALSE; } - -protected: - - Bool doHeal( Object *obj, UnsignedInt framesForFullHeal ); ///< do the heal on an object - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/HealCrateCollide.h b/Generals/Code/GameEngine/Include/GameLogic/Module/HealCrateCollide.h deleted file mode 100644 index 7980d83b7eb..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/HealCrateCollide.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: HealCrateCollide.h ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: A crate that heals everything owned by the collider -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/Module.h" -#include "GameLogic/Module/CrateCollide.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -//------------------------------------------------------------------------------------------------- -class HealCrateCollide : public CrateCollide -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( HealCrateCollide, "HealCrateCollide" ) - MAKE_STANDARD_MODULE_MACRO( HealCrateCollide ); - -public: - - HealCrateCollide( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - -protected: - - /// This is the game logic execution function that all real CrateCollides will implement - virtual Bool executeCrateBehavior( Object *other ) override; -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/HeightDieUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/HeightDieUpdate.h deleted file mode 100644 index f8ff7f5a548..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/HeightDieUpdate.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: HeightDieUpdate.h //////////////////////////////////////////////////////////////////////// -// Author: Objects that will die when the are a certain height above the terrain or objects -// Desc: Colin Day, April 2002 -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class HeightDieUpdateModuleData: public UpdateModuleData -{ - -public: - - HeightDieUpdateModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - Real m_targetHeightAboveTerrain; ///< die at this height above terrain - Bool m_targetHeightIncludesStructures; ///< target height considers terrain AND structure height underneath us - Bool m_onlyWhenMovingDown; ///< don't detonate unless moving in downward z dir - Real m_destroyAttachedParticlesAtHeight; ///< HACK, destroy any attached particle system of object when below this height - Bool m_snapToGroundOnDeath; ///< snap to the ground when killed - UnsignedInt m_initialDelay; ///< Don't explode before this time - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class HeightDieUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( HeightDieUpdate, "HeightDieUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( HeightDieUpdate, HeightDieUpdateModuleData ) - -public: - - HeightDieUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual UpdateSleepTime update() override; - -protected: - - - Bool m_hasDied; ///< TRUE once we have triggered death - Bool m_particlesDestroyed; ///< TRUE once we destroy attached systems (so we do it only once) - Coord3D m_lastPosition; ///< we record our last position for logic that needs to know our direction of travel - UnsignedInt m_earliestDeathFrame; ///< Earliest we are allowed to think about dying - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/HighlanderBody.h b/Generals/Code/GameEngine/Include/GameLogic/Module/HighlanderBody.h deleted file mode 100644 index e938afea293..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/HighlanderBody.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: HighlanderBody.h //////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, November 2002 -// Desc: Takes damage according to armor, but can't die from normal damage. Can die from Unresistable though -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/ActiveBody.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Object; - -//------------------------------------------------------------------------------------------------- -/** Structure body module */ -//------------------------------------------------------------------------------------------------- -class HighlanderBody : public ActiveBody -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( HighlanderBody, "HighlanderBody" ) - MAKE_STANDARD_MODULE_MACRO( HighlanderBody ) - -public: - - HighlanderBody( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void attemptDamage( DamageInfo *damageInfo ) override; ///< try to damage this object - -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/HijackerUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/HijackerUpdate.h deleted file mode 100644 index de0f3ccd841..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/HijackerUpdate.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FILE: HijackerUpdate.h ///////////////////////////////////////////////////////////////////////// -// Author: Mark Lorenzen, July 2002 -// Desc: Allows hijacker to keep with his hijacked vehicle (though hidden) until it dies, then -// to become a hijacker once more -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "GameLogic/Module/UpdateModule.h" - -//------------------------------------------------------------------------------------------------- -class HijackerUpdateModuleData : public UpdateModuleData -{ -public: - AsciiString m_attachToBone; - AsciiString m_parachuteName; - - //StickBombUpdateModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p) - { - UpdateModuleData::buildFieldParse(p); - static const FieldParse dataFieldParse[] = - { - { "AttachToTargetBone", INI::parseAsciiString, nullptr, offsetof( HijackerUpdateModuleData, m_attachToBone ) }, - { "ParachuteName", INI::parseAsciiString, nullptr, offsetof( HijackerUpdateModuleData, m_parachuteName ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } -}; - -//------------------------------------------------------------------------------------------------- -class HijackerUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( HijackerUpdate, "HijackerUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( HijackerUpdate, HijackerUpdateModuleData ) - -public: - - HijackerUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual UpdateSleepTime update() override; ///< called once per frame - - void setTargetObject( const Object *object ); - Object* getTargetObject() const; - void setUpdate(Bool u ) {m_update = u;} - void setIsInVehicle(Bool i ) {m_isInVehicle = i;} - -private: - - ObjectID m_targetID; - Coord3D m_ejectPos; - Bool m_update; - Bool m_isInVehicle; - Bool m_wasTargetAirborne; - -// DieModuleInterface *m_ejectPilotDMI; // point to ejectpilotdiemodule - // of target vehicle if it has one - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/ImmortalBody.h b/Generals/Code/GameEngine/Include/GameLogic/Module/ImmortalBody.h deleted file mode 100644 index 3c98e5cf5ae..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/ImmortalBody.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ImmortalBody.h //////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, April 2002 -// Desc: Just like Active Body, but won't let health drop below 1 -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/ActiveBody.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Object; - -//------------------------------------------------------------------------------------------------- -/** Structure body module */ -//------------------------------------------------------------------------------------------------- -class ImmortalBody : public ActiveBody -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( ImmortalBody, "ImmortalBody" ) - MAKE_STANDARD_MODULE_MACRO( ImmortalBody ) - -public: - - ImmortalBody( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void internalChangeHealth( Real delta ) override; ///< change health - -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/InstantDeathBehavior.h b/Generals/Code/GameEngine/Include/GameLogic/Module/InstantDeathBehavior.h deleted file mode 100644 index 6a32434efbf..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/InstantDeathBehavior.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: InstantDeathBehavior.h ///////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, Sep 2002 -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/DieModule.h" - -class FXList; -class ObjectCreationList; -class WeaponTemplate; -class DamageInfo; - -//------------------------------------------------------------------------------------------------- -typedef std::vector FXListVec; -typedef std::vector OCLVec; -typedef std::vector WeaponTemplateVec; - -//------------------------------------------------------------------------------------------------- -class InstantDeathBehaviorModuleData : public DieModuleData -{ -public: - FXListVec m_fx; - OCLVec m_ocls; - WeaponTemplateVec m_weapons; - - InstantDeathBehaviorModuleData(); - static void buildFieldParse(MultiIniFieldParse& p); - -private: - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class InstantDeathBehavior : public DieModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( InstantDeathBehavior, "InstantDeathBehavior" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( InstantDeathBehavior, InstantDeathBehaviorModuleData ) - -public: - - InstantDeathBehavior( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - // DieModuleInterface - virtual void onDie( const DamageInfo *damageInfo ) override; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/KeepObjectDie.h b/Generals/Code/GameEngine/Include/GameLogic/Module/KeepObjectDie.h deleted file mode 100644 index 521599c59f9..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/KeepObjectDie.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: KeepObjectDie.h ///////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, November 2002 -// Desc: Die module for things that want to leave rubble in the world and don't have other die -// modules. This fixes civilian buildings that don't have garrison contains. Garrison -// contains have a die module built in, so these buildings need something. Without it -// they default to the destroydie module which outright removes the object. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/DieModule.h" -#include "Common/INI.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -class KeepObjectDie : public DieModule -{ - - MAKE_STANDARD_MODULE_MACRO( KeepObjectDie ); - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( KeepObjectDie, "KeepObjectDie" ) - -public: - - KeepObjectDie( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onDie( const DamageInfo *damageInfo ) override; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/LifetimeUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/LifetimeUpdate.h deleted file mode 100644 index c8d56cf82c2..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/LifetimeUpdate.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: LifetimeUpdate.h ///////////////////////////////////////////////////////////////////////// -// Author: Colin Day, December 2001 -// Desc: Update that will count down a lifetime and destroy object when it reaches zero -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" - -//------------------------------------------------------------------------------------------------- -class LifetimeUpdateModuleData : public UpdateModuleData -{ -public: - UnsignedInt m_minFrames; - UnsignedInt m_maxFrames; - - LifetimeUpdateModuleData() - { - m_minFrames = 0.0f; - m_maxFrames = 0.0f; - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - UpdateModuleData::buildFieldParse(p); - static const FieldParse dataFieldParse[] = - { - { "MinLifetime", INI::parseDurationUnsignedInt, nullptr, offsetof( LifetimeUpdateModuleData, m_minFrames ) }, - { "MaxLifetime", INI::parseDurationUnsignedInt, nullptr, offsetof( LifetimeUpdateModuleData, m_maxFrames ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class LifetimeUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( LifetimeUpdate, "LifetimeUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( LifetimeUpdate, LifetimeUpdateModuleData ) - -public: - - LifetimeUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - void setLifetimeRange( UnsignedInt minFrames, UnsignedInt maxFrames ); - UnsignedInt getDieFrame() const { return m_dieFrame; } - - virtual UpdateSleepTime update() override; - -private: - - UnsignedInt calcSleepDelay(UnsignedInt minFrames, UnsignedInt maxFrames); - - UnsignedInt m_dieFrame; -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h deleted file mode 100644 index ebc2344d40c..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: LocomotorSetUpgrade.h ///////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, Aug 2002 -// Desc: -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpgradeModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -//------------------------------------------------------------------------------------------------- -/** The default die module */ -//------------------------------------------------------------------------------------------------- -class LocomotorSetUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( LocomotorSetUpgrade, "LocomotorSetUpgrade" ) - MAKE_STANDARD_MODULE_MACRO( LocomotorSetUpgrade ); - -public: - - LocomotorSetUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - -protected: - virtual void upgradeImplementation( ) override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h deleted file mode 100644 index 62c90801186..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: MaxHealthUpgrade.h ///////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, September 2002 -// Desc: UpgradeModule that increases an object's maximum health. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpgradeModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; -enum MaxHealthChangeType CPP_11(: Int); - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class MaxHealthUpgradeModuleData: public UpgradeModuleData -{ - -public: - - MaxHealthUpgradeModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - Real m_addMaxHealth; - MaxHealthChangeType m_maxHealthChangeType; - -}; - -//------------------------------------------------------------------------------------------------- -// ------------------------------------------------------------------------------------------------ -class MaxHealthUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( MaxHealthUpgrade, "MaxHealthUpgrade" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( MaxHealthUpgrade, MaxHealthUpgradeModuleData ); - -public: - - MaxHealthUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - -protected: - - virtual void upgradeImplementation() override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/MobMemberSlavedUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/MobMemberSlavedUpdate.h deleted file mode 100644 index 97681fbe5b9..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/MobMemberSlavedUpdate.h +++ /dev/null @@ -1,132 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// MobMemberSlavedUpdate.h ///////////////////////////////////////////////////////////// -// Will obey to spawner... or die trying... used by angry mob members -// Author: Mark Lorenzen, August 2002 - -#pragma once - -#define MM_SLAVED_UPDATE_RATE (LOGICFRAMES_PER_SECOND / 8) ///< This is a low priority module that only needs to be called every this many frames -#define MIN_SQUIRRELLINESS (0.01f) -#define MAX_SQUIRRELLINESS (1.0f) -#define CATCH_UP_RADIUS_MAX (50) -#define CATCH_UP_RADIUS_MIN (25) -#define DEFAULT_MUST_CATCH_UP_RADIUS (CATCH_UP_RADIUS_MAX) -#define DEFAULT_NO_NEED_TO_CATCH_UP_RADIUS (CATCH_UP_RADIUS_MIN) - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/INI.h" -#include "GameLogic/Module/UpdateModule.h" -class DamageInfo; -enum ModelConditionFlagType CPP_11(: Int); - -//------------------------------------------------------------------------------------------------- -class MobMemberSlavedUpdateModuleData : public UpdateModuleData -{ -public: - //Example: Currently used by scout drones owned by rangers AND stinger soldiers owned by stinger sites. - Int m_mustCatchUpRadius; //Distance from master I'm allowed when he's idle. If I go too far away, I'll come back. - Int m_noNeedToCatchUpRadius; //Allowable wander distance from master while guarding master. - Real m_squirrellinessRatio; - UnsignedInt m_catchUpCrisisBailTime; //after this many consecutive frames outside the catchup radius, I will teleport to the nexus - - MobMemberSlavedUpdateModuleData() - { - m_mustCatchUpRadius = DEFAULT_MUST_CATCH_UP_RADIUS; - m_noNeedToCatchUpRadius = DEFAULT_NO_NEED_TO_CATCH_UP_RADIUS; - m_squirrellinessRatio = 0; - m_catchUpCrisisBailTime = 999999;//default to very large number - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - UpdateModuleData::buildFieldParse(p); - static const FieldParse dataFieldParse[] = - { - { "MustCatchUpRadius", INI::parseInt, nullptr, offsetof( MobMemberSlavedUpdateModuleData, m_mustCatchUpRadius ) }, - { "CatchUpCrisisBailTime", INI::parseUnsignedInt, nullptr, offsetof( MobMemberSlavedUpdateModuleData, m_catchUpCrisisBailTime ) }, - { "NoNeedToCatchUpRadius", INI::parseInt, nullptr, offsetof( MobMemberSlavedUpdateModuleData, m_noNeedToCatchUpRadius ) }, - { "Squirrelliness", INI::parseReal, nullptr, offsetof( MobMemberSlavedUpdateModuleData, m_squirrellinessRatio ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } -}; - - -enum MobStates CPP_11(: Int) -{ - MOB_STATE_NONE, - MOB_STATE_IDLE, - MOB_STATE_CATCHUP_NOW, - MOB_STATE_CATCHING_UP, - MOB_STATE_ATTACK, -}; - -//------------------------------------------------------------------------------------------------- -class MobMemberSlavedUpdate : public UpdateModule, public SlavedUpdateInterface -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( MobMemberSlavedUpdate, "MobMemberSlavedUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( MobMemberSlavedUpdate, MobMemberSlavedUpdateModuleData ) - -public: - - MobMemberSlavedUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual SlavedUpdateInterface* getSlavedUpdateInterface() override { return this; }// hee hee... behaves just like slavedupdate - - virtual ObjectID getSlaverID() const override { return m_slaver; } - virtual void onEnslave( const Object *slaver ) override; - virtual void onSlaverDie( const DamageInfo *info ) override; - virtual void onSlaverDamage( const DamageInfo *info ) override; - virtual void onObjectCreated() override; - virtual Bool isSelfTasking() const override { return m_isSelfTasking; }; - - void doCatchUpLogic( Coord3D *pinnedPosition ); - - void setMobState( MobStates state ) { m_mobState = state; }; - MobStates getMobState() { return m_mobState; }; - - - virtual UpdateSleepTime update() override; ///< Deciding whether or not to make new guys - -private: - void startSlavedEffects( const Object *slaver ); ///< We have been marked as Slaved, so we can't be selected or move too far or other stuff - void stopSlavedEffects(); ///< We are no longer slaved. - - ObjectID m_slaver; ///< To whom we are enslaved - Int m_framesToWait; - MobStates m_mobState; - RGBColor m_personalColor; - ObjectID m_primaryVictimID; - Real m_squirrellinessRatio; - Bool m_isSelfTasking; - UnsignedInt m_catchUpCrisisTimer;// how many consecutive frames have I remained outside the catchup radius - //This is a failsafe to make sure that an individual mobmember does not get isolated from his buddies - // thus causing the mob to become invincible, since they will continue to bud around the nexus - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h deleted file mode 100644 index 6cb3902809a..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h +++ /dev/null @@ -1,111 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: NeutronMissileSlowDeathUpdate.h ////////////////////////////////////////////////////////// -// Author: Colin Day, April 2002 -// Desc: Update module for the neutron missile superweapon object -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/SlowDeathBehavior.h" - -class FXList; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -enum NeutronBlast CPP_11(: Int) -{ - NEUTRON_BLAST_1 = 0, - NEUTRON_BLAST_2, - NEUTRON_BLAST_3, - NEUTRON_BLAST_4, - NEUTRON_BLAST_5, - NEUTRON_BLAST_6, - NEUTRON_BLAST_7, - NEUTRON_BLAST_8, - NEUTRON_BLAST_9, - - MAX_NEUTRON_BLASTS -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -struct BlastInfo -{ - Bool enabled; ///< this blast is enabled - Real delay; ///< delay after death to start the regular blast - Real scorchDelay; ///< delay after death to start a scorch blast - Real innerRadius; ///< inner radius of damage - Real outerRadius; ///< outer radius of damage - Real maxDamage; ///< max amount - Real minDamage; ///< any object in the outerradius will always have at least this much damage done - Real toppleSpeed; ///< speed to topple things at - Real pushForceMag; ///< magnitude of the physics force to push objects -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class NeutronMissileSlowDeathBehaviorModuleData : public SlowDeathBehaviorModuleData -{ - -public: - - NeutronMissileSlowDeathBehaviorModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - BlastInfo m_blastInfo[ MAX_NEUTRON_BLASTS ]; ///< blast information - Real m_scorchSize; ///< size of scorch mark - const FXList *m_fxList; ///< the actual fx list that creates all the visuals. - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class NeutronMissileSlowDeathBehavior : public SlowDeathBehavior -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( NeutronMissileSlowDeathBehavior, "NeutronMissileSlowDeathBehavior" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( NeutronMissileSlowDeathBehavior, NeutronMissileSlowDeathBehaviorModuleData ) - -public: - - NeutronMissileSlowDeathBehavior( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual UpdateSleepTime update() override; ///< the update call - -protected: - - void doBlast( const BlastInfo *blastInfo ); ///< do blast - void doScorchBlast( const BlastInfo *blastInfo ); ///< do a scorch blast ring - - UnsignedInt m_activationFrame; ///< frame we were activated on - Bool m_completedBlasts[ MAX_NEUTRON_BLASTS ]; ///< blasts indexes we've already done - Bool m_completedScorchBlasts[ MAX_NEUTRON_BLASTS ]; ///< scorch blast indexes we've already done - Bool m_scorchPlaced; ///< TRUE once we've placed the scorch mark - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h deleted file mode 100644 index 62a8a3676e7..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectCreationUpgrade.h /////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, April 2002 -// Desc: upgrades that spawn OCLs -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpgradeModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; -class Player; -class ObjectCreationList; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class ObjectCreationUpgradeModuleData : public UpgradeModuleData -{ - -public: - - ObjectCreationUpgradeModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - const ObjectCreationList *m_ocl; ///< the object creation list to make - -}; - -//------------------------------------------------------------------------------------------------- -/** The OCL upgrade module */ -//------------------------------------------------------------------------------------------------- -class ObjectCreationUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( ObjectCreationUpgrade, "ObjectCreationUpgrade" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( ObjectCreationUpgrade, ObjectCreationUpgradeModuleData ); - -public: - - ObjectCreationUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - - virtual void onDelete() override; ///< we have some work to do when this module goes away - -protected: - - virtual void upgradeImplementation() override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectDefectionHelper.h b/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectDefectionHelper.h deleted file mode 100644 index ea282e7fdd8..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectDefectionHelper.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectDefectionHelper.h ////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, Colin Day - September 202 -// Desc: Object helper - defection -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/ObjectHelper.h" - -//------------------------------------------------------------------------------------------------- -#define DEFECTION_DETECTION_TIME_MAX (LOGICFRAMES_PER_SECOND * 10) - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class ObjectDefectionHelperModuleData : public ModuleData -{ - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class ObjectDefectionHelper : public ObjectHelper -{ - - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( ObjectDefectionHelper, ObjectDefectionHelperModuleData ) - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(ObjectDefectionHelper, "ObjectDefectionHelperPool" ) - -private: - - UnsignedInt m_defectionDetectionStart; ///< this is the timer, mentioned above (absolute frame, NOT counter) - UnsignedInt m_defectionDetectionEnd; ///< this is the timer, mentioned above (absolute frame, NOT counter) - Real m_defectionDetectionFlashPhase; ///< keeps track of the flashing rate logarithmic curve - Bool m_doDefectorFX; ///. -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectHelper.h /////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, Colin Day - September 202 -// Desc: Object helper -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class ObjectHelper : public UpdateModule -{ - - MEMORY_POOL_GLUE_ABC( ObjectHelper ) - -protected: - - // snapshot methods - virtual void crc( Xfer *xfer ) override; - virtual void xfer( Xfer *xfer ) override; - virtual void loadPostProcess() override; - -public: - - ObjectHelper( Thing *thing, const ModuleData *modData ) : - UpdateModule( thing, modData ) - { - setWakeFrame(getObject(), UPDATE_SLEEP_FOREVER); - } - - // custom to this class. - void sleepUntil(UnsignedInt when); - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectRepulsorHelper.h b/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectRepulsorHelper.h deleted file mode 100644 index 9e4b227a26d..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectRepulsorHelper.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectRepulsorHelper.h //////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, December 202 -// Desc: Object helper - Repulsor -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/ObjectHelper.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class ObjectRepulsorHelperModuleData : public ModuleData -{ - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class ObjectRepulsorHelper : public ObjectHelper -{ - - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( ObjectRepulsorHelper, ObjectRepulsorHelperModuleData ) - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(ObjectRepulsorHelper, "ObjectRepulsorHelper" ) - -public: - - ObjectRepulsorHelper( Thing *thing, const ModuleData *modData ) : ObjectHelper( thing, modData ) { } - // virtual destructor prototype provided by memory pool object - - virtual UpdateSleepTime update() override; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectSMCHelper.h b/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectSMCHelper.h deleted file mode 100644 index 82f22db8462..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectSMCHelper.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectSMCHelper.h //////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, Colin Day - September 202 -// Desc: Object helper - SMC -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/ObjectHelper.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class ObjectSMCHelperModuleData : public ModuleData -{ - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class ObjectSMCHelper : public ObjectHelper -{ - - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( ObjectSMCHelper, ObjectSMCHelperModuleData ) - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(ObjectSMCHelper, "ObjectSMCHelperPool" ) - -public: - - ObjectSMCHelper( Thing *thing, const ModuleData *modData ) : ObjectHelper( thing, modData ) { } - // virtual destructor prototype provided by memory pool object - - virtual UpdateSleepTime update() override; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectWeaponStatusHelper.h b/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectWeaponStatusHelper.h deleted file mode 100644 index 5de48081afd..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/ObjectWeaponStatusHelper.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectWeaponStatusHelper.h /////////////////////////////////////////////////////////////// -// Author: Steven Johnson, Colin Day - September 202 -// Desc: Object helper - WeaponStatus -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/ThingTemplate.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/ObjectHelper.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class ObjectWeaponStatusHelperModuleData : public ModuleData -{ - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class ObjectWeaponStatusHelper : public ObjectHelper -{ - - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( ObjectWeaponStatusHelper, ObjectWeaponStatusHelperModuleData ) - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(ObjectWeaponStatusHelper, "ObjectWeaponStatusHelperPool" ) - -protected: - - /* - The ObjectWeaponStatusHelper needs to have its update run after all "normal" - user update modules, so it redefines this. Please don't redefine this - for other modules without very careful deliberation. (srj) - */ - virtual SleepyUpdatePhase getUpdatePhase() const override - { - return PHASE_FINAL; - } -public: - - ObjectWeaponStatusHelper( Thing *thing, const ModuleData *modData ) : - ObjectHelper( thing, modData ) - { - // unlike other helpers, this one needs to start active. - DEBUG_ASSERTCRASH(getObject()->getTemplate()->canPossiblyHaveAnyWeapon(), ("should not be instantiated if we have no weapon")); - setWakeFrame(getObject(), UPDATE_SLEEP_NONE); - } - // virtual destructor prototype provided by memory pool object - - virtual UpdateSleepTime update() override - { - getObject()->adjustModelConditionForWeaponStatus(); - // unlike other helpers, this one must run every frame. - return UPDATE_SLEEP_NONE; - } -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/OverchargeBehavior.h b/Generals/Code/GameEngine/Include/GameLogic/Module/OverchargeBehavior.h deleted file mode 100644 index 7ad033812b4..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/OverchargeBehavior.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: OverchargeBehavior.h ///////////////////////////////////////////////////////////////////// -// Author: Colin Day, June 2002 -// Desc: Objects with this behavior module will get the ability to produce more power -// for a short amount of time, during this "overcharge" state object health is -// slowly reduced -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/BehaviorModule.h" -#include "GameLogic/Module/DamageModule.h" -#include "GameLogic/Module/UpdateModule.h" - -//------------------------------------------------------------------------------------------------- -// ------------------------------------------------------------------------------------------------ -class OverchargeBehaviorModuleData : public UpdateModuleData -{ - -public: - - OverchargeBehaviorModuleData(); - - static void buildFieldParse( MultiIniFieldParse &p ); - - Real m_healthPercentToDrainPerSecond; ///< when active, this much health is drained - Real m_notAllowedWhenHealthBelowPercent; ///< you cannot overcharge when object is below this health % - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class OverchargeBehaviorInterface -{ - -public: - - virtual void toggle() = 0; - virtual void enable( Bool enable ) = 0; - virtual Bool isOverchargeActive() = 0; - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class OverchargeBehavior : public UpdateModule, - public DamageModuleInterface, - public OverchargeBehaviorInterface -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( OverchargeBehavior, "OverchargeBehavior" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( OverchargeBehavior, OverchargeBehaviorModuleData ) - -public: - - OverchargeBehavior( Thing *thing, const ModuleData *moduleData ); - // virtual destructor prototype provided by memory pool declaration - - // interface housekeeping - virtual OverchargeBehaviorInterface* getOverchargeBehaviorInterface() override { return this; } - static Int getInterfaceMask() { return UpdateModule::getInterfaceMask() | (MODULEINTERFACE_DAMAGE); } - - // BehaviorModule - virtual DamageModuleInterface* getDamage() override { return this; } - - // UpdateModuleInterface - virtual UpdateSleepTime update() override; - - // DamageModuleInterface - virtual void onDamage( DamageInfo *damageInfo ) override; - virtual void onHealing( DamageInfo *damageInfo ) override { } - virtual void onBodyDamageStateChange( const DamageInfo *damageInfo, - BodyDamageType oldState, - BodyDamageType newState ) override { } - - - // specific methods - virtual void toggle() override; ///< toggle overcharge on/off - virtual void enable( Bool enable ) override; ///< turn overcharge on/off - virtual Bool isOverchargeActive() override { return m_overchargeActive; } - - virtual void onDelete() override; ///< we have some work to do when this module goes away - virtual void onCapture( Player *oldOwner, Player *newOwner ) override; ///< object containing upgrade has changed teams - -protected: - - Bool m_overchargeActive; ///< Overcharge is currently on/off for this object - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/POWTruckAIUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/POWTruckAIUpdate.h deleted file mode 100644 index d9aeb3400dd..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/POWTruckAIUpdate.h +++ /dev/null @@ -1,145 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: POWTruckAIUpdate.h /////////////////////////////////////////////////////////////////////// -// Author: Colin Day -// Desc: AI for the POW Truck -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/AIUpdate.h" - -#ifdef ALLOW_SURRENDER - -// ------------------------------------------------------------------------------------------------ -/** NOTE: If you edit module data you must do it in both the Dozer *AND* the Worker */ -// ------------------------------------------------------------------------------------------------ -class POWTruckAIUpdateModuleData : public AIUpdateModuleData -{ - -public: - - POWTruckAIUpdateModuleData(); - - static void buildFieldParse( MultiIniFieldParse &p ); - - UnsignedInt m_boredTimeInFrames; ///< after this long we seek out targets in AUTOMATIC mode - Real m_hangAroundPrisonDistance; ///< this close is considered "at the prison" for purposes of waiting - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -enum POWTruckTask CPP_11(: Int) // Stored in save file, do not renumber. jba. -{ - POW_TRUCK_TASK_WAITING = 0, ///< Waiting for something to do - POW_TRUCK_TASK_FIND_TARGET = 1, ///< We need to search out a target to collect - POW_TRUCK_TASK_COLLECTING_TARGET = 2, ///< collecting a targeted POW - POW_TRUCK_TASK_RETURNING_PRISONERS= 3 ///< return all POWs to base -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class POWTruckAIUpdateInterface -{ - -public: - - virtual void setTask( POWTruckTask task, Object *taskObject = nullptr ) = 0; - virtual POWTruckTask getCurrentTask() = 0; - virtual void loadPrisoner( Object *prisoner ) = 0; - virtual void unloadPrisonersToPrison( Object *prison ) = 0; - -}; - -//------------------------------------------------------------------------------------------------- -/** The Dozer AI Update interface. Dozers are workers that are capable of building all the - * structures available to a player, as well as repairing building, and fortifying - * civilian structures */ -//------------------------------------------------------------------------------------------------- -class POWTruckAIUpdate : public AIUpdateInterface, - public POWTruckAIUpdateInterface -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( POWTruckAIUpdate, "POWTruckAIUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( POWTruckAIUpdate, POWTruckAIUpdateModuleData ) - -public: - - POWTruckAIUpdate( Thing *thing, const ModuleData *moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onDelete(); - virtual UpdateSleepTime update(); - - // Pow truck ai interface - virtual POWTruckAIUpdateInterface *getPOWTruckAIUpdateInterface() { return this; } - virtual POWTruckTask getCurrentTask() { return m_currentTask; } - virtual void loadPrisoner( Object *prisoner ); - virtual void unloadPrisonersToPrison( Object *prison ); - - // - // the following methods must be overridden so that if a player issues a command the dozer - // can exit the internal state machine and do whatever the player says - // - virtual void aiDoCommand( const AICommandParms *parms ); - -protected: - - virtual void setTask( POWTruckTask task, Object *taskObject = nullptr ); ///< set our current task - - enum POWTruckAIMode // Stored in save file, do not renumber. jba. - { - AUTOMATIC = 0, - MANUAL = 1 - }; - virtual void setAIMode( POWTruckAIMode mode ); ///< put truck in automatic or manual mode - - virtual void updateWaiting(); - virtual void updateFindTarget(); - virtual void updateCollectingTarget(); - virtual void updateReturnPrisoners(); - - virtual Bool validateTarget( const Object *target ); ///< is 'target' a valid object to collect - virtual void doReturnPrisoners(); ///< initiate a return prisoners to base - virtual void doReturnToPrison( Object *prison ); ///< initiate a return to prison (no prisoner dump off) - virtual Object *findBestPrison(); ///< find the best prison for us given our current position - virtual Object *findBestTarget(); ///< find the best prisoner for us given our current situation - - // AIUpdateInterface implementations - virtual void privatePickUpPrisoner( Object *prisoner, CommandSourceType cmdSource ); - virtual void privateReturnPrisoners( Object *prison, CommandSourceType cmdSource ); - - POWTruckAIMode m_aiMode; ///< Type of AI, automatic or explicitly controlled be player - POWTruckTask m_currentTask; ///< our current task - ObjectID m_targetID; ///< Object ID of the target we're going to collect - ObjectID m_prisonID; ///< Prison we're going back to - UnsignedInt m_enteredWaitingFrame; ///< frame we entered the waiting task - UnsignedInt m_lastFindFrame; ///< so that we don't search for targets too much - -}; - -#endif diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/POWTruckBehavior.h b/Generals/Code/GameEngine/Include/GameLogic/Module/POWTruckBehavior.h deleted file mode 100644 index d6d97311761..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/POWTruckBehavior.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: POWTruckBehavior.h /////////////////////////////////////////////////////////////////////// -// Author: Colin Day -// Desc: POW Truck Behavior -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/OpenContain.h" - -#ifdef ALLOW_SURRENDER - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class POWTruckBehaviorModuleData : public OpenContainModuleData -{ - -public: - - POWTruckBehaviorModuleData(); - - static void buildFieldParse( MultiIniFieldParse &p ); - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class POWTruckBehavior : public OpenContain -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( POWTruckBehavior, "POWTruckBehavior" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( POWTruckBehavior, POWTruckBehaviorModuleData ) - -public: - - POWTruckBehavior( Thing *thing, const ModuleData *moduleData ); - // virtual destructor prototype provided by memory pool declaration - - // collide methods - virtual void onCollide( Object *other, const Coord3D *loc, const Coord3D *normal ); - -protected: - -}; - -#endif diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/PilotFindVehicleUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/PilotFindVehicleUpdate.h deleted file mode 100644 index a5dd8a629df..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/PilotFindVehicleUpdate.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PilotFindVehicleUpdate.cpp ////////////////////////////////////////////////////////////////////////// -// Author: John Ahlquist, Sept. 2002 -// Desc: Update module to handle wounded idle infantry finding a heal unit or structure. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/KindOf.h" -#include "GameLogic/Module/UpdateModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class ThingTemplate; -class WeaponTemplate; - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class PilotFindVehicleUpdateModuleData : public ModuleData -{ -public: - UnsignedInt m_scanFrames; - Real m_scanRange; - Real m_minHealth; - - PilotFindVehicleUpdateModuleData(); - static void buildFieldParse(MultiIniFieldParse& p); - -private: - -}; - -//------------------------------------------------------------------------------------------------- -/** The default update module */ -//------------------------------------------------------------------------------------------------- -class PilotFindVehicleUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PilotFindVehicleUpdate, "PilotFindVehicleUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( PilotFindVehicleUpdate, PilotFindVehicleUpdateModuleData ); - -public: - - PilotFindVehicleUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onObjectCreated() override; - virtual UpdateSleepTime update() override; - - Object* scanClosestTarget(); - -protected: - Bool m_didMoveToBase; -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h deleted file mode 100644 index f3388aec980..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PowerPlantUpdate.h //////////////////////////////////////////////////////////////////////////// -// Author: Amit Kumar, August 2002 -// Desc: Updating the power plant -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class PowerPlantUpdateModuleData : public UpdateModuleData -{ - -public: - - PowerPlantUpdateModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p) - { - UpdateModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - - { "RodsExtendTime", INI::parseDurationUnsignedInt, nullptr, offsetof( PowerPlantUpdateModuleData, m_rodsExtendTime ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - - } - - UnsignedInt m_rodsExtendTime; ///< in frames, time it takes the rods to be built - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class PowerPlantUpdateInterface -{ - -public: - - virtual void extendRods( Bool extend ) = 0; - -}; - -//------------------------------------------------------------------------------------------------- -/** The Power Plant Update module */ -//------------------------------------------------------------------------------------------------- -class PowerPlantUpdate : public UpdateModule, - public PowerPlantUpdateInterface -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PowerPlantUpdate, "PowerPlantUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( PowerPlantUpdate, PowerPlantUpdateModuleData ); - -public: - - PowerPlantUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - - // interface housekeeping - virtual PowerPlantUpdateInterface* getPowerPlantUpdateInterface() override { return this; } - - virtual void extendRods( Bool extend ) override; ///< extend the rods from this object - virtual UpdateSleepTime update() override; ///< Here's the actual work of Upgrading - -protected: - - Bool m_extended; ///< TRUE when extend is all done - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h deleted file mode 100644 index 9ac1324f20e..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PowerPlantUpgrade.h /////////////////////////////////////////////////////////////////////////// -// Author: Amit Kumar, August 2002 -// Desc: Upgrading a power plant -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpgradeModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; -class Player; - -//------------------------------------------------------------------------------------------------- -/** The Power Plant upgrade module */ -//------------------------------------------------------------------------------------------------- -class PowerPlantUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PowerPlantUpgrade, "PowerPlantUpgrade" ) - MAKE_STANDARD_MODULE_MACRO( PowerPlantUpgrade ); - -public: - - PowerPlantUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - - virtual void onDelete() override; ///< we have some work to do when this module goes away - virtual void onCapture( Player *oldOwner, Player *newOwner ) override; ///< object containing upgrade has changed teams - -protected: - - virtual void upgradeImplementation() override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/PreorderCreate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/PreorderCreate.h deleted file mode 100644 index 90ea6405535..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/PreorderCreate.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - - -// FILE: PreorderCreate.h ///////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, December 2002 -// Desc: When a building is created, set the preorder status if necessary -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/CreateModule.h" - -class Thing; - -//------------------------------------------------------------------------------------------------- -/** PreorderCreate */ -//------------------------------------------------------------------------------------------------- -class PreorderCreate : public CreateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PreorderCreate, "PreorderCreate" ) - MAKE_STANDARD_MODULE_MACRO( PreorderCreate ) - -public: - - PreorderCreate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onCreate() override; - virtual void onBuildComplete() override; - -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/PrisonDockUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/PrisonDockUpdate.h deleted file mode 100644 index 49dfd0cc325..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/PrisonDockUpdate.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PrisonDockUpdate.h /////////////////////////////////////////////////////////////////////// -// Author: Colin Day, August 2002 -// Desc: Dock update for prison structures -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/GameMemory.h" -#include "GameLogic/Module/DockUpdate.h" - -#ifdef ALLOW_SURRENDER - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class PrisonDockUpdate : public DockUpdate -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PrisonDockUpdate, "PrisonDockUpdate" ) - MAKE_STANDARD_MODULE_MACRO( PrisonDockUpdate ) - -public: - - PrisonDockUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by MemoryPoolObject base class - virtual DockUpdateInterface* getDockUpdateInterface() { return this; } - - virtual Bool action( Object *docker, Object *drone = nullptr ); ///< for me this means do some Prison - -protected: - -}; - -#endif diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/ProneUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/ProneUpdate.h deleted file mode 100644 index 33acdb44d5d..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/ProneUpdate.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ProneUpdate.h ////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: Update module to encapsulate what it means to be "prone" -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; -class DamageInfo; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class ProneUpdateModuleData : public ModuleData -{ -public: - Real m_damageToFramesRatio; ///< Conversion from damage dealt to number of frames we cower - - ProneUpdateModuleData(); - static void buildFieldParse(MultiIniFieldParse& p); - -private: - -}; - -//------------------------------------------------------------------------------------------------- -/** The default update module */ -//------------------------------------------------------------------------------------------------- -class ProneUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( ProneUpdate, "ProneUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( ProneUpdate, ProneUpdateModuleData ); - -public: - - ProneUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - void goProne( const DamageInfo *damageInfo ); - - virtual UpdateSleepTime update() override; - -protected: - - void startProneEffects(); - void stopProneEffects(); - - Int m_proneFrames; -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h b/Generals/Code/GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h deleted file mode 100644 index 702c14367b6..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PropagandaCenterBehavior.h /////////////////////////////////////////////////////////////// -// Author: Colin Day, August 2002 -// Desc: Propaganda Center Behavior -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/PrisonBehavior.h" - -#ifdef ALLOW_SURRENDER - -// ------------------------------------------------------------------------------------------------ -typedef std::list< ObjectID > BrainwashedIDList; -typedef BrainwashedIDList::const_iterator BrainwashedIDListContIterator; -typedef BrainwashedIDList::iterator BrainwashedIDListIterator; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class PropagandaCenterBehaviorModuleData : public PrisonBehaviorModuleData -{ - -public: - - PropagandaCenterBehaviorModuleData(); - - static void buildFieldParse( MultiIniFieldParse &p ); - - UnsignedInt m_brainwashDuration; ///< how long (in frames) it takes to become brainwashed - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class PropagandaCenterBehavior : public PrisonBehavior -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PropagandaCenterBehavior, "PropagandaCenterBehavior" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( PropagandaCenterBehavior, PropagandaCenterBehaviorModuleData ) - -public: - - PropagandaCenterBehavior( Thing *thing, const ModuleData *moduleData ); - // virtual destructor prototype provided by memory pool object - - // generic module methods - virtual void onDelete(); - - // contain methods - virtual UpdateSleepTime update(); - virtual void onRemoving( Object *obj ); - -protected: - - ObjectID m_brainwashingSubjectID; ///< who we're currently brainwashing - UnsignedInt m_brainwashingSubjectStartFrame; ///< frame we started brainwashing - BrainwashedIDList m_brainwashedList; ///< list of objects we've brainwashed - -}; - -#endif diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h deleted file mode 100644 index 639669d4ff9..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: QueueProductionExitUpdate.h ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, January, 2002 -// Desc: Hand off produced Units to me so I can Exit them into the world with my specific style -// This instance refuses to spit a second out until the first is clear -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "GameLogic/Module/UpdateModule.h" -#include "Common/INI.h" -#include "Lib/BaseType.h" - -class Object; - -//------------------------------------------------------------------------------------------------- -class QueueProductionExitUpdateModuleData : public UpdateModuleData -{ -public: - Coord3D m_unitCreatePoint; - Coord3D m_naturalRallyPoint; - UnsignedInt m_exitDelayData; - Bool m_allowAirborneCreationData; - UnsignedInt m_initialBurst; - - QueueProductionExitUpdateModuleData() - { - m_unitCreatePoint.zero(); - m_naturalRallyPoint.zero(); - m_exitDelayData = 0; - m_allowAirborneCreationData = FALSE; - m_initialBurst = 0; - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - UpdateModuleData::buildFieldParse(p); - static const FieldParse dataFieldParse[] = - { - { "UnitCreatePoint", INI::parseCoord3D, nullptr, offsetof( QueueProductionExitUpdateModuleData, m_unitCreatePoint ) }, - { "NaturalRallyPoint", INI::parseCoord3D, nullptr, offsetof( QueueProductionExitUpdateModuleData, m_naturalRallyPoint ) }, - { "ExitDelay", INI::parseDurationUnsignedInt, nullptr, offsetof( QueueProductionExitUpdateModuleData, m_exitDelayData ) }, - { "AllowAirborneCreation", INI::parseBool, nullptr, offsetof( QueueProductionExitUpdateModuleData, m_allowAirborneCreationData ) }, - { "InitialBurst", INI::parseUnsignedInt, nullptr, offsetof( QueueProductionExitUpdateModuleData, m_initialBurst ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } -}; - -//------------------------------------------------------------------------------------------------- -class QueueProductionExitUpdate : public UpdateModule, public ExitInterface -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( QueueProductionExitUpdate, "QueueProductionExitUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( QueueProductionExitUpdate, QueueProductionExitUpdateModuleData ) - -public: - - virtual ExitInterface* getUpdateExitInterface() override { return this; } - - QueueProductionExitUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - // Required funcs to fulfill interface requirements - virtual Bool isExitBusy() const override {return FALSE;} ///< Contain style exiters are getting the ability to space out exits, so ask this before reserveDoor as a kind of no-commitment check. - virtual ExitDoorType reserveDoorForExit( const ThingTemplate* objType, Object *specificObject ) override; - virtual void exitObjectViaDoor( Object *newObj, ExitDoorType exitDoor ) override; - virtual void exitObjectByBudding( Object *newObj, Object *budHost ) override; - virtual void unreserveDoorForExit( ExitDoorType exitDoor ) override; - - virtual void setRallyPoint( const Coord3D *pos ) override; ///< define a "rally point" for units to move towards - virtual const Coord3D *getRallyPoint() const override; ///< define a "rally point" for units to move towards - virtual Bool getExitPosition( Coord3D& exitPosition ) const override; ///< access to the "Door" position of the production object - virtual Bool getNaturalRallyPoint( Coord3D& rallyPoint, Bool offset = TRUE ) const override; ///< get the natural "rally point" for units to move towards - - virtual UpdateSleepTime update() override; - -protected: - - UnsignedInt m_currentDelay; ///< When this hits zero, I can exit again - Coord3D m_rallyPoint; ///< Where units should move to after they have reached the "natural" rally point - Bool m_rallyPointExists; ///< Only move to the rally point if this is true - Real m_creationClearDistance; ///< I can think of myself as ready when the previous guy is this far away. - UnsignedInt m_currentBurstCount; ///< how many times must I still override the delay timer - - Bool isFreeToExit() const; -}; - -inline void QueueProductionExitUpdate::setRallyPoint( const Coord3D *pos ) -{ - m_rallyPoint = *pos; - m_rallyPointExists = true; -} - -inline const Coord3D *QueueProductionExitUpdate::getRallyPoint() const -{ - if (m_rallyPointExists) - return &m_rallyPoint; - - return nullptr; -} diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/RadarUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/RadarUpdate.h deleted file mode 100644 index 6d95c7c144b..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/RadarUpdate.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RadarUpdate.h //////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, April 2002 -// Desc: Updating a radar on an object -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class RadarUpdateModuleData : public UpdateModuleData -{ - -public: - - RadarUpdateModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p) - { - UpdateModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - - { "RadarExtendTime", INI::parseDurationReal, nullptr, offsetof( RadarUpdateModuleData, m_radarExtendTime ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - - } - - Real m_radarExtendTime; ///< in frames, time it takes the radar tower to build - -}; - -//------------------------------------------------------------------------------------------------- -/** The Radar Update module */ -//------------------------------------------------------------------------------------------------- -class RadarUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RadarUpdate, "RadarUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( RadarUpdate, RadarUpdateModuleData ); - -public: - - RadarUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - - void extendRadar(); ///< extend the radar from this object - Bool isRadarActive() { return m_radarActive; } - - virtual UpdateSleepTime update() override; ///< Here's the actual work of Upgrading - -protected: - - UnsignedInt m_extendDoneFrame; ///< radar will be done extending on this frame - Bool m_extendComplete; ///< TRUE when extend is all done - Bool m_radarActive; ///< TRUE when radar is actually online and generating radar information. - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/RadarUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/RadarUpgrade.h deleted file mode 100644 index b8bd0748248..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/RadarUpgrade.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RadarUpgrade.h /////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, March 2002 -// Desc: Adding a radar upgrade to an object -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpgradeModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; -class Player; - -//----------------------------------------------------------------------------- -class RadarUpgradeModuleData : public UpgradeModuleData -{ -public: - Bool m_isDisableProof;// Super radar, ignores radarDisabled checks - - RadarUpgradeModuleData() - { - m_isDisableProof = FALSE; - } - - static void buildFieldParse(MultiIniFieldParse& p); -}; - -//------------------------------------------------------------------------------------------------- -/** The Radar upgrade module */ -//------------------------------------------------------------------------------------------------- -class RadarUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RadarUpgrade, "RadarUpgrade" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( RadarUpgrade, RadarUpgradeModuleData ); - -public: - - RadarUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - - virtual void onDelete() override; ///< we have some work to do when this module goes away - virtual void onCapture( Player *oldOwner, Player *newOwner ) override; ///< object containing upgrade has changed teams - Bool getIsDisableProof() const { return getRadarUpgradeModuleData()->m_isDisableProof; } - -protected: - - virtual void upgradeImplementation() override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/RadiusDecalUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/RadiusDecalUpdate.h deleted file mode 100644 index 2fd30bf2f4f..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/RadiusDecalUpdate.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RadiusDecalUpdate.h ///////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" -#include "GameClient/RadiusDecal.h" - -//------------------------------------------------------------------------------------------------- -class RadiusDecalUpdateModuleData : public UpdateModuleData -{ -public: - //RadiusDecalTemplate m_deliveryDecalTemplate; - //Real m_deliveryDecalRadius; - - RadiusDecalUpdateModuleData() - { - //m_deliveryDecalRadius = 0.0f; - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - UpdateModuleData::buildFieldParse(p); - static const FieldParse dataFieldParse[] = - { - //{ "DeliveryDecal", RadiusDecalTemplate::parseRadiusDecalTemplate, nullptr, offsetof( RadiusDecalUpdateModuleData, m_deliveryDecalTemplate ) }, - //{ "DeliveryDecalRadius", INI::parseReal, nullptr, offsetof( RadiusDecalUpdateModuleData, m_deliveryDecalRadius ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class RadiusDecalUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RadiusDecalUpdate, "RadiusDecalUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( RadiusDecalUpdate, RadiusDecalUpdateModuleData ) - -public: - - RadiusDecalUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - //void createRadiusDecal( const Coord3D& pos ); - void createRadiusDecal( const RadiusDecalTemplate& tmpl, Real radius, const Coord3D& pos ); - void killWhenNoLongerAttacking(Bool v) { m_killWhenNoLongerAttacking = v; } - void killRadiusDecal(); - - virtual UpdateSleepTime update() override; - -private: - - RadiusDecal m_deliveryDecal; - Bool m_killWhenNoLongerAttacking; -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/RailedTransportAIUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/RailedTransportAIUpdate.h deleted file mode 100644 index c9c2dd7e676..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/RailedTransportAIUpdate.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RailedTransportAIUpdate.h //////////////////////////////////////////////////////////////// -// Author: Colin Day, August 2002 -// Desc: Railed transport AI -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/AIUpdate.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Waypoint; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class RailedTransportAIUpdateModuleData : public AIUpdateModuleData -{ - -public: - - RailedTransportAIUpdateModuleData(); - - static void buildFieldParse( MultiIniFieldParse &p ); - - AsciiString m_pathPrefixName; ///< prefix to use for waypont start and end points we'll look for - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class RailedTransportAIUpdate : public AIUpdateInterface -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RailedTransportAIUpdate, "RailedTransportAIUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( RailedTransportAIUpdate, RailedTransportAIUpdateModuleData ) - -public: - - RailedTransportAIUpdate( Thing *thing, const ModuleData *moduleData ); - // virtual destructor prototype provided by memory pool declaration - - // AIUpdate interface methods - virtual void aiDoCommand( const AICommandParms *parms ) override; - virtual UpdateSleepTime update() override; - -protected: - - // ai module methods - virtual void privateExecuteRailedTransport( CommandSourceType cmdSource ) override; - virtual void privateEvacuate( Int exposeStealthUnits, CommandSourceType cmdSource ) override; - - // our methods - void setInTransit( Bool inTransit ); - void loadWaypointData(); - void pickAndMoveToInitialLocation(); - - // our data - Bool m_inTransit; ///< in transit - struct WaypointPathInfo - { - UnsignedInt startWaypointID; - UnsignedInt endWaypointID; - }; - enum { MAX_WAYPOINT_PATHS = 32 }; - WaypointPathInfo m_path[ MAX_WAYPOINT_PATHS ]; ///< transit paths we can use - Int m_numPaths; ///< how many waypoint paths are in m_path - Int m_currentPath; ///< index into m_path for our current path - - Bool m_waypointDataLoaded; ///< TRUE once we've searched the map to load m_path - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/RailedTransportContain.h b/Generals/Code/GameEngine/Include/GameLogic/Module/RailedTransportContain.h deleted file mode 100644 index 24450d5237a..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/RailedTransportContain.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RailedTransportContain.h ///////////////////////////////////////////////////////////////// -// Author: Colin Day, August 2002 -// Desc: Railed transport contain module -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/TransportContain.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class RailedTransportContain : public TransportContain -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RailedTransportContain, "RailedTransportContain" ) - MAKE_STANDARD_MODULE_MACRO( RailedTransportContain ) - -public: - - RailedTransportContain( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onRemoving( Object *obj ) override; ///< object no longer contains 'obj' - virtual void exitObjectViaDoor( Object *newObj, ExitDoorType exitDoor ) override; - virtual void exitObjectByBudding( Object *newObj, Object *budHost ) override { return; }; - -protected: - - virtual Bool isSpecificRiderFreeToExit( Object *obj ) override; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/RepairDockUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/RepairDockUpdate.h deleted file mode 100644 index 63bb9357761..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/RepairDockUpdate.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RepairDockUpdate.h /////////////////////////////////////////////////////////////////////// -// Author: Colin Day, June 2002 -// Desc: The action of docking with a structure for repairs -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/GameMemory.h" -#include "GameLogic/Module/SupplyCenterDockUpdate.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class RepairDockUpdateModuleData : public DockUpdateModuleData -{ - -public: - - RepairDockUpdateModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - Real m_framesForFullHeal; ///< time (in frames) something becomes fully repaired - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class RepairDockUpdate : public DockUpdate -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RepairDockUpdate, "RepairDockUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( RepairDockUpdate, RepairDockUpdateModuleData ) - -public: - - RepairDockUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by MemoryPoolObject base class - - virtual DockUpdateInterface* getDockUpdateInterface() override { return this; } - - virtual Bool action( Object *docker, Object *drone = nullptr ) override; ///< for me this means do some repair - - virtual Bool isRallyPointAfterDockType() override {return TRUE;} ///< A minority of docks want to give you a final command to their rally point - -protected: - - ObjectID m_lastRepair; ///< object we were repairing last - Real m_healthToAddPerFrame; ///< health to add per frame to current docked object - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/ShroudCrateCollide.h b/Generals/Code/GameEngine/Include/GameLogic/Module/ShroudCrateCollide.h deleted file mode 100644 index 1e2e7c49577..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/ShroudCrateCollide.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ShroudCrateCollide.h ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: A crate that clears the shroud for the pickerupper -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/Module.h" -#include "GameLogic/Module/CrateCollide.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -//------------------------------------------------------------------------------------------------- -class ShroudCrateCollide : public CrateCollide -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( ShroudCrateCollide, "ShroudCrateCollide" ) - MAKE_STANDARD_MODULE_MACRO( ShroudCrateCollide ); - -public: - - ShroudCrateCollide( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - -protected: - - /// This is the game logic execution function that all real CrateCollides will implement - virtual Bool executeCrateBehavior( Object *other ) override; -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SpawnPointProductionExitUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SpawnPointProductionExitUpdate.h deleted file mode 100644 index 98bfa0eb31e..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SpawnPointProductionExitUpdate.h +++ /dev/null @@ -1,99 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SpawnPointProductionExitUpdate.h ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, April, 2002 -// Desc: Hand off produced Units to me so I can Exit them into the world with my specific style -// This instance puts guys at named bones. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "GameLogic/Module/UpdateModule.h" -#include "Common/INI.h" -#include "Lib/BaseType.h" - -class Object; - -enum -{ - MAX_SPAWN_POINTS = 10 ///< Size the array that holds the bone positions -}; - -//------------------------------------------------------------------------------------------------- -class SpawnPointProductionExitUpdateModuleData : public UpdateModuleData -{ -public: - AsciiString m_spawnPointBoneNameData; - - static void buildFieldParse(MultiIniFieldParse& p) - { - UpdateModuleData::buildFieldParse(p); - static const FieldParse dataFieldParse[] = - { - { "SpawnPointBoneName", INI::parseAsciiString, nullptr, offsetof( SpawnPointProductionExitUpdateModuleData, m_spawnPointBoneNameData ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } -}; - -//------------------------------------------------------------------------------------------------- -class SpawnPointProductionExitUpdate : public UpdateModule, public ExitInterface -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SpawnPointProductionExitUpdate, "SpawnPointProductionExitUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SpawnPointProductionExitUpdate, SpawnPointProductionExitUpdateModuleData ) - -public: - - virtual ExitInterface* getUpdateExitInterface() override { return this; } - - SpawnPointProductionExitUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - // Required funcs to fulfill interface requirements - virtual Bool isExitBusy() const override {return FALSE;} ///< Contain style exiters are getting the ability to space out exits, so ask this before reserveDoor as a kind of no-commitment check. - virtual ExitDoorType reserveDoorForExit( const ThingTemplate* objType, Object *specificObject ) override; - virtual void exitObjectViaDoor( Object *newObj, ExitDoorType exitDoor ) override; - virtual void unreserveDoorForExit( ExitDoorType exitDoor ) override; - virtual void setRallyPoint( const Coord3D * ) override {} - virtual const Coord3D *getRallyPoint() const override { return nullptr; } - virtual void exitObjectByBudding( Object *newObj, Object *budHost ) override { return; } - - virtual UpdateSleepTime update() override { return UPDATE_SLEEP_FOREVER; } - -protected: - Bool m_bonesInitialized; ///< To prevent creation bugs, only init the World coords when first asked for one - Int m_spawnPointCount; ///< How many in the array are actually live and valid - Coord3D m_worldCoordSpawnPoints[MAX_SPAWN_POINTS];///< Where my little friends will be created - Real m_worldAngleSpawnPoints[MAX_SPAWN_POINTS]; ///< And what direction they should face - ObjectID m_spawnPointOccupier[MAX_SPAWN_POINTS]; ///< Who I think is in each spot. I can validate their existence to see if I am free to exit something. - - // Required func to fulfill Module requirement - -private: - void initializeBonePositions(); ///< Look up the bone positions and store them in world space coords - void revalidateOccupiers(); ///< Do a lookup on all our ID's and clear the dead ones. -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialAbility.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialAbility.h deleted file mode 100644 index 2142fb7b68e..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialAbility.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Special Ability.h /////////////////////////////////////////////////////////////// -// Author: Kris Morness, July 2002 -// Desc: This is the class that handles processing of any special attack from a unit. There are -// many different styles and rules for various attacks. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/SpecialPowerModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Object; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class SpecialAbilityModuleData : public SpecialPowerModuleData -{ - // nothing -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class SpecialAbility : public SpecialPowerModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SpecialAbility, "SpecialAbility" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SpecialAbility, SpecialAbilityModuleData ) - -public: - - SpecialAbility( Thing *thing, const ModuleData *moduleData ); - - virtual void doSpecialPowerAtObject( Object *obj, UnsignedInt commandOptions ) override; - virtual void doSpecialPowerAtLocation( const Coord3D *loc, Real angle, UnsignedInt commandOptions ) override; - virtual void doSpecialPower( UnsignedInt commandOptions ) override; - -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCompletionDie.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCompletionDie.h deleted file mode 100644 index 789ce9f576f..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCompletionDie.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SpecialPowerCompletionDie.h ////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, May 2002 -// Desc: Die method responsible for telling TheScriptEngine that a special power has been completed -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/INI.h" -#include "GameLogic/Module/DieModule.h" - -class SpecialPowerTemplate; - -//------------------------------------------------------------------------------------------------- -class SpecialPowerCompletionDieModuleData : public DieModuleData -{ -public: - SpecialPowerTemplate *m_specialPowerTemplate; ///< pointer to the special power template - - SpecialPowerCompletionDieModuleData() - { - m_specialPowerTemplate = nullptr; - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - DieModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "SpecialPowerTemplate", INI::parseSpecialPowerTemplate, nullptr, offsetof( SpecialPowerCompletionDieModuleData, m_specialPowerTemplate ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - - } -}; - -//------------------------------------------------------------------------------------------------- -/** Special power completion die */ -//------------------------------------------------------------------------------------------------- -class SpecialPowerCompletionDie : public DieModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SpecialPowerCompletionDie, "SpecialPowerCompletionDie" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SpecialPowerCompletionDie, SpecialPowerCompletionDieModuleData ) - -public: - - SpecialPowerCompletionDie( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - - void setCreator( ObjectID creatorID ); - void notifyScriptEngine(); - - virtual void onDie( const DamageInfo *damageInfo ) override; - -protected: - - ObjectID m_creatorID; - Bool m_creatorSet; - -}; - -// Creator is stored as ID, so a failed lookup just means that he died first and noone cares that we are going. diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCreate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCreate.h deleted file mode 100644 index 8ee4e95e106..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerCreate.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SpecialPowerCreate.h ///////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, May 2002 -// Desc: When a building is created, tell special powers to start counting down -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/CreateModule.h" - -class Thing; - -//------------------------------------------------------------------------------------------------- -/** SpecialPowerCreate */ -//------------------------------------------------------------------------------------------------- -class SpecialPowerCreate : public CreateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SpecialPowerCreate, "SpecialPowerCreate" ) - MAKE_STANDARD_MODULE_MACRO( SpecialPowerCreate ) - -public: - - SpecialPowerCreate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onCreate() override; - virtual void onBuildComplete() override; ///< This is called when you are a finished game object - -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SpyVisionSpecialPower.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SpyVisionSpecialPower.h deleted file mode 100644 index 61e5e81dd7e..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SpyVisionSpecialPower.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SpyVisionSpecialPower.h ///////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, September 2002 -// Desc: Special Power will spy on the vision of all enemy players. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/SpecialPowerModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class FXList; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class SpyVisionSpecialPowerModuleData : public SpecialPowerModuleData -{ - -public: - - SpyVisionSpecialPowerModuleData(); - - static void buildFieldParse( MultiIniFieldParse& p ); - - UnsignedInt m_baseDurationInFrames; ///< duration of the demoralization (in frames) - UnsignedInt m_bonusDurationPerCapturedInFrames; ///< additional duration added for each prisoner we have - UnsignedInt m_maxDurationInFrames; ///< no matter how many prisoners we have, this is max - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class SpyVisionSpecialPower : public SpecialPowerModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SpyVisionSpecialPower, "SpyVisionSpecialPower" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SpyVisionSpecialPower, SpyVisionSpecialPowerModuleData ) - -public: - - SpyVisionSpecialPower( Thing *thing, const ModuleData *moduleData ); - // virtual destructor prototype provided by memory pool object - - virtual void doSpecialPower( UnsignedInt commandOptions ) override; - -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SquishCollide.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SquishCollide.h deleted file mode 100644 index 86548e4ac18..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SquishCollide.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SquishCollide.h //////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, Jan 2002 -// Desc: Topple collide module -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/CollideModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -//------------------------------------------------------------------------------------------------- -/** The tank collide module */ -//------------------------------------------------------------------------------------------------- -class SquishCollide : public CollideModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SquishCollide, "SquishCollide" ) - MAKE_STANDARD_MODULE_MACRO( SquishCollide ); - -public: - - SquishCollide( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - /// This collide method gets called when collision occur - virtual void onCollide( Object *other, const Coord3D *loc, const Coord3D *normal ) override; - -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h deleted file mode 100644 index f7fe50aac42..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h +++ /dev/null @@ -1,105 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: StatusBitsUpgrade.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: May 2002 -// -// Filename: StatusBitsUpgrade.h -// -// author: Steven Johnson -// -// purpose: -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "GameLogic/Module/UpgradeModule.h" -#include "Common/ObjectStatusTypes.h" - -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class Thing; - -//----------------------------------------------------------------------------- -// TYPE DEFINES /////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -class StatusBitsUpgradeModuleData : public UpgradeModuleData -{ -public: - ObjectStatusMaskType m_statusToSet; - ObjectStatusMaskType m_statusToClear; - - StatusBitsUpgradeModuleData() - { - } - - static void buildFieldParse(MultiIniFieldParse& p); -}; - -//----------------------------------------------------------------------------- -class StatusBitsUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( StatusBitsUpgrade, "StatusBitsUpgrade" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( StatusBitsUpgrade, StatusBitsUpgradeModuleData ); - -public: - - StatusBitsUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - -protected: - virtual void upgradeImplementation( ) override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - -}; - -//----------------------------------------------------------------------------- -// INLINING /////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// EXTERNALS ////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/StructureBody.h b/Generals/Code/GameEngine/Include/GameLogic/Module/StructureBody.h deleted file mode 100644 index c9e0da3ad69..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/StructureBody.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: StructureBody.h ////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, November 2001 -// Desc: Structure bodies are active bodies specifically for structures that are built -// and/or interactable (is that a world) with the player. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/ActiveBody.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Object; - -//------------------------------------------------------------------------------------------------- -class StructureBodyModuleData : public ActiveBodyModuleData -{ -public: - - StructureBodyModuleData(){} - - static void buildFieldParse(MultiIniFieldParse& p) - { - ActiveBodyModuleData::buildFieldParse(p); - static const FieldParse dataFieldParse[] = - { - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - } -}; - -//------------------------------------------------------------------------------------------------- -/** Structure body module */ -//------------------------------------------------------------------------------------------------- -class StructureBody : public ActiveBody -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( StructureBody, "StructureBody" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( StructureBody, StructureBodyModuleData ) - -public: - - StructureBody( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - void setConstructorObject( Object *obj ); - ObjectID getConstructorObjectID() { return m_constructorObjectID; } - -protected: - - ObjectID m_constructorObjectID; ///< object that built this structure - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h deleted file mode 100644 index 6a68c82869a..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SubObjectsUpgrade.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Created: September 2002 -// -// Filename: SubObjectsUpgrade.cpp -// -// Author: Kris Morness -// -// Purpose: Shows or hides a list of subobjects based on upgrade statii. It -// will override any animation subobjects states. -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "GameLogic/Module/UpgradeModule.h" - -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class Thing; - -//----------------------------------------------------------------------------- -class SubObjectsUpgradeModuleData : public UpgradeModuleData -{ -public: - std::vector m_showSubObjectNames; - std::vector m_hideSubObjectNames; - - SubObjectsUpgradeModuleData(){} - - static void buildFieldParse(MultiIniFieldParse& p); -}; - -//----------------------------------------------------------------------------- -class SubObjectsUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SubObjectsUpgrade, "SubObjectsUpgrade" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SubObjectsUpgrade, SubObjectsUpgradeModuleData ); - -public: - - SubObjectsUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - -protected: - virtual void upgradeImplementation( ) override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return true; } - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h deleted file mode 100644 index 0bc93489578..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SupplyCenterCreate.h ///////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood Feb 2002 -// Desc: When a Supply Center is created, it needs to update all the Resource brains in all players -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/CreateModule.h" - -class Thing; - -//------------------------------------------------------------------------------------------------- -/** SupplyWarehouseCreate */ -//------------------------------------------------------------------------------------------------- -class SupplyCenterCreate : public CreateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyCenterCreate, "SupplyCenterCreate" ) - MAKE_STANDARD_MODULE_MACRO( SupplyCenterCreate ) - -public: - - SupplyCenterCreate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onCreate() override; - virtual void onBuildComplete() override; ///< This is called when you are a finished game object - -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCreate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCreate.h deleted file mode 100644 index e408e6dec7d..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCreate.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SupplyWarehouseCreate.h ///////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood Feb 2002 -// Desc: When a Supply Warehouse is created, it needs to update all the Resource brains in all players -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/CreateModule.h" - -class Thing; - -//------------------------------------------------------------------------------------------------- -/** SupplyWarehouseCreate */ -//------------------------------------------------------------------------------------------------- -class SupplyWarehouseCreate : public CreateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyWarehouseCreate, "SupplyWarehouseCreate" ) - MAKE_STANDARD_MODULE_MACRO( SupplyWarehouseCreate ) - -public: - - SupplyWarehouseCreate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onCreate() override; - -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h deleted file mode 100644 index 70d03dc6bd8..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SupplyWarehouseCripplingBehavior.h ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, Septemmber 2002 -// Desc: Behavior that Disables the building on ReallyDamaged edge state, and manages an Update timer to heal -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/BehaviorModule.h" -#include "GameLogic/Module/DamageModule.h" -#include "GameLogic/Module/UpdateModule.h" - - -//------------------------------------------------------------------------------------------------- -class SupplyWarehouseCripplingBehaviorModuleData : public UpdateModuleData -{ -public: - UnsignedInt m_selfHealSupression; ///< Time since last damage until I can start to heal - UnsignedInt m_selfHealDelay; ///< Once I am okay to heal, how often to do so - Real m_selfHealAmount; ///< And how much - - SupplyWarehouseCripplingBehaviorModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - -private: - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class SupplyWarehouseCripplingBehavior : public UpdateModule, - public DamageModuleInterface -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyWarehouseCripplingBehavior, "SupplyWarehouseCripplingBehavior" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SupplyWarehouseCripplingBehavior, SupplyWarehouseCripplingBehaviorModuleData ) - -public: - - SupplyWarehouseCripplingBehavior( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - static Int getInterfaceMask() { return UpdateModule::getInterfaceMask() | (MODULEINTERFACE_DAMAGE); } - - // BehaviorModule - virtual DamageModuleInterface* getDamage() override { return this; } - - // DamageModuleInterface - virtual void onDamage( DamageInfo *damageInfo ) override; - virtual void onHealing( DamageInfo *damageInfo ) override {} - virtual void onBodyDamageStateChange(const DamageInfo* damageInfo, BodyDamageType oldState, BodyDamageType newState) override; - - // UpdateInterface - virtual UpdateSleepTime update() override; - -protected: - virtual void resetSelfHealSupression();// Reset our able to heal timer, as we took damage - virtual void startCrippledEffects();//Disable our object - virtual void stopCrippledEffects();//Enable our object - -private: - UnsignedInt m_healingSupressedUntilFrame; - UnsignedInt m_nextHealingFrame; -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h deleted file mode 100644 index 1a37a717ec9..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SupplyWarehouseDockUpdate.h ///////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood Feb 2002 -// Desc: The action of this dock update is identifying who is docking and either taking Boxes away or giving them -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/INI.h" -#include "Common/GameMemory.h" -#include "GameLogic/Module/DockUpdate.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class SupplyWarehouseDockUpdateModuleData : public DockUpdateModuleData -{ -public: - - SupplyWarehouseDockUpdateModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - Int m_startingBoxesData; - Bool m_deleteWhenEmpty; -}; - -//------------------------------------------------------------------------------------------------- -class SupplyWarehouseDockUpdate : public DockUpdate -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyWarehouseDockUpdate, "SupplyWarehouseDockUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SupplyWarehouseDockUpdate, SupplyWarehouseDockUpdateModuleData ) - -public: - - virtual DockUpdateInterface* getDockUpdateInterface() override { return this; } - - SupplyWarehouseDockUpdate( Thing *thing, const ModuleData* moduleData ); - - virtual void setDockCrippled( Bool setting ) override; ///< Game Logic can set me as inoperative. I get to decide what that means. - virtual Bool action( Object* docker, Object *drone = nullptr ) override; ///. -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: TensileFormationUpdate.h //////////////////////////////////////////////////////////////////////////// -// Author: Mark Lorenzen, November 2002 -// Desc: Springy formation movement like that of say, an avalanche -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpdateModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -struct FieldParse; - -//------------------------------------------------------------------------------------------------- -class TensileFormationUpdateModuleData: public UpdateModuleData -{ - -public: - - TensileFormationUpdateModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - Bool m_enabled; ///< enabled - AudioEventRTS m_crackSound; - -}; - -//------------------------------------------------------------------------------------------------- -class TensileFormationUpdate : public UpdateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( TensileFormationUpdate, "TensileFormationUpdate" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( TensileFormationUpdate, TensileFormationUpdateModuleData ) - -public: - - TensileFormationUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - void setEnabled( Bool enabled ) { m_enabled = enabled; } ///< enable/disable formation - virtual UpdateSleepTime update() override; ///< Deciding whether or not to make new guys - -protected: - - void propagateDislodgement( Bool enabled ); - void initLinks(); - - struct TensileLink - { - ObjectID id; - Coord3D tensor; - }; - - TensileLink m_links[4];//standard textile algorithm - Coord3D m_inertia; - Bool m_enabled; ///< enabled - Bool m_linksInited; - UnsignedInt m_motionlessCounter; - UnsignedInt m_life; - Real m_lowestSlideElevation; - - AudioEventRTS m_crackSound; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/UnitCrateCollide.h b/Generals/Code/GameEngine/Include/GameLogic/Module/UnitCrateCollide.h deleted file mode 100644 index 8586ebfa7b2..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/UnitCrateCollide.h +++ /dev/null @@ -1,82 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: UnitCrateCollide.h ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: A crate that gives n units of type m the the pickerupper -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/Module.h" -#include "GameLogic/Module/CrateCollide.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -//------------------------------------------------------------------------------------------------- -class UnitCrateCollideModuleData : public CrateCollideModuleData -{ -public: - UnsignedInt m_unitCount; - AsciiString m_unitType; - - UnitCrateCollideModuleData() - { - m_unitCount = 0; - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - CrateCollideModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "UnitCount", INI::parseUnsignedInt, nullptr, offsetof( UnitCrateCollideModuleData, m_unitCount ) }, - { "UnitName", INI::parseAsciiString, nullptr, offsetof( UnitCrateCollideModuleData, m_unitType ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - - } -}; - -//------------------------------------------------------------------------------------------------- -class UnitCrateCollide : public CrateCollide -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( UnitCrateCollide, "UnitCrateCollide" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( UnitCrateCollide, UnitCrateCollideModuleData ); - -public: - - UnitCrateCollide( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - /// This is the game logic execution function that all real CrateCollides will implement - virtual Bool executeCrateBehavior( Object *other ) override; -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h deleted file mode 100644 index d02631f1372..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: UnpauseSpecialPowerUpgrade.h /////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, August 2002 -// Desc: An upgrade that starts the timer on a Special Power module, so you can have them -// dependent on upgrades on the logic side, like NEED_UPGRADE does on the client side by disabling -// the button. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpgradeModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class SpecialPowerTemplate; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -class UnpauseSpecialPowerUpgradeModuleData : public UpgradeModuleData -{ - -public: - - UnpauseSpecialPowerUpgradeModuleData(); - - static void buildFieldParse(MultiIniFieldParse& p); - - const SpecialPowerTemplate *m_specialPower; - -}; - -//------------------------------------------------------------------------------------------------- -/** The OCL upgrade module */ -//------------------------------------------------------------------------------------------------- -class UnpauseSpecialPowerUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( UnpauseSpecialPowerUpgrade, "UnpauseSpecialPowerUpgrade" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( UnpauseSpecialPowerUpgrade, UnpauseSpecialPowerUpgradeModuleData ); - -public: - - UnpauseSpecialPowerUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - -protected: - - virtual void upgradeImplementation() override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/UpgradeDie.h b/Generals/Code/GameEngine/Include/GameLogic/Module/UpgradeDie.h deleted file mode 100644 index 4cf0a53e845..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/UpgradeDie.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: UpgradeDie.h ///////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, August 2002 -// Desc: Free's producer's upgrade (assuming this object was created via an upgrade). -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/INI.h" -#include "GameLogic/Module/DieModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -//------------------------------------------------------------------------------------------------- -// ------------------------------------------------------------------------------------------------ -class UpgradeDieModuleData : public DieModuleData -{ -public: - AsciiString m_upgradeName; - - UpgradeDieModuleData(){} - - static void buildFieldParse(MultiIniFieldParse& p) - { - - DieModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "UpgradeToRemove", INI::parseAsciiString, nullptr, offsetof( UpgradeDieModuleData, m_upgradeName ) }, - { 0, 0, 0, 0 } - }; - - p.add(dataFieldParse); - } -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class UpgradeDie : public DieModule -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( UpgradeDie, "UpgradeDie" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( UpgradeDie, UpgradeDieModuleData ) - -public: - - UpgradeDie( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - virtual void onDie( const DamageInfo *damageInfo ) override; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/VeterancyCrateCollide.h b/Generals/Code/GameEngine/Include/GameLogic/Module/VeterancyCrateCollide.h deleted file mode 100644 index 4673da2b9c5..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/VeterancyCrateCollide.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: VeterancyCrateCollide.h ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: A crate that gives a level of experience to all within n distance -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/Module.h" -#include "GameLogic/Module/CrateCollide.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -//------------------------------------------------------------------------------------------------- -class VeterancyCrateCollideModuleData : public CrateCollideModuleData -{ -public: - UnsignedInt m_rangeOfEffect; - Bool m_addsOwnerVeterancy; - Bool m_isPilot; - - VeterancyCrateCollideModuleData() - { - m_rangeOfEffect = 0; - m_addsOwnerVeterancy = false; - m_isPilot = false; - } - - static void buildFieldParse(MultiIniFieldParse& p) - { - CrateCollideModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "EffectRange", INI::parseUnsignedInt, nullptr, offsetof( VeterancyCrateCollideModuleData, m_rangeOfEffect ) }, - { "AddsOwnerVeterancy", INI::parseBool, nullptr, offsetof( VeterancyCrateCollideModuleData, m_addsOwnerVeterancy ) }, - { "IsPilot", INI::parseBool, nullptr, offsetof( VeterancyCrateCollideModuleData, m_isPilot ) }, - { 0, 0, 0, 0 } - }; - p.add(dataFieldParse); - - } -}; - -//------------------------------------------------------------------------------------------------- -class VeterancyCrateCollide : public CrateCollide -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( VeterancyCrateCollide, "VeterancyCrateCollide" ) - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( VeterancyCrateCollide, VeterancyCrateCollideModuleData ); - -public: - - VeterancyCrateCollide( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - -protected: - - /// This allows specific vetoes to certain types of crates and their data - virtual Bool isValidToExecute( const Object *other ) const override; - - /// This is the game logic execution function that all real CrateCollides will implement - virtual Bool executeCrateBehavior( Object *other ) override; - - Int getLevelsToGain() const; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/VeterancyGainCreate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/VeterancyGainCreate.h deleted file mode 100644 index 13fff283183..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/VeterancyGainCreate.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: VeterancyGainCreate.h ////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, August 2002 -// Desc: On creation, will set Object's veterancy level if required Science is present. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#define DEFINE_VETERANCY_NAMES -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "Common/GameCommon.h" -#include "Common/Science.h" -#include "GameLogic/Module/CreateModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -class VeterancyGainCreateModuleData : public CreateModuleData -{ -public: - VeterancyLevel m_startingLevel; ///< Level to set Object at - ScienceType m_scienceRequired; ///< The science you must have to trigger this - - VeterancyGainCreateModuleData(); - static void buildFieldParse(MultiIniFieldParse& p); -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -class VeterancyGainCreate : public CreateModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( VeterancyGainCreate, "VeterancyGainCreate" ); - MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( VeterancyGainCreate, VeterancyGainCreateModuleData ); - -public: - - VeterancyGainCreate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - /// the create method - virtual void onCreate() override; - -protected: - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/WanderAIUpdate.h b/Generals/Code/GameEngine/Include/GameLogic/Module/WanderAIUpdate.h deleted file mode 100644 index 3c8f1017e2f..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/WanderAIUpdate.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// WanderAIUpdate.h ////////// -// Will give self random move commands -// Author: Graham Smallwood, April 2002 - -#pragma once - -#include "GameLogic/Module/AIUpdate.h" - -//------------------------------------------------------------------------------------------------- -/** - * Soldier behavior implementation. - * Override or extend AIUpdate methods to customize the Soldier's behavior. - */ -class WanderAIUpdate : public AIUpdateInterface -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( WanderAIUpdate, "WanderAIUpdate" ) - MAKE_STANDARD_MODULE_MACRO( WanderAIUpdate ) - - /* - IMPORTANT NOTE: if you ever add module data to this, you must have it inherit from - AIUpdateModuleData to allow locomotors to work correctly. (see SupplyTruckAIUpdate - for an example.) - */ - - virtual UpdateSleepTime update() override; - -public: - - WanderAIUpdate( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype provided by memory pool declaration - - -protected: - - virtual AIStateMachine* makeStateMachine() override; - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h deleted file mode 100644 index 855eefa2142..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: WeaponBonusUpgrade.h ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: May 2002 -// -// Filename: WeaponBonusUpgrade.h -// -// author: Chris Huybregts -// -// purpose: -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "GameLogic/Module/UpgradeModule.h" - -//----------------------------------------------------------------------------- -// FORWARD REFERENCES ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -class Thing; - -//----------------------------------------------------------------------------- -// TYPE DEFINES /////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -class WeaponBonusUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( WeaponBonusUpgrade, "WeaponBonusUpgrade" ) - MAKE_STANDARD_MODULE_MACRO( WeaponBonusUpgrade ); - -public: - - WeaponBonusUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - -protected: - virtual void upgradeImplementation( ) override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - -}; - -//----------------------------------------------------------------------------- -// INLINING /////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// EXTERNALS ////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h b/Generals/Code/GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h deleted file mode 100644 index e88e87dc6fa..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: WeaponSetUpgrade.h ///////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: UpgradeModule that sets a weapon set bit for the Best Fit weapon set chooser to discover -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "GameLogic/Module/UpgradeModule.h" - -// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// -class Thing; - -//------------------------------------------------------------------------------------------------- -/** The default die module */ -//------------------------------------------------------------------------------------------------- -class WeaponSetUpgrade : public UpgradeModule -{ - - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( WeaponSetUpgrade, "WeaponSetUpgrade" ) - MAKE_STANDARD_MODULE_MACRO( WeaponSetUpgrade ); - -public: - - WeaponSetUpgrade( Thing *thing, const ModuleData* moduleData ); - // virtual destructor prototype defined by MemoryPoolObject - -protected: - virtual void upgradeImplementation( ) override; ///< Here's the actual work of Upgrading - virtual Bool isSubObjectsUpgrade() override { return false; } - -}; diff --git a/Generals/Code/GameEngine/Include/GameLogic/Squad.h b/Generals/Code/GameEngine/Include/GameLogic/Squad.h deleted file mode 100644 index 9ed357edec0..00000000000 --- a/Generals/Code/GameEngine/Include/GameLogic/Squad.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Sqaud.h -/*---------------------------------------------------------------------------*/ -/* EA Pacific */ -/* Confidential Information */ -/* Copyright (C) 2001 - All Rights Reserved */ -/* DO NOT DISTRIBUTE */ -/*---------------------------------------------------------------------------*/ -/* Project: RTS3 */ -/* File name: Sqaud.h */ -/* Created: John K. McDonald, Jr., 4/19/2002 */ -/* Desc: // @todo */ -/* Revision History: */ -/* 4/19/2002 : Initial creation */ -/*---------------------------------------------------------------------------*/ - -#pragma once - -// INCLUDES /////////////////////////////////////////////////////////////////// -#include "Common/Snapshot.h" -#include "Common/GameMemory.h" - -// DEFINES //////////////////////////////////////////////////////////////////// - -// FORWARD DECLARATIONS /////////////////////////////////////////////////////// -class AIGroup; -class Object; -class Team; - - -// TYPE DEFINES /////////////////////////////////////////////////////////////// -typedef std::vector VecObjectID; -typedef VecObjectID::iterator VecObjectIDIt; - -typedef std::vector VecObjectPtr; -typedef VecObjectPtr::iterator VecObjectPtrIt; - -class Squad : public MemoryPoolObject, public Snapshot -{ - MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(Squad, "Squad") - -protected: - // snapshot methods - virtual void crc( Xfer *xfer ) override; - virtual void xfer( Xfer *xfer ) override; - virtual void loadPostProcess() override; - - VecObjectID m_objectIDs; - - // this one is the last requested object stuff. Its used so that we can return a - // const& rather than making a copy and placing it on the stack. - VecObjectPtr m_objectsCached; - -public: - void addObject(Object *objectToAdd); // add an object - void addObjectID(ObjectID objectID); // add an object ID - void removeObject(Object *objectToRemove); // remove an object - void clearSquad(); // remove all objects from this squad. - const VecObjectPtr& getAllObjects(); // get all objects on the list that haven't been deleted - const VecObjectPtr& getLiveObjects(); // get all objects that pass "isEffectivelyDead" test - Int getSizeOfGroup() const; // get the current number of objects, including dead objects - Bool isOnSquad(const Object *objToTest) const; // returns true if the object is on this squad, otherwise false - - // convenience function to fill this squad with members of a team - // There SHOULD NOT be a TeamFromSquad Function. See comments in Squad.cpp for details - void squadFromTeam(const Team* fromTeam, Bool clearSquadFirst); - - // convenience function to create a squad from an AIGroup, and an AIGroup from a team. - // When creating the AIGroup from the Squad, the old AIGroup affiliations are broken. - void squadFromAIGroup(const AIGroup* fromAIGroup, Bool clearSquadFirst); - void aiGroupFromSquad(AIGroup* aiGroupToFill); -}; -EMPTY_DTOR(Squad) diff --git a/Generals/Code/GameEngine/Source/Common/Bezier/BezFwdIterator.cpp b/Generals/Code/GameEngine/Source/Common/Bezier/BezFwdIterator.cpp deleted file mode 100644 index 3df2a515fc6..00000000000 --- a/Generals/Code/GameEngine/Source/Common/Bezier/BezFwdIterator.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" -#include "Common/BezFwdIterator.h" - -//------------------------------------------------------------------------------------------------- -BezFwdIterator::BezFwdIterator(): mStep(0), mStepsDesired(0) -{ - mCurrPoint.zero(); - mDDDq.zero(); - mDDq.zero(); - mDq.zero(); -} - -//------------------------------------------------------------------------------------------------- -BezFwdIterator::BezFwdIterator(Int stepsDesired, const BezierSegment *bezSeg) -{ - mCurrPoint.zero(); - mDDDq.zero(); - mDDq.zero(); - mDq.zero(); - mStepsDesired = stepsDesired; - mBezSeg = (*bezSeg); -} - -//------------------------------------------------------------------------------------------------- -void BezFwdIterator::start() -{ - mStep = 0; - - if (mStepsDesired <= 1) - return; - - float d = 1.0f / (mStepsDesired - 1); - float d2 = d * d; - float d3 = d * d2; - - D3DXVECTOR4 px(mBezSeg.m_controlPoints[0].x, mBezSeg.m_controlPoints[1].x, mBezSeg.m_controlPoints[2].x, mBezSeg.m_controlPoints[3].x); - D3DXVECTOR4 py(mBezSeg.m_controlPoints[0].y, mBezSeg.m_controlPoints[1].y, mBezSeg.m_controlPoints[2].y, mBezSeg.m_controlPoints[3].y); - D3DXVECTOR4 pz(mBezSeg.m_controlPoints[0].z, mBezSeg.m_controlPoints[1].z, mBezSeg.m_controlPoints[2].z, mBezSeg.m_controlPoints[3].z); - - D3DXVECTOR4 cVec[3]; - D3DXVec4Transform(&cVec[0], &px, &BezierSegment::s_bezBasisMatrix); - D3DXVec4Transform(&cVec[1], &py, &BezierSegment::s_bezBasisMatrix); - D3DXVec4Transform(&cVec[2], &pz, &BezierSegment::s_bezBasisMatrix); - - mCurrPoint = mBezSeg.m_controlPoints[0]; - - int i = 3; - while (i--) { - float a = cVec[i].x; - float b = cVec[i].y; - float c = cVec[i].z; - - float *pD, *pDD, *pDDD; - - if (i == 2) { - pD = &mDq.z; - pDD = &mDDq.z; - pDDD = &mDDDq.z; - } else if (i == 1) { - pD = &mDq.y; - pDD = &mDDq.y; - pDDD = &mDDDq.y; - } else if (i == 0) { - pD = &mDq.x; - pDD = &mDDq.x; - pDDD = &mDDDq.x; - } - - (*pD) = a * d3 + b * d2 + c * d; - (*pDD) = 6 * a * d3 + 2 * b * d2; - (*pDDD) = 6 * a * d3; - } -} - -//------------------------------------------------------------------------------------------------- -Bool BezFwdIterator::done() -{ - return (mStep >= mStepsDesired); -} - -//------------------------------------------------------------------------------------------------- -const Coord3D& BezFwdIterator::getCurrent() const -{ - return mCurrPoint; -} - -//------------------------------------------------------------------------------------------------- -void BezFwdIterator::next() -{ - mCurrPoint.add(mDq); - mDq.add(mDDq); - mDDq.add(mDDDq); - - ++mStep; -} - diff --git a/Generals/Code/GameEngine/Source/Common/Bezier/BezierSegment.cpp b/Generals/Code/GameEngine/Source/Common/Bezier/BezierSegment.cpp deleted file mode 100644 index 639b6d1bf2b..00000000000 --- a/Generals/Code/GameEngine/Source/Common/Bezier/BezierSegment.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - - -#include "PreRTS.h" -#include "Common/BezierSegment.h" -#include "Common/BezFwdIterator.h" - -#include - -//------------------------------------------------------------------------------------------------- -BezierSegment::BezierSegment() -{ - for(int i=0; i < 4; i++) - m_controlPoints[i].zero(); -} - -//------------------------------------------------------------------------------------------------- -BezierSegment::BezierSegment(Real x0, Real y0, Real z0, - Real x1, Real y1, Real z1, - Real x2, Real y2, Real z2, - Real x3, Real y3, Real z3) -{ - m_controlPoints[0].x = x0; - m_controlPoints[0].y = y0; - m_controlPoints[0].z = z0; - - m_controlPoints[1].x = x1; - m_controlPoints[1].y = y1; - m_controlPoints[1].z = z1; - - m_controlPoints[2].x = x2; - m_controlPoints[2].y = y2; - m_controlPoints[2].z = z2; - - m_controlPoints[3].x = x3; - m_controlPoints[3].y = y3; - m_controlPoints[3].z = z3; -} - -BezierSegment::BezierSegment(Real cp[12]) -{ - m_controlPoints[0].x = cp[0]; - m_controlPoints[0].y = cp[1]; - m_controlPoints[0].z = cp[2]; - - m_controlPoints[1].x = cp[3]; - m_controlPoints[1].y = cp[4]; - m_controlPoints[1].z = cp[5]; - - m_controlPoints[2].x = cp[6]; - m_controlPoints[2].y = cp[7]; - m_controlPoints[2].z = cp[8]; - - m_controlPoints[3].x = cp[9]; - m_controlPoints[3].y = cp[10]; - m_controlPoints[3].z = cp[11]; -} - -BezierSegment::BezierSegment(const Coord3D& cp0, const Coord3D& cp1, const Coord3D& cp2, const Coord3D& cp3) -{ - m_controlPoints[0] = cp0; - m_controlPoints[1] = cp1; - m_controlPoints[2] = cp2; - m_controlPoints[3] = cp3; -} - -BezierSegment::BezierSegment(Coord3D cp[4]) -{ - m_controlPoints[0] = cp[0]; - m_controlPoints[1] = cp[1]; - m_controlPoints[2] = cp[2]; - m_controlPoints[3] = cp[3]; -} - - -//------------------------------------------------------------------------------------------------- -void BezierSegment::evaluateBezSegmentAtT(Real tValue, Coord3D *outResult) const - -{ - if (!outResult) - return; - - D3DXVECTOR4 tVec(tValue * tValue * tValue, tValue * tValue, tValue, 1); - - D3DXVECTOR4 xCoords(m_controlPoints[0].x, m_controlPoints[1].x, m_controlPoints[2].x, m_controlPoints[3].x); - D3DXVECTOR4 yCoords(m_controlPoints[0].y, m_controlPoints[1].y, m_controlPoints[2].y, m_controlPoints[3].y); - D3DXVECTOR4 zCoords(m_controlPoints[0].z, m_controlPoints[1].z, m_controlPoints[2].z, m_controlPoints[3].z); - - D3DXVECTOR4 tResult; - D3DXVec4Transform(&tResult, &tVec, &BezierSegment::s_bezBasisMatrix); - - outResult->x = D3DXVec4Dot(&xCoords, &tResult); - outResult->y = D3DXVec4Dot(&yCoords, &tResult); - outResult->z = D3DXVec4Dot(&zCoords, &tResult); -} - -//------------------------------------------------------------------------------------------------- -void BezierSegment::getSegmentPoints(Int numSegments, VecCoord3D *outResult) const -{ - if (!outResult) { - return; - } - - outResult->clear(); - outResult->resize(numSegments); - - BezFwdIterator iter(numSegments, this); - iter.start(); - Int i = 0; - while (!iter.done()) { - (*outResult)[i] = iter.getCurrent(); - ++i; - iter.next(); - } -} - -//------------------------------------------------------------------------------------------------- -// This function isn't terribly fast. There are alternatives, and if this is too slow, we can -// take a look at the other approximations. -// There is no known close-form solution to this problem. -Real BezierSegment::getApproximateLength(Real withinTolerance) const -{ - /* - How this works: - We can determine the approximate length of a bezier segment by - L0 = |(P0,P1)| + |(P1,P2)| + |(P2,P3)| - L1 = |(P0,P3)| - - The length of the segment is approximately 1/2 L0 + 1/2 L1 - - P1__P2 - / \ - P0----P3 - - The error in this is L1 - L0. If the error is too much, then we subdivide the curve and - try again. - */ - - Coord3D p0p1 = { m_controlPoints[1].x - m_controlPoints[0].x, - m_controlPoints[1].y - m_controlPoints[0].y, - m_controlPoints[1].z - m_controlPoints[0].z, }; - - Coord3D p1p2 = { m_controlPoints[2].x - m_controlPoints[1].x, - m_controlPoints[2].y - m_controlPoints[1].y, - m_controlPoints[2].z - m_controlPoints[1].z, }; - - Coord3D p2p3 = { m_controlPoints[3].x - m_controlPoints[2].x, - m_controlPoints[3].y - m_controlPoints[2].y, - m_controlPoints[3].z - m_controlPoints[2].z, }; - - Coord3D p0p3 = { m_controlPoints[3].x - m_controlPoints[0].x, - m_controlPoints[3].y - m_controlPoints[0].y, - m_controlPoints[3].z - m_controlPoints[0].z, }; - - Real length0 = p0p3.length(); - Real length1 = p0p1.length() + p1p2.length() + p2p3.length(); - - if ((length1 - length0) > withinTolerance) { - BezierSegment seg1, seg2; - splitSegmentAtT(0.5f, seg1, seg2); - return (seg1.getApproximateLength(withinTolerance) + seg2.getApproximateLength(withinTolerance)); - } - - return (INT_TO_REAL(length0 + length1) / 2.0f); -} - -//------------------------------------------------------------------------------------------------- -void BezierSegment::splitSegmentAtT(Real tValue, BezierSegment &outSeg1, BezierSegment &outSeg2) const -{ - // I think there are faster ways to do this. Could someone clue me in? - - Coord3D p0p1 = { m_controlPoints[1].x - m_controlPoints[0].x, - m_controlPoints[1].y - m_controlPoints[0].y, - m_controlPoints[1].z - m_controlPoints[0].z, }; - - Coord3D p1p2 = { m_controlPoints[2].x - m_controlPoints[1].x, - m_controlPoints[2].y - m_controlPoints[1].y, - m_controlPoints[2].z - m_controlPoints[1].z, }; - - Coord3D p2p3 = { m_controlPoints[3].x - m_controlPoints[2].x, - m_controlPoints[3].y - m_controlPoints[2].y, - m_controlPoints[3].z - m_controlPoints[2].z, }; - - p0p1.scale(tValue); - p1p2.scale(tValue); - p2p3.scale(tValue); - - p0p1.add(m_controlPoints[0]); - p1p2.add(m_controlPoints[1]); - p2p3.add(m_controlPoints[2]); - - Coord3D triLeft = { p1p2.x - p0p1.x, - p1p2.y - p0p1.y, - p1p2.z - p0p1.z, }; - - Coord3D triRight = { p2p3.x - p1p2.x, - p2p3.y - p1p2.y, - p2p3.z - p1p2.z, }; - - triLeft.scale(tValue); - triRight.scale(tValue); - - triLeft.add(p0p1); - triRight.add(p1p2); - - outSeg1.m_controlPoints[0] = m_controlPoints[0]; - outSeg1.m_controlPoints[1] = p0p1; - outSeg1.m_controlPoints[2] = triLeft; - evaluateBezSegmentAtT(tValue, &outSeg1.m_controlPoints[3]); - - outSeg2.m_controlPoints[0] = outSeg1.m_controlPoints[3]; - outSeg2.m_controlPoints[1] = triRight; - outSeg2.m_controlPoints[2] = p2p3; - outSeg2.m_controlPoints[3] = m_controlPoints[3]; -} - -//------------------------------------------------------------------------------------------------- -// The Basis Matrix for a bezier segment -const D3DXMATRIX BezierSegment::s_bezBasisMatrix( - -1.0f, 3.0f, -3.0f, 1.0f, - 3.0f, -6.0f, 3.0f, 0.0f, - -3.0f, 3.0f, 0.0f, 0.0f, - 1.0f, 0.0f, 0.0f, 0.0f -); diff --git a/Generals/Code/GameEngine/Source/Common/DamageFX.cpp b/Generals/Code/GameEngine/Source/Common/DamageFX.cpp deleted file mode 100644 index b1d24b77fa2..00000000000 --- a/Generals/Code/GameEngine/Source/Common/DamageFX.cpp +++ /dev/null @@ -1,324 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DamageFX.cpp /////////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, November 2001 -// Desc: DamageFX descriptions -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "Common/ThingFactory.h" -#include "Common/ThingTemplate.h" -#include "Common/DamageFX.h" -#include "Common/GameAudio.h" - -#include "GameClient/FXList.h" -#include "GameLogic/Damage.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameClient/GameClient.h" -#include "GameClient/InGameUI.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC DATA //////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -DamageFXStore *TheDamageFXStore = nullptr; ///< the DamageFX store definition - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PRIVATE CLASSES /////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -DamageFX::DamageFX() -{ - // not necessary. - //clear(); -} - -//------------------------------------------------------------------------------------------------- -void DamageFX::clear() -{ - for (Int dt = 0; dt < DAMAGE_NUM_TYPES; ++dt) - { - for (Int v = LEVEL_FIRST; v <= LEVEL_LAST; ++v) - { - m_dfx[dt][v].clear(); - } - } -} - -//------------------------------------------------------------------------------------------------- -UnsignedInt DamageFX::getDamageFXThrottleTime(DamageType t, const Object* source) const -{ - return m_dfx[t][source ? source->getVeterancyLevel() : LEVEL_REGULAR].m_damageFXThrottleTime; -} - -//------------------------------------------------------------------------------------------------- -void DamageFX::doDamageFX(DamageType t, Real damageAmount, const Object* source, const Object* victim) const -{ - ConstFXListPtr fx = getDamageFXList(t, damageAmount, source); - // since the victim is receiving the damage, it's the "primary" object. - // the source is the "secondary" object -- unused by most fx, but could be - // useful in some cases. - FXList::doFXObj(fx, victim, source); -} - -//------------------------------------------------------------------------------------------------- -ConstFXListPtr DamageFX::getDamageFXList(DamageType t, Real damageAmount, const Object* source) const -{ - /* - if damage is zero, never do damage fx. this is by design, since "zero" damage can happen - with some special weapons, like the battleship, which is a "faux" weapon that never does damage. - if you really need to change this for some reason, consider carefully... (srj) - */ - if (damageAmount == 0.0f) - return nullptr; - - const DFX& dfx = m_dfx[t][source ? source->getVeterancyLevel() : LEVEL_REGULAR]; - ConstFXListPtr fx = - damageAmount >= dfx.m_amountForMajorFX ? - dfx.m_majorDamageFXList : - dfx.m_minorDamageFXList; - - return fx; -} - -//------------------------------------------------------------------------------------------------- -const FieldParse* DamageFX::getFieldParse() const -{ - static const FieldParse myFieldParse[] = - { - { "AmountForMajorFX", parseAmount, nullptr, 0 }, - { "MajorFX", parseMajorFXList, nullptr, 0 }, - { "MinorFX", parseMinorFXList, nullptr, 0 }, - { "ThrottleTime", parseTime, nullptr, 0 }, - { "VeterancyAmountForMajorFX", parseAmount, TheVeterancyNames, 0 }, - { "VeterancyMajorFX", parseMajorFXList, TheVeterancyNames, 0 }, - { "VeterancyMinorFX", parseMinorFXList, TheVeterancyNames, 0 }, - { "VeterancyThrottleTime", parseTime, TheVeterancyNames, 0 }, - { nullptr, nullptr, nullptr,0 } - }; - return myFieldParse; -} - -//-------------------------------------------------------------------------------------------Static -static void parseCommonStuff( - INI* ini, - ConstCharPtrArray names, - VeterancyLevel& vetFirst, - VeterancyLevel& vetLast, - DamageType& damageFirst, - DamageType& damageLast -) -{ - if (names) - { - vetFirst = (VeterancyLevel)INI::scanIndexList(ini->getNextToken(), names); - vetLast = vetFirst; - } - else - { - vetFirst = LEVEL_FIRST; - vetLast = LEVEL_LAST; - } - - const char* damageName = ini->getNextToken(); - if (stricmp(damageName, "Default") == 0) - { - damageFirst = (DamageType)0; - damageLast = (DamageType)(DAMAGE_NUM_TYPES - 1); - } - else - { - damageFirst = (DamageType)DamageTypeFlags::getSingleBitFromName(damageName); - damageLast = damageFirst; - } -} - -//-------------------------------------------------------------------------------------------Static -/*static*/ void DamageFX::parseAmount( INI* ini, void* instance, void* /*store*/, const void* userData ) -{ - DamageFX* self = (DamageFX*)instance; - ConstCharPtrArray names = (ConstCharPtrArray)userData; - - VeterancyLevel vetFirst, vetLast; - DamageType damageFirst, damageLast; - parseCommonStuff(ini, names, vetFirst, vetLast, damageFirst, damageLast); - - Real amt = INI::scanReal(ini->getNextToken()); - - for (Int dt = damageFirst; dt <= damageLast; ++dt) - { - for (Int v = vetFirst; v <= vetLast; ++v) - { - self->m_dfx[dt][v].m_amountForMajorFX = amt; - } - } -} - -//-------------------------------------------------------------------------------------------Static -/*static*/ void DamageFX::parseMajorFXList( INI* ini, void* instance, void* /*store*/, const void* userData ) -{ - DamageFX* self = (DamageFX*)instance; - ConstCharPtrArray names = (ConstCharPtrArray)userData; - - VeterancyLevel vetFirst, vetLast; - DamageType damageFirst, damageLast; - parseCommonStuff(ini, names, vetFirst, vetLast, damageFirst, damageLast); - - ConstFXListPtr fx; - INI::parseFXList(ini, nullptr, &fx, nullptr); - - for (Int dt = damageFirst; dt <= damageLast; ++dt) - { - for (Int v = vetFirst; v <= vetLast; ++v) - { - self->m_dfx[dt][v].m_majorDamageFXList = fx; - } - } -} - -//-------------------------------------------------------------------------------------------Static -/*static*/ void DamageFX::parseMinorFXList( INI* ini, void* instance, void* /*store*/, const void* userData ) -{ - DamageFX* self = (DamageFX*)instance; - ConstCharPtrArray names = (ConstCharPtrArray)userData; - - VeterancyLevel vetFirst, vetLast; - DamageType damageFirst, damageLast; - parseCommonStuff(ini, names, vetFirst, vetLast, damageFirst, damageLast); - - ConstFXListPtr fx; - INI::parseFXList(ini, nullptr, &fx, nullptr); - - for (Int dt = damageFirst; dt <= damageLast; ++dt) - { - for (Int v = vetFirst; v <= vetLast; ++v) - { - self->m_dfx[dt][v].m_minorDamageFXList = fx; - } - } -} - -//-------------------------------------------------------------------------------------------Static -/*static*/ void DamageFX::parseTime( INI* ini, void* instance, void* /*store*/, const void* userData ) -{ - DamageFX* self = (DamageFX*)instance; - ConstCharPtrArray names = (ConstCharPtrArray)userData; - - VeterancyLevel vetFirst, vetLast; - DamageType damageFirst, damageLast; - parseCommonStuff(ini, names, vetFirst, vetLast, damageFirst, damageLast); - - UnsignedInt t; - INI::parseDurationUnsignedInt(ini, nullptr, &t, nullptr); - - for (Int dt = damageFirst; dt <= damageLast; ++dt) - { - for (Int v = vetFirst; v <= vetLast; ++v) - { - self->m_dfx[dt][v].m_damageFXThrottleTime = t; - } - } -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -DamageFXStore::DamageFXStore() -{ - m_dfxmap.clear(); -} - -//------------------------------------------------------------------------------------------------- -DamageFXStore::~DamageFXStore() -{ - m_dfxmap.clear(); -} - -//------------------------------------------------------------------------------------------------- -const DamageFX *DamageFXStore::findDamageFX(NameKeyType namekey) const -{ - DamageFXMap::const_iterator it = m_dfxmap.find(namekey); - if (it == m_dfxmap.end()) - { - return nullptr; - } - else - { - return &(*it).second; - } -} - -//------------------------------------------------------------------------------------------------- -const DamageFX *DamageFXStore::findDamageFX(const AsciiString& name) const -{ - return findDamageFX(TheNameKeyGenerator->nameToKey(name)); -} - -//------------------------------------------------------------------------------------------------- -const DamageFX *DamageFXStore::findDamageFX(const char* name) const -{ - return findDamageFX(TheNameKeyGenerator->nameToKey(name)); -} - -//------------------------------------------------------------------------------------------------- -void DamageFXStore::init() -{ -} - -//------------------------------------------------------------------------------------------------- -void DamageFXStore::reset() -{ -} - -//------------------------------------------------------------------------------------------------- -void DamageFXStore::update() -{ -} - -//------------------------------------------------------------------------------------------------- -/*static */ void DamageFXStore::parseDamageFXDefinition(INI* ini) -{ - - const char *c = ini->getNextToken(); - NameKeyType key = TheNameKeyGenerator->nameToKey(c); - DamageFX& dfx = TheDamageFXStore->m_dfxmap[key]; - dfx.clear(); - ini->initFromINI(&dfx, dfx.getFieldParse()); -} diff --git a/Generals/Code/GameEngine/Source/Common/Dict.cpp b/Generals/Code/GameEngine/Source/Common/Dict.cpp deleted file mode 100644 index 21b54df2ea7..00000000000 --- a/Generals/Code/GameEngine/Source/Common/Dict.cpp +++ /dev/null @@ -1,549 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Dict.cpp -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: Dict.cpp -// -// Created: Steven Johnson, November 2001 -// -// Desc: General-purpose dictionary class -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Dict.h" -#include "Common/GameMemory.h" - -// ----------------------------------------------------- -void Dict::DictPair::copyFrom(DictPair* that) -{ - Dict::DataType curType = this->getType(); - Dict::DataType newType = that->getType(); - if (curType != newType) - { - clear(); - } - - switch(newType) - { - case DICT_BOOL: - case DICT_INT: - case DICT_REAL: - *this = *that; - break; - case DICT_ASCIISTRING: - this->m_key = that->m_key; - *this->asAsciiString() = *that->asAsciiString(); - break; - case DICT_UNICODESTRING: - this->m_key = that->m_key; - *this->asUnicodeString() = *that->asUnicodeString(); - break; - } -} - -// ----------------------------------------------------- -void Dict::DictPair::clear() -{ - switch (getType()) - { - case DICT_BOOL: - case DICT_INT: - case DICT_REAL: - m_value = nullptr; - break; - case DICT_ASCIISTRING: - asAsciiString()->clear(); - break; - case DICT_UNICODESTRING: - asUnicodeString()->clear(); - break; - } -} - -// ----------------------------------------------------- -void Dict::DictPair::setNameAndType(NameKeyType key, Dict::DataType type) -{ - Dict::DataType curType = getType(); - if (curType != type) - { - clear(); - } - m_key = createKey(key, type); -} - -// ----------------------------------------------------- -#ifdef RTS_DEBUG -void Dict::validate() const -{ - if (!m_data) return; - DEBUG_ASSERTCRASH(m_data->m_refCount > 0, ("m_refCount is zero")); - DEBUG_ASSERTCRASH(m_data->m_refCount < 32000, ("m_refCount is suspiciously large")); - DEBUG_ASSERTCRASH(m_data->m_numPairsAllocated > 0, ("m_numPairsAllocated is zero")); - DEBUG_ASSERTCRASH(m_data->m_numPairsUsed >= 0, ("m_numPairsUsed is neg")); - DEBUG_ASSERTCRASH(m_data->m_numPairsAllocated >= m_data->m_numPairsUsed, ("m_numPairsAllocated too small")); - DEBUG_ASSERTCRASH(m_data->m_numPairsAllocated < 1024, ("m_numPairsAllocated suspiciously large")); -} -#endif - -// ----------------------------------------------------- -Dict::DictPair* Dict::findPairByKey(NameKeyType key) const -{ - DEBUG_ASSERTCRASH(key != NAMEKEY_INVALID, ("invalid namekey!")); - DEBUG_ASSERTCRASH((UnsignedInt)key < (1L<<23), ("namekey too large!")); - if (!m_data) - return nullptr; - DictPair* base = m_data->peek(); - Int minIdx = 0; - Int maxIdx = m_data->m_numPairsUsed; - while (minIdx < maxIdx) - { - Int midIdx = (((minIdx + maxIdx) - 1) >> 1); - DictPair* mid = base + midIdx; - NameKeyType midKey = mid->getName(); - if (key > midKey) - minIdx = midIdx + 1; - else if (key < midKey) - maxIdx = midIdx; - else - return mid; - } - - return nullptr; -} - -// ----------------------------------------------------- -Dict::DictPair *Dict::ensureUnique(int numPairsNeeded, Bool preserveData, DictPair *pairToTranslate) -{ - if (m_data && - m_data->m_refCount == 1 && - m_data->m_numPairsAllocated >= numPairsNeeded) - { - // no buffer manhandling is needed (it's already large enough, and unique to us) - return pairToTranslate; - } - - Dict::DictPairData* newData = nullptr; - if (numPairsNeeded > 0) - { - DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != nullptr, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.")); - DEBUG_ASSERTCRASH(numPairsNeeded <= MAX_LEN, ("Dict::ensureUnique exceeds max pairs length %d with requested length %d", MAX_LEN, numPairsNeeded)); - int minBytes = sizeof(Dict::DictPairData) + numPairsNeeded*sizeof(Dict::DictPair); - int actualBytes = TheDynamicMemoryAllocator->getActualAllocationSize(minBytes); - // note: be certain to alloc with zero; we'll take advantage of the fact that all-zero - // is a bit-pattern that happens to init all our pairs to legal values: - // type BOOL, key INVALID, value FALSE. - newData = (Dict::DictPairData*)TheDynamicMemoryAllocator->allocateBytes(actualBytes, "Dict::ensureUnique"); - newData->m_refCount = 1; - newData->m_numPairsAllocated = (actualBytes - sizeof(Dict::DictPairData))/sizeof(Dict::DictPair); - newData->m_numPairsUsed = 0; - - if (preserveData && m_data) - { - Dict::DictPair* src = m_data->peek(); - Dict::DictPair* dst = newData->peek(); - for (Int i = 0; i < m_data->m_numPairsUsed; ++i, ++src, ++dst) - dst->copyFrom(src); - newData->m_numPairsUsed = m_data->m_numPairsUsed; - } - } - - Int delta = 0; - if (pairToTranslate && m_data) - delta = pairToTranslate - m_data->peek(); - - releaseData(); - m_data = newData; - - if (pairToTranslate && m_data) - pairToTranslate = m_data->peek() + delta; - - return pairToTranslate; -} - - -// ----------------------------------------------------- -void Dict::clear() -{ - releaseData(); - m_data = nullptr; -} - -// ----------------------------------------------------- -void Dict::releaseData() -{ - if (m_data) - { - if (--m_data->m_refCount == 0) - { - Dict::DictPair* src = m_data->peek(); - for (Int i = 0; i < m_data->m_numPairsUsed; ++i, ++src) - src->clear(); - TheDynamicMemoryAllocator->freeBytes(m_data); - } - m_data = nullptr; - } -} - -// ----------------------------------------------------- -Dict::Dict(Int numPairsToPreAllocate) : m_data(nullptr) -{ - - /* - This class plays some skanky games, in the name of memory and code - efficiency; it assumes all the data types will fit into a pointer. - This is currently true, but if that assumption ever changes, all hell - will break loose. So we do a quick check to assure this... - */ - DEBUG_ASSERTCRASH(sizeof(Bool) <= sizeof(void*) && - sizeof(Int) <= sizeof(void*) && - sizeof(Real) <= sizeof(void*) && - sizeof(AsciiString) <= sizeof(void*) && - sizeof(UnicodeString) <= sizeof(void*), ("oops, this code needs attention")); - - if (numPairsToPreAllocate) - ensureUnique(numPairsToPreAllocate, false, nullptr); // will throw on error -} - -// ----------------------------------------------------- -Dict& Dict::operator=(const Dict& src) -{ - validate(); - if (&src != this) - { - releaseData(); - m_data = src.m_data; - if (m_data) - ++m_data->m_refCount; - } - validate(); - return *this; -} - -// ----------------------------------------------------- -Dict::DataType Dict::getType(NameKeyType key) const -{ - validate(); - DictPair* pair = findPairByKey(key); - if (pair) - return pair->getType(); - return DICT_NONE; -} - -// ----------------------------------------------------- -Bool Dict::getBool(NameKeyType key, Bool *exists/*=nullptr*/) const -{ - validate(); - DictPair* pair = findPairByKey(key); - if (pair && pair->getType() == DICT_BOOL) - { - if (exists) *exists = true; - return *pair->asBool(); - } - DEBUG_ASSERTCRASH(exists != nullptr, ("dict key missing, or of wrong type")); // only assert if they didn't check result - if (exists) *exists = false; - return false; -} - -// ----------------------------------------------------- -Int Dict::getInt(NameKeyType key, Bool *exists/*=nullptr*/) const -{ - validate(); - DictPair* pair = findPairByKey(key); - if (pair && pair->getType() == DICT_INT) - { - if (exists) *exists = true; - return *pair->asInt(); - } - DEBUG_ASSERTCRASH(exists != nullptr,("dict key missing, or of wrong type")); // only assert if they didn't check result - if (exists) *exists = false; - return 0; -} - -// ----------------------------------------------------- -Real Dict::getReal(NameKeyType key, Bool *exists/*=nullptr*/) const -{ - validate(); - DictPair* pair = findPairByKey(key); - if (pair && pair->getType() == DICT_REAL) - { - if (exists) *exists = true; - return *pair->asReal(); - } - DEBUG_ASSERTCRASH(exists != nullptr,("dict key missing, or of wrong type")); // only assert if they didn't check result - if (exists) *exists = false; - return 0.0f; -} - -// ----------------------------------------------------- -AsciiString Dict::getAsciiString(NameKeyType key, Bool *exists/*=nullptr*/) const -{ - validate(); - DictPair* pair = findPairByKey(key); - if (pair && pair->getType() == DICT_ASCIISTRING) - { - if (exists) *exists = true; - return *pair->asAsciiString(); - } - DEBUG_ASSERTCRASH(exists != nullptr,("dict key missing, or of wrong type")); // only assert if they didn't check result - if (exists) *exists = false; - return AsciiString::TheEmptyString; -} - -// ----------------------------------------------------- -UnicodeString Dict::getUnicodeString(NameKeyType key, Bool *exists/*=nullptr*/) const -{ - validate(); - DictPair* pair = findPairByKey(key); - if (pair && pair->getType() == DICT_UNICODESTRING) - { - if (exists) *exists = true; - return *pair->asUnicodeString(); - } - DEBUG_ASSERTCRASH(exists != nullptr,("dict key missing, or of wrong type")); // only assert if they didn't check result - if (exists) *exists = false; - return UnicodeString::TheEmptyString; -} - -// ----------------------------------------------------- -Bool Dict::getNthBool(Int n) const -{ - validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); - if (m_data) - { - DictPair* pair = &m_data->peek()[n]; - if (pair && pair->getType() == DICT_BOOL) - return *pair->asBool(); - } - DEBUG_CRASH(("dict key missing, or of wrong type")); - return false; -} - -// ----------------------------------------------------- -Int Dict::getNthInt(Int n) const -{ - validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); - if (m_data) - { - DictPair* pair = &m_data->peek()[n]; - if (pair && pair->getType() == DICT_INT) - return *pair->asInt(); - } - DEBUG_CRASH(("dict key missing, or of wrong type")); - return 0; -} - -// ----------------------------------------------------- -Real Dict::getNthReal(Int n) const -{ - validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); - if (m_data) - { - DictPair* pair = &m_data->peek()[n]; - if (pair && pair->getType() == DICT_REAL) - return *pair->asReal(); - } - DEBUG_CRASH(("dict key missing, or of wrong type")); - return 0.0f; -} - -// ----------------------------------------------------- -AsciiString Dict::getNthAsciiString(Int n) const -{ - validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); - if (m_data) - { - DictPair* pair = &m_data->peek()[n]; - if (pair && pair->getType() == DICT_ASCIISTRING) - return *pair->asAsciiString(); - } - DEBUG_CRASH(("dict key missing, or of wrong type")); - return AsciiString::TheEmptyString; -} - -// ----------------------------------------------------- -UnicodeString Dict::getNthUnicodeString(Int n) const -{ - validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); - if (m_data) - { - DictPair* pair = &m_data->peek()[n]; - if (pair && pair->getType() == DICT_UNICODESTRING) - return *pair->asUnicodeString(); - } - DEBUG_CRASH(("dict key missing, or of wrong type")); - return UnicodeString::TheEmptyString; -} - -// ----------------------------------------------------- -Dict::DictPair *Dict::setPrep(NameKeyType key, Dict::DataType type) -{ - DictPair* pair = findPairByKey(key); - Int pairsNeeded = getPairCount(); - if (!pair) - ++pairsNeeded; - pair = ensureUnique(pairsNeeded, true, pair); - if (!pair) - { - pair = &m_data->peek()[m_data->m_numPairsUsed++]; - } - pair->setNameAndType(key, type); - DEBUG_ASSERTCRASH(pair, ("pair must not be null here")); - return pair; -} - -// ----------------------------------------------------- -void Dict::sortPairs() -{ - if (!m_data) - return; - - // yer basic shellsort. - for (Int gap = m_data->m_numPairsUsed >> 1; gap > 0; gap >>= 1) - { - for (Int i = gap; i < m_data->m_numPairsUsed; i++) - { - for (Int j = i - gap; j >= 0; j -= gap) - { - DictPair* a = m_data->peek() + j; - DictPair* b = m_data->peek() + j + gap; - if (a->getName() > b->getName()) - { - DictPair tmp = *a; - *a = *b; - *b = tmp; - } - else - { - break; - } - } - } - } -} - -// ----------------------------------------------------- -void Dict::setBool(NameKeyType key, Bool value) -{ - validate(); - DictPair* pair = setPrep(key, DICT_BOOL); - *pair->asBool() = value; - sortPairs(); - validate(); -} - -// ----------------------------------------------------- -void Dict::setInt(NameKeyType key, Int value) -{ - validate(); - DictPair* pair = setPrep(key, DICT_INT); - *pair->asInt() = value; - sortPairs(); - validate(); -} - -// ----------------------------------------------------- -void Dict::setReal(NameKeyType key, Real value) -{ - validate(); - DictPair* pair = setPrep(key, DICT_REAL); - *pair->asReal() = value; - sortPairs(); - validate(); -} - -// ----------------------------------------------------- -void Dict::setAsciiString(NameKeyType key, const AsciiString& value) -{ - validate(); - DictPair* pair = setPrep(key, DICT_ASCIISTRING); - *pair->asAsciiString() = value; - sortPairs(); - validate(); -} - -// ----------------------------------------------------- -void Dict::setUnicodeString(NameKeyType key, const UnicodeString& value) -{ - validate(); - DictPair* pair = setPrep(key, DICT_UNICODESTRING); - *pair->asUnicodeString() = value; - sortPairs(); - validate(); -} - -// ----------------------------------------------------- -Bool Dict::remove(NameKeyType key) -{ - validate(); - DictPair* pair = findPairByKey(key); - if (pair) - { - pair = ensureUnique(m_data->m_numPairsUsed, true, pair); - pair->setNameAndType((NameKeyType)0x7fffffff, DICT_BOOL); - sortPairs(); - --m_data->m_numPairsUsed; - validate(); - return true; - } - DEBUG_CRASH(("dict key missing in remove")); - return false; -} - -// ----------------------------------------------------- -void Dict::copyPairFrom(const Dict& that, NameKeyType key) -{ - this->validate(); - DictPair* thatPair = that.findPairByKey(key); - if (thatPair) - { - DictPair* thisPair = this->setPrep(key, thatPair->getType()); - thisPair->copyFrom(thatPair); - this->sortPairs(); - } - else - { - if (this->findPairByKey(key)) - this->remove(key); - } - this->validate(); -} diff --git a/Generals/Code/GameEngine/Source/Common/DiscreteCircle.cpp b/Generals/Code/GameEngine/Source/Common/DiscreteCircle.cpp deleted file mode 100644 index cfd9a1ca624..00000000000 --- a/Generals/Code/GameEngine/Source/Common/DiscreteCircle.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DiscreteCircle.cpp //////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// EA Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: DiscreteCircle.cpp -// -// Created: John McDonald, September 2002 -// -// Desc: ??? -// -//----------------------------------------------------------------------------- - -#include "PreRTS.h" -#include "Common/DiscreteCircle.h" - -//------------------------------------------------------------------------------------------------- -DiscreteCircle::DiscreteCircle(Int xCenter, Int yCenter, Int radius) -{ - m_yPos = yCenter; - m_yPosDoubled = (yCenter << 1); - m_edges.reserve(radius << 1); // largest that it should ever be. - - generateEdgePairs(xCenter, yCenter, radius); - removeDuplicates(); -} - -//------------------------------------------------------------------------------------------------- -void DiscreteCircle::drawCircle(ScanlineDrawFunc functionToDrawWith, void *parmToPass) -{ - for (VecHorzLine::const_iterator it = m_edges.begin(); it != m_edges.end(); ++it) { - (functionToDrawWith)(it->xStart, it->xEnd, it->yPos, parmToPass); - if (it->yPos != m_yPos) { - (functionToDrawWith)(it->xStart, it->xEnd, m_yPosDoubled - it->yPos, parmToPass); - } - } -} - -//------------------------------------------------------------------------------------------------- -void DiscreteCircle::generateEdgePairs(Int xCenter, Int yCenter, Int radius) -{ - // Uses Bresenham to generate points. - Int x = 0; - Int y = radius; - Int d = (1 - radius) << 1; - - while (y >= 0) { - HorzLine hl; - hl.xStart = xCenter - x; - hl.xEnd = xCenter + x; - hl.yPos = yCenter + y; - m_edges.push_back(hl); - - if (d + y > 0) { - --y; - d -= ((y << 1) - 1); - } - - if (x > d) { - ++x; - d += ((x << 1) + 1); - } - } -} - -//------------------------------------------------------------------------------------------------- -void DiscreteCircle::removeDuplicates() -{ - VecHorzLineIt it, nextIt; - for ( it = m_edges.begin(); it != m_edges.end(); /* empty */) { - nextIt = it; - ++nextIt; - if (nextIt == m_edges.end()) { - break; - } - - if (it->yPos == nextIt->yPos) { - it = m_edges.erase(it); - } else { - ++it; - } - } -} diff --git a/Generals/Code/GameEngine/Source/Common/Language.cpp b/Generals/Code/GameEngine/Source/Common/Language.cpp deleted file mode 100644 index 7548a7982d7..00000000000 --- a/Generals/Code/GameEngine/Source/Common/Language.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Language.cpp ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: Language.cpp -// -// Created: Colin Day, June 2001 -// -// Desc: For dealing with multiple languages -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Language.h" - -// DEFINES //////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// PRIVATE TYPES ////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -LanguageID OurLanguage = LANGUAGE_ID_US; - -// PRIVATE DATA /////////////////////////////////////////////////////////////// - -// PUBLIC DATA //////////////////////////////////////////////////////////////// - -// PRIVATE PROTOTYPES ///////////////////////////////////////////////////////// - -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// - -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// - diff --git a/Generals/Code/GameEngine/Source/Common/MiniLog.cpp b/Generals/Code/GameEngine/Source/Common/MiniLog.cpp deleted file mode 100644 index cb1fed45d37..00000000000 --- a/Generals/Code/GameEngine/Source/Common/MiniLog.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: MiniLog.cpp /////////////////////////////////////////////////////////// -// Alternative logging -// Author: Matthew D. Campbell, January 2003 -//////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/MiniLog.h" - -#ifdef DEBUG_LOGGING - -LogClass::LogClass(const char *fname) -{ - char buffer[ _MAX_PATH ]; - GetModuleFileName( nullptr, buffer, sizeof( buffer ) ); - if (char *pEnd = strrchr(buffer, '\\')) - { - *pEnd = 0; - } - // TheSuperHackers @fix Caball009 03/06/2025 Don't use AsciiString here anymore because its memory allocator may not have been initialized yet. - const std::string fullPath = std::string(buffer) + "\\" + fname; - m_fp = fopen(fullPath.c_str(), "wt"); -} - -LogClass::~LogClass() -{ - if (m_fp) - { - fclose(m_fp); - } -} - -void LogClass::log(const char *fmt, ...) -{ - if (!m_fp) - return; - static char buf[1024]; - static Int lastFrame = 0; - static Int lastIndex = 0; - if (lastFrame != TheGameLogic->getFrame()) - { - lastFrame = TheGameLogic->getFrame(); - lastIndex = 0; - } - - va_list va; - va_start( va, fmt ); - vsnprintf(buf, 1024, fmt, va ); - va_end( va ); - - char *tmp = buf; - while (tmp && *tmp) - { - if (*tmp == '\r' || *tmp == '\n') - { - *tmp = ' '; - } - ++tmp; - } - - fprintf(m_fp, "%d:%d %s\n", lastFrame, lastIndex++, buf); - fflush(m_fp); -} - -#endif // DEBUG_LOGGING diff --git a/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp b/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp deleted file mode 100644 index 74072ae5a1d..00000000000 --- a/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp +++ /dev/null @@ -1,663 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PerfTimer.cpp /////////////////////////////////////////////////////////////////////////// -// Author: -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/PerfTimer.h" - -#include "Common/GlobalData.h" -#include "GameClient/DebugDisplay.h" -#include "GameClient/Display.h" -#include "GameClient/GraphDraw.h" - -__forceinline void ProfileGetTime(__int64 &t) -{ - t = _rdtsc(); -} - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -#if defined(PERF_TIMERS) || defined(DUMP_PERF_STATS) - -//------------------------------------------------------------------------------------------------- -static Int64 s_ticksPerSec = 0; -static double s_ticksPerMSec = 0; -static double s_ticksPerUSec = 0; - -//------------------------------------------------------------------------------------------------- -void GetPrecisionTimerTicksPerSec(Int64* t) -{ - *t = s_ticksPerSec; -} - -//Kris: Plugged in Martin's code to optimize timer setup. -#define HOFFESOMMER_REPLACEMENT_CODE - -//------------------------------------------------------------------------------------------------- -void InitPrecisionTimer() -{ -#ifdef HOFFESOMMER_REPLACEMENT_CODE - - // measure clock cycles 3 times for 20 msec each - // then take the 2 counts that are closest, average - _int64 n[ 3 ]; - for( int k = 0; k < 3; k++ ) - { - // wait for end of current tick - unsigned timeEnd = timeGetTime() + 2; - while( timeGetTime() < timeEnd ); //do nothing - - // get cycles - _int64 start, startQPC, endQPC; - QueryPerformanceCounter( (LARGE_INTEGER *)&startQPC ); - ProfileGetTime( start ); - timeEnd += 20; - while( timeGetTime() < timeEnd ); //do nothing - ProfileGetTime( n[ k ] ); - n[ k ] -= start; - - // convert to 1 second - if( QueryPerformanceCounter( (LARGE_INTEGER*)&endQPC ) ) - { - QueryPerformanceFrequency( (LARGE_INTEGER*)&s_ticksPerSec ); - n[ k ] = ( n[ k ] * s_ticksPerSec ) / ( endQPC - startQPC ); - } - else - { - n[ k ] = ( n[ k ] * 1000 ) / 20; - } - } - - // find two closest values - _int64 d01 = n[ 1 ] - n[ 0 ]; - _int64 d02 = n[ 2 ] - n[ 0 ]; - _int64 d12 = n[ 2 ] - n[ 1 ]; - - if( d01 < 0 ) - { - d01 = -d01; - } - if( d02 < 0 ) - { - d02 = -d02; - } - if( d12 < 0 ) - { - d12 = -d12; - } - - _int64 avg; - if( d01 < d02 ) - { - avg = d01 < d12 ? n[ 0 ] + n[ 1 ] : n[ 1 ] + n[ 2 ]; - } - else - { - avg = d02 < d12 ? n[ 0 ] + n[ 2 ] : n[ 1 ] + n[ 2 ]; - } - - //s_ticksPerMSec = 1.0 * TotalTicks / totalTime; - s_ticksPerMSec = avg / 2000.0f; - s_ticksPerSec = s_ticksPerMSec * 1000.0f; - s_ticksPerUSec = s_ticksPerSec / 1000000.0f; - - -#else - - //Kris: With total disrespect, this code costs 5 real seconds of init time - //whenever we fire up the game. - - #ifdef USE_QPF - QueryPerformanceFrequency((LARGE_INTEGER*)&s_ticksPerSec); - #else - // Init the precision timers - Int64 totalTime = 0; - Int64 TotalTicks = 0; - static int TESTS = 5; - - for (int i = 0; i < TESTS; ++i) - { - int TimeStart; - int TimeStop; - Int64 StartTicks; - Int64 EndTicks; - - TimeStart = timeGetTime(); - GetPrecisionTimer(&StartTicks); - for(;;) - { - TimeStop = timeGetTime(); - if ((TimeStop - TimeStart) > 1000) - { - GetPrecisionTimer(&EndTicks); - break; - } - } - - TotalTicks += (EndTicks - StartTicks); - - totalTime += (TimeStop - TimeStart); - } - - s_ticksPerMSec = 1.0 * TotalTicks / totalTime; - s_ticksPerSec = s_ticksPerMSec * 1000.0f; - #endif - s_ticksPerMSec = s_ticksPerSec / 1000.0f; - s_ticksPerUSec = s_ticksPerSec / 1000000.0f; - - #ifdef NOT_IN_USE - Int64 bogus[8]; - GetPrecisionTimer(&start); - for (Int ii = 0; ii < ITERS; ++ii) - { - GetPrecisionTimer(&bogus[0]); - GetPrecisionTimer(&bogus[1]); - GetPrecisionTimer(&bogus[2]); - GetPrecisionTimer(&bogus[3]); - GetPrecisionTimer(&bogus[4]); - GetPrecisionTimer(&bogus[5]); - GetPrecisionTimer(&bogus[6]); - GetPrecisionTimer(&bogus[7]); - } - TheTicksToGetTicks = (bogus[7] - start) / (ITERS*8); - DEBUG_LOG(("TheTicksToGetTicks is %d (%f usec)",(int)TheTicksToGetTicks,TheTicksToGetTicks/s_ticksPerUSec)); - #endif - -#endif - -} -#endif // defined(PERF_TIMERS) || defined(DUMP_PERF_STATS) - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -#ifdef PERF_TIMERS - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -/*static*/ Bool AutoPerfGatherIgnore::s_ignoring = false; - -//------------------------------------------------------------------------------------------------- -typedef std::vector< std::pair< AsciiString, AsciiString >/**/> StringPairVec; - -//------------------------------------------------------------------------------------------------- -// PerfMetrics class. Basically, request a handle with your name and it will return. We use a vector -// of pairs of asciistrings for this - -class PerfMetricsOutput -{ -private: - StringPairVec m_outputStats; - -public: - - AsciiString& getStatsString(const AsciiString& id) - { - for (int i = 0; i < m_outputStats.size(); ++i) - { - if (m_outputStats[i].first == id) - return m_outputStats[i].second; - } - std::pair newPair; - newPair.first = id; - m_outputStats.push_back(newPair); - return m_outputStats.back().second; - } - - void clearStatsString(const AsciiString& id) - { - for (int i = 0; i < m_outputStats.size(); ++i) - { - if (m_outputStats[i].first == id) - { - m_outputStats.erase(&m_outputStats[i]); - return; - } - } - } - - StringPairVec& friend_getAllStatsStrings() { return m_outputStats; } -}; - -//------------------------------------------------------------------------------------------------- -static PerfMetricsOutput s_output; -static FILE* s_perfStatsFile = nullptr; -static Int s_perfDumpOptions = 0; -static UnsignedInt s_lastDumpedFrame = 0; -static char s_buf[256] = ""; - -PerfGather* PerfGather::m_active[MAX_ACTIVE_STACK] = { 0 }; -PerfGather** PerfGather::m_activeHead = &PerfGather::m_active[0]; -Int64 PerfGather::s_stopStartOverhead = -1; - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -/*static*/ PerfGather*& PerfGather::getHeadPtr() -{ - // funky technique for order-of-init problem. trust me. (srj) - static PerfGather* s_head = nullptr; - return s_head; -} - -//------------------------------------------------------------------------------------------------- -void PerfGather::addToList() -{ - PerfGather*& head = getHeadPtr(); - - this->m_next = head; - if (head) - head->m_prev = this; - head = this; -} - -//------------------------------------------------------------------------------------------------- -void PerfGather::removeFromList() -{ - PerfGather*& head = getHeadPtr(); - - if (this->m_next) - this->m_next->m_prev = this->m_prev; - - if (this->m_prev) - this->m_prev->m_next = this->m_next; - else - head = this->m_next; - - this->m_prev = 0; - this->m_next = 0; -} - -//------------------------------------------------------------------------------------------------- -PerfGather::PerfGather(const char *identifier) : - m_identifier(identifier), - m_startTime(0), - m_runningTimeGross(0), - m_runningTimeNet(0), - m_callCount(0), - m_next(0), - m_prev(0) -{ - m_ignore = FALSE; - DEBUG_ASSERTCRASH(strchr(m_identifier, ',') == nullptr, ("PerfGather names must not contain commas")); - addToList(); -} - -//------------------------------------------------------------------------------------------------- -PerfGather::~PerfGather() -{ - removeFromList(); -} - -//------------------------------------------------------------------------------------------------- -void PerfGather::reset() -{ - m_startTime = 0; - m_runningTimeGross = 0; - m_runningTimeNet = 0; - m_callCount = 0; -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void PerfGather::resetAll() -{ - for (PerfGather* head = getHeadPtr(); head != nullptr; head = head->m_next) - { - head->reset(); - } -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void PerfGather::initPerfDump(const char* fname, Int options) -{ - PerfGather::termPerfDump(); - - strlcpy(s_buf, fname, ARRAY_SIZE(s_buf); - - char tmp[256]; - static_assert(ARRAY_SIZE(tmp) >= ARRAY_SIZE(s_buf), "Incorrect array size"); - strcpy(tmp, s_buf); - strlcat(tmp, ".csv", ARRAY_SIZE(tmp)); - - s_perfStatsFile = fopen(tmp, "w"); - s_perfDumpOptions = options; - - if (s_perfStatsFile == nullptr) - { - DEBUG_CRASH(("could not open/create perf file %s -- is it open in another app?",s_buf)); - return; - } - - if (s_stopStartOverhead == -1) - { - const Int ITERS = 100000; - Int64 start, end; - PerfGather pf("timer"); - GetPrecisionTimer(&start); - for (Int ii = 0; ii < ITERS; ++ii) - { - pf.startTimer(); pf.stopTimer(); - pf.startTimer(); pf.stopTimer(); - pf.startTimer(); pf.stopTimer(); - pf.startTimer(); pf.stopTimer(); - pf.startTimer(); pf.stopTimer(); - pf.startTimer(); pf.stopTimer(); - pf.startTimer(); pf.stopTimer(); - pf.startTimer(); pf.stopTimer(); - } - GetPrecisionTimer(&end); - s_stopStartOverhead = (end - start) / (ITERS*8); - DEBUG_LOG(("s_stopStartOverhead is %d (%f usec)",(int)s_stopStartOverhead,s_stopStartOverhead/s_ticksPerUSec)); - } -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void PerfGather::dumpAll(UnsignedInt frame) -{ - if (frame < s_lastDumpedFrame) - { - // must have reset or started a new game. - termPerfDump(); - initPerfDump(s_buf, s_perfDumpOptions); - } - - if (!s_perfStatsFile) - { - DEBUG_CRASH(("not inited")); - return; - } - - if (frame >= 1 && frame <= 30) - { - // always skip the first second or so, since it loads everything and skews the results horribly - } - else - { - if (s_lastDumpedFrame == 0) - { - fprintf(s_perfStatsFile, "Frame"); - if (s_perfDumpOptions & PERF_GROSSTIME) - { - for (const PerfGather* head = getHeadPtr(); head != nullptr; head = head->m_next) - { - fprintf(s_perfStatsFile, ",Gross:%s", head->m_identifier); - } - } - if (s_perfDumpOptions & PERF_NETTIME) - { - for (const PerfGather* head = getHeadPtr(); head != nullptr; head = head->m_next) - { - fprintf(s_perfStatsFile, ",Net:%s", head->m_identifier); - } - } - if (s_perfDumpOptions & PERF_CALLCOUNT) - { - for (const PerfGather* head = getHeadPtr(); head != nullptr; head = head->m_next) - { - fprintf(s_perfStatsFile, ",Count:%s", head->m_identifier); - } - } - fprintf(s_perfStatsFile, "\n"); - } - - // a strange value so we can find it in the dump, if necessary. - // there's nothing magic about this value, it's purely determined from sample dumps... -// const Real CLIP_BIG_SPIKES = 1e10f; - const Real CLIP_BIG_SPIKES = 100000.0f; - - // make this a nonnumeric thing so Excel won't try to graph it... - fprintf(s_perfStatsFile, "Frame%08d", frame); - if (s_perfDumpOptions & PERF_GROSSTIME) - { - for (const PerfGather* head = getHeadPtr(); head != nullptr; head = head->m_next) - { - double t = head->m_runningTimeGross; - t /= s_ticksPerUSec; - if (t > CLIP_BIG_SPIKES) - t = CLIP_BIG_SPIKES; - fprintf(s_perfStatsFile, ",%f", t); - } - } - if (s_perfDumpOptions & PERF_NETTIME) - { - for (const PerfGather* head = getHeadPtr(); head != nullptr; head = head->m_next) - { - double t = head->m_runningTimeNet; - t /= s_ticksPerUSec; - if (t > CLIP_BIG_SPIKES) - t = CLIP_BIG_SPIKES; - fprintf(s_perfStatsFile, ",%f", t); - } - } - if (s_perfDumpOptions & PERF_CALLCOUNT) - { - for (const PerfGather* head = getHeadPtr(); head != nullptr; head = head->m_next) - { - fprintf(s_perfStatsFile, ",%d", head->m_callCount); - } - } - - fprintf(s_perfStatsFile, "\n"); - fflush(s_perfStatsFile); - - s_lastDumpedFrame = frame; - - } - -} - -//------------------------------------------------------------------------------------------------- -// This function will queue up stuff to draw on the next frame. We also need to adjust the -// perf timers to not include time spent paused by the script engine. -/*static*/ void PerfGather::displayGraph(UnsignedInt frame) -{ - if (!TheGraphDraw) { - return; - } - - if (frame >= 1 && frame <= 30) - { - // always skip the first second or so, since it loads everything and skews the results horribly - } - else - { - const Real CLIP_BIG_SPIKES = 100000.0f; - - if (s_perfDumpOptions & PERF_GROSSTIME) - { - for (const PerfGather* head = getHeadPtr(); head != nullptr; head = head->m_next) - { - Real t = head->m_runningTimeGross; - t /= s_ticksPerUSec; - if (t > CLIP_BIG_SPIKES) - t = CLIP_BIG_SPIKES; - - TheGraphDraw->addEntry(head->m_identifier, REAL_TO_INT(t)); - } - } - if (s_perfDumpOptions & PERF_NETTIME) - { - for (const PerfGather* head = getHeadPtr(); head != nullptr; head = head->m_next) - { - Real t = head->m_runningTimeNet; - t /= s_ticksPerUSec; - if (t > CLIP_BIG_SPIKES) - t = CLIP_BIG_SPIKES; - - TheGraphDraw->addEntry(head->m_identifier, REAL_TO_INT(t)); - } - } - if (s_perfDumpOptions & PERF_CALLCOUNT) - { - for (const PerfGather* head = getHeadPtr(); head != nullptr; head = head->m_next) - { - Real t = head->m_callCount; - TheGraphDraw->addEntry(head->m_identifier, REAL_TO_INT(t)); - - } - } - } -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void PerfGather::termPerfDump() -{ - if (s_perfStatsFile) - { - fflush(s_perfStatsFile); - fclose(s_perfStatsFile); - s_perfStatsFile = nullptr; - } - s_lastDumpedFrame = 0; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -PerfTimer::PerfTimer( const char *identifier, Bool crashWithInfo, Int startFrame, Int endFrame) : - m_identifier(identifier), - m_crashWithInfo(crashWithInfo), - m_startFrame(startFrame), - m_endFrame(endFrame), - m_callCount(0), - m_runningTime(0), - m_outputInfo(true), - m_lastFrame(-1) -{ -} - -//------------------------------------------------------------------------------------------------- -PerfTimer::~PerfTimer( ) -{ - if (m_endFrame == -1) { - outputInfo(); - } -} - -//------------------------------------------------------------------------------------------------- -void PerfTimer::outputInfo() -{ - if (TheGlobalData->m_showMetrics) { - return; - } - - if (m_outputInfo && !TheGlobalData->m_showMetrics) { - m_outputInfo = false; - } else { - return; - } - - if (!s_ticksPerSec) { - // DEBUG_CRASH here - return; - } - -#if defined(RTS_DEBUG) - double totalTimeInMS = 1000.0 * m_runningTime / s_ticksPerSec; - double avgTimePerFrame = totalTimeInMS / (m_lastFrame - m_startFrame + 1); - double avgTimePerCall = totalTimeInMS / m_callCount; -#endif - - if (m_crashWithInfo) { - DEBUG_CRASH(("%s\n" - "Average Time (per call): %.4f ms\n" - "Average Time (per frame): %.4f ms\n" - "Average calls per frame: %.2f\n" - "Number of calls: %d\n" - "Max possible FPS: %.4f", - m_identifier, - avgTimePerCall, - avgTimePerFrame, - 1.0f * m_callCount / (m_lastFrame - m_startFrame + 1), - m_callCount, - 1000.0f / avgTimePerFrame)); - } else { - DEBUG_LOG(("%s\n" - "Average Time (per call): %.4f ms\n" - "Average Time (per frame): %.4f ms\n" - "Average calls per frame: %.2f\n" - "Number of calls: %d\n" - "Max possible FPS: %.4f", - m_identifier, - avgTimePerCall, - avgTimePerFrame, - 1.0f * m_callCount / (m_lastFrame - m_startFrame + 1), - m_callCount, - 1000.0f / avgTimePerFrame)); - } -} - -//------------------------------------------------------------------------------------------------- -void PerfTimer::showMetrics() -{ -#if defined(RTS_DEBUG) - double totalTimeInMS = 1000.0 * m_runningTime / s_ticksPerSec; - double avgTimePerFrame = totalTimeInMS / (m_lastFrame - m_startFrame + 1); - double avgTimePerCall = totalTimeInMS / m_callCount; -#endif - - // we want to work on the thing in the array, so just store a reference. - AsciiString &outputStats = s_output.getStatsString(m_identifier); - - outputStats.format("%s: %.2fms / call, %.2fms / frame \n", - m_identifier, - avgTimePerCall, - avgTimePerFrame); - m_callCount = 0; - m_runningTime = 0; - - UnsignedInt frm = (TheGameLogic ? TheGameLogic->getFrame() : m_startFrame); - m_startFrame = frm + 1; - m_endFrame = m_startFrame + PERFMETRICS_BETWEEN_METRICS; -} - -//-------------------------------------------------------------------------------StatMetricsDisplay -void StatMetricsDisplay( DebugDisplayInterface *dd, void *, FILE *fp ) -{ - dd->printf("Performance Metrics: \n"); - // no copies will take place because we are storing a reference to the thing - StringPairVec &stats = s_output.friend_getAllStatsStrings(); - - for (int i = 0; i < stats.size(); ++i) { - dd->printf("%s", stats[i].second.str()); - } -} - -#endif // PERF_TIMERS - diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Handicap.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Handicap.cpp deleted file mode 100644 index 85420402741..00000000000 --- a/Generals/Code/GameEngine/Source/Common/RTS/Handicap.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Handicap.cpp ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: Handicap.cpp -// -// Created: Steven Johnson, October 2001 -// -// Desc: @todo -// -//----------------------------------------------------------------------------- - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Handicap.h" -#include "Common/Player.h" -#include "Common/Dict.h" -#include "Common/ThingTemplate.h" - -//----------------------------------------------------------------------------- -Handicap::Handicap() -{ - init(); -} - -//----------------------------------------------------------------------------- -void Handicap::init() -{ - for (Int i = 0; i < HANDICAP_TYPE_COUNT; ++i) - for (Int j = 0; j < THING_TYPE_COUNT; ++j) - m_handicaps[i][j] = 1.0f; -} - -//----------------------------------------------------------------------------- -void Handicap::readFromDict(const Dict* d) -{ - // this isn't very efficient, but is only called at load times, - // so it probably doesn't really matter. - - const char* htNames[HANDICAP_TYPE_COUNT] = - { - "BUILDCOST", - "BUILDTIME", -// "FIREPOWER", -// "ARMOR", -// "GROUNDSPEED", -// "AIRSPEED", -// "INCOME" - }; - - const char* ttNames[THING_TYPE_COUNT] = - { - "GENERIC", - "BUILDINGS", - }; - -// no, you should NOT call init() here. -//init(); - - AsciiString c; - for (Int i = 0; i < HANDICAP_TYPE_COUNT; ++i) - { - for (Int j = 0; j < THING_TYPE_COUNT; ++j) - { - c.clear(); - c.set("HANDICAP_"); - c.concat(htNames[i]); - c.concat("_"); - c.concat(ttNames[j]); - NameKeyType k = TheNameKeyGenerator->nameToKey(c); - Bool exists; - Real r = d->getReal(k, &exists); - if (exists) - m_handicaps[i][j] = r; - } - } -} - -//----------------------------------------------------------------------------- -/*static*/ Handicap::ThingType Handicap::getBestThingType(const ThingTemplate *tmpl) -{ - /// if this ends up being too slow, cache the information in the object - if (tmpl->isKindOf(KINDOF_STRUCTURE)) - return BUILDINGS; - - return GENERIC; -} - -//----------------------------------------------------------------------------- -Real Handicap::getHandicap(HandicapType ht, const ThingTemplate *tmpl) const -{ - ThingType tt = getBestThingType(tmpl); - return m_handicaps[ht][tt]; -} diff --git a/Generals/Code/GameEngine/Source/Common/RTS/MissionStats.cpp b/Generals/Code/GameEngine/Source/Common/RTS/MissionStats.cpp deleted file mode 100644 index 16047cfefd2..00000000000 --- a/Generals/Code/GameEngine/Source/Common/RTS/MissionStats.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: MissionStats.cpp ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: MissionStats.cpp -// -// Created: Steven Johnson, October 2001 -// -// Desc: @todo -// -//----------------------------------------------------------------------------- - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/MissionStats.h" -#include "Common/Player.h" -#include "Common/Xfer.h" - -//----------------------------------------------------------------------------- -MissionStats::MissionStats() -{ - init(); -} - -//----------------------------------------------------------------------------- -void MissionStats::init() -{ - Int i; - - for (i = 0; i < MAX_PLAYER_COUNT; ++i) - { - m_unitsKilled[i] = 0; - m_buildingsKilled[i] = 0; - } - m_unitsLost = 0; - m_buildingsLost = 0; - //m_whoLastHurtMe = PLAYER_NONE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void MissionStats::crc( Xfer *xfer ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info; - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void MissionStats::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // units killed - xfer->xferUser( m_unitsKilled, sizeof( Int ) * MAX_PLAYER_COUNT ); - - // units lost - xfer->xferInt( &m_unitsLost ); - - // buildings killed - xfer->xferUser( m_buildingsKilled, sizeof( Int ) * MAX_PLAYER_COUNT ); - - // buildings lost - xfer->xferInt( &m_buildingsLost ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void MissionStats::loadPostProcess() -{ - -} diff --git a/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp b/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp deleted file mode 100644 index 3aa5b628db3..00000000000 --- a/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp +++ /dev/null @@ -1,484 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PlayerList.cpp ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: PlayerList.cpp -// -// Created: Steven Johnson, October 2001 -// -// Desc: @todo -// -//----------------------------------------------------------------------------- - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Errors.h" -#include "Common/DataChunk.h" -#include "Common/GameState.h" -#include "Common/GlobalData.h" -#include "Common/Player.h" -#include "Common/PlayerList.h" -#include "Common/PlayerTemplate.h" -#include "Common/Team.h" -#include "Common/WellKnownKeys.h" -#include "Common/Xfer.h" -#ifdef RTS_DEBUG -#include "GameLogic/Object.h" -#endif -#include "GameLogic/SidesList.h" -#include "GameNetwork/NetworkDefs.h" - - -//----------------------------------------------------------------------------- -/*extern*/ PlayerList *ThePlayerList = nullptr; - -//----------------------------------------------------------------------------- -PlayerList::PlayerList() : - m_local(nullptr), - m_playerCount(0) -{ - // we only allocate a few of these, so don't bother pooling 'em - for (Int i = 0; i < MAX_PLAYER_COUNT; i++) - m_players[ i ] = NEW Player( i ); - init(); -} - -//----------------------------------------------------------------------------- -PlayerList::~PlayerList() -{ - // the world is happier if we reinit things before destroying them, - // to avoid debug warnings - init(); - - for( Int i = 0; i < MAX_PLAYER_COUNT; ++i ) - delete m_players[ i ]; -} - -//----------------------------------------------------------------------------- -Player *PlayerList::getNthPlayer(Int i) -{ - if( i < 0 || i >= MAX_PLAYER_COUNT ) - { -// DEBUG_CRASH( ("Illegal player index") ); - return nullptr; - } - return m_players[i]; -} - -//----------------------------------------------------------------------------- -Player *PlayerList::findPlayerWithNameKey(NameKeyType key) -{ - for (Int i = 0; i < m_playerCount; i++) - { - if (m_players[i]->getPlayerNameKey() == key) - { - return m_players[i]; - } - } - return nullptr; -} - -//----------------------------------------------------------------------------- -void PlayerList::reset() -{ - // TheSuperHackers @bugfix xezon 20/03/2025 Delete the Player AI before purging the dependent teams in the factory. - for (int i = 0; i < MAX_PLAYER_COUNT; i++) - m_players[i]->deletePlayerAI(); - - TheTeamFactory->clear(); // cleans up energy, among other things - init(); -} - -//----------------------------------------------------------------------------- -void PlayerList::newGame() -{ - Int i; - - DEBUG_ASSERTCRASH(this != nullptr, ("null this")); - - reset(); - - // ok, now create the rest of players we need. - Bool setLocal = false; - for( i = 0; i < TheSidesList->getNumSides(); i++) - { - Dict *d = TheSidesList->getSideInfo(i)->getDict(); - AsciiString pname = d->getAsciiString(TheKey_playerName); - if (pname.isEmpty()) - continue; // it's neutral, which we've already done, so skip it. - - /// @todo The Player class should have a reset() method, instead of directly calling initFromDict() (MSB) - Player* p = m_players[m_playerCount++]; - p->initFromDict(d); - - // Multiplayer override - Bool exists; // throwaway, since we don't care if it exists - if (d->getBool(TheKey_multiplayerIsLocal, &exists)) - { - DEBUG_LOG(("Player %s is multiplayer local", pname.str())); - setLocalPlayer(p); - setLocal = true; - } - - if (!setLocal && !TheNetwork && d->getBool(TheKey_playerIsHuman)) - { - setLocalPlayer(p); - setLocal = true; - } - - // Set the build list. - p->setBuildList(TheSidesList->getSideInfo(i)->getBuildList()); - // Build list is attached to player now, so release it from the side info. - TheSidesList->getSideInfo(i)->releaseBuildList(); - } - - if (!setLocal) - { - DEBUG_ASSERTCRASH(TheNetwork, ("*** Map has no human player... picking first nonneutral player for control")); - for( i = 0; i < TheSidesList->getNumSides(); i++) - { - Player* p = getNthPlayer(i); - if (p != getNeutralPlayer()) - { - p->setPlayerType(PLAYER_HUMAN, false); - setLocalPlayer(p); - setLocal = true; - break; - } - } - } - - // must reset teams *after* creating players. - TheTeamFactory->initFromSides(TheSidesList); - - for( i = 0; i < TheSidesList->getNumSides(); i++) - { - Dict *d = TheSidesList->getSideInfo(i)->getDict(); - Player* p = findPlayerWithNameKey(NAMEKEY(d->getAsciiString(TheKey_playerName))); - - AsciiString tok; - - AsciiString enemies = d->getAsciiString(TheKey_playerEnemies); - while (enemies.nextToken(&tok)) - { - Player *p2 = findPlayerWithNameKey(NAMEKEY(tok)); - if (p2) - { - p->setPlayerRelationship(p2, ENEMIES); - } - else - { - DEBUG_LOG(("unknown enemy %s",tok.str())); - } - } - - AsciiString allies = d->getAsciiString(TheKey_playerAllies); - while (allies.nextToken(&tok)) - { - Player *p2 = findPlayerWithNameKey(NAMEKEY(tok)); - if (p2) - { - p->setPlayerRelationship(p2, ALLIES); - } - else - { - DEBUG_LOG(("unknown ally %s",tok.str())); - } - } - - // finally, make sure self & neutral are correct. - p->setPlayerRelationship(p, ALLIES); - if (p != getNeutralPlayer()) - p->setPlayerRelationship(getNeutralPlayer(), NEUTRAL); - - p->setDefaultTeam(); - } - -} - -//----------------------------------------------------------------------------- -void PlayerList::init() -{ - m_playerCount = 1; - m_players[0]->init(nullptr); - - for (int i = 1; i < MAX_PLAYER_COUNT; i++) - m_players[i]->init(nullptr); - - // call setLocalPlayer so that becomingLocalPlayer() gets called appropriately - setLocalPlayer(m_players[0]); - -} - -//----------------------------------------------------------------------------- -void PlayerList::update() -{ - // update all players - for( Int i = 0; i < MAX_PLAYER_COUNT; i++ ) - { - m_players[i]->update(); - } - -} - -//----------------------------------------------------------------------------- -void PlayerList::newMap() -{ - // update all players - for( Int i = 0; i < MAX_PLAYER_COUNT; i++ ) - { - m_players[i]->newMap(); - } - -} - -// ------------------------------------------------------------------------ -void PlayerList::teamAboutToBeDeleted(Team* team) -{ - for( Int i = 0; i < MAX_PLAYER_COUNT; i++ ) - { - m_players[i]->removeTeamRelationship(team); - } -} - -//============================================================================= -void PlayerList::updateTeamStates() -{ - // Clear team flags for all players. - for( Int i = 0; i < MAX_PLAYER_COUNT; i++ ) - { - m_players[i]->updateTeamStates(); - } -} - -//----------------------------------------------------------------------------- -Team *PlayerList::validateTeam( AsciiString owner ) -{ - // owner could be a player or team. first, check team names. - Team *t = TheTeamFactory->findTeam(owner); - if (t) - { - //DEBUG_LOG(("assigned obj %08lx to team %s",obj,owner.str())); - } - else - { - DEBUG_CRASH(("no team or player named %s could be found!", owner.str())); - t = getNeutralPlayer()->getDefaultTeam(); - } - return t; -} - -//----------------------------------------------------------------------------- -void PlayerList::setLocalPlayer(Player *player) -{ - // can't set local player to null -- if you try, you get neutral. - if (player == nullptr) - { - DEBUG_CRASH(("local player may not be null")); - player = getNeutralPlayer(); - } - - if (player != m_local) - { - // m_local can be null the very first time we call this. - if (m_local) - m_local->becomingLocalPlayer(false); - m_local = player; - player->becomingLocalPlayer(true); - } - -#ifdef INTENSE_DEBUG - if (player) - { - // did you know? you can use "%ls" to print a doublebyte string, even in a single-byte printf... - DEBUG_LOG(("Switching local players. The new player is named '%ls' (%s) and owns the following objects:", - player->getPlayerDisplayName().str(), - TheNameKeyGenerator->keyToName(player->getPlayerNameKey()).str() - )); - for (Object *obj = player->getFirstOwnedObject(); obj; obj = obj->getNextOwnedObject()) - { - DEBUG_LOG_RAW(("Obj %08lx is of type %s",obj,obj->getTemplate()->getName().str())); - if (!player->canBuild(obj->getTemplate())) - { - DEBUG_LOG_RAW((" (NOT BUILDABLE)")); - } - DEBUG_LOG_RAW(("\n")); - } - } -#endif - -} - -//----------------------------------------------------------------------------- -Player *PlayerList::getPlayerFromMask( PlayerMaskType mask ) -{ - Player *player = nullptr; - Int i; - - for( i = 0; i < MAX_PLAYER_COUNT; i++ ) - { - - player = getNthPlayer( i ); - if( player && player->getPlayerMask() == mask ) - return player; - - } - - DEBUG_CRASH( ("Player does not exist for mask") ); - return nullptr; // mask not found - -} - -//----------------------------------------------------------------------------- -Player *PlayerList::getEachPlayerFromMask( PlayerMaskType& maskToAdjust ) -{ - Player *player = nullptr; - Int i; - - for( i = 0; i < MAX_PLAYER_COUNT; i++ ) - { - - player = getNthPlayer( i ); - if ( player && BitIsSet(player->getPlayerMask(), maskToAdjust )) - { - maskToAdjust &= (~player->getPlayerMask()); - return player; - } - } - - DEBUG_CRASH( ("No players found that contain any matching masks.") ); - maskToAdjust = 0; - return nullptr; // mask not found -} - - -//------------------------------------------------------------------------------------------------- -PlayerMaskType PlayerList::getPlayersWithRelationship( Int srcPlayerIndex, UnsignedInt allowedRelationships ) -{ - PlayerMaskType retVal = 0; - - if (allowedRelationships == 0) - return retVal; - - Player *srcPlayer = getNthPlayer(srcPlayerIndex); - if (!srcPlayer) - return retVal; - - if (BitIsSet(allowedRelationships, ALLOW_SAME_PLAYER)) - BitSet(retVal, srcPlayer->getPlayerMask()); - - for ( Int i = 0; i < getPlayerCount(); ++i ) - { - Player *player = getNthPlayer(i); - if (!player) - continue; - - if (player == srcPlayer) - continue; - - switch (srcPlayer->getRelationship(player->getDefaultTeam())) - { - case ENEMIES: - if (BitIsSet(allowedRelationships, ALLOW_ENEMIES)) - BitSet(retVal, player->getPlayerMask()); - break; - case ALLIES: - if (BitIsSet(allowedRelationships, ALLOW_ALLIES)) - BitSet(retVal, player->getPlayerMask()); - break; - case NEUTRAL: - if (BitIsSet(allowedRelationships, ALLOW_NEUTRAL)) - BitSet(retVal, player->getPlayerMask()); - break; - } - } - - return retVal; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void PlayerList::crc( Xfer *xfer ) -{ - xfer->xferInt( &m_playerCount ); - - for( Int i = 0; i < m_playerCount; ++i ) - xfer->xferSnapshot( m_players[ i ] ); -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer Method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void PlayerList::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // xfer the player count - Int playerCount = m_playerCount; - xfer->xferInt( &playerCount ); - - // - // sanity, the player count read from the file should match our player count that - // was setup from the bare bones map load since that data can't change during run time - // - if( playerCount != m_playerCount ) - { - - DEBUG_CRASH(( "Invalid player count '%d', should be '%d'", playerCount, m_playerCount )); - throw SC_INVALID_DATA; - - } - - // xfer each of the player data - for( Int i = 0; i < playerCount; ++i ) - xfer->xferSnapshot( m_players[ i ] ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void PlayerList::loadPostProcess() -{ - -} - diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Science.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Science.cpp deleted file mode 100644 index 6cb201b2467..00000000000 --- a/Generals/Code/GameEngine/Source/Common/RTS/Science.cpp +++ /dev/null @@ -1,376 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Science.cpp ///////////////////////////////////////////////////////// -// Created: Steven Johnson, October 2001 -// Desc: @todo -//----------------------------------------------------------------------------- - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "Common/Player.h" -#include "Common/Science.h" - -ScienceStore* TheScienceStore = nullptr; - - -//----------------------------------------------------------------------------- -void ScienceStore::init() -{ - DEBUG_ASSERTCRASH(m_sciences.empty(), ("Hmm")); - m_sciences.clear(); -} - -//----------------------------------------------------------------------------- -ScienceStore::~ScienceStore() -{ - // nope. - //m_sciences.clear(); - - // go through all sciences and delete any overrides - for (ScienceInfoVec::iterator it = m_sciences.begin(); it != m_sciences.end(); /*++it*/) - { - ScienceInfo* si = *it; - ++it; - deleteInstance(si); - } -} - -//----------------------------------------------------------------------------- -void ScienceStore::reset() -{ - // nope. - //m_sciences.clear(); - - // go through all sciences and delete any overrides - for (ScienceInfoVec::iterator it = m_sciences.begin(); it != m_sciences.end(); /*++it*/) - { - ScienceInfo* si = *it; - Overridable* temp = si->deleteOverrides(); - if (!temp) - { - it = m_sciences.erase(it); - } - else - { - ++it; - } - } -} - -//----------------------------------------------------------------------------- -ScienceType ScienceStore::getScienceFromInternalName(const AsciiString& name) const -{ - if (name.isEmpty()) - return SCIENCE_INVALID; - NameKeyType nkt = TheNameKeyGenerator->nameToKey(name); - ScienceType st = (ScienceType)nkt; - return st; -} - -//----------------------------------------------------------------------------- -AsciiString ScienceStore::getInternalNameForScience(ScienceType science) const -{ - if (science == SCIENCE_INVALID) - return AsciiString::TheEmptyString; - NameKeyType nk = (NameKeyType)(science); - return TheNameKeyGenerator->keyToName(nk); -} - -//----------------------------------------------------------------------------- -// return a vector of all the currently-known science names -// NOTE: this is really only for use by WorldBuilder! Please -// do not use it in RTS! -std::vector ScienceStore::friend_getScienceNames() const -{ - std::vector v; - for (ScienceInfoVec::const_iterator it = m_sciences.begin(); it != m_sciences.end(); ++it) - { - const ScienceInfo* si = (const ScienceInfo*)(*it)->getFinalOverride(); - NameKeyType nk = (NameKeyType)(si->m_science); - v.push_back(TheNameKeyGenerator->keyToName(nk)); - } - return v; -} - -//----------------------------------------------------------------------------- -void ScienceInfo::addRootSciences(ScienceVec& v) const -{ - if (m_prereqSciences.empty()) - { - // we're a root. add ourselves. - if (std::find(v.begin(), v.end(), m_science) == v.end()) - v.push_back(m_science); - } - else - { - // we're not a root. add the roots of all our prereqs. - for (ScienceVec::const_iterator it = m_prereqSciences.begin(); it != m_prereqSciences.end(); ++it) - { - const ScienceInfo* si = TheScienceStore->findScienceInfo(*it); - if (si) - si->addRootSciences(v); - } - } -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -const ScienceInfo* ScienceStore::findScienceInfo(ScienceType st) const -{ - for (ScienceInfoVec::const_iterator it = m_sciences.begin(); it != m_sciences.end(); ++it) - { - const ScienceInfo* si = (const ScienceInfo*)(*it)->getFinalOverride(); - if (si->m_science == st) - { - return si; - } - } - return nullptr; -} - -//----------------------------------------------------------------------------- -/*static*/ void ScienceStore::friend_parseScienceDefinition( INI* ini ) -{ - const char* c = ini->getNextToken(); - NameKeyType nkt = NAMEKEY(c); - ScienceType st = (ScienceType)nkt; - - if (TheScienceStore) - { - - static const FieldParse myFieldParse[] = - { - { "PrerequisiteSciences", INI::parseScienceVector, nullptr, offsetof( ScienceInfo, m_prereqSciences ) }, - { "SciencePurchasePointCost", INI::parseInt, nullptr, offsetof( ScienceInfo, m_sciencePurchasePointCost ) }, - { "IsGrantable", INI::parseBool, nullptr, offsetof( ScienceInfo, m_grantable ) }, - { "DisplayName", INI::parseAndTranslateLabel, nullptr, offsetof( ScienceInfo, m_name) }, - { "Description", INI::parseAndTranslateLabel, nullptr, offsetof( ScienceInfo, m_description) }, - { nullptr, nullptr, nullptr, 0 } - }; - - ScienceInfo* info = nullptr; - - // see if the science already exists. (can't use findScienceInfo() since it is const and should remain so.) - for (ScienceInfoVec::iterator it = TheScienceStore->m_sciences.begin(); it != TheScienceStore->m_sciences.end(); ++it) - { - // note that we don't use getFinalOverride here. this is correct and as-desired. - if ((*it)->m_science == st) - { - info = *it; - break; - } - } - - if (ini->getLoadType() == INI_LOAD_CREATE_OVERRIDES) - { - ScienceInfo* newInfo = newInstance(ScienceInfo); - - if (info == nullptr) - { - // only add if it's not overriding an existing one. - info = newInfo; - info->markAsOverride(); // yep, so we will get cleared on reset() - TheScienceStore->m_sciences.push_back(info); - } - else - { - // copy data from final override to 'newInfo' as a set of initial default values - info = (ScienceInfo*)(info->friend_getFinalOverride()); - - *newInfo = *info; - info->setNextOverride(newInfo); - newInfo->markAsOverride(); // must do AFTER the copy - - // use the newly created override for us to set values with etc - info = newInfo; - //TheScienceStore->m_sciences.push_back(info); // NO, BAD, WRONG -- don't add in this case. - } - } - else - { - if (info != nullptr) - { - DEBUG_CRASH(("duplicate science %s!",c)); - throw INI_INVALID_DATA; - } - info = newInstance(ScienceInfo); - TheScienceStore->m_sciences.push_back(info); - } - - ini->initFromINI(info, myFieldParse); - info->m_science = st; - info->addRootSciences(info->m_rootSciences); - } -} - -//----------------------------------------------------------------------------- -Int ScienceStore::getSciencePurchaseCost(ScienceType st) const -{ - const ScienceInfo* si = findScienceInfo(st); - if (si) - { - return si->m_sciencePurchasePointCost; - } - else - { - return 0; - } -} - -//----------------------------------------------------------------------------- -Bool ScienceStore::isScienceGrantable(ScienceType st) const -{ - const ScienceInfo* si = findScienceInfo(st); - if (si) - { - return si->m_grantable; - } - else - { - return false; - } -} - -//----------------------------------------------------------------------------- -Bool ScienceStore::getNameAndDescription(ScienceType st, UnicodeString& name, UnicodeString& description) const -{ - const ScienceInfo* si = findScienceInfo(st); - if (si) - { - name = si->m_name; - description = si->m_description; - return true; - } - else - { - return false; - } -} - -//----------------------------------------------------------------------------- -Bool ScienceStore::playerHasPrereqsForScience(const Player* player, ScienceType st) const -{ - const ScienceInfo* si = findScienceInfo(st); - if (si) - { - for (ScienceVec::const_iterator it2 = si->m_prereqSciences.begin(); it2 != si->m_prereqSciences.end(); ++it2) - { - if (!player->hasScience(*it2)) - { - return false; - } - } - return true; - } - else - { - return false; - } -} - -//----------------------------------------------------------------------------- -Bool ScienceStore::playerHasRootPrereqsForScience(const Player* player, ScienceType st) const -{ - const ScienceInfo* si = findScienceInfo(st); - if (si) - { - for (ScienceVec::const_iterator it2 = si->m_rootSciences.begin(); it2 != si->m_rootSciences.end(); ++it2) - { - if (!player->hasScience(*it2)) - { - return false; - } - } - return true; - } - else - { - return false; - } -} - -//----------------------------------------------------------------------------- -/** return a list of the sciences the given player can purchase now, and a list he might be able to purchase in the future, - but currently lacks prereqs or points for. (either might be an empty list) */ -void ScienceStore::getPurchasableSciences(const Player* player, ScienceVec& purchasable, ScienceVec& potentiallyPurchasable) const -{ - purchasable.clear(); - potentiallyPurchasable.clear(); - for (ScienceInfoVec::const_iterator it = m_sciences.begin(); it != m_sciences.end(); ++it) - { - const ScienceInfo* si = (const ScienceInfo*)(*it)->getFinalOverride(); - - if (si->m_sciencePurchasePointCost == 0) - { - // 0 means "cannot be purchased" - continue; - } - - if (player->hasScience(si->m_science)) - { - continue; - } - - if (playerHasPrereqsForScience(player, si->m_science)) - { - purchasable.push_back(si->m_science); - } - else if (playerHasRootPrereqsForScience(player, si->m_science)) - { - potentiallyPurchasable.push_back(si->m_science); - } - } -} - -//----------------------------------------------------------------------------- -// this is intended ONLY for use by INI::scanScience. -// Don't use it anywhere else. In particular, never, ever, ever -// call this with a hardcoded science name. (srj) -ScienceType ScienceStore::friend_lookupScience(const char* scienceName) const -{ - NameKeyType nkt = NAMEKEY(scienceName); - ScienceType st = (ScienceType)nkt; - if (!isValidScience(st)) - { - DEBUG_CRASH(("Science name %s not known! (Did you define it in Science.ini?)",scienceName)); - throw INI_INVALID_DATA; - } - return st; -} - -//----------------------------------------------------------------------------- -Bool ScienceStore::isValidScience(ScienceType st) const -{ - const ScienceInfo* si = findScienceInfo(st); - return si != nullptr; -} - -//----------------------------------------------------------------------------- -void INI::parseScienceDefinition( INI* ini ) -{ - ScienceStore::friend_parseScienceDefinition(ini); -} - diff --git a/Generals/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp b/Generals/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp deleted file mode 100644 index 96396f14279..00000000000 --- a/Generals/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp +++ /dev/null @@ -1,565 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ScoreKeeper.cpp ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Jun 2002 -// -// Filename: ScoreKeeper.cpp -// -// author: Chris Huybregts -// -// purpose: Score Keeper class will be an object attached to each player -// that will maintain accurate counts for the various stats we -// want to show on the score screen. The information in here -// could also be used for the observer screen -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/GameState.h" -#include "Common/KindOf.h" -#include "Common/Player.h" -#include "Common/ScoreKeeper.h" -#include "Common/ThingFactory.h" -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" - -#include "GameLogic/Object.h" -#include "GameLogic/GameLogic.h" - -//----------------------------------------------------------------------------- -// DEFINES //////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -ScoreKeeper::ScoreKeeper() -{ - reset(0); -} - -ScoreKeeper::~ScoreKeeper() -{ - -} - -static KindOfMaskType scoringBuildingMask; -static KindOfMaskType scoringBuildingDestroyMask; -static KindOfMaskType scoringBuildingCreateMask; - -void ScoreKeeper::reset( Int playerIdx ) -{ - scoringBuildingMask.set(KINDOF_STRUCTURE); - scoringBuildingMask.set(KINDOF_SCORE); - - scoringBuildingCreateMask.set(KINDOF_STRUCTURE); - scoringBuildingCreateMask.set(KINDOF_SCORE_CREATE); - - scoringBuildingDestroyMask.set(KINDOF_STRUCTURE); - scoringBuildingDestroyMask.set(KINDOF_SCORE_DESTROY); - - m_totalMoneyEarned = m_totalMoneySpent = 0; - m_totalUnitsLost = m_totalUnitsBuilt = 0; - m_totalBuildingsLost = m_totalBuildingsBuilt = 0; - m_totalFactionBuildingsCaptured = m_totalTechBuildingsCaptured = 0; - m_currentScore = 0; - m_objectsBuilt.clear(); - m_objectsCaptured.clear(); - m_objectsLost.clear(); - for(int i = 0; i < MAX_PLAYER_COUNT; ++i) - { - m_objectsDestroyed[i].clear(); - m_totalBuildingsDestroyed[i] = m_totalUnitsDestroyed[i] = 0; - } - m_myPlayerIdx = playerIdx; -} - -void ScoreKeeper::addObjectBuilt( const Object *o) -{ - Bool addToCount = FALSE; - - if (TheGameLogic->isScoringEnabled() == FALSE) { - return; - } - - if(o->getTemplate()->isKindOfMulti(scoringBuildingMask, KINDOFMASK_NONE)) - { - ++m_totalBuildingsBuilt; - addToCount = TRUE; - } - else if (o->getTemplate()->isKindOfMulti(scoringBuildingCreateMask, KINDOFMASK_NONE)) - { - ++m_totalBuildingsBuilt; - addToCount = TRUE; - } - else if(o->getTemplate()->isKindOf(KINDOF_INFANTRY) || o->getTemplate()->isKindOf(KINDOF_VEHICLE)) - { - if (o->getTemplate()->isKindOf(KINDOF_SCORE) || o->getTemplate()->isKindOf(KINDOF_SCORE_CREATE)) - { - ++m_totalUnitsBuilt; - addToCount = TRUE; - } - } - - if(addToCount) - { - Int existingCount = 0; - ObjectCountMapIt it = m_objectsBuilt.find(o->getTemplate()); - if (it != m_objectsBuilt.end()) - existingCount = it->second; - m_objectsBuilt[o->getTemplate()] = existingCount + 1; - } -} - -Int ScoreKeeper::getTotalUnitsBuilt( KindOfMaskType validMask, KindOfMaskType invalidMask ) -{ - Int count = 0; - for (ObjectCountMapIt it = m_objectsBuilt.begin(); it != m_objectsBuilt.end(); ++it) - { - const ThingTemplate *theTemplate = it->first; - Int numBuilt = it->second; - if (theTemplate && theTemplate->isKindOfMulti(validMask, invalidMask)) - count += numBuilt; - } - return count; -} - -Int ScoreKeeper::getTotalObjectsBuilt( const ThingTemplate *pTemplate ) -{ - Int count = 0; - for (ObjectCountMapIt it = m_objectsBuilt.begin(); it != m_objectsBuilt.end(); ++it) - { - const ThingTemplate *theTemplate = it->first; - if (theTemplate && theTemplate->isEquivalentTo(pTemplate)) - ++count; - } - return count; -} - - -void ScoreKeeper::removeObjectBuilt( const Object *o) -{ - if (TheGameLogic->isScoringEnabled() == FALSE) { - return; - } - - Bool removeFromCount = FALSE; - if (o->getTemplate()->isKindOfMulti(scoringBuildingMask, KINDOFMASK_NONE)) - { - --m_totalBuildingsBuilt; - removeFromCount = TRUE; - } - else if (o->getTemplate()->isKindOfMulti(scoringBuildingCreateMask, KINDOFMASK_NONE)) - { - --m_totalBuildingsBuilt; - removeFromCount = TRUE; - } - else if (o->getTemplate()->isKindOf(KINDOF_INFANTRY) || o->getTemplate()->isKindOf(KINDOF_VEHICLE)) - { - if (o->getTemplate()->isKindOf(KINDOF_SCORE) || o->getTemplate()->isKindOf(KINDOF_SCORE_CREATE)) - { - --m_totalUnitsBuilt; - removeFromCount = TRUE; - } - } - - if (removeFromCount) - { - Int existingCount = 0; - ObjectCountMapIt it = m_objectsBuilt.find(o->getTemplate()); - if (it != m_objectsBuilt.end()) - existingCount = it->second; - m_objectsBuilt[o->getTemplate()] = existingCount - 1; - } -} - -void ScoreKeeper::addObjectCaptured( const Object *o ) -{ - if (TheGameLogic->isScoringEnabled() == FALSE) { - return; - } - - Bool addToCount = FALSE; - if(o->getTemplate()->isKindOf(KINDOF_STRUCTURE)) - { - if (o->getTemplate()->isKindOf(KINDOF_SCORE)) - { - ++m_totalFactionBuildingsCaptured; - } - else - { - ++m_totalTechBuildingsCaptured; - } - addToCount = TRUE; - } - - if(addToCount) - { - Int existingCount = 0; - ObjectCountMapIt it = m_objectsCaptured.find(o->getTemplate()); - if (it != m_objectsCaptured.end()) - existingCount = it->second; - m_objectsCaptured[o->getTemplate()] = existingCount + 1; - } -} - - - -void ScoreKeeper::addObjectDestroyed( const Object *o) -{ - - if (TheGameLogic->isScoringEnabled() == FALSE) { - return; - } - - Int playerIdx = o->getControllingPlayer()->getPlayerIndex(); - - Bool addToCount = FALSE; - if(o->getTemplate()->isKindOfMulti(scoringBuildingMask, KINDOFMASK_NONE)) - { - if (!(o->testStatus(OBJECT_STATUS_UNDER_CONSTRUCTION))) { - ++m_totalBuildingsDestroyed[playerIdx]; - addToCount = TRUE; - } - } - else if (o->getTemplate()->isKindOfMulti(scoringBuildingDestroyMask, KINDOFMASK_NONE)) - { - if (!(o->testStatus(OBJECT_STATUS_UNDER_CONSTRUCTION))) { - ++m_totalBuildingsDestroyed[playerIdx]; - addToCount = TRUE; - } - } - else if(o->getTemplate()->isKindOf(KINDOF_INFANTRY) || o->getTemplate()->isKindOf(KINDOF_VEHICLE)) - { - if (o->getTemplate()->isKindOf(KINDOF_SCORE) || o->getTemplate()->isKindOf(KINDOF_SCORE_DESTROY)) - { - if (!(o->testStatus(OBJECT_STATUS_UNDER_CONSTRUCTION))) { - m_totalUnitsDestroyed[playerIdx]++; - addToCount = TRUE; - } - } - } - - if(addToCount) - { - Int existingCount = 0; - ObjectCountMapIt it = m_objectsDestroyed[playerIdx].find(o->getTemplate()); - if (it != m_objectsDestroyed[playerIdx].end()) - existingCount = it->second; - m_objectsDestroyed[playerIdx][o->getTemplate()] = existingCount + 1; - } -} - -void ScoreKeeper::addObjectLost( const Object *o ) -{ - if (TheGameLogic->isScoringEnabled() == FALSE) { - return; - } - - Bool addToCount = FALSE; - if(o->getTemplate()->isKindOfMulti(scoringBuildingMask, KINDOFMASK_NONE)) - { - if (!(o->testStatus(OBJECT_STATUS_UNDER_CONSTRUCTION))) { - ++m_totalBuildingsLost; - addToCount = TRUE; - } - } - else if (o->getTemplate()->isKindOfMulti(scoringBuildingDestroyMask, KINDOFMASK_NONE)) - { - if (!(o->testStatus(OBJECT_STATUS_UNDER_CONSTRUCTION))) { - ++m_totalBuildingsLost; - addToCount = TRUE; - } - } - else if(o->getTemplate()->isKindOf(KINDOF_INFANTRY) || o->getTemplate()->isKindOf(KINDOF_VEHICLE)) - { - if (o->getTemplate()->isKindOf(KINDOF_SCORE) || o->getTemplate()->isKindOf(KINDOF_SCORE_DESTROY)) - { - if (!(o->testStatus(OBJECT_STATUS_UNDER_CONSTRUCTION))) { - ++m_totalUnitsLost; - addToCount = TRUE; - } - } - } - - if(addToCount) - { - Int existingCount = 0; - ObjectCountMapIt it = m_objectsLost.find(o->getTemplate()); - if (it != m_objectsLost.end()) - existingCount = it->second; - m_objectsLost[o->getTemplate()] = existingCount + 1; - } -} - -Int ScoreKeeper::calculateScore() -{ - Int score = 0; - score += m_totalUnitsBuilt * 100; - score += m_totalMoneyEarned; - score += m_totalBuildingsBuilt * 100; - for (Int i = 0; i < MAX_PLAYER_COUNT; ++i) - { - if(i == m_myPlayerIdx) - continue; - score += m_totalUnitsDestroyed[i] * 100; - score += m_totalBuildingsDestroyed[i] * 100; - } - - m_currentScore = score; - return m_currentScore; - -} - -//----------------------------------------------------------------------------- -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -Int ScoreKeeper::getTotalBuildingsDestroyed() -{ - int count = 0; - for (int i = 0; i< MAX_PLAYER_COUNT; ++i) - { - // Design change, display even if we killed our own -// if(i == m_myPlayerIdx) -// continue; - count += m_totalBuildingsDestroyed[i]; - //for (ObjectCountMapIt it = m_objectsDestroyed[i].begin(); it != m_objectsDestroyed[i].end(); ++it) - // { - // - // count += it->second; - // } - - } - return count; -} -Int ScoreKeeper::getTotalUnitsDestroyed() -{ - int count = 0; - for (int i = 0; i< MAX_PLAYER_COUNT; ++i) - { - // Design change, display even if we killed our own -// if(i == m_myPlayerIdx) -// continue; - count += m_totalUnitsDestroyed[i]; -// for (ObjectCountMapIt it = m_objectsDestroyed[i].begin(); it != m_objectsDestroyed[i].end(); ++it) -// { -// } - } - return count; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ScoreKeeper::crc( Xfer *xfer ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer of an object count map - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ScoreKeeper::xferObjectCountMap( Xfer *xfer, ObjectCountMap *map ) -{ - - // sanity - if( map == nullptr ) - { - - DEBUG_CRASH(( "xferObjectCountMap - Invalid map parameter" )); - throw SC_INVALID_DATA; - - } - - // version info - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // size of the map - UnsignedShort mapSize = map->size(); - xfer->xferUnsignedShort( &mapSize ); - - // map data - Int count; - const ThingTemplate *thingTemplate; - AsciiString thingTemplateName; - if( xfer->getXferMode() == XFER_SAVE ) - { - ObjectCountMapIt it; - - // save all entries - for( it = map->begin(); it != map->end(); ++it ) - { - - // thing template - thingTemplate = it->first; - thingTemplateName = thingTemplate->getName(); - xfer->xferAsciiString( &thingTemplateName ); - - // the count - count = it->second; - xfer->xferInt( &count ); - - } - - } - else - { - - // read all entries - for( UnsignedShort i = 0; i < mapSize; ++i ) - { - - // read thing template name - xfer->xferAsciiString( &thingTemplateName ); - thingTemplate = TheThingFactory->findTemplate( thingTemplateName ); - if( thingTemplate == nullptr ) - { - - DEBUG_CRASH(( "xferObjectCountMap - Unknown thing template '%s'", thingTemplateName.str() )); - throw SC_INVALID_DATA; - - } - - // read count - xfer->xferInt( &count ); - - // add to map - (*map)[ thingTemplate ] = count; - - } - - } - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ScoreKeeper::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // money earned - xfer->xferInt( &m_totalMoneyEarned ); - - // money spent - xfer->xferInt( &m_totalMoneySpent ); - - // units destroyed - xfer->xferUser( m_totalUnitsDestroyed, sizeof( Int ) * MAX_PLAYER_COUNT ); - - // units built - xfer->xferInt( &m_totalUnitsBuilt ); - - // units lost - xfer->xferInt( &m_totalUnitsLost ); - - // buildings destroyed - xfer->xferUser( m_totalBuildingsDestroyed, sizeof( Int ) * MAX_PLAYER_COUNT ); - - // buildings built - xfer->xferInt( &m_totalBuildingsBuilt ); - - // buildings lost - xfer->xferInt( &m_totalBuildingsLost ); - - // tech buildings captured - xfer->xferInt( &m_totalTechBuildingsCaptured ); - - // faction buildings captured - xfer->xferInt( &m_totalFactionBuildingsCaptured ); - - // current score - xfer->xferInt( &m_currentScore ); - - // player index - xfer->xferInt( &m_myPlayerIdx ); - - // objects built - xferObjectCountMap( xfer, &m_objectsBuilt ); - - // objects destroyed - UnsignedShort destroyedArraySize = MAX_PLAYER_COUNT; - xfer->xferUnsignedShort( &destroyedArraySize ); - if( destroyedArraySize != MAX_PLAYER_COUNT ) - { - - DEBUG_CRASH(( "ScoreKeeper::xfer - size of objects destroyed array has changed" )); - throw SC_INVALID_DATA; - - } - for( UnsignedShort i = 0; i < destroyedArraySize; ++i ) - { - - // xfer map data - xferObjectCountMap( xfer, &m_objectsDestroyed[ i ] ); - - } - - // objects lost - xferObjectCountMap( xfer, &m_objectsLost ); - - // objects captured - xferObjectCountMap( xfer, &m_objectsCaptured ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ScoreKeeper::loadPostProcess() -{ - -} diff --git a/Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp b/Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp deleted file mode 100644 index 6be4ec457b2..00000000000 --- a/Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/CriticalSection.h" - -// Definitions. -CriticalSection *TheAsciiStringCriticalSection = nullptr; -CriticalSection *TheUnicodeStringCriticalSection = nullptr; -CriticalSection *TheDmaCriticalSection = nullptr; -CriticalSection *TheMemoryPoolCriticalSection = nullptr; -CriticalSection *TheDebugLogCriticalSection = nullptr; - -#ifdef PERF_TIMERS -PerfGather TheCritSecPerfGather("CritSec"); -#endif - diff --git a/Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp b/Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp deleted file mode 100644 index 2b90ade8db2..00000000000 --- a/Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp +++ /dev/null @@ -1,980 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// DataChunk.cpp -// Implementation of Data Chunk save/load system -// Author: Michael S. Booth, October 2000 - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "stdlib.h" -#include "Compression.h" -#include "Common/DataChunk.h" -#include "Common/file.h" -#include "Common/FileSystem.h" - -// If verbose, lots of debug logging. -#define not_VERBOSE - -CachedFileInputStream::CachedFileInputStream():m_buffer(nullptr),m_size(0) -{ -} - -CachedFileInputStream::~CachedFileInputStream() -{ - delete[] m_buffer; - m_buffer=nullptr; -} - -Bool CachedFileInputStream::open(AsciiString path) -{ - File *file=TheFileSystem->openFile(path.str(), File::READ | File::BINARY); - m_size = 0; - - if (file) { - m_size=file->size(); - if (m_size) { - m_buffer = file->readEntireAndClose(); - file = nullptr; - } - m_pos=0; - } - - if (CompressionManager::isDataCompressed(m_buffer, m_size) == 0) - { - //DEBUG_LOG(("CachedFileInputStream::open() - file %s is uncompressed at %d bytes!", path.str(), m_size)); - } - else - { - Int uncompLen = CompressionManager::getUncompressedSize(m_buffer, m_size); - //DEBUG_LOG(("CachedFileInputStream::open() - file %s is compressed! It should go from %d to %d", path.str(), - // m_size, uncompLen)); - char *uncompBuffer = NEW char[uncompLen]; - Int actualLen = CompressionManager::decompressData(m_buffer, m_size, uncompBuffer, uncompLen); - if (actualLen == uncompLen) - { - //DEBUG_LOG(("Using uncompressed data")); - delete[] m_buffer; - m_buffer = uncompBuffer; - m_size = uncompLen; - } - else - { - //DEBUG_LOG(("Decompression failed - using compressed data")); - // decompression failed. Maybe we invalidly thought it was compressed? - delete[] uncompBuffer; - } - } - //if (m_size >= 4) - //{ - // DEBUG_LOG(("File starts as '%c%c%c%c'", m_buffer[0], m_buffer[1], - // m_buffer[2], m_buffer[3])); - //} - - if (file) - { - file->close(); - } - return m_size != 0; -} - -void CachedFileInputStream::close() -{ - delete[] m_buffer; - m_buffer=nullptr; - - m_pos=0; - m_size=0; -} - -Int CachedFileInputStream::read(void *pData, Int numBytes) -{ - if (m_buffer) { - if ((numBytes+m_pos)>m_size) { - numBytes=m_size-m_pos; - } - if (numBytes) { - memcpy(pData,m_buffer+m_pos,numBytes); - m_pos+=numBytes; - } - return(numBytes); - } - return 0; -} - -UnsignedInt CachedFileInputStream::tell() -{ - return m_pos; -} - -Bool CachedFileInputStream::absoluteSeek(UnsignedInt pos) -{ - if (pos<0) return false; - if (pos>m_size) { - pos=m_size; - } - m_pos=pos; - return true; -} - -Bool CachedFileInputStream::eof() -{ - return m_size==m_pos; -} - -void CachedFileInputStream::rewind() -{ - m_pos=0; -} - -// ----------------------------------------------------------- - -// -// FileInputStream - helper class. Used to read in data using a FILE * -// -/* -FileInputStream::FileInputStream():m_file(nullptr) -{ -} - -FileInputStream::~FileInputStream() -{ - if (m_file != nullptr) { - m_file->close(); - m_file = nullptr; - } -} - -Bool FileInputStream::open(AsciiString path) -{ - m_file = TheFileSystem->openFile(path.str(), File::READ | File::BINARY); - return m_file == nullptr?false:true; -} - -void FileInputStream::close() -{ - if (m_file != nullptr) { - m_file->close(); - m_file = nullptr; - } -} - -Int FileInputStream::read(void *pData, Int numBytes) -{ - int bytesRead = 0; - if (m_file != nullptr) { - bytesRead = m_file->read(pData, numBytes); - } - return(bytesRead); -} - -UnsignedInt FileInputStream::tell() -{ - UnsignedInt pos = 0; - if (m_file != nullptr) { - pos = m_file->position(); - } - return(pos); -} - -Bool FileInputStream::absoluteSeek(UnsignedInt pos) -{ - if (m_file != nullptr) { - return (m_file->seek(pos, File::START) != -1); - } - return(false); -} - -Bool FileInputStream::eof() -{ - if (m_file != nullptr) { - return (m_file->size() == m_file->position()); - } - return(true); -} - -void FileInputStream::rewind() -{ - if (m_file != nullptr) { - m_file->seek(0, File::START); - } -} -*/ - -//---------------------------------------------------------------------- -// DataChunkOutput -// Data will be stored to a temporary m_tmp_file until the DataChunkOutput -// object is destroyed. At that time, the actual output m_tmp_file will -// be written, including a table of m_contents. -//---------------------------------------------------------------------- - -#define TEMP_FILENAME "_tmpChunk.dat" - -DataChunkOutput::DataChunkOutput( OutputStream *pOut ) : -m_pOut(pOut) -{ - AsciiString tmpFileName = TheGlobalData->getPath_UserData(); - tmpFileName.concat(TEMP_FILENAME); - m_tmp_file = ::fopen( tmpFileName.str(), "wb" ); - m_chunkStack = nullptr; -} - -DataChunkOutput::~DataChunkOutput() -{ - // store the table of m_contents - m_contents.write(*m_pOut); - - // Rewind the temp m_tmp_file - ::fclose(m_tmp_file); - - AsciiString tmpFileName = TheGlobalData->getPath_UserData(); - tmpFileName.concat(TEMP_FILENAME); - - m_tmp_file = ::fopen( tmpFileName.str(), "rb" ); - ::fseek(m_tmp_file, 0, SEEK_SET); - - // append the temp m_tmp_file m_contents - char buffer[256]; - int len = 256; - while( len == 256 ) - { - // copy data from the temp m_tmp_file to the output m_tmp_file - len = ::fread( buffer, 1, 256, m_tmp_file ); - m_pOut->write( buffer, len ); - } - - ::fclose(m_tmp_file); -} - -void DataChunkOutput::openDataChunk( const char *name, DataChunkVersionType ver ) -{ - // allocate (or get existing) ID from the table of m_contents - UnsignedInt id = m_contents.allocateID( AsciiString(name) ); - - // allocate a new chunk and place it on top of the chunk stack - OutputChunk *c = newInstance(OutputChunk); - c->next = m_chunkStack; - m_chunkStack = c; - m_chunkStack->id = id; - - // store the chunk ID - ::fwrite( (const char *)&id, sizeof(UnsignedInt), 1, m_tmp_file ); - - // store the chunk version number - ::fwrite( (const char *)&ver, sizeof(DataChunkVersionType), 1, m_tmp_file ); - - // remember this m_tmp_file position so we can write the real data size later - c->filepos = ::ftell(m_tmp_file); -#ifdef VERBOSE - DEBUG_LOG(("Writing chunk %s at %d (%x)", name, ::ftell(m_tmp_file), ::ftell(m_tmp_file))); -#endif - // store a placeholder for the data size - Int dummy = 0xffff; - ::fwrite( (const char *)&dummy, sizeof(Int), 1, m_tmp_file ); -} - -void DataChunkOutput::closeDataChunk() -{ - if (m_chunkStack == nullptr) - { - // TODO: Throw exception - return; - } - - // remember where we are - Int here = ::ftell(m_tmp_file); - - // rewind to store the data size - ::fseek(m_tmp_file, m_chunkStack->filepos , SEEK_SET); - - // compute data size (not including the actual data size itself) - Int size = here - m_chunkStack->filepos - sizeof(Int); - - // store the data size - ::fwrite( (const char *)&size, sizeof(Int) , 1, m_tmp_file ); - - // go back to where we were - ::fseek(m_tmp_file, here , SEEK_SET); - - // pop the chunk off the stack - OutputChunk *c = m_chunkStack; -#ifdef VERBOSE - DEBUG_LOG(("Closing chunk %s at %d (%x)", m_contents.getName(c->id).str(), here, here)); -#endif - m_chunkStack = m_chunkStack->next; - deleteInstance(c); -} - -void DataChunkOutput::writeReal( Real r ) -{ - ::fwrite( (const char *)&r, sizeof(float) , 1, m_tmp_file ); -} - -void DataChunkOutput::writeInt( Int i ) -{ - ::fwrite( (const char *)&i, sizeof(Int) , 1, m_tmp_file ); -} - -void DataChunkOutput::writeByte( Byte b ) -{ - ::fwrite( (const char *)&b, sizeof(Byte) , 1, m_tmp_file ); -} - -void DataChunkOutput::writeArrayOfBytes(char *ptr, Int len) -{ - ::fwrite( (const char *)ptr, 1, len , m_tmp_file ); -} - -void DataChunkOutput::writeAsciiString( const AsciiString& theString ) -{ - UnsignedShort len = theString.getLength(); - ::fwrite( (const char *)&len, sizeof(UnsignedShort) , 1, m_tmp_file ); - ::fwrite( theString.str(), len , 1, m_tmp_file ); -} - -void DataChunkOutput::writeUnicodeString( UnicodeString theString ) -{ - UnsignedShort len = theString.getLength(); - ::fwrite( (const char *)&len, sizeof(UnsignedShort) , 1, m_tmp_file ); - ::fwrite( theString.str(), len*sizeof(WideChar) , 1, m_tmp_file ); -} - -void DataChunkOutput::writeNameKey( const NameKeyType key ) -{ - AsciiString kname = TheNameKeyGenerator->keyToName(key); - Int keyAndType = m_contents.allocateID(kname); - keyAndType <<= 8; - Dict::DataType t = Dict::DICT_ASCIISTRING; - keyAndType |= (t & 0xff); - writeInt(keyAndType); -} - -void DataChunkOutput::writeDict( const Dict& d ) -{ - UnsignedShort len = d.getPairCount(); - ::fwrite( (const char *)&len, sizeof(UnsignedShort) , 1, m_tmp_file ); - for (int i = 0; i < len; i++) - { - NameKeyType k = d.getNthKey(i); - AsciiString kname = TheNameKeyGenerator->keyToName(k); - - Int keyAndType = m_contents.allocateID(kname); - keyAndType <<= 8; - Dict::DataType t = d.getNthType(i); - keyAndType |= (t & 0xff); - writeInt(keyAndType); - - switch(t) - { - case Dict::DICT_BOOL: - writeByte(d.getNthBool(i)?1:0); - break; - case Dict::DICT_INT: - writeInt(d.getNthInt(i)); - break; - case Dict::DICT_REAL: - writeReal(d.getNthReal(i)); - break; - case Dict::DICT_ASCIISTRING: - writeAsciiString(d.getNthAsciiString(i)); - break; - case Dict::DICT_UNICODESTRING: - writeUnicodeString(d.getNthUnicodeString(i)); - break; - default: - DEBUG_CRASH(("impossible")); - break; - } - } -} - -//---------------------------------------------------------------------- -// DataChunkTableOfContents -//---------------------------------------------------------------------- - -DataChunkTableOfContents::DataChunkTableOfContents() : -m_list(nullptr), -m_nextID(1), -m_listLength(0), -m_headerOpened(false) -{ -} - -DataChunkTableOfContents::~DataChunkTableOfContents() -{ - Mapping *m, *next; - - // free all list elements - for( m=m_list; m; m=next ) - { - next = m->next; - deleteInstance(m); - } -} - -// return mapping data -Mapping *DataChunkTableOfContents::findMapping( const AsciiString& name ) -{ - Mapping *m; - - for( m=m_list; m; m=m->next ) - if (name == m->name ) - return m; - - return nullptr; -} - -// convert name to integer identifier -UnsignedInt DataChunkTableOfContents::getID( const AsciiString& name ) -{ - Mapping *m = findMapping( name ); - - if (m) - return m->id; - - DEBUG_CRASH(("name not found in DataChunkTableOfContents::getName for name %s",name.str())); - return 0; -} - -// convert integer identifier to name -AsciiString DataChunkTableOfContents::getName( UnsignedInt id ) -{ - Mapping *m; - - for( m=m_list; m; m=m->next ) - if (m->id == id) - return m->name; - - DEBUG_CRASH(("name not found in DataChunkTableOfContents::getName for id %d",id)); - return AsciiString::TheEmptyString; -} - -// create new ID for given name or return existing mapping -UnsignedInt DataChunkTableOfContents::allocateID(const AsciiString& name ) -{ - Mapping *m = findMapping( name ); - - if (m) - return m->id; - else - { - // allocate new id mapping - m = newInstance(Mapping); - - m->id = m_nextID++; - m->name = name ; - - // prepend to list - m->next = m_list; - m_list = m; - - m_listLength++; - - return m->id; - } -} - -// output the table of m_contents to a binary m_tmp_file stream -void DataChunkTableOfContents::write( OutputStream &s ) -{ - Mapping *m; - unsigned char len; - - Byte tag[4]={'C','k', 'M', 'p'}; // Chunky height map. jba. - s.write(tag,sizeof(tag)); - - // output number of elements in the table - s.write( (void *)&this->m_listLength, sizeof(Int) ); - - // output symbol table - for( m=this->m_list; m; m=m->next ) - { - len = m->name.getLength(); - s.write( (char *)&len, sizeof(unsigned char) ); - s.write( (char *)m->name.str(), len); - s.write( (char *)&m->id, sizeof(UnsignedInt) ); - } -} - -// read the table of m_contents from a binary m_tmp_file stream -// TODO: Should this reset the symbol table? -// Append symbols to table -void DataChunkTableOfContents::read( ChunkInputStream &s) -{ - Int count, i; - UnsignedInt maxID = 0; - unsigned char len; - Mapping *m; - - Byte tag[4]={'x','x', 'x', 'x'}; // Chunky height map. jba. - s.read(tag,sizeof(tag)); - if (tag[0] != 'C' || tag[1] != 'k' || tag[2] != 'M' || tag[3] != 'p') { - return; // Don't throw, may happen with legacy files. - } - - // get number of symbols in table - s.read( (char *)&count, sizeof(Int) ); - - for( i=0; i0) { - char *str = m->name.getBufferForRead(len); - s.read( str, len ); - str[len] = '\000'; - } - - // read id - s.read( (char *)&m->id, sizeof(UnsignedInt) ); - - // prepend to list - m->next = this->m_list; - this->m_list = m; - - this->m_listLength++; - - // track max ID used - if (m->id > maxID) - maxID = m->id; - } - m_headerOpened = count > 0 && !s.eof(); - - // adjust next ID so no ID's are reused - this->m_nextID = max( this->m_nextID, maxID+1 ); -} - -//---------------------------------------------------------------------- -// DataChunkInput -//---------------------------------------------------------------------- -DataChunkInput::DataChunkInput( ChunkInputStream *pStream ) : m_file( pStream ), - m_userData(nullptr), - m_currentObject(nullptr), - m_chunkStack(nullptr), - m_parserList(nullptr) -{ - // read table of m_contents - m_contents.read(*m_file); - - // store location of first data chunk - m_fileposOfFirstChunk = m_file->tell(); -} - -DataChunkInput::~DataChunkInput() -{ - clearChunkStack(); - - UserParser *p, *next; - for (p=m_parserList; p; p=next) { - next = p->next; - deleteInstance(p); - } - -} - -// register a user parsing function for a given DataChunk label -void DataChunkInput::registerParser( const AsciiString& label, const AsciiString& parentLabel, - DataChunkParserPtr parser, void *userData ) -{ - UserParser *p = newInstance(UserParser); - - p->label.set( label ); - p->parentLabel.set(parentLabel ); - p->parser = parser; - p->userData = userData; - - // prepend parser to parser list - p->next = m_parserList; - m_parserList = p; -} - -// parse the chunk stream using registered parsers -// it is assumed that the file position is at the start of a data chunk -// (it can be inside a parent chunk) when parse is called. -Bool DataChunkInput::parse( void *userData ) -{ - AsciiString label; - AsciiString parentLabel; - DataChunkVersionType ver; - UserParser *parser; - Bool scopeOK; - DataChunkInfo info; - - // If the header wasn't a chunk table of contents, we can't parse. - if (!m_contents.isOpenedForRead()) { - return false; - } - - // if we are inside a data chunk right now, get its name - if (m_chunkStack) - parentLabel = m_contents.getName( m_chunkStack->id ); - - while( atEndOfFile() == false ) - { - if (m_chunkStack) { // If we are parsing chunks in a chunk, check current length. - if (m_chunkStack->dataLeft < CHUNK_HEADER_BYTES) { - DEBUG_ASSERTCRASH( m_chunkStack->dataLeft==0, ("Unexpected extra data in chunk.")); - break; - } - } - // open the chunk - label = openDataChunk( &ver ); - if (atEndOfFile()) { // FILE * returns eof after you read past end of file, so check. - break; - } - - // find a registered parser for this chunk - for( parser=m_parserList; parser; parser=parser->next ) - { - // chunk labels must match - if ( parser->label == label ) - { - // make sure parent name (scope) also matches - scopeOK = true; - - if (parentLabel != parser->parentLabel) - scopeOK = false; - - if (scopeOK) - { - // m_tmp_file out the chunk info and call the user parser - info.label = label; - info.parentLabel = parentLabel; - info.version = ver; - info.dataSize = getChunkDataSize(); - - if (parser->parser( *this, &info, userData ) == false) - return false; - break; - } - } - } - - // close chunk (and skip to end if need be) - closeDataChunk(); - } - - return true; -} - -// clear the stack -void DataChunkInput::clearChunkStack() -{ - InputChunk *c, *next; - - for( c=m_chunkStack; c; c=next ) - { - next = c->next; - deleteInstance(c); - } - - m_chunkStack = nullptr; -} - -// reset the stream to just-opened state - ready to parse the first chunk -void DataChunkInput::reset() -{ - clearChunkStack(); - m_file->absoluteSeek( m_fileposOfFirstChunk ); -} - -// Checks if the file has our initial tag word. -Bool DataChunkInput::isValidFileType() -{ - return m_contents.isOpenedForRead(); -} - -AsciiString DataChunkInput::openDataChunk(DataChunkVersionType *ver ) -{ - // allocate a new chunk and place it on top of the chunk stack - InputChunk *c = newInstance(InputChunk); - c->id = 0; - c->version = 0; - c->dataSize = 0; - //DEBUG_LOG(("Opening data chunk at offset %d (%x)", m_file->tell(), m_file->tell())); - // read the chunk ID - m_file->read( (char *)&c->id, sizeof(UnsignedInt) ); - decrementDataLeft( sizeof(UnsignedInt) ); - - // read the chunk version number - m_file->read( (char *)&c->version, sizeof(DataChunkVersionType) ); - decrementDataLeft( sizeof(DataChunkVersionType) ); - - // read the chunk data size - m_file->read( (char *)&c->dataSize, sizeof(Int) ); - decrementDataLeft( sizeof(Int) ); - - // all of the data remains to be read - c->dataLeft = c->dataSize; - c->chunkStart = m_file->tell(); - - *ver = c->version; - - c->next = m_chunkStack; - m_chunkStack = c; - if (this->atEndOfFile()) { - return AsciiString::TheEmptyString; - } - return m_contents.getName( c->id ); -} - -// close chunk and move to start of next chunk -void DataChunkInput::closeDataChunk() -{ - if (m_chunkStack == nullptr) - { - // TODO: Throw exception - return; - } - - if (m_chunkStack->dataLeft > 0) - { - // skip past the remainder of this chunk - m_file->absoluteSeek( m_file->tell()+m_chunkStack->dataLeft ); - decrementDataLeft( m_chunkStack->dataLeft ); - - } - - // pop the chunk off the stack - InputChunk *c = m_chunkStack; - m_chunkStack = m_chunkStack->next; - deleteInstance(c); -} - - -// return label of current data chunk -AsciiString DataChunkInput::getChunkLabel() -{ - if (m_chunkStack == nullptr) - { - // TODO: Throw exception - DEBUG_CRASH(("Bad.")); - return AsciiString::TheEmptyString; - } - - return m_contents.getName( m_chunkStack->id ); -} - -// return version of current data chunk -DataChunkVersionType DataChunkInput::getChunkVersion() -{ - if (m_chunkStack == nullptr) - { - // TODO: Throw exception - DEBUG_CRASH(("Bad.")); - return 0; - } - - return m_chunkStack->version; -} - -// return size of data stored in this chunk -UnsignedInt DataChunkInput::getChunkDataSize() -{ - if (m_chunkStack == nullptr) - { - // TODO: Throw exception - DEBUG_CRASH(("Bad.")); - return 0; - } - - return m_chunkStack->dataSize; -} - - -// return size of data left to read in this chunk -UnsignedInt DataChunkInput::getChunkDataSizeLeft() -{ - if (m_chunkStack == nullptr) - { - // TODO: Throw exception - DEBUG_CRASH(("Bad.")); - return 0; - } - - return m_chunkStack->dataLeft; -} - -Bool DataChunkInput::atEndOfChunk() -{ - if (m_chunkStack) - { - if (m_chunkStack->dataLeft <= 0) - return true; - return false; - } - - return true; -} - -// update data left in chunk(s) -// since data read from a chunk is also read from all parent chunks, -// traverse the chunk stack and decrement the data left for each -void DataChunkInput::decrementDataLeft( Int size ) -{ - InputChunk *c; - - c = m_chunkStack; - while (c) { - c->dataLeft -= size; - c = c->next; - } - // The sizes of the parent chunks on the stack are adjusted in closeDataChunk. -} - -Real DataChunkInput::readReal() -{ - Real r; - DEBUG_ASSERTCRASH(m_chunkStack->dataLeft>=sizeof(Real), ("Read past end of chunk.")); - m_file->read( (char *)&r, sizeof(Real) ); - decrementDataLeft( sizeof(Real) ); - return r; -} - -Int DataChunkInput::readInt() -{ - Int i; - DEBUG_ASSERTCRASH(m_chunkStack->dataLeft>=sizeof(Int), ("Read past end of chunk.")); - m_file->read( (char *)&i, sizeof(Int) ); - decrementDataLeft( sizeof(Int) ); - return i; -} - -Byte DataChunkInput::readByte() -{ - Byte b; - DEBUG_ASSERTCRASH(m_chunkStack->dataLeft>=sizeof(Byte), ("Read past end of chunk.")); - m_file->read( (char *)&b, sizeof(Byte) ); - decrementDataLeft( sizeof(Byte) ); - return b; -} - -void DataChunkInput::readArrayOfBytes(char *ptr, Int len) -{ - DEBUG_ASSERTCRASH(m_chunkStack->dataLeft>=len, ("Read past end of chunk.")); - m_file->read( ptr, len ); - decrementDataLeft( len ); -} - -NameKeyType DataChunkInput::readNameKey() -{ - Int keyAndType = readInt(); -#ifdef DEBUG_CRASHING - Dict::DataType t = (Dict::DataType)(keyAndType & 0xff); - DEBUG_ASSERTCRASH(t==Dict::DICT_ASCIISTRING,("Invalid key data.")); -#endif - keyAndType >>= 8; - - AsciiString kname = m_contents.getName(keyAndType); - NameKeyType k = TheNameKeyGenerator->nameToKey(kname); - return k; -} - -Dict DataChunkInput::readDict() -{ - UnsignedShort len; - DEBUG_ASSERTCRASH(m_chunkStack->dataLeft>=sizeof(UnsignedShort), ("Read past end of chunk.")); - m_file->read( &len, sizeof(UnsignedShort) ); - decrementDataLeft( sizeof(UnsignedShort) ); - DEBUG_ASSERTCRASH(m_chunkStack->dataLeft>=len, ("Read past end of chunk.")); - - Dict d(len); - - for (int i = 0; i < len; i++) - { - Int keyAndType = readInt(); - Dict::DataType t = (Dict::DataType)(keyAndType & 0xff); - keyAndType >>= 8; - - AsciiString kname = m_contents.getName(keyAndType); - NameKeyType k = TheNameKeyGenerator->nameToKey(kname); - - switch(t) - { - case Dict::DICT_BOOL: - d.setBool(k, readByte() ? true : false); - break; - case Dict::DICT_INT: - d.setInt(k, readInt()); - break; - case Dict::DICT_REAL: - d.setReal(k, readReal()); - break; - case Dict::DICT_ASCIISTRING: - d.setAsciiString(k, readAsciiString()); - break; - case Dict::DICT_UNICODESTRING: - d.setUnicodeString(k, readUnicodeString()); - break; - default: - throw ERROR_CORRUPT_FILE_FORMAT; - break; - } - } - - return d; -} - -AsciiString DataChunkInput::readAsciiString() -{ - UnsignedShort len; - DEBUG_ASSERTCRASH(m_chunkStack->dataLeft>=sizeof(UnsignedShort), ("Read past end of chunk.")); - m_file->read( &len, sizeof(UnsignedShort) ); - decrementDataLeft( sizeof(UnsignedShort) ); - DEBUG_ASSERTCRASH(m_chunkStack->dataLeft>=len, ("Read past end of chunk.")); - AsciiString theString; - if (len>0) { - char *str = theString.getBufferForRead(len); - m_file->read( str, len ); - decrementDataLeft( len ); - // add null delimiter to string. Note that getBufferForRead allocates space for terminating null. - str[len] = '\000'; - } - - return theString; -} - -UnicodeString DataChunkInput::readUnicodeString() -{ - UnsignedShort len; - DEBUG_ASSERTCRASH(m_chunkStack->dataLeft>=sizeof(UnsignedShort), ("Read past end of chunk.")); - m_file->read( &len, sizeof(UnsignedShort) ); - decrementDataLeft( sizeof(UnsignedShort) ); - DEBUG_ASSERTCRASH(m_chunkStack->dataLeft>=len, ("Read past end of chunk.")); - UnicodeString theString; - if (len>0) { - WideChar *str = theString.getBufferForRead(len); - m_file->read( (char*)str, len*sizeof(WideChar) ); - decrementDataLeft( len*sizeof(WideChar) ); - // add null delimiter to string. Note that getBufferForRead allocates space for terminating null. - str[len] = '\000'; - } - - return theString; -} diff --git a/Generals/Code/GameEngine/Source/Common/System/Directory.cpp b/Generals/Code/GameEngine/Source/Common/System/Directory.cpp deleted file mode 100644 index 67fe174d470..00000000000 --- a/Generals/Code/GameEngine/Source/Common/System/Directory.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#if (0) - -#include "Common/Directory.h" - -//------------------------------------------------------------------------------------------------- - -static void TimetToFileTime( time_t t, FILETIME& ft ) -{ - LONGLONG ll = Int32x32To64(t, 10000000) + 116444736000000000; - ft.dwLowDateTime = (DWORD) ll; - ft.dwHighDateTime = ll >>32; -} - -static time_t FileTimeToTimet( const FILETIME& ft ) -{ - LONGLONG ll = (ft.dwHighDateTime << 32) + ft.dwLowDateTime - 116444736000000000; - ll /= 10000000; - return (time_t)ll; -} - -//------------------------------------------------------------------------------------------------- - -void FileInfo::set( const WIN32_FIND_DATA& info ) -{ - filename = info.cFileName; - creationTime = FileTimeToTimet(info.ftCreationTime); - accessTime = FileTimeToTimet(info.ftLastAccessTime); - modTime = FileTimeToTimet(info.ftLastWriteTime); - attributes = info.dwFileAttributes; - filesize = info.nFileSizeLow; - //DEBUG_LOG(("FileInfo::set(): fname=%s, size=%d", filename.str(), filesize)); -} - -//------------------------------------------------------------------------------------------------- - -Directory::Directory( const AsciiString& dirPath ) : m_dirPath(dirPath) -{ - WIN32_FIND_DATA item; // search item - HANDLE hFile; // handle for search resources - char currDir[ MAX_PATH ]; - - // sanity - if( m_dirPath.isEmpty() ) - { - DEBUG_LOG(( "Empty dirname")); - return; - } - - // save the current directory - GetCurrentDirectory( MAX_PATH, currDir ); - - // switch into the directory provided - if( SetCurrentDirectory( m_dirPath.str() ) == 0 ) - { - DEBUG_LOG(( "Can't set directory '%s'", m_dirPath.str() )); - return; - } - - // go through each item in the output directory - bool done = false; - hFile = FindFirstFile( "*", &item); - if( hFile == INVALID_HANDLE_VALUE ) - { - DEBUG_LOG(( "Can't search directory '%s'", m_dirPath.str() )); - done = true; - } - - FileInfo info; - - while (!done) - { - // if this is a subdirectory keep the name around till the end - if( BitIsSet( item.dwFileAttributes, FILE_ATTRIBUTE_DIRECTORY ) ) - { - if ( strcmp( item.cFileName, "." ) != 0 && strcmp( item.cFileName, ".." ) != 0 ) - { - info.set(item); - m_subdirs.insert( info ); - } - } - else - { - info.set(item); - m_files.insert( info ); - } - - if ( FindNextFile( hFile, &item ) == 0 ) - { - done = true; - } - } - - // close search - FindClose( hFile ); - - // restore the working directory to what it was when we started here - SetCurrentDirectory( currDir ); -} - -FileInfoSet* Directory::getFiles() -{ - return &m_files; -} - -FileInfoSet* Directory::getSubdirs() -{ - return &m_subdirs; -} - -#endif diff --git a/Generals/Code/GameEngine/Source/Common/System/DisabledTypes.cpp b/Generals/Code/GameEngine/Source/Common/System/DisabledTypes.cpp deleted file mode 100644 index 5c0ffee7146..00000000000 --- a/Generals/Code/GameEngine/Source/Common/System/DisabledTypes.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// DisabledTypes.cpp ///////////////////////////////////////////////////////////////////////////////////// -// Kris Morness, September 2002 - -#include "PreRTS.h" - -#include "Common/DisabledTypes.h" -#include "Common/BitFlagsIO.h" - -template<> -const char* const DisabledMaskType::s_bitNameList[] = -{ - "DEFAULT", - "DISABLED_HACKED", - "DISABLED_EMP", - "DISABLED_HELD", - "DISABLED_PARALYZED", - "DISABLED_UNMANNED", - "DISABLED_UNDERPOWERED", - "DISABLED_FREEFALL", - - "DISABLED_AWESTRUCK", - "DISABLED_BRAINWASHED", - "DISABLED_SUBDUED", - - "DISABLED_SCRIPT_DISABLED", - "DISABLED_SCRIPT_UNDERPOWERED", - - nullptr -}; -static_assert(ARRAY_SIZE(DisabledMaskType::s_bitNameList) == DisabledMaskType::NumBits + 1, "Incorrect array size"); - -DisabledMaskType DISABLEDMASK_NONE; // inits to all zeroes -DisabledMaskType DISABLEDMASK_ALL(DisabledMaskType::kInitSetAll); diff --git a/Generals/Code/GameEngine/Source/Common/System/Geometry.cpp b/Generals/Code/GameEngine/Source/Common/System/Geometry.cpp deleted file mode 100644 index 2e4c35a2421..00000000000 --- a/Generals/Code/GameEngine/Source/Common/System/Geometry.cpp +++ /dev/null @@ -1,600 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Geometry.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, Aug 2002 -// Desc: -/////////////////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#define DEFINE_GEOMETRY_NAMES - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "Common/Geometry.h" -#include "Common/INI.h" -#include "Common/RandomValue.h" -#include "Common/Xfer.h" - - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//============================================================================= -/*static*/ void GeometryInfo::parseGeometryType( INI* ini, void * /*instance*/, void *store, const void* /*userData*/ ) -{ - ((GeometryInfo*)store)->m_type = (GeometryType)INI::scanIndexList(ini->getNextToken(), GeometryNames); - ((GeometryInfo*)store)->calcBoundingStuff(); -} - -//============================================================================= -/*static*/ void GeometryInfo::parseGeometryIsSmall( INI* ini, void * /*instance*/, void *store, const void* /*userData*/ ) -{ - ((GeometryInfo*)store)->m_isSmall = INI::scanBool(ini->getNextToken()); - ((GeometryInfo*)store)->calcBoundingStuff(); -} - -//============================================================================= -/*static*/ void GeometryInfo::parseGeometryHeight( INI* ini, void * /*instance*/, void *store, const void* /*userData*/ ) -{ - ((GeometryInfo*)store)->m_height = INI::scanReal(ini->getNextToken()); - ((GeometryInfo*)store)->calcBoundingStuff(); -} - -//============================================================================= -/*static*/ void GeometryInfo::parseGeometryMajorRadius( INI* ini, void * /*instance*/, void *store, const void* /*userData*/ ) -{ - ((GeometryInfo*)store)->m_majorRadius = INI::scanReal(ini->getNextToken()); - ((GeometryInfo*)store)->calcBoundingStuff(); -} - -//============================================================================= -/*static*/ void GeometryInfo::parseGeometryMinorRadius( INI* ini, void * /*instance*/, void *store, const void* /*userData*/ ) -{ - ((GeometryInfo*)store)->m_minorRadius = INI::scanReal(ini->getNextToken()); - ((GeometryInfo*)store)->calcBoundingStuff(); -} - -//----------------------------------------------------------------------------- -void GeometryInfo::set(GeometryType type, Bool isSmall, Real height, Real majorRadius, Real minorRadius) -{ - m_type = type; - m_isSmall = isSmall; - - switch(m_type) - { - case GEOMETRY_SPHERE: - m_majorRadius = majorRadius; - m_minorRadius = majorRadius; - m_height = majorRadius; - break; - - case GEOMETRY_CYLINDER: - m_majorRadius = majorRadius; - m_minorRadius = majorRadius; - m_height = height; - break; - - case GEOMETRY_BOX: - m_majorRadius = majorRadius; - m_minorRadius = minorRadius; - m_height = height; - break; - }; - - calcBoundingStuff(); -} - -//----------------------------------------------------------------------------- -static Real calcDotProduct(const Coord3D& a, const Coord3D& b) -{ - return a.x*b.x + a.y*b.y + a.z*b.z; -} - -//----------------------------------------------------------------------------- -static Real calcDistSquared(const Coord3D& a, const Coord3D& b) -{ - return sqr(a.x - b.x) + sqr(a.y - b.y) + sqr(a.z - b.z); -} - -//----------------------------------------------------------------------------- -static Real calcPointToLineDistSquared(const Coord3D& pt, const Coord3D& lineStart, const Coord3D& lineEnd) -{ - Coord3D line, lineToPt, closest; - - line.x = lineEnd.x - lineStart.x; - line.y = lineEnd.y - lineStart.y; - line.z = lineEnd.z - lineStart.z; - - lineToPt.x = pt.x - lineStart.x; - lineToPt.y = pt.y - lineStart.y; - lineToPt.z = pt.z - lineStart.z; - - Real dot = calcDotProduct(lineToPt, line); - if (dot <= 0.0f) - { - // angle is obtuse - return calcDistSquared(pt, lineStart); - } - - Real lineLenSqr = calcDistSquared(lineStart, lineEnd); - DEBUG_ASSERTCRASH(lineLenSqr==calcDotProduct(line,line),("hmm")); - if (lineLenSqr <= dot) - { - return calcDistSquared(pt, lineEnd); - } - - Real tmp = dot / lineLenSqr; - - closest.x = lineStart.x + tmp * line.x; - closest.y = lineStart.y + tmp * line.y; - closest.z = lineStart.z + tmp * line.z; - - return calcDistSquared(pt, closest); -} - -//============================================================================= -Bool GeometryInfo::isIntersectedByLineSegment(const Coord3D& loc, const Coord3D& from, const Coord3D& to) const -{ - DEBUG_CRASH(("this call does not work properly for nonspheres yet. use with caution.")); - - /// @todo srj -- treats everything as a sphere for now. fix. - Real distSquared = calcPointToLineDistSquared(loc, from, to); - return distSquared <= sqr(getBoundingSphereRadius()); -} - -//============================================================================= -// given an object with this geom, located at 'pos', and another obj with the given -// pos & geom, calc the min and max pitches from this to that. -void GeometryInfo::calcPitches(const Coord3D& thisPos, const GeometryInfo& that, const Coord3D& thatPos, - Real& minPitch, Real& maxPitch) const -{ - Coord3D thisCenter; - getCenterPosition(thisPos, thisCenter); - - Real dxy = sqrt(sqr(thatPos.x - thisCenter.x) + sqr(thatPos.y - thisCenter.y)); - - Real dz; - - /** @todo srj -- this could be better, by calcing it for all the corners, not just top-center - and bottom-center... oh well */ - dz = (thatPos.z + that.getMaxHeightAbovePosition()) - thisCenter.z; - maxPitch = atan2(dz, dxy); - - dz = (thatPos.z - that.getMaxHeightBelowPosition()) - thisCenter.z; - minPitch = atan2(dz, dxy); -} - -//============================================================================= -// given an object with this geom, SET how far above the object's canonical position its max z should extend. -void GeometryInfo::setMaxHeightAbovePosition(Real z) -{ - switch(m_type) - { - case GEOMETRY_SPHERE: - m_majorRadius = z; - break; - - case GEOMETRY_BOX: - case GEOMETRY_CYLINDER: - m_height = z; - break; - }; - - calcBoundingStuff(); -} - -//============================================================================= -// given an object with this geom, how far above the object's canonical position does its max z extend? -Real GeometryInfo::getMaxHeightAbovePosition() const -{ - switch(m_type) - { - case GEOMETRY_SPHERE: - return m_majorRadius; - - case GEOMETRY_BOX: - case GEOMETRY_CYLINDER: - return m_height; - }; - - return 0.0f; -} - -//============================================================================= -// given an object with this geom, how far below the object's canonical position does its max z extend? -Real GeometryInfo::getMaxHeightBelowPosition() const -{ - switch(m_type) - { - case GEOMETRY_SPHERE: - return m_majorRadius; - - case GEOMETRY_BOX: - case GEOMETRY_CYLINDER: - return 0.0f; - }; - - return 0.0f; -} - -//============================================================================= -// given an object with this geom, located at 'pos', where is the "center" of the geometry? -Real GeometryInfo::getZDeltaToCenterPosition() const -{ - return (m_type == GEOMETRY_SPHERE) ? 0.0f : (m_height * 0.5f); -} - -//============================================================================= -// given an object with this geom, located at 'pos', where is the "center" of the geometry? -void GeometryInfo::getCenterPosition(const Coord3D& pos, Coord3D& center) const -{ - center = pos; - center.z += getZDeltaToCenterPosition(); -} - -//============================================================================= -void GeometryInfo::expandFootprint(Real radius) -{ - m_majorRadius += radius; - m_minorRadius += radius; - calcBoundingStuff(); -} - -//============================================================================= -void GeometryInfo::get2DBounds(const Coord3D& geomCenter, Real angle, Region2D& bounds) const -{ - switch(m_type) - { - case GEOMETRY_SPHERE: - case GEOMETRY_CYLINDER: - { - bounds.lo.x = geomCenter.x - m_majorRadius; - bounds.lo.y = geomCenter.y - m_majorRadius; - bounds.hi.x = geomCenter.x + m_majorRadius; - bounds.hi.y = geomCenter.y + m_majorRadius; - break; - } - - case GEOMETRY_BOX: - { - Real c = (Real)cos(angle); - Real s = (Real)sin(angle); - Real exc = m_majorRadius*c; - Real eyc = m_minorRadius*c; - Real exs = m_majorRadius*s; - Real eys = m_minorRadius*s; - Real x,y; - x = geomCenter.x - exc - eys; - y = geomCenter.y + eyc - exs; - bounds.lo.x = x; - bounds.lo.y = y; - bounds.hi.x = x; - bounds.hi.y = y; - - x = geomCenter.x + exc - eys; - y = geomCenter.y + eyc + exs; - if (bounds.lo.x > x) bounds.lo.x = x; - if (bounds.lo.y > y) bounds.lo.y = y; - if (bounds.hi.x < x) bounds.hi.x = x; - if (bounds.hi.y < y) bounds.hi.y = y; - - x = geomCenter.x + exc + eys; - y = geomCenter.y - eyc + exs; - if (bounds.lo.x > x) bounds.lo.x = x; - if (bounds.lo.y > y) bounds.lo.y = y; - if (bounds.hi.x < x) bounds.hi.x = x; - if (bounds.hi.y < y) bounds.hi.y = y; - - x = geomCenter.x - exc + eys; - y = geomCenter.y - eyc - exs; - if (bounds.lo.x > x) bounds.lo.x = x; - if (bounds.lo.y > y) bounds.lo.y = y; - if (bounds.hi.x < x) bounds.hi.x = x; - if (bounds.hi.y < y) bounds.hi.y = y; - - break; - } - } -} - -//============================================================================= -void GeometryInfo::clipPointToFootprint(const Coord3D& geomCenter, Coord3D& ptToClip) const -{ - switch(m_type) - { - case GEOMETRY_SPHERE: - case GEOMETRY_CYLINDER: - { - Real dx = ptToClip.x - geomCenter.x; - Real dy = ptToClip.y - geomCenter.y; - Real radius = sqrt(sqr(dx) + sqr(dy)); - if (radius > m_majorRadius) - { - Real ratio = m_majorRadius / radius; - ptToClip.x = geomCenter.x + dx * ratio; - ptToClip.y = geomCenter.y + dy * ratio; - } - break; - } - - case GEOMETRY_BOX: - { - ptToClip.x = clamp(geomCenter.x - m_majorRadius, ptToClip.x, geomCenter.x + m_majorRadius); - ptToClip.y = clamp(geomCenter.y - m_minorRadius, ptToClip.y, geomCenter.y + m_minorRadius); - break; - } - }; -} - -//============================================================================= -inline Bool isWithin(Real a, Real b, Real c) { return a<=b && b<=c; } - -//============================================================================= -Bool GeometryInfo::isPointInFootprint(const Coord3D& geomCenter, const Coord3D& pt) const -{ - switch(m_type) - { - case GEOMETRY_SPHERE: - case GEOMETRY_CYLINDER: - { - Real dx = pt.x - geomCenter.x; - Real dy = pt.y - geomCenter.y; - Real radius = sqrt(sqr(dx) + sqr(dy)); - return (radius <= m_majorRadius); - break; - } - - case GEOMETRY_BOX: - { - return isWithin(geomCenter.x - m_majorRadius, pt.x, geomCenter.x + m_majorRadius) && - isWithin(geomCenter.y - m_minorRadius, pt.y, geomCenter.y + m_minorRadius); - } - }; - return false; -} - -//============================================================================= -void GeometryInfo::makeRandomOffsetWithinFootprint(Coord3D& pt, const RandomValueClass& random) const -{ - switch(m_type) - { - case GEOMETRY_SPHERE: - case GEOMETRY_CYLINDER: - { -#if 1 - // this is a better technique than the more obvious radius-and-angle - // one, below, because the latter tends to clump more towards the center. - Real maxDistSqr = sqr(m_majorRadius); - Real distSqr; - do - { - pt.x = RandomValueReal(random, -m_majorRadius, m_majorRadius); - pt.y = RandomValueReal(random, -m_majorRadius, m_majorRadius); - pt.z = 0.0f; - distSqr = sqr(pt.x) + sqr(pt.y); - } while (distSqr > maxDistSqr); -#else - Real radius = RandomValueReal(random, 0.0f, m_boundingCircleRadius); - Real angle = RandomValueReal(random, -PI, PI); - pt.x = radius * Cos(angle); - pt.y = radius * Sin(angle); - pt.z = 0.0f; -#endif - break; - } - - case GEOMETRY_BOX: - { - pt.x = RandomValueReal(random, -m_majorRadius, m_majorRadius); - pt.y = RandomValueReal(random, -m_minorRadius, m_minorRadius); - pt.z = 0.0f; - break; - } - }; -} - -//============================================================================= -void GeometryInfo::makeRandomOffsetOnPerimeter(Coord3D& pt) const -{ - switch(m_type) - { - case GEOMETRY_SPHERE: - case GEOMETRY_CYLINDER: - { - DEBUG_CRASH( ("GeometryInfo::makeRandomOffsetOnPerimeter() not implemented for SPHERE or CYLINDER extents. Using position.") ); - - //Kris: Did not have time nor need to support non-box extents. I added this feature for script placement - // of boobytraps. - pt.x = 0.0f; - pt.y = 0.0f; - break; - } - - case GEOMETRY_BOX: - { - if( GameLogicRandomValueReal( 0.0f, 1.0f ) < 0.5f ) - { - //Pick random point on x axis. - pt.x = GameLogicRandomValueReal(-m_majorRadius, m_majorRadius); - - //Min or max the y axis value - if( GameLogicRandomValueReal( 0.0f, 1.0f ) < 0.5f ) - pt.y = -m_minorRadius; - else - pt.y = m_minorRadius; - } - else - { - //Pick random point on y axis. - pt.y = GameLogicRandomValueReal(-m_minorRadius, m_minorRadius); - - //Min or max the x axis value - if( GameLogicRandomValueReal( 0.0f, 1.0f ) < 0.5f ) - pt.x = -m_majorRadius; - else - pt.x = m_majorRadius; - } - pt.z = 0.0f; - break; - } - }; -} - -//============================================================================= -Real GeometryInfo::getFootprintArea() const -{ - switch(m_type) - { - case GEOMETRY_SPHERE: - case GEOMETRY_CYLINDER: - { - return PI * sqr(m_boundingCircleRadius); - } - - case GEOMETRY_BOX: - { - return 4.0f * m_majorRadius * m_minorRadius; - } - }; - - DEBUG_CRASH(("should never get here")); - return 0.0f; -} - -//============================================================================= -void GeometryInfo::calcBoundingStuff() -{ - switch(m_type) - { - case GEOMETRY_SPHERE: - { - m_boundingSphereRadius = m_majorRadius; - m_boundingCircleRadius = m_majorRadius; - break; - } - case GEOMETRY_CYLINDER: - { - m_boundingCircleRadius = m_majorRadius; - - m_boundingSphereRadius = m_height*0.5; - if (m_boundingSphereRadius < m_majorRadius) - m_boundingSphereRadius = m_majorRadius; - break; - } - - case GEOMETRY_BOX: - { - m_boundingCircleRadius = sqrt(sqr(m_majorRadius) + sqr(m_minorRadius)); - m_boundingSphereRadius = sqrt(sqr(m_majorRadius) + sqr(m_minorRadius) + sqr(m_height*0.5)); - break; - } - }; -} - -#if defined(RTS_DEBUG) -//============================================================================= -void GeometryInfo::tweakExtents(ExtentModType extentModType, Real extentModAmount) -{ - switch(extentModType) - { - case EXTENTMOD_HEIGHT: - m_height += extentModAmount; - break; - case EXTENTMOD_MAJOR: - m_majorRadius += extentModAmount; - break; - case EXTENTMOD_MINOR: - m_minorRadius += extentModAmount; - break; - case EXTENTMOD_TYPE: - m_type = (GeometryType)((m_type + ((extentModType == EXTENTMOD_TYPE)?1:0)) % GEOMETRY_NUM_TYPES); - break; - } - m_isSmall = false; - calcBoundingStuff(); -} -#endif - -#if defined(RTS_DEBUG) -//============================================================================= -AsciiString GeometryInfo::getDescriptiveString() const -{ - AsciiString msg; - msg.format("%d/%d(%g %g %g)", (Int)m_type, (Int)m_isSmall, m_majorRadius, m_minorRadius, m_height); - return msg; -} -#endif - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void GeometryInfo::crc( Xfer *xfer ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void GeometryInfo::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // type - xfer->xferUser( &m_type, sizeof( GeometryType ) ); - - // is small - xfer->xferBool( &m_isSmall ); - - // height - xfer->xferReal( &m_height ); - - // major radius - xfer->xferReal( &m_majorRadius ); - - // minor radius - xfer->xferReal( &m_minorRadius ); - - // bouncing circle radius - xfer->xferReal( &m_boundingCircleRadius ); - - // bounding sphere radius - xfer->xferReal( &m_boundingSphereRadius ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void GeometryInfo::loadPostProcess() -{ - -} diff --git a/Generals/Code/GameEngine/Source/Common/System/KindOf.cpp b/Generals/Code/GameEngine/Source/Common/System/KindOf.cpp deleted file mode 100644 index e5c20d2cfb2..00000000000 --- a/Generals/Code/GameEngine/Source/Common/System/KindOf.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// Kindof.cpp ///////////////////////////////////////////////////////////////////////////////////// -// Part of header detangling -// John McDonald, Aug 2002 - -#include "PreRTS.h" - -#include "Common/KindOf.h" -#include "Common/BitFlagsIO.h" - -template<> -const char* const KindOfMaskType::s_bitNameList[] = -{ - "OBSTACLE", - "SELECTABLE", - "IMMOBILE", - "CAN_ATTACK", - "STICK_TO_TERRAIN_SLOPE", - "CAN_CAST_REFLECTIONS", - "SHRUBBERY", - "STRUCTURE", - "INFANTRY", - "VEHICLE", - "AIRCRAFT", - "HUGE_VEHICLE", - "DOZER", - "HARVESTER", - "COMMANDCENTER", -#ifdef ALLOW_SURRENDER - "PRISON", - "COLLECTS_PRISON_BOUNTY", - "POW_TRUCK", -#endif - "LINEBUILD", - "SALVAGER", - "WEAPON_SALVAGER", - "TRANSPORT", - "BRIDGE", - "LANDMARK_BRIDGE", - "BRIDGE_TOWER", - "PROJECTILE", - "PRELOAD", - "NO_GARRISON", - "WAVEGUIDE", - "WAVE_EFFECT", - "NO_COLLIDE", - "REPAIR_PAD", - "HEAL_PAD", - "STEALTH_GARRISON", - "CASH_GENERATOR", -#if RTS_GENERALS - "AIRFIELD", -#endif - "DRAWABLE_ONLY", - "MP_COUNT_FOR_VICTORY", - "REBUILD_HOLE", - "SCORE", - "SCORE_CREATE", - "SCORE_DESTROY", - "NO_HEAL_ICON", - "CAN_RAPPEL", - "PARACHUTABLE", -#ifdef ALLOW_SURRENDER - "CAN_SURRENDER", -#endif - "CAN_BE_REPULSED", - "MOB_NEXUS", - "IGNORED_IN_GUI", - "CRATE", - "CAPTURABLE", - "CLEARED_BY_BUILD", - "SMALL_MISSILE", - "ALWAYS_VISIBLE", - "UNATTACKABLE", - "MINE", - "CLEANUP_HAZARD", - "PORTABLE_STRUCTURE", - "ALWAYS_SELECTABLE", - "ATTACK_NEEDS_LINE_OF_SIGHT", - "WALK_ON_TOP_OF_WALL", - "DEFENSIVE_WALL", - "FS_POWER", - "FS_FACTORY", - "FS_BASE_DEFENSE", - "FS_TECHNOLOGY", - "AIRCRAFT_PATH_AROUND", - "LOW_OVERLAPPABLE", - "FORCEATTACKABLE", - "AUTO_RALLYPOINT", - "TECH_BUILDING", - "POWERED", - "PRODUCED_AT_HELIPAD", - "DRONE", - "CAN_SEE_THROUGH_STRUCTURE", - "BALLISTIC_MISSILE", - "CLICK_THROUGH", - "SUPPLY_SOURCE_ON_PREVIEW", - "PARACHUTE", - "GARRISONABLE_UNTIL_DESTROYED", - "BOAT", - "IMMUNE_TO_CAPTURE", - "HULK", - "SHOW_PORTRAIT_WHEN_CONTROLLED", - "SPAWNS_ARE_THE_WEAPONS", - "CANNOT_BUILD_NEAR_SUPPLIES", - "SUPPLY_SOURCE", - "REVEAL_TO_ALL", - "DISGUISER", - "INERT", - "HERO", - "IGNORES_SELECT_ALL", - "DONT_AUTO_CRUSH_INFANTRY", - "CLIFF_JUMPER", - "FS_SUPPLY_DROPZONE", - "FS_SUPERWEAPON", - "FS_BLACK_MARKET", - "FS_SUPPLY_CENTER", - "FS_STRATEGY_CENTER", - "MONEY_HACKER", - "ARMOR_SALVAGER", - "REVEALS_ENEMY_PATHS", - "BOOBY_TRAP", - "FS_FAKE", - "FS_INTERNET_CENTER", - "BLAST_CRATER", - "PROP", - "OPTIMIZED_TREE", - "FS_ADVANCED_TECH", - "FS_BARRACKS", - "FS_WARFACTORY", - "FS_AIRFIELD", - "AIRCRAFT_CARRIER", - "NO_SELECT", - "REJECT_UNMANNED", - "CANNOT_RETALIATE", - "TECH_BASE_DEFENSE", - "EMP_HARDENED", - "DEMOTRAP", - "CONSERVATIVE_BUILDING", - "IGNORE_DOCKING_BONES", - - nullptr -}; -static_assert(ARRAY_SIZE(KindOfMaskType::s_bitNameList) == KindOfMaskType::NumBits + 1, "Incorrect array size"); - -static const Int fsList[] = { - KINDOF_FS_FACTORY, - KINDOF_FS_BASE_DEFENSE, - KINDOF_FS_TECHNOLOGY, - KINDOF_FS_SUPPLY_DROPZONE, - KINDOF_FS_SUPERWEAPON, - KINDOF_FS_BLACK_MARKET, - KINDOF_FS_SUPPLY_CENTER, - KINDOF_FS_STRATEGY_CENTER, - KINDOF_FS_FAKE, - KINDOF_FS_INTERNET_CENTER, - KINDOF_FS_ADVANCED_TECH, - KINDOF_FS_BARRACKS, - KINDOF_FS_WARFACTORY, - KINDOF_FS_AIRFIELD, -}; - -KindOfMaskType KINDOFMASK_NONE; // inits to all zeroes -KindOfMaskType KINDOFMASK_FS(KindOfMaskType::kInit, fsList, ARRAY_SIZE(fsList)); diff --git a/Generals/Code/GameEngine/Source/Common/System/List.cpp b/Generals/Code/GameEngine/Source/Common/System/List.cpp deleted file mode 100644 index 00608d1386e..00000000000 --- a/Generals/Code/GameEngine/Source/Common/System/List.cpp +++ /dev/null @@ -1,451 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//---------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright(C) 2001 - All Rights Reserved -// -//---------------------------------------------------------------------------- -// -// Project: WSYS Library -// -// Module: List -// -// File name: WSYS_List.cpp -// -// Created: 10/31/01 TR -// -//---------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- -// Includes -//---------------------------------------------------------------------------- - -#include "PreRTS.h" - -#include "Common/List.h" - -// 'assignment within condition expression'. -#pragma warning(disable : 4706) - -//---------------------------------------------------------------------------- -// Externals -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Defines -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Types -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Data -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Public Data -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Prototypes -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Private Functions -//---------------------------------------------------------------------------- - - - -//---------------------------------------------------------------------------- -// Public Functions -//---------------------------------------------------------------------------- - -//============================================================================ -// LList::LList -//============================================================================ - -LList::LList() -: m_sortMode(DESCENDING) -{ - m_head.setItem( &m_head.m_item); -}; - -//================================================================= -// LList::add -//================================================================= - -void LList::add( LListNode* new_node ) -{ - LListNode* node; - Int pri; - - if ( m_addToEndOfGroup ) - { - pri = new_node->priority(); - node = &m_head; - while( (node = node->prev() )) - { - if( (m_sortMode == ASCENDING && node->priority() >= pri) - || (m_sortMode == DESCENDING && node->priority() <= pri) ) - { - node->append( new_node ); - return; - } - } - m_head.append( new_node ); - } - else - { - pri = new_node->priority(); - node = &m_head; - while( (node = node->next() )) - { - if( (m_sortMode == ASCENDING && node->priority() <= pri) - || (m_sortMode == DESCENDING && node->priority() >= pri) ) - { - node->insert( new_node ); - return; - } - } - m_head.insert( new_node ); - } -} - -//============================================================================ -// LList::addGDFNode -//============================================================================ - -void LList::addItem( Int pri, void* item ) -{ - LListNode *node = NEW LListNode(); // poolify - - if ( node ) - { - node->setPriority( pri ); - node->setItem( item ); - node->autoDelete(); - add( node ); - } -} - -//============================================================================ -// LList::addGDFNodeToHead -//============================================================================ - -void LList::addItemToHead( void *item ) -{ - LListNode *node = NEW LListNode(); - - if ( node ) - { - node->setItem( item ); - node->autoDelete(); - addToHead( node ); - } -} - -//============================================================================ -// LList::addGDFNodeToTail -//============================================================================ - -void LList::addItemToTail( void *item ) -{ - LListNode *node = NEW LListNode(); - - if ( node ) - { - node->setItem( item ); - node->autoDelete(); - addToTail( node ); - } -} - -//============================================================================ -// LList::Clear -//============================================================================ - -void LList::clear() -{ - LListNode *node; - - while ( (node = firstNode()) != nullptr ) - { - node->remove(); - node->destroy(); - } -} - -//================================================================= -// LList::nodeCount -//================================================================= - -Int LList::nodeCount() -{ - LListNode* node; - Int count = 0; - - node = firstNode(); - - while(node) - { - count++; - node = node->next(); - } - - return count; -} - -//================================================================= -// LList::getNode -//================================================================= - -LListNode* LList::getNode( Int index ) -{ - LListNode* node; - - node = firstNode(); - - while( node && index >= 0 ) - { - if( index-- == 0 ) - { - return node; - } - node = node->next(); - } - - return nullptr; -} - -//============================================================================ -// LList::merge -//============================================================================ - -void LList::merge( LList *list ) -{ - - if ( list == nullptr || list->isEmpty() ) - { - return; - } - - m_head.m_prev->m_next = list->m_head.m_next; - list->m_head.m_next->m_prev = m_head.m_prev; - list->m_head.m_prev->m_next = &m_head; - m_head.m_prev = list->m_head.m_prev; - list->m_head.m_next = &list->m_head; - list->m_head.m_prev = &list->m_head; - -} - -//============================================================================ -// LList::hasReference -//============================================================================ - -Bool LList::hasItem( void *item ) -{ - return findItem( item ) != nullptr; -} - -//============================================================================ -// LList::findReference -//============================================================================ - -LListNode* LList::findItem( void *item ) -{ - LListNode* node; - - node = firstNode(); - - while( node ) - { - if( node->item() == item ) - { - return node; - } - node = node->next(); - } - - return nullptr; -} - -//============================================================================ -// LListNode::LListNode -//============================================================================ - -LListNode::LListNode() -: m_pri(0), - m_item(nullptr), - m_autoDelete(FALSE) -{ - m_next = m_prev = this; -}; - -//================================================================= -// LListNode::insert -//================================================================= - -void LListNode::insert( LListNode* new_node ) -{ - new_node->m_prev = m_prev; - new_node->m_next = this; - m_prev = new_node; - new_node->m_prev->m_next = new_node; -} - -//================================================================= -// LListNode::append -//================================================================= - -void LListNode::append( LListNode* new_node ) -{ - new_node->m_prev = this; - new_node->m_next = m_next; - this->m_next = new_node; - new_node->m_next->m_prev = new_node; -} - -//================================================================= -// LListNode::remove -//================================================================= - -void LListNode::remove() -{ - m_prev->m_next = m_next; - m_next->m_prev = m_prev; - m_prev = m_next = this; // so we know that the node is not in a list -} - -//================================================================= -// LListNode::next -//================================================================= - -LListNode* LListNode::next() -{ - - if( m_next->isHead()) - { - return nullptr; - } - - return m_next; -} - -//================================================================= -// LListNode::prev -//================================================================= - -LListNode* LListNode::prev() -{ - if( m_prev->isHead()) - { - return nullptr; - } - - return m_prev; -} - -//================================================================= -// LListNode::loopNext -//================================================================= - -LListNode* LListNode::loopNext() -{ - LListNode* next; - - next = m_next; - - if( next->isHead()) - { - // skip head node - next = next->m_next; - if( next->isHead()) - { - return nullptr; // it is an empty list - } - } - - return next; -} - -//================================================================= -// LListNode::loopPrev -//================================================================= - -LListNode* LListNode::loopPrev() -{ - LListNode* prev; - - prev = m_prev; - - if( prev->isHead()) - { - // skip head node - prev = prev->m_prev; - if( prev->isHead()) - { - return nullptr; // it is an empty list - } - } - - return prev; -} - -//============================================================================ -// LListNode::destroy -//============================================================================ - -void LListNode::destroy() -{ - if ( m_autoDelete ) - { - delete this; - } -} - -//============================================================================ -// LList::addToEndOfGroup -//============================================================================ - -void LList::addToEndOfGroup( Bool yes ) -{ - m_addToEndOfGroup = yes; -} diff --git a/Generals/Code/GameEngine/Source/Common/System/QuotedPrintable.cpp b/Generals/Code/GameEngine/Source/Common/System/QuotedPrintable.cpp deleted file mode 100644 index 29a158b821e..00000000000 --- a/Generals/Code/GameEngine/Source/Common/System/QuotedPrintable.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: QuotedPrintable.cpp ///////////////////////////////////////////////////////// -// Author: Matt Campbell, February 2002 -// Description: Quoted-printable encode/decode -//////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/QuotedPrintable.h" - -#define MAGIC_CHAR '_' - -// takes an integer and returns an ASCII representation -static char intToHexDigit(int num) -{ - if (num<0 || num >15) return '\0'; - if (num<10) - { - return '0' + num; - } - return 'A' + (num-10); -} - -// convert an ASCII representation of a hex digit into the digit itself -static int hexDigitToInt(char c) -{ - if (c <= '9' && c >= '0') return (c - '0'); - if (c <= 'f' && c >= 'a') return (c - 'a' + 10); - if (c <= 'F' && c >= 'A') return (c - 'A' + 10); - return 0; -} - -// Convert unicode strings into ascii quoted-printable strings -AsciiString UnicodeStringToQuotedPrintable(UnicodeString original) -{ - static char dest[1024]; - const unsigned char *src = reinterpret_cast(original.str()); - int i=0; - while ( !(src[0]=='\0' && src[1]=='\0') && i<1021 ) - { - if (!isalnum(*src)) - { - dest[i++] = MAGIC_CHAR; - dest[i++] = intToHexDigit((*src)>>4); - dest[i++] = intToHexDigit((*src)&0xf); - } - else - { - dest[i++] = *src; - } - src ++; - if (!isalnum(*src)) - { - dest[i++] = MAGIC_CHAR; - dest[i++] = intToHexDigit((*src)>>4); - dest[i++] = intToHexDigit((*src)&0xf); - } - else - { - dest[i++] = *src; - } - src ++; - } - dest[i] = '\0'; - - return dest; -} - -// Convert ascii strings into ascii quoted-printable strings -AsciiString AsciiStringToQuotedPrintable(AsciiString original) -{ - static char dest[1024]; - const unsigned char *src = reinterpret_cast(original.str()); - int i=0; - while ( src[0]!='\0' && i<1021 ) - { - if (!isalnum(*src)) - { - dest[i++] = MAGIC_CHAR; - dest[i++] = intToHexDigit((*src)>>4); - dest[i++] = intToHexDigit((*src)&0xf); - } - else - { - dest[i++] = *src; - } - src ++; - } - dest[i] = '\0'; - - return dest; -} - -// Convert ascii quoted-printable strings into unicode strings -UnicodeString QuotedPrintableToUnicodeString(AsciiString original) -{ - static WideChar dest[1024]; - int i=0; - - unsigned char *c = reinterpret_cast(dest); - const unsigned char *src = reinterpret_cast(original.str()); - - while (*src && i<1023) - { - if (*src == MAGIC_CHAR) - { - if (src[1] == '\0') - { - // string ends with MAGIC_CHAR - break; - } - *c = hexDigitToInt(src[1]); - src++; - if (src[1] != '\0') - { - *c = *c<<4; - *c = *c | hexDigitToInt(src[1]); - src++; - } - } - else - { - *c = *src; - } - src++; - c++; - } - - // Fixup odd-length strings - if ((c-(unsigned char *)dest)%2) - { - // OK - } - else - { - *c = '\0'; - c++; - } - - *c = 0; - - return dest; -} - -// Convert ascii quoted-printable strings into ascii strings -AsciiString QuotedPrintableToAsciiString(AsciiString original) -{ - static char dest[1024]; - int i=0; - - unsigned char *c = reinterpret_cast(dest); - const unsigned char *src = reinterpret_cast(original.str()); - - while (*src && i<1023) - { - if (*src == MAGIC_CHAR) - { - if (src[1] == '\0') - { - // string ends with MAGIC_CHAR - break; - } - *c = hexDigitToInt(src[1]); - src++; - if (src[1] != '\0') - { - *c = *c<<4; - *c = *c | hexDigitToInt(src[1]); - src++; - } - } - else - { - *c = *src; - } - src++; - c++; - } - - *c = 0; - - return dest; -} - diff --git a/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp b/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp deleted file mode 100644 index ccf690a860a..00000000000 --- a/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp +++ /dev/null @@ -1,640 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#if defined(RTS_DEBUG) || defined(IG_DEBUG_STACKTRACE) - -#pragma pack(push, 8) - -#include "Common/StackDump.h" -#include "Common/Debug.h" - -#include "DbgHelpLoader.h" - -//***************************************************************************** -// Prototypes -//***************************************************************************** -BOOL InitSymbolInfo(); -void MakeStackTrace(DWORD myeip,DWORD myesp,DWORD myebp, int skipFrames, void (*callback)(const char*)); -void GetFunctionDetails(void *pointer, char*name, char*filename, unsigned int* linenumber, unsigned int* address); -void WriteStackLine(void*address, void (*callback)(const char*)); - -//***************************************************************************** -// Mis-named globals :-) -//***************************************************************************** -static CONTEXT gsContext; - - -//***************************************************************************** -//***************************************************************************** -void StackDumpDefaultHandler(const char*line) -{ - DEBUG_LOG((line)); -} - - -//***************************************************************************** -//***************************************************************************** -void StackDump(void (*callback)(const char*)) -{ - if (callback == nullptr) - { - callback = StackDumpDefaultHandler; - } - - if (!InitSymbolInfo()) - return; - - DWORD myeip,myesp,myebp; - -#if defined(_MSC_VER) -_asm -{ -MYEIP1: - mov eax, MYEIP1 - mov dword ptr [myeip] , eax - mov eax, esp - mov dword ptr [myesp] , eax - mov eax, ebp - mov dword ptr [myebp] , eax -} -#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(_M_IX86)) - // GCC/Clang inline assembly for x86-32 - __asm__ __volatile__( - "call 1f\n\t" - "1: pop %0\n\t" - "mov %%esp, %1\n\t" - "mov %%ebp, %2" - : "=r"(myeip), "=r"(myesp), "=r"(myebp) - : - : "memory" - ); -#else - #error "Unsupported compiler or architecture for register capture" -#endif - - - MakeStackTrace(myeip,myesp,myebp, 2, callback); -} - - -//***************************************************************************** -//***************************************************************************** -void StackDumpFromContext(DWORD eip,DWORD esp,DWORD ebp, void (*callback)(const char*)) -{ - if (callback == nullptr) - { - callback = StackDumpDefaultHandler; - } - - if (!InitSymbolInfo()) - return; - - MakeStackTrace(eip,esp,ebp, 0, callback); -} - - -//***************************************************************************** -//***************************************************************************** -BOOL InitSymbolInfo() -{ - if (DbgHelpLoader::isLoaded()) - return TRUE; - - if (DbgHelpLoader::isFailed()) - return FALSE; - - if (!DbgHelpLoader::load()) - { - atexit(DbgHelpLoader::unload); - return FALSE; - } - - char pathname[_MAX_PATH+1]; - char drive[10]; - char directory[_MAX_PATH+1]; - HANDLE process; - - DbgHelpLoader::symSetOptions(SYMOPT_DEFERRED_LOADS | SYMOPT_UNDNAME | SYMOPT_LOAD_LINES | SYMOPT_OMAP_FIND_NEAREST); - - process = GetCurrentProcess(); - - //Get the apps name - ::GetModuleFileName(nullptr, pathname, _MAX_PATH); - - // turn it into a search path - _splitpath(pathname, drive, directory, nullptr, nullptr); - sprintf(pathname, "%s:\\%s", drive, directory); - - // append the current directory to build a search path for SymInit - ::lstrcat(pathname, ";.;"); - - if(DbgHelpLoader::symInitialize(process, pathname, FALSE)) - { - // regenerate the name of the app - ::GetModuleFileName(nullptr, pathname, _MAX_PATH); - if(DbgHelpLoader::symLoadModule(process, nullptr, pathname, nullptr, 0, 0)) - { - //Load any other relevant modules (ie dlls) here - atexit(DbgHelpLoader::unload); - return TRUE; - } - } - - DbgHelpLoader::unload(); - return FALSE; -} - - -//***************************************************************************** -//***************************************************************************** -void MakeStackTrace(DWORD myeip,DWORD myesp,DWORD myebp, int skipFrames, void (*callback)(const char*)) -{ -STACKFRAME stack_frame; -BOOL b_ret = TRUE; - -HANDLE thread = GetCurrentThread(); -HANDLE process = GetCurrentProcess(); - -memset(&gsContext, 0, sizeof(CONTEXT)); -gsContext.ContextFlags = CONTEXT_FULL; - -memset(&stack_frame, 0, sizeof(STACKFRAME)); -stack_frame.AddrPC.Mode = AddrModeFlat; -stack_frame.AddrPC.Offset = myeip; -stack_frame.AddrStack.Mode = AddrModeFlat; -stack_frame.AddrStack.Offset = myesp; -stack_frame.AddrFrame.Mode = AddrModeFlat; -stack_frame.AddrFrame.Offset = myebp; -{ -/* - if(GetThreadContext(thread, &gsContext)) - { - memset(&stack_frame, 0, sizeof(STACKFRAME)); - stack_frame.AddrPC.Mode = AddrModeFlat; - stack_frame.AddrPC.Offset = gsContext.Eip; - stack_frame.AddrStack.Mode = AddrModeFlat; - stack_frame.AddrStack.Offset = gsContext.Esp; - stack_frame.AddrFrame.Mode = AddrModeFlat; - stack_frame.AddrFrame.Offset = gsContext.Ebp; -*/ - - //{ - callback("Call Stack\n**********\n"); - - // Skip some ? - unsigned int skip = skipFrames; - while (b_ret&&skip) - { - b_ret = DbgHelpLoader::stackWalk( IMAGE_FILE_MACHINE_I386, - process, - thread, - &stack_frame, - nullptr, //&gsContext, - nullptr, - DbgHelpLoader::symFunctionTableAccess, - DbgHelpLoader::symGetModuleBase, - nullptr); - skip--; - } - - skip = 30; - while(b_ret&&skip) - { - - b_ret = DbgHelpLoader::stackWalk( IMAGE_FILE_MACHINE_I386, - process, - thread, - &stack_frame, - nullptr, //&gsContext, - nullptr, - DbgHelpLoader::symFunctionTableAccess, - DbgHelpLoader::symGetModuleBase, - nullptr); - - - - if (b_ret) WriteStackLine((void *) stack_frame.AddrPC.Offset, callback); - skip--; - } - } -} - - -//***************************************************************************** -//***************************************************************************** -void GetFunctionDetails(void *pointer, char*name, char*filename, unsigned int* linenumber, unsigned int* address) -{ - if (!InitSymbolInfo()) - return; - - if (name) - { - strcpy(name, ""); - } - if (filename) - { - strcpy(filename, ""); - } - if (linenumber) - { - *linenumber = 0xFFFFFFFF; - } - if (address) - { - *address = 0xFFFFFFFF; - } - - ULONG displacement = 0; - - HANDLE process = ::GetCurrentProcess(); - - char symbol_buffer[512 + sizeof(IMAGEHLP_SYMBOL)]; - memset(symbol_buffer, 0, sizeof(symbol_buffer)); - - PIMAGEHLP_SYMBOL psymbol = (PIMAGEHLP_SYMBOL)symbol_buffer; - psymbol->SizeOfStruct = sizeof(symbol_buffer); - psymbol->MaxNameLength = 512; - - if (DbgHelpLoader::symGetSymFromAddr(process, (DWORD) pointer, &displacement, psymbol)) - { - if (name) - { - strcpy(name, psymbol->Name); - strcat(name, "();"); - } - - // Get line now - - IMAGEHLP_LINE line; - memset(&line,0,sizeof(line)); - line.SizeOfStruct = sizeof(line); - - if (DbgHelpLoader::symGetLineFromAddr(process, (DWORD) pointer, &displacement, &line)) - { - if (filename) - { - strcpy(filename, line.FileName); - } - if (linenumber) - { - *linenumber = (unsigned int)line.LineNumber; - } - if (address) - { - *address = (unsigned int)line.Address; - } - } - } -} - - -//***************************************************************************** -// Gets last x addresses from the stack -//***************************************************************************** -void FillStackAddresses(void**addresses, unsigned int count, unsigned int skip) -{ - if (!InitSymbolInfo()) - return; - - STACKFRAME stack_frame; - - - HANDLE thread = GetCurrentThread(); - HANDLE process = GetCurrentProcess(); - - memset(&gsContext, 0, sizeof(CONTEXT)); - gsContext.ContextFlags = CONTEXT_FULL; - - DWORD myeip,myesp,myebp; -#if defined(_MSC_VER) -_asm -{ -MYEIP2: - mov eax, MYEIP2 - mov dword ptr [myeip] , eax - mov eax, esp - mov dword ptr [myesp] , eax - mov eax, ebp - mov dword ptr [myebp] , eax - xor eax,eax -} -#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(_M_IX86)) - // GCC/Clang inline assembly for x86-32 - __asm__ __volatile__( - "call 1f\n\t" - "1: pop %0\n\t" - "mov %%esp, %1\n\t" - "mov %%ebp, %2\n\t" - "xor %%eax, %%eax" - : "=r"(myeip), "=r"(myesp), "=r"(myebp) - : - : "eax", "memory" - ); -#else - #error "Unsupported compiler or architecture for register capture" -#endif -memset(&stack_frame, 0, sizeof(STACKFRAME)); -stack_frame.AddrPC.Mode = AddrModeFlat; -stack_frame.AddrPC.Offset = myeip; -stack_frame.AddrStack.Mode = AddrModeFlat; -stack_frame.AddrStack.Offset = myesp; -stack_frame.AddrFrame.Mode = AddrModeFlat; -stack_frame.AddrFrame.Offset = myebp; - -{ -/* - if(GetThreadContext(thread, &gsContext)) - { - memset(&stack_frame, 0, sizeof(STACKFRAME)); - stack_frame.AddrPC.Mode = AddrModeFlat; - stack_frame.AddrPC.Offset = gsContext.Eip; - stack_frame.AddrStack.Mode = AddrModeFlat; - stack_frame.AddrStack.Offset = gsContext.Esp; - stack_frame.AddrFrame.Mode = AddrModeFlat; - stack_frame.AddrFrame.Offset = gsContext.Ebp; -*/ - - Bool stillgoing = TRUE; -// unsigned int cd = count; - - // Skip some? - while (stillgoing&&skip) - { - stillgoing = DbgHelpLoader::stackWalk(IMAGE_FILE_MACHINE_I386, - process, - thread, - &stack_frame, - nullptr, //&gsContext, - nullptr, - DbgHelpLoader::symFunctionTableAccess, - DbgHelpLoader::symGetModuleBase, - nullptr) != 0; - skip--; - } - - while(stillgoing&&count) - { - stillgoing = DbgHelpLoader::stackWalk(IMAGE_FILE_MACHINE_I386, - process, - thread, - &stack_frame, - nullptr, //&gsContext, - nullptr, - DbgHelpLoader::symFunctionTableAccess, - DbgHelpLoader::symGetModuleBase, - nullptr) != 0; - if (stillgoing) - { - *addresses = (void*)stack_frame.AddrPC.Offset; - addresses++; - count--; - } - } - - // Fill remainder - while (count) - { - *addresses = nullptr; - addresses++; - count--; - } - - } -/* - else - { - memset(addresses,nullptr,count*sizeof(void*)); - } -*/ -} - - - -//***************************************************************************** -// Do full stack dump using an address array -//***************************************************************************** -void StackDumpFromAddresses(void**addresses, unsigned int count, void (*callback)(const char *)) -{ - if (callback == nullptr) - { - callback = StackDumpDefaultHandler; - } - - if (!InitSymbolInfo()) - return; - - while ((count--) && (*addresses!=nullptr)) - { - WriteStackLine(*addresses,callback); - addresses++; - } -} - - -AsciiString g_LastErrorDump; -//***************************************************************************** -//***************************************************************************** -void WriteStackLine(void*address, void (*callback)(const char*)) -{ - static char line[MAX_PATH]; - static char function_name[512]; - static char filename[MAX_PATH]; - unsigned int linenumber; - unsigned int addr; - - GetFunctionDetails(address, function_name, filename, &linenumber, &addr); - sprintf(line, " %s(%d) : %s 0x%08p", filename, linenumber, function_name, address); - if (g_LastErrorDump.isNotEmpty()) { - g_LastErrorDump.concat(line); - g_LastErrorDump.concat("\n"); - } - callback(line); -} - - -//***************************************************************************** -//***************************************************************************** -void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) -{ - DEBUG_LOG_RAW(("\n")); - DEBUG_LOG(( "********** EXCEPTION DUMP ****************" )); - /* - ** List of possible exceptions - */ - g_LastErrorDump.clear(); - - static const unsigned int _codes[] = { - EXCEPTION_ACCESS_VIOLATION, - EXCEPTION_ARRAY_BOUNDS_EXCEEDED, - EXCEPTION_BREAKPOINT, - EXCEPTION_DATATYPE_MISALIGNMENT, - EXCEPTION_FLT_DENORMAL_OPERAND, - EXCEPTION_FLT_DIVIDE_BY_ZERO, - EXCEPTION_FLT_INEXACT_RESULT, - EXCEPTION_FLT_INVALID_OPERATION, - EXCEPTION_FLT_OVERFLOW, - EXCEPTION_FLT_STACK_CHECK, - EXCEPTION_FLT_UNDERFLOW, - EXCEPTION_ILLEGAL_INSTRUCTION, - EXCEPTION_IN_PAGE_ERROR, - EXCEPTION_INT_DIVIDE_BY_ZERO, - EXCEPTION_INT_OVERFLOW, - EXCEPTION_INVALID_DISPOSITION, - EXCEPTION_NONCONTINUABLE_EXCEPTION, - EXCEPTION_PRIV_INSTRUCTION, - EXCEPTION_SINGLE_STEP, - EXCEPTION_STACK_OVERFLOW, - 0xffffffff - }; - - /* - ** Information about each exception type. - */ - static char const * _code_txt[] = { - "Error code: EXCEPTION_ACCESS_VIOLATION\nDescription: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.", - "Error code: EXCEPTION_ARRAY_BOUNDS_EXCEEDED\nDescription: The thread tried to access an array element that is out of bounds and the underlying hardware supports bounds checking.", - "Error code: EXCEPTION_BREAKPOINT\nDescription: A breakpoint was encountered.", - "Error code: EXCEPTION_DATATYPE_MISALIGNMENT\nDescription: The thread tried to read or write data that is misaligned on hardware that does not provide alignment. For example, 16-bit values must be aligned on 2-byte boundaries; 32-bit values on 4-byte boundaries, and so on.", - "Error code: EXCEPTION_FLT_DENORMAL_OPERAND\nDescription: One of the operands in a floating-point operation is denormal. A denormal value is one that is too small to represent as a standard floating-point value.", - "Error code: EXCEPTION_FLT_DIVIDE_BY_ZERO\nDescription: The thread tried to divide a floating-point value by a floating-point divisor of zero.", - "Error code: EXCEPTION_FLT_INEXACT_RESULT\nDescription: The result of a floating-point operation cannot be represented exactly as a decimal fraction.", - "Error code: EXCEPTION_FLT_INVALID_OPERATION\nDescription: Some strange unknown floating point operation was attempted.", - "Error code: EXCEPTION_FLT_OVERFLOW\nDescription: The exponent of a floating-point operation is greater than the magnitude allowed by the corresponding type.", - "Error code: EXCEPTION_FLT_STACK_CHECK\nDescription: The stack overflowed or underflowed as the result of a floating-point operation.", - "Error code: EXCEPTION_FLT_UNDERFLOW\nDescription: The exponent of a floating-point operation is less than the magnitude allowed by the corresponding type.", - "Error code: EXCEPTION_ILLEGAL_INSTRUCTION\nDescription: The thread tried to execute an invalid instruction.", - "Error code: EXCEPTION_IN_PAGE_ERROR\nDescription: The thread tried to access a page that was not present, and the system was unable to load the page. For example, this exception might occur if a network connection is lost while running a program over the network.", - "Error code: EXCEPTION_INT_DIVIDE_BY_ZERO\nDescription: The thread tried to divide an integer value by an integer divisor of zero.", - "Error code: EXCEPTION_INT_OVERFLOW\nDescription: The result of an integer operation caused a carry out of the most significant bit of the result.", - "Error code: EXCEPTION_INVALID_DISPOSITION\nDescription: An exception handler returned an invalid disposition to the exception dispatcher. Programmers using a high-level language such as C should never encounter this exception.", - "Error code: EXCEPTION_NONCONTINUABLE_EXCEPTION\nDescription: The thread tried to continue execution after a noncontinuable exception occurred.", - "Error code: EXCEPTION_PRIV_INSTRUCTION\nDescription: The thread tried to execute an instruction whose operation is not allowed in the current machine mode.", - "Error code: EXCEPTION_SINGLE_STEP\nDescription: A trace trap or other single-instruction mechanism signaled that one instruction has been executed.", - "Error code: EXCEPTION_STACK_OVERFLOW\nDescription: The thread used up its stack.", - "Error code: ?????\nDescription: Unknown exception." - }; - - DEBUG_LOG( ("Dump exception info") ); - CONTEXT *context = e_info->ContextRecord; - /* - ** The following are set for access violation only - */ - int access_read_write=-1; - unsigned long access_address = 0; - AsciiString msg; - -// DOUBLE_DEBUG does a DEBUG_LOG, and concats to g_LastErrorDump. jba. -#define DOUBLE_DEBUG(x) { msg.format x; g_LastErrorDump.concat(msg); DEBUG_LOG( x ); } - - if ( e_info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION ) - { - DOUBLE_DEBUG (("Exception is access violation")); - access_read_write = e_info->ExceptionRecord->ExceptionInformation[0]; // 0=read, 1=write - access_address = e_info->ExceptionRecord->ExceptionInformation[1]; - } - else - { - DOUBLE_DEBUG (("Exception code is %x", e_info->ExceptionRecord->ExceptionCode)); - } - Int *winMainAddr = (Int *)WinMain; - DOUBLE_DEBUG(("WinMain at %x", winMainAddr)); - /* - ** Match the exception type with the error string and print it out - */ - int i=0; - for ( ; _codes[i] != 0xffffffff ; i++ ) - { - if ( _codes[i] == e_info->ExceptionRecord->ExceptionCode ) - { - DEBUG_LOG ( ("Found exception description") ); - break; - } - } - DOUBLE_DEBUG( ("%s", _code_txt[i])); - /** For access violations, print out the violation address and if it was read or write. - */ - if ( e_info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION ) - { - if ( access_read_write ) - { - DOUBLE_DEBUG( ("Access address:%08X was written to.", access_address)); - } - else - { - DOUBLE_DEBUG( ("Access address:%08X was read from.", access_address)); - } - } - - DOUBLE_DEBUG (("\nStack Dump:")); - StackDumpFromContext(context->Eip, context->Esp, context->Ebp, nullptr); - - DOUBLE_DEBUG (("\nDetails:")); - - DOUBLE_DEBUG (("Register dump...")); - - /* - ** Dump the registers. - */ - DOUBLE_DEBUG ( ( "Eip:%08X\tEsp:%08X\tEbp:%08X", context->Eip, context->Esp, context->Ebp)); - DOUBLE_DEBUG ( ( "Eax:%08X\tEbx:%08X\tEcx:%08X", context->Eax, context->Ebx, context->Ecx)); - DOUBLE_DEBUG ( ( "Edx:%08X\tEsi:%08X\tEdi:%08X", context->Edx, context->Esi, context->Edi)); - DOUBLE_DEBUG ( ( "EFlags:%08X ", context->EFlags)); - DOUBLE_DEBUG ( ( "CS:%04x SS:%04x DS:%04x ES:%04x FS:%04x GS:%04x", context->SegCs, context->SegSs, context->SegDs, context->SegEs, context->SegFs, context->SegGs)); - - /* - ** Dump the bytes at EIP. This will make it easier to match the crash address with later versions of the game. - */ - char scrap[512]; - DOUBLE_DEBUG ( ("EIP bytes dump...")); - wsprintf (scrap, "\nBytes at CS:EIP (%08X) : ", context->Eip); - - unsigned char *eip_ptr = (unsigned char *) (context->Eip); - char bytestr[32]; - - for (int c = 0 ; c < 32 ; c++) - { - if (IsBadReadPtr(eip_ptr, 1)) - { - lstrcat (scrap, "?? "); - } - else - { - sprintf (bytestr, "%02X ", *eip_ptr); - strlcat(scrap, bytestr, ARRAY_SIZE(scrap)); - } - eip_ptr++; - } - - DOUBLE_DEBUG ( ( (scrap))); - DEBUG_LOG(( "********** END EXCEPTION DUMP ****************" )); - DEBUG_LOG_RAW(("\n")); -} - - -#pragma pack(pop) - -#endif - diff --git a/Generals/Code/GameEngine/Source/Common/System/Upgrade.cpp b/Generals/Code/GameEngine/Source/Common/System/Upgrade.cpp deleted file mode 100644 index dbf9263c34c..00000000000 --- a/Generals/Code/GameEngine/Source/Common/System/Upgrade.cpp +++ /dev/null @@ -1,501 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Upgrade.cpp ////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, March 2002 -// Desc: Upgrade system for players -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#define DEFINE_VETERANCY_NAMES -#include "Common/Upgrade.h" -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameClient/InGameUI.h" -#include "GameClient/Image.h" - - -const char *const TheUpgradeTypeNames[] = -{ - "PLAYER", - "OBJECT", - nullptr -}; -static_assert(ARRAY_SIZE(TheUpgradeTypeNames) == NUM_UPGRADE_TYPES + 1, "Incorrect array size"); - -// PUBLIC ///////////////////////////////////////////////////////////////////////////////////////// -class UpgradeCenter *TheUpgradeCenter = nullptr; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// UPGRADE //////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -Upgrade::Upgrade( const UpgradeTemplate *upgradeTemplate ) -{ - - m_template = upgradeTemplate; - m_status = UPGRADE_STATUS_INVALID; - m_next = nullptr; - m_prev = nullptr; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -Upgrade::~Upgrade() -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void Upgrade::crc( Xfer *xfer ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void Upgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // status - xfer->xferUser( &m_status, sizeof( UpgradeStatusType ) ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void Upgrade::loadPostProcess() -{ - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// UPGRADE TEMPLATE /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -const FieldParse UpgradeTemplate::m_upgradeFieldParseTable[] = -{ - - { "DisplayName", INI::parseAsciiString, nullptr, offsetof( UpgradeTemplate, m_displayNameLabel ) }, - { "Type", INI::parseIndexList, TheUpgradeTypeNames, offsetof( UpgradeTemplate, m_type ) }, - { "BuildTime", INI::parseReal, nullptr, offsetof( UpgradeTemplate, m_buildTime ) }, - { "BuildCost", INI::parseInt, nullptr, offsetof( UpgradeTemplate, m_cost ) }, - { "ButtonImage", INI::parseAsciiString, nullptr, offsetof( UpgradeTemplate, m_buttonImageName ) }, - { "ResearchSound", INI::parseAudioEventRTS, nullptr, offsetof( UpgradeTemplate, m_researchSound ) }, - { "UnitSpecificSound", INI::parseAudioEventRTS, nullptr, offsetof( UpgradeTemplate, m_unitSpecificSound ) }, - { "AcademyClassify", INI::parseIndexList, TheAcademyClassificationTypeNames, offsetof( UpgradeTemplate, m_academyClassificationType ) }, - { nullptr, nullptr, nullptr, 0 } - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpgradeTemplate::UpgradeTemplate() -{ - m_cost = 0; - m_type = UPGRADE_TYPE_PLAYER; - m_nameKey = NAMEKEY_INVALID; - m_buildTime = 0.0f; - m_next = nullptr; - m_prev = nullptr; - m_buttonImage = nullptr; - m_academyClassificationType = ACT_NONE; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpgradeTemplate::~UpgradeTemplate() -{ - -} - -//------------------------------------------------------------------------------------------------- -/** Calculate the time it takes (in logic frames) for a player to build this UpgradeTemplate */ -//------------------------------------------------------------------------------------------------- -Int UpgradeTemplate::calcTimeToBuild( Player *player ) const -{ -#if defined(RTS_DEBUG) || defined(_ALLOW_DEBUG_CHEATS_IN_RELEASE) - if( player->buildsInstantly() ) - { - return 1; - } -#endif - - ///@todo modify this by power state of player - return m_buildTime * LOGICFRAMES_PER_SECOND; - -} - -//------------------------------------------------------------------------------------------------- -/** Calculate the cost takes this player to build this upgrade */ -//------------------------------------------------------------------------------------------------- -Int UpgradeTemplate::calcCostToBuild( Player *player ) const -{ - - ///@todo modify this by any player handicaps - return m_cost; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -static AsciiString getVetUpgradeName(VeterancyLevel v) -{ - AsciiString tmp; - tmp = "Upgrade_Veterancy_"; - tmp.concat(TheVeterancyNames[v]); - return tmp; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void UpgradeTemplate::friend_makeVeterancyUpgrade(VeterancyLevel v) -{ - m_type = UPGRADE_TYPE_OBJECT; // veterancy "upgrades" are always per-object, not per-player - m_name = getVetUpgradeName(v); - m_nameKey = TheNameKeyGenerator->nameToKey( m_name ); - m_displayNameLabel.clear(); // should never be displayed - m_buildTime = 0.0f; - m_cost = 0.0f; - // leave this alone. - //m_upgradeMask = ???; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void UpgradeTemplate::cacheButtonImage() -{ - if( m_buttonImageName.isNotEmpty() ) - { - m_buttonImage = TheMappedImageCollection->findImageByName( m_buttonImageName ); - DEBUG_ASSERTCRASH( m_buttonImage, ("UpgradeTemplate: %s is looking for button image %s but can't find it. Skipping...", m_name.str(), m_buttonImageName.str() ) ); - m_buttonImageName.clear(); // we're done with this, so nuke it - } -} - - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// UPGRADE CENTER ///////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpgradeCenter::UpgradeCenter() -{ - - m_upgradeList = nullptr; - m_nextTemplateMaskBit = 0; - buttonImagesCached = FALSE; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpgradeCenter::~UpgradeCenter() -{ - - // delete all the upgrades loaded from the INI database - UpgradeTemplate *next; - while( m_upgradeList ) - { - - // get next - next = m_upgradeList->friend_getNext(); - - // delete head of list - deleteInstance(m_upgradeList); - - // set head to next element - m_upgradeList = next; - - } - -} - -//------------------------------------------------------------------------------------------------- -/** Upgrade center initialization */ -//------------------------------------------------------------------------------------------------- -void UpgradeCenter::init() -{ - UpgradeTemplate* up; - - // name will be overridden by friend_makeVeterancyUpgrade - -// no, there ISN'T an upgrade for this one... -//up = newUpgrade(""); -//up->friend_makeVeterancyUpgrade(LEVEL_REGULAR); - - up = newUpgrade(""); - up->friend_makeVeterancyUpgrade(LEVEL_VETERAN); - - up = newUpgrade(""); - up->friend_makeVeterancyUpgrade(LEVEL_ELITE); - - up = newUpgrade(""); - up->friend_makeVeterancyUpgrade(LEVEL_HEROIC); - -} - -//------------------------------------------------------------------------------------------------- -/** Upgrade center system reset */ -//------------------------------------------------------------------------------------------------- -void UpgradeCenter::reset() -{ - if( TheMappedImageCollection && !buttonImagesCached ) - { - UpgradeTemplate *upgrade; - for( upgrade = m_upgradeList; upgrade; upgrade = upgrade->friend_getNext() ) - { - upgrade->cacheButtonImage(); - } - buttonImagesCached = TRUE; - } -} - -//------------------------------------------------------------------------------------------------- -/** Find upgrade by veterancy level */ -//------------------------------------------------------------------------------------------------- -const UpgradeTemplate *UpgradeCenter::findVeterancyUpgrade( VeterancyLevel level ) const -{ - AsciiString tmp = getVetUpgradeName(level); - return findUpgrade(tmp); -} - -//------------------------------------------------------------------------------------------------- -/** Find upgrade by name key */ -//------------------------------------------------------------------------------------------------- -UpgradeTemplate *UpgradeCenter::findNonConstUpgradeByKey( NameKeyType key ) -{ - UpgradeTemplate *upgrade; - - // search list - for( upgrade = m_upgradeList; upgrade; upgrade = upgrade->friend_getNext() ) - if( upgrade->getUpgradeNameKey() == key ) - return upgrade; - - // item not found - return nullptr; - -} - -// ------------------------------------------------------------------------------------------------ -/** Return the first upgrade template */ -// ------------------------------------------------------------------------------------------------ -UpgradeTemplate *UpgradeCenter::firstUpgradeTemplate() -{ - - return m_upgradeList; - -} - -//------------------------------------------------------------------------------------------------- -/** Find upgrade by name key */ -//------------------------------------------------------------------------------------------------- -const UpgradeTemplate *UpgradeCenter::findUpgradeByKey( NameKeyType key ) const -{ - const UpgradeTemplate *upgrade; - - // search list - for( upgrade = m_upgradeList; upgrade; upgrade = upgrade->friend_getNext() ) - if( upgrade->getUpgradeNameKey() == key ) - return upgrade; - - // item not found - return nullptr; -} - -//------------------------------------------------------------------------------------------------- -/** Find upgrade by name */ -//------------------------------------------------------------------------------------------------- -const UpgradeTemplate *UpgradeCenter::findUpgrade( const AsciiString& name ) const -{ - return findUpgradeByKey( TheNameKeyGenerator->nameToKey( name ) ); -} - -//------------------------------------------------------------------------------------------------- -/** Find upgrade by name */ -//------------------------------------------------------------------------------------------------- -const UpgradeTemplate *UpgradeCenter::findUpgrade( const char* name ) const -{ - return findUpgradeByKey( TheNameKeyGenerator->nameToKey( name ) ); -} - -//------------------------------------------------------------------------------------------------- -/** Allocate a new upgrade template */ -//------------------------------------------------------------------------------------------------- -UpgradeTemplate *UpgradeCenter::newUpgrade( const AsciiString& name ) -{ - UpgradeTemplate *newUpgrade = newInstance(UpgradeTemplate); - - // copy data from the default upgrade - const UpgradeTemplate *defaultUpgrade = findUpgrade( "DefaultUpgrade" ); - if( defaultUpgrade ) - *newUpgrade = *defaultUpgrade; - - // assign name and starting data - newUpgrade->setUpgradeName( name ); - newUpgrade->setUpgradeNameKey( TheNameKeyGenerator->nameToKey( name ) ); - - // Make a unique bitmask for this new template by keeping track of what bits have been assigned - // damn MSFT! proper ANSI syntax for a proper 64-bit constant is "1LL", but MSVC doesn't recognize it - UpgradeMaskType newMask; - newMask.set( m_nextTemplateMaskBit ); - //Int64 newMask = 1i64 << m_nextTemplateMaskBit; - m_nextTemplateMaskBit++; - DEBUG_ASSERTCRASH( m_nextTemplateMaskBit < UPGRADE_MAX_COUNT, ("Can't have over %d types of Upgrades and have a Bitfield function.", UPGRADE_MAX_COUNT) ); - newUpgrade->friend_setUpgradeMask( newMask ); - - // link upgrade - linkUpgrade( newUpgrade ); - - // return new upgrade - return newUpgrade; - -} - -//------------------------------------------------------------------------------------------------- -/** Link an upgrade to our list */ -//------------------------------------------------------------------------------------------------- -void UpgradeCenter::linkUpgrade( UpgradeTemplate *upgrade ) -{ - - // sanity - if( upgrade == nullptr ) - return; - - // link - upgrade->friend_setPrev( nullptr ); - upgrade->friend_setNext( m_upgradeList ); - if( m_upgradeList ) - m_upgradeList->friend_setPrev( upgrade ); - m_upgradeList = upgrade; - -} - -//------------------------------------------------------------------------------------------------- -/** Unlink an upgrade from our list */ -//------------------------------------------------------------------------------------------------- -void UpgradeCenter::unlinkUpgrade( UpgradeTemplate *upgrade ) -{ - - // sanity - if( upgrade == nullptr ) - return; - - if( upgrade->friend_getNext() ) - upgrade->friend_getNext()->friend_setPrev( upgrade->friend_getPrev() ); - if( upgrade->friend_getPrev() ) - upgrade->friend_getPrev()->friend_setNext( upgrade->friend_getNext() ); - else - m_upgradeList = upgrade->friend_getNext(); - -} - -//------------------------------------------------------------------------------------------------- -/** does this player have all the necessary things to make this upgrade */ -//------------------------------------------------------------------------------------------------- -Bool UpgradeCenter::canAffordUpgrade( Player *player, const UpgradeTemplate *upgradeTemplate, Bool displayReason ) const -{ - - // sanity - if( player == nullptr || upgradeTemplate == nullptr ) - return FALSE; - - // money check - Money *money = player->getMoney(); - if( money->countMoney() < upgradeTemplate->calcCostToBuild( player ) ) - { - //Post reason why we can't make upgrade! - if( displayReason ) - { - TheInGameUI->message( "GUI:NotEnoughMoneyToUpgrade" ); - } - return FALSE; - } - - /// @todo maybe have prereq checks for upgrades??? - - return TRUE; // all is well - -} - -//------------------------------------------------------------------------------------------------- -/** generate a list of upgrade names for WorldBuilder */ -//------------------------------------------------------------------------------------------------- -std::vector UpgradeCenter::getUpgradeNames() const -{ - std::vector upgradeNames; - - for( UpgradeTemplate *upgrade = m_upgradeList; upgrade; upgrade = upgrade->friend_getNext() ) - upgradeNames.push_back(upgrade->getUpgradeName()); - - return upgradeNames; - -} - -//------------------------------------------------------------------------------------------------- -/** Parse an upgrade definition */ -//------------------------------------------------------------------------------------------------- -void UpgradeCenter::parseUpgradeDefinition( INI *ini ) -{ - // read the name - const char* name = ini->getNextToken(); - - // find existing item if present - UpgradeTemplate* upgrade = TheUpgradeCenter->findNonConstUpgradeByKey( NAMEKEY(name) ); - if( upgrade == nullptr ) - { - - // allocate a new item - upgrade = TheUpgradeCenter->newUpgrade( name ); - - } - - // sanity - DEBUG_ASSERTCRASH( upgrade, ("parseUpgradeDefinition: Unable to allocate upgrade '%s'", name) ); - - // parse the ini definition - ini->initFromINI( upgrade, upgrade->getFieldParse() ); - -} - diff --git a/Generals/Code/GameEngine/Source/Common/System/encrypt.cpp b/Generals/Code/GameEngine/Source/Common/System/encrypt.cpp deleted file mode 100644 index 5aa7099a88d..00000000000 --- a/Generals/Code/GameEngine/Source/Common/System/encrypt.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Encrypt.cpp ////////////////////////////////////////////////////// -// Ancient Westwood Online password encryption (obfuscation?) code -// Author: Anonymous - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/encrypt.h" - -#define MAX_CHARS 65 -static char Base_String[MAX_CHARS] = - - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; - -static char Return_Buffer[MAX_ENCRYPTED_STRING + 1]; -static char Temp_Buffer [MAX_ENCRYPTED_STRING + 1]; - -/*******************************************************/ -/* This function is a simple one-way encryption that */ -/* is portable across many platforms */ -/* */ -/* The 'String' to encrypt MUST be up to 8 chars long */ -/* and should be no shorter than 4 characters. */ -/* It can contain letters and numbers and '.' and '/' */ -/*******************************************************/ - -/* String is the original string to encrypt */ -/* Seed is the string to encrypt */ -//char *encrypt(char *String, char *Seed) -const char *EncryptString(const char *String) -{ - /* We need a 56 bit key, so use two 32 bit values */ - /* and we'll strip off the high order 8 bits */ - //unsigned long Random_Seed_Value_high = 0; /* 32 bit seed value */ - //unsigned long Random_Seed_Value_low = 0; /* 32 bit seed value */ - //unsigned long Temp_high = 0; /* 32 bit storage value */ - //unsigned long Temp_low = 0; /* 32 bit storage value */ - unsigned int UpCnt = 0, DnCnt = 0, Cnt = 0; - unsigned int Length = strlen(String); - - /* Ok, here is the algorithm: */ - /* */ - - if (Length > MAX_ENCRYPTED_STRING) - Length = MAX_ENCRYPTED_STRING; - - for (UpCnt = 0, DnCnt = Length; UpCnt < Length; UpCnt++, DnCnt--) - if (String[UpCnt] & 0x01) - Temp_Buffer[UpCnt] = (String[UpCnt] << (String[UpCnt] & 0x01)) & - String[DnCnt]; - else - Temp_Buffer[UpCnt] = (String[UpCnt] << (String[UpCnt] & 0x01)) ^ - String[DnCnt]; - - for (Cnt = 0; Cnt < MAX_ENCRYPTED_STRING; Cnt++) - Return_Buffer[Cnt] = Base_String[Temp_Buffer[Cnt] & 0x3F]; - - Return_Buffer[Cnt] = '\0'; - return (Return_Buffer); - -} - - -#ifdef UNIT_TEST -void main() -{ - char Input_String[9]; - char *new_string; - - while (1) - { - printf ("Enter a string to encrypt:"); - gets(Input_String); - printf("\nString enterred was: %s", Input_String); - new_string = encrypt(Input_String, "ab"); - printf("\nEncrypted string is: %s", new_string); - } -} - -#endif - diff --git a/Generals/Code/GameEngine/Source/Common/TerrainTypes.cpp b/Generals/Code/GameEngine/Source/Common/TerrainTypes.cpp deleted file mode 100644 index 710db5e216e..00000000000 --- a/Generals/Code/GameEngine/Source/Common/TerrainTypes.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: TerrainTypes.cpp ///////////////////////////////////////////////////////////////////////// -// Author: Colin Day, December 2001 -// Desc: Terrain type descriptions and collection -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#define DEFINE_TERRAIN_TYPE_NAMES - -#include "Common/INI.h" -#include "Common/TerrainTypes.h" - -// PUBLIC DATA //////////////////////////////////////////////////////////////////////////////////// -TerrainTypeCollection *TheTerrainTypes = nullptr; - -// PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// -const FieldParse TerrainType::m_terrainTypeFieldParseTable[] = -{ - - { "Texture", INI::parseAsciiString, nullptr, offsetof( TerrainType, m_texture ) }, - { "BlendEdges", INI::parseBool, nullptr, offsetof( TerrainType, m_blendEdgeTexture ) }, - { "Class", INI::parseIndexList, terrainTypeNames, offsetof( TerrainType, m_class ) }, - { "RestrictConstruction", INI::parseBool, nullptr, offsetof( TerrainType, m_restrictConstruction ) }, - - { nullptr, nullptr, nullptr, 0 }, - -}; - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -TerrainType::TerrainType() -{ - - m_name.clear(); - m_texture.clear(); - m_blendEdgeTexture = FALSE; - m_class = TERRAIN_NONE; - m_restrictConstruction = FALSE; - m_next = nullptr; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -TerrainType::~TerrainType() -{ - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -TerrainTypeCollection::TerrainTypeCollection() -{ - - m_terrainList = nullptr; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -TerrainTypeCollection::~TerrainTypeCollection() -{ - TerrainType *temp; - - // delete all the type instances - while( m_terrainList ) - { - - // get the next element - temp = m_terrainList->friend_getNext(); - - // delete the head of the type list - deleteInstance(m_terrainList); - - // set the new head of the type list - m_terrainList = temp; - - } - -} - -//------------------------------------------------------------------------------------------------- -/** Find a terrain type given the name */ -//------------------------------------------------------------------------------------------------- -TerrainType *TerrainTypeCollection::findTerrain( AsciiString name ) -{ - TerrainType *terrain; - - for( terrain = m_terrainList; terrain; terrain = terrain->friend_getNext() ) - { - - if( terrain->getName() == name ) - return terrain; - - } - - // not found - return nullptr; - -} - -//------------------------------------------------------------------------------------------------- -/** Allocate a new type, assign the name, and tie to type list */ -//------------------------------------------------------------------------------------------------- -TerrainType *TerrainTypeCollection::newTerrain( AsciiString name ) -{ - TerrainType *terrain = nullptr; - - // allocate a new type - terrain = newInstance(TerrainType); - - // copy default values from the default terrain entry - TerrainType *defaultTerrain = findTerrain( "DefaultTerrain" ); - if( defaultTerrain ) - *terrain = *defaultTerrain; -/* - { - - terrain->friend_setTexture( defaultTerrain->getTexture() ); - terrain->friend_setClass( defaultTerrain->getClass() ); - terrain->friend_setBlendEdge( defaultTerrain->isBlendEdge() ); - - } -*/ - - // assign a name - terrain->friend_setName( name ); - - // tie to list - terrain->friend_setNext( m_terrainList ); - m_terrainList = terrain; - - // return the new terrain - return terrain; - -} diff --git a/Generals/Code/GameEngine/Source/Common/version.cpp b/Generals/Code/GameEngine/Source/Common/version.cpp deleted file mode 100644 index 0967c840094..00000000000 --- a/Generals/Code/GameEngine/Source/Common/version.cpp +++ /dev/null @@ -1,453 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: version.cpp ////////////////////////////////////////////////////// -// Generals version number class -// Author: Matthew D. Campbell, November 2001 - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/GameText.h" -#include "Common/version.h" - -#include "gitinfo.h" - -Version *TheVersion = nullptr; ///< The Version singleton - -Version::Version() -{ - m_major = 1; - m_minor = 0; - m_buildNum = 0; - m_localBuildNum = 0; - m_buildUser = AsciiString::TheEmptyString; - m_buildLocation = AsciiString::TheEmptyString; - m_asciiGitCommitCount = buildAsciiGitCommitCount(); - m_asciiGitTagOrHash = buildAsciiGitTagOrHash(); - m_asciiGitShortHash = buildAsciiGitShortHash(); - m_asciiGitCommitTime = buildAsciiGitCommitTime(); - m_unicodeGitCommitCount = buildUnicodeGitCommitCount(); - m_unicodeGitTagOrHash = buildUnicodeGitTagOrHash(); - m_unicodeGitShortHash = buildUnicodeGitShortHash(); - m_unicodeGitCommitTime = buildUnicodeGitCommitTime(); -#if defined(RTS_DEBUG) - m_showFullVersion = TRUE; -#else - m_showFullVersion = FALSE; -#endif -} - -void Version::setVersion(Int major, Int minor, Int buildNum, - Int localBuildNum, AsciiString user, AsciiString location, - AsciiString buildTime, AsciiString buildDate) -{ - m_major = major; - m_minor = minor; - m_buildNum = buildNum; - m_localBuildNum = localBuildNum; - m_buildUser = user; - m_buildLocation = location; - m_buildTime = buildTime; - m_buildDate = buildDate; -} - -UnsignedInt Version::getVersionNumber() const -{ - return m_major << 16 | m_minor; -} - -AsciiString Version::getAsciiVersion() const -{ - AsciiString version; - - if (m_showFullVersion) - { - if (!m_localBuildNum) - { - version.format("%d.%d.%d", m_major, m_minor, m_buildNum); - } - else - { - AsciiString user = getAsciiBuildUserOrGitCommitAuthorName(); - // User name requires at least 2 characters - if (user.getLength() < 2) - user.concat("xx"); - - version.format("%d.%d.%d.%d%c%c", m_major, m_minor, m_buildNum, m_localBuildNum, - user.getCharAt(0), user.getCharAt(1)); - } - } - else - { - version.format("%d.%d", m_major, m_minor); - } - -#ifdef RTS_DEBUG - version.concat(" Debug"); -#endif - - return version; -} - -UnicodeString Version::getUnicodeVersion() const -{ - UnicodeString version; - - if (m_showFullVersion) - { - if (!m_localBuildNum) - { - version.format(TheGameText->fetch("Version:Format3").str(), m_major, m_minor, m_buildNum); - } - else - { - UnicodeString user = getUnicodeBuildUserOrGitCommitAuthorName(); - // User name requires at least 2 characters - if (user.getLength() < 2) - user.concat(L"xx"); - - version.format(TheGameText->fetch("Version:Format4").str(), m_major, m_minor, m_buildNum, m_localBuildNum, - user.getCharAt(0), user.getCharAt(1)); - } - } - else - { - version.format(TheGameText->fetch("Version:Format2").str(), m_major, m_minor); - } - -#ifdef RTS_DEBUG - version.concat(L" Debug"); -#endif - - return version; -} - -AsciiString Version::getAsciiBuildTime() const -{ - AsciiString timeStr; - timeStr.format("%s %s", m_buildDate.str(), m_buildTime.str()); - - return timeStr; -} - -UnicodeString Version::getUnicodeBuildTime() const -{ - UnicodeString build; - UnicodeString dateStr; - UnicodeString timeStr; - - dateStr.translate(m_buildDate); - timeStr.translate(m_buildTime); - build.format(TheGameText->fetch("Version:BuildTime").str(), dateStr.str(), timeStr.str()); - - return build; -} - -AsciiString Version::getAsciiBuildLocation() const -{ - return m_buildLocation; -} - -UnicodeString Version::getUnicodeBuildLocation() const -{ - UnicodeString build; - - if (!m_buildLocation.isEmpty()) - { - UnicodeString machine; - machine.translate(m_buildLocation); - build.format(TheGameText->fetch("Version:BuildMachine").str(), machine.str()); - } - - return build; -} - -AsciiString Version::getAsciiBuildUser() const -{ - return m_buildUser; -} - -UnicodeString Version::getUnicodeBuildUser() const -{ - UnicodeString build; - - if (!m_buildUser.isEmpty()) - { - UnicodeString user; - user.translate(m_buildUser); - build.format(TheGameText->fetch("Version:BuildUser").str(), user.str()); - } - - return build; -} - -Int Version::getGitCommitCount() -{ - return GitRevision; -} - -time_t Version::getGitCommitTime() -{ - return GitCommitTimeStamp; -} - -const char* Version::getGitCommitAuthorName() -{ - return GitCommitAuthorName; -} - -AsciiString Version::getAsciiGitCommitCount() const -{ - return m_asciiGitCommitCount; -} - -UnicodeString Version::getUnicodeGitCommitCount() const -{ - return m_unicodeGitCommitCount; -} - -AsciiString Version::getAsciiGitTagOrHash() const -{ - return m_asciiGitTagOrHash; -} - -UnicodeString Version::getUnicodeGitTagOrHash() const -{ - return m_unicodeGitTagOrHash; -} - -AsciiString Version::getAsciiGitShortHash() const -{ - return m_asciiGitShortHash; -} - -UnicodeString Version::getUnicodeGitShortHash() const -{ - return m_unicodeGitShortHash; -} - -AsciiString Version::getAsciiGitCommitTime() const -{ - return m_asciiGitCommitTime; -} - -UnicodeString Version::getUnicodeGitCommitTime() const -{ - return m_unicodeGitCommitTime; -} - -AsciiString Version::getAsciiGitVersion() const -{ - AsciiString str; - if (m_showFullVersion) - { - str.format("%s %s", - getAsciiGitCommitCount().str(), - getAsciiGitTagOrHash().str()); - } - else - { - str.format("%s", - getAsciiGitCommitCount().str()); - } - return str; -} - -UnicodeString Version::getUnicodeGitVersion() const -{ - UnicodeString str; - if (m_showFullVersion) - { - str.format(L"%s %s", - getUnicodeGitCommitCount().str(), - getUnicodeGitTagOrHash().str()); - } - else - { - str.format(L"%s", - getUnicodeGitCommitCount().str()); - } - return str; -} - -AsciiString Version::getAsciiBuildUserOrGitCommitAuthorName() const -{ - AsciiString asciiUser = getAsciiBuildUser(); - - if (asciiUser.isEmpty()) - { - asciiUser = getGitCommitAuthorName(); - } - - return asciiUser; -} - -UnicodeString Version::getUnicodeBuildUserOrGitCommitAuthorName() const -{ - UnicodeString str; - AsciiString asciiUser = getAsciiBuildUserOrGitCommitAuthorName(); - - if (!asciiUser.isEmpty()) - { - UnicodeString unicodeUser; - unicodeUser.translate(asciiUser); - str.format(TheGameText->fetch("Version:BuildUser").str(), unicodeUser.str()); - } - - return str; -} - -UnicodeString Version::getUnicodeProductTitle() const -{ - // @todo Make configurable - return L"Community Patch"; -} - -UnicodeString Version::getUnicodeProductVersion() const -{ - return getUnicodeGitVersion(); -} - -UnicodeString Version::getUnicodeProductAuthor() const -{ - return getUnicodeBuildUserOrGitCommitAuthorName(); -} - -UnicodeString Version::getUnicodeProductString() const -{ - UnicodeString str; - UnicodeString productTitle = TheGameText->FETCH_OR_SUBSTITUTE("Version:ProductTitle", getUnicodeProductTitle().str()); - - if (!productTitle.isEmpty()) - { - UnicodeString productVersion = TheGameText->FETCH_OR_SUBSTITUTE("Version:ProductVersion", getUnicodeProductVersion().str()); - UnicodeString productAuthor = TheGameText->FETCH_OR_SUBSTITUTE("Version:ProductAuthor", getUnicodeProductAuthor().str()); - - str.concat(productTitle); - - if (!productVersion.isEmpty()) - { - str.concat(L" "); - str.concat(productVersion); - } - - if (!productAuthor.isEmpty()) - { - str.concat(L" "); - str.concat(productAuthor); - } - } - - return str; -} - -UnicodeString Version::getUnicodeProductVersionHashString() const -{ - UnicodeString str; - UnicodeString productString = getUnicodeProductString(); - UnicodeString gameVersion = getUnicodeVersion(); - UnicodeString gameHash; - gameHash.format(L"exe:%08X ini:%08X", TheGlobalData->m_exeCRC, TheGlobalData->m_iniCRC); - - if (!productString.isEmpty()) - { - str.concat(productString); - str.concat(L" | "); - } - str.concat(gameHash); - str.concat(L" "); - str.concat(gameVersion); - - return str; -} - -AsciiString Version::buildAsciiGitCommitCount() -{ - AsciiString str; - str.format("%s%d", - GitUncommittedChanges ? "~" : "", - GitRevision); - return str; -} - -UnicodeString Version::buildUnicodeGitCommitCount() -{ - UnicodeString str; - str.format(L"%s%d", - GitUncommittedChanges ? L"~" : L"", - GitRevision); - return str; -} - -AsciiString Version::buildAsciiGitTagOrHash() -{ - AsciiString str; - str.format("%s%s", - GitUncommittedChanges ? "~" : "", - GitTag[0] ? GitTag : GitShortSHA1); - return str; -} - -UnicodeString Version::buildUnicodeGitTagOrHash() -{ - UnicodeString str; - str.translate(buildAsciiGitTagOrHash()); - return str; -} - -AsciiString Version::buildAsciiGitShortHash() -{ - AsciiString str; - str.format("%s%s", - GitUncommittedChanges ? "~" : "", - GitShortSHA1); - return str; -} - -UnicodeString Version::buildUnicodeGitShortHash() -{ - UnicodeString str; - str.translate(buildAsciiGitShortHash()); - return str; -} - -AsciiString Version::buildAsciiGitCommitTime() -{ - const Int len = 19; - AsciiString str; - Char* buf = str.getBufferForRead(len); - tm* time = gmtime(&GitCommitTimeStamp); - strftime(buf, len+1, "%Y-%m-%d %H:%M:%S", time); - return str; -} - -UnicodeString Version::buildUnicodeGitCommitTime() -{ - const Int len = 19; - UnicodeString str; - WideChar* buf = str.getBufferForRead(len); - tm* time = gmtime(&GitCommitTimeStamp); - wcsftime(buf, len+1, L"%Y-%m-%d %H:%M:%S", time); - return str; -} diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp deleted file mode 100644 index ddafc23e33e..00000000000 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//// EstablishConnectionsMenu.cpp ///////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/GUICallbacks.h" -#include "GameClient/EstablishConnectionsMenu.h" -#include "Common/NameKeyGenerator.h" -#include "GameClient/GameWindow.h" -#include "GameClient/GameWindowManager.h" -#include "GameClient/GadgetStaticText.h" -#include "GameClient/GameText.h" - -EstablishConnectionsMenu *TheEstablishConnectionsMenu = nullptr; - -const char *const EstablishConnectionsMenu::m_playerReadyControlNames[] = { - "EstablishConnectionsScreen.wnd:ButtonAccept1", - "EstablishConnectionsScreen.wnd:ButtonAccept2", - "EstablishConnectionsScreen.wnd:ButtonAccept3", - "EstablishConnectionsScreen.wnd:ButtonAccept4", - "EstablishConnectionsScreen.wnd:ButtonAccept5", - "EstablishConnectionsScreen.wnd:ButtonAccept6", - "EstablishConnectionsScreen.wnd:ButtonAccept7", - nullptr}; - -const char *const EstablishConnectionsMenu::m_playerNameControlNames[] = { - "EstablishConnectionsScreen.wnd:StaticPlayer1Name", - "EstablishConnectionsScreen.wnd:StaticPlayer2Name", - "EstablishConnectionsScreen.wnd:StaticPlayer3Name", - "EstablishConnectionsScreen.wnd:StaticPlayer4Name", - "EstablishConnectionsScreen.wnd:StaticPlayer5Name", - "EstablishConnectionsScreen.wnd:StaticPlayer6Name", - "EstablishConnectionsScreen.wnd:StaticPlayer7Name", - nullptr -}; - -const char *const EstablishConnectionsMenu::m_playerStatusControlNames[] = { - "EstablishConnectionsScreen.wnd:StaticPlayer1Status", - "EstablishConnectionsScreen.wnd:StaticPlayer2Status", - "EstablishConnectionsScreen.wnd:StaticPlayer3Status", - "EstablishConnectionsScreen.wnd:StaticPlayer4Status", - "EstablishConnectionsScreen.wnd:StaticPlayer5Status", - "EstablishConnectionsScreen.wnd:StaticPlayer6Status", - "EstablishConnectionsScreen.wnd:StaticPlayer7Status", - nullptr -}; - -/** - Constructor - */ -EstablishConnectionsMenu::EstablishConnectionsMenu() { -} - -/** - Destructor - */ -EstablishConnectionsMenu::~EstablishConnectionsMenu() { -} - -/** - Initialize the menu - */ -void EstablishConnectionsMenu::initMenu() { - ShowEstablishConnectionsWindow(); -} - -/** - Close down the menu - */ -void EstablishConnectionsMenu::endMenu() { - HideEstablishConnectionsWindow(); -} - -/** - Abort the game gracefully...ok, as gracefully as possible considering - the game was supposed to be started and now for some reason we have to - stop it. Its really sad that this game isn't going to be played - considering how difficult it is to even get a game going in the first - place, especially one with more than two players. - */ -void EstablishConnectionsMenu::abortGame() { -} - -// the slot number passed in is the index we are to use for the menu. -void EstablishConnectionsMenu::setPlayerName(Int slot, UnicodeString name) { - NameKeyType controlID = TheNameKeyGenerator->nameToKey(m_playerNameControlNames[slot]); - GameWindow *control = TheWindowManager->winGetWindowFromId(nullptr, controlID); - - if (control == nullptr) { - DEBUG_ASSERTCRASH(control != nullptr, ("player name control for slot %d is null", slot)); - return; - } - GadgetStaticTextSetText(control, name); -} - -void EstablishConnectionsMenu::setPlayerStatus(Int slot, NATConnectionState state) { - NameKeyType controlID = TheNameKeyGenerator->nameToKey(m_playerStatusControlNames[slot]); - GameWindow *control = TheWindowManager->winGetWindowFromId(nullptr, controlID); - - if (control == nullptr) { - DEBUG_ASSERTCRASH(control != nullptr, ("player status control for slot %d is null", slot)); - return; - } -// if (state == NATCONNECTIONSTATE_NETGEARDELAY) { -// GadgetStaticTextSetText(control, TheGameText->fetch("GUI:NetgearDelay")); - if (state == NATCONNECTIONSTATE_WAITINGFORMANGLERRESPONSE) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:WaitingForManglerResponse")); - } else if (state == NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:WaitingForMangledPort")); - } else if (state == NATCONNECTIONSTATE_WAITINGFORRESPONSE) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:WaitingForResponse")); - } else if (state == NATCONNECTIONSTATE_DONE) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:ConnectionDone")); - } else if (state == NATCONNECTIONSTATE_FAILED) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:ConnectionFailed")); - } else if (state == NATCONNECTIONSTATE_WAITINGTOBEGIN) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:WaitingToBeginConnection")); - } else { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:UnknownConnectionState")); - } -} diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp deleted file mode 100644 index 2dbfe6c95ca..00000000000 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp +++ /dev/null @@ -1,597 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Diplomacy.cpp /////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell - August 2002 -// Desc: GUI callbacks for the diplomacy menu -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/GlobalData.h" -#include "Common/MultiplayerSettings.h" -#include "Common/Player.h" -#include "Common/PlayerList.h" -#include "Common/PlayerTemplate.h" -#include "Common/Recorder.h" -#include "GameClient/AnimateWindowManager.h" -#include "GameClient/Diplomacy.h" -#include "GameClient/DisconnectMenu.h" -#include "GameClient/GameWindow.h" -#include "GameClient/Gadget.h" -#include "GameClient/GadgetCheckBox.h" -#include "GameClient/GadgetListBox.h" -#include "GameClient/GadgetTextEntry.h" -#include "GameClient/GadgetStaticText.h" -#include "GameClient/GadgetRadioButton.h" -#include "GameClient/GameClient.h" -#include "GameClient/GameText.h" -#include "GameClient/GUICallbacks.h" -#include "GameClient/InGameUI.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/VictoryConditions.h" -#include "GameNetwork/GameInfo.h" -#include "GameNetwork/NetworkInterface.h" -#include "GameNetwork/GameSpy/BuddyDefs.h" -#include "GameNetwork/GameSpy/PeerDefs.h" - - -//------------------------------------------------------------------------------------------------- - -static NameKeyType staticTextPlayerID[MAX_SLOTS]; -static NameKeyType staticTextSideID[MAX_SLOTS]; -static NameKeyType staticTextTeamID[MAX_SLOTS]; -static NameKeyType staticTextStatusID[MAX_SLOTS]; -static NameKeyType buttonMuteID[MAX_SLOTS]; -static NameKeyType buttonUnMuteID[MAX_SLOTS]; -static NameKeyType radioButtonInGameID = NAMEKEY_INVALID; -static NameKeyType radioButtonBuddiesID = NAMEKEY_INVALID; -static GameWindow *radioButtonInGame = nullptr; -static GameWindow *radioButtonBuddies = nullptr; -static NameKeyType winInGameID = NAMEKEY_INVALID; -static NameKeyType winBuddiesID = NAMEKEY_INVALID; -static NameKeyType winSoloID = NAMEKEY_INVALID; -static GameWindow *winInGame = nullptr; -static GameWindow *winBuddies = nullptr; -static GameWindow *winSolo = nullptr; -static GameWindow *staticTextPlayer[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; -static GameWindow *staticTextSide[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; -static GameWindow *staticTextTeam[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; -static GameWindow *staticTextStatus[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; -static GameWindow *buttonMute[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; -static GameWindow *buttonUnMute[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; -static Int slotNumInRow[MAX_SLOTS]; - -//------------------------------------------------------------------------------------------------- - -static WindowLayout *theLayout = nullptr; -static GameWindow *theWindow = nullptr; -static AnimateWindowManager *theAnimateWindowManager = nullptr; -WindowMsgHandledType BuddyControlSystem( GameWindow *window, UnsignedInt msg, - WindowMsgData mData1, WindowMsgData mData2); -void InitBuddyControls(Int type); -void updateBuddyInfo(); -static void grabWindowPointers() -{ - for (Int i=0; iwinGetWindowFromId(theWindow, staticTextPlayerID[i]); - staticTextSide[i] = TheWindowManager->winGetWindowFromId(theWindow, staticTextSideID[i]); - staticTextTeam[i] = TheWindowManager->winGetWindowFromId(theWindow, staticTextTeamID[i]); - staticTextStatus[i] = TheWindowManager->winGetWindowFromId(theWindow, staticTextStatusID[i]); - buttonMute[i] = TheWindowManager->winGetWindowFromId(theWindow, buttonMuteID[i]); - buttonUnMute[i] = TheWindowManager->winGetWindowFromId(theWindow, buttonUnMuteID[i]); - - slotNumInRow[i] = -1; - } -} - -static void releaseWindowPointers() -{ - for (Int i=0; im_animateWindows) - { - Bool wasFinished = theAnimateWindowManager->isFinished(); - theAnimateWindowManager->update(); - if (theAnimateWindowManager->isFinished() && !wasFinished && theAnimateWindowManager->isReversed()) - theWindow->winHide( TRUE ); - } -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -static BriefingList theBriefingList; - -//------------------------------------------------------------------------------------------------- -BriefingList* GetBriefingTextList() -{ - return &theBriefingList; -} - -//------------------------------------------------------------------------------------------------- -void UpdateDiplomacyBriefingText(AsciiString newText, Bool clear) -{ - GameWindow *listboxSolo = TheWindowManager->winGetWindowFromId(theWindow, NAMEKEY("Diplomacy.wnd:ListboxSolo")); - - if (clear) - { - theBriefingList.clear(); - if (listboxSolo) - GadgetListBoxReset(listboxSolo); - } - - if (newText.isEmpty()) - return; - - if (std::find(theBriefingList.begin(), theBriefingList.end(), newText) != theBriefingList.end()) - return; - - theBriefingList.push_back(newText); - if (!listboxSolo) - return; - - UnicodeString translated = TheGameText->fetch(newText); - - Int numEntries = GadgetListBoxGetNumEntries(listboxSolo); - GadgetListBoxAddEntryText(listboxSolo, translated, TheInGameUI->getMessageColor(numEntries%2), -1); -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void ShowDiplomacy( Bool immediate ) -{ - if (!TheInGameUI->getInputEnabled() || TheGameLogic->isIntroMoviePlaying() || - TheGameLogic->isLoadingMap()) - return; - - - if (TheInGameUI->isQuitMenuVisible()) - return; - - if (TheDisconnectMenu && TheDisconnectMenu->isScreenVisible()) - return; - - if (theWindow) - { - theWindow->winHide(FALSE); - theWindow->winEnable(TRUE); - } - else - { - theLayout = TheWindowManager->winCreateLayout( "Diplomacy.wnd" ); - theWindow = theLayout->getFirstWindow(); - theLayout->setUpdate(updateFunc); - theAnimateWindowManager = NEW AnimateWindowManager; - radioButtonInGameID = TheNameKeyGenerator->nameToKey("Diplomacy.wnd:RadioButtonInGame"); - radioButtonBuddiesID = TheNameKeyGenerator->nameToKey("Diplomacy.wnd:RadioButtonBuddies"); - radioButtonInGame = TheWindowManager->winGetWindowFromId(nullptr, radioButtonInGameID); - radioButtonBuddies = TheWindowManager->winGetWindowFromId(nullptr, radioButtonBuddiesID); - winInGameID = TheNameKeyGenerator->nameToKey("Diplomacy.wnd:InGameParent"); - winBuddiesID = TheNameKeyGenerator->nameToKey("Diplomacy.wnd:BuddiesParent"); - winSoloID = TheNameKeyGenerator->nameToKey("Diplomacy.wnd:SoloParent"); - winInGame = TheWindowManager->winGetWindowFromId(nullptr, winInGameID); - winBuddies = TheWindowManager->winGetWindowFromId(nullptr, winBuddiesID); - winSolo = TheWindowManager->winGetWindowFromId(nullptr, winSoloID); - - if (!TheRecorder->isMultiplayer()) - { - GameWindow *listboxSolo = TheWindowManager->winGetWindowFromId(theWindow, NAMEKEY("Diplomacy.wnd:ListboxSolo")); - if (listboxSolo) - { - for (BriefingList::iterator it = theBriefingList.begin(); it != theBriefingList.end(); ++it) - { - UnicodeString translated = TheGameText->fetch(*it); - Int numEntries = GadgetListBoxGetNumEntries(listboxSolo); - GadgetListBoxAddEntryText(listboxSolo, translated, TheInGameUI->getMessageColor(numEntries%2), -1); - } - } - } - } - theLayout->hide(FALSE); - - radioButtonInGame->winHide(TRUE); - radioButtonBuddies->winHide(TRUE); - GadgetRadioSetSelection(radioButtonInGame, FALSE); - if (TheRecorder->isMultiplayer()) - { - winInGame->winHide(FALSE); - winBuddies->winHide(TRUE); - winSolo->winHide(TRUE); - } - else - { - winInGame->winHide(TRUE); - winBuddies->winHide(TRUE); - winSolo->winHide(FALSE); - } - - theAnimateWindowManager->reset(); - if (!immediate && TheGlobalData->m_animateWindows) - theAnimateWindowManager->registerGameWindow( theWindow, WIN_ANIMATION_SLIDE_TOP, TRUE, 200 ); - - TheInGameUI->registerWindowLayout(theLayout); - grabWindowPointers(); - PopulateInGameDiplomacyPopup(); - - if(TheGameSpyInfo && TheGameSpyInfo->getLocalProfileID() != 0) - { - radioButtonInGame->winHide(FALSE); - radioButtonBuddies->winHide(FALSE); - InitBuddyControls(1); - PopulateOldBuddyMessages(); - updateBuddyInfo(); - } - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void ResetDiplomacy() -{ - if(theLayout) - { - TheInGameUI->unregisterWindowLayout(theLayout); - theLayout->destroyWindows(); - deleteInstance(theLayout); - InitBuddyControls(-1); - theLayout = nullptr; - } - theWindow = nullptr; - - delete theAnimateWindowManager; - theAnimateWindowManager = nullptr; -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void HideDiplomacy( Bool immediate ) -{ - releaseWindowPointers(); - if (theWindow) - { - if (immediate || !TheGlobalData->m_animateWindows) - { - theWindow->winHide(TRUE); - theWindow->winEnable(FALSE); - } - else - { - if (theAnimateWindowManager->isFinished()) - theAnimateWindowManager->reverseAnimateWindow(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void ToggleDiplomacy( Bool immediate ) -{ - // If we bring this up, let's hide the quit menu - HideQuitMenu(); - - if (theWindow) - { - Bool show = theWindow->winIsHidden(); - if (show) - ShowDiplomacy( immediate ); - else - HideDiplomacy( immediate ); - } - else - { - ShowDiplomacy( immediate ); - } -} - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -WindowMsgHandledType DiplomacyInput( GameWindow *window, UnsignedInt msg, - WindowMsgData mData1, WindowMsgData mData2 ) -{ - - switch( msg ) - { - - // -------------------------------------------------------------------------------------------- - case GWM_CHAR: - { - UnsignedByte key = mData1; -// UnsignedByte state = mData2; - - switch( key ) - { - - // ---------------------------------------------------------------------------------------- - case KEY_ESC: - { - HideDiplomacy(); - return MSG_HANDLED; - //return MSG_IGNORED; - } - - } - - return MSG_HANDLED; - - } - - } - - return MSG_IGNORED; - -} - -//------------------------------------------------------------------------------------------------- -WindowMsgHandledType DiplomacySystem( GameWindow *window, UnsignedInt msg, - WindowMsgData mData1, WindowMsgData mData2 ) -{ - if(BuddyControlSystem(window, msg, mData1, mData2) == MSG_HANDLED) - { - return MSG_HANDLED; - } - switch( msg ) - { - //--------------------------------------------------------------------------------------------- - case GGM_FOCUS_CHANGE: - { -// Bool focus = (Bool) mData1; - //if (focus) - //TheWindowManager->winSetGrabWindow( chatTextEntry ); - break; - } - - //--------------------------------------------------------------------------------------------- - case GWM_INPUT_FOCUS: - { - // if we're given the opportunity to take the keyboard focus we must say we don't want it - if( mData1 == TRUE ) - *(Bool *)mData2 = FALSE; - - return MSG_HANDLED; - } - - //--------------------------------------------------------------------------------------------- - case GBM_SELECTED: - { - GameWindow *control = (GameWindow *)mData1; - NameKeyType controlID = (NameKeyType)control->winGetWindowId(); - static NameKeyType buttonHideID = NAMEKEY( "Diplomacy.wnd:ButtonHide" ); - if (controlID == buttonHideID) - { - HideDiplomacy( FALSE ); - } - else if( controlID == radioButtonInGameID) - { - winInGame->winHide(FALSE); - winBuddies->winHide(TRUE); - } - else if( controlID == radioButtonBuddiesID) - { - winInGame->winHide(TRUE); - winBuddies->winHide(FALSE); - } - - for (Int i=0; i= 0) - { - TheGameInfo->getSlot(slotNumInRow[i])->mute(TRUE); - PopulateInGameDiplomacyPopup(); - break; - } - if (controlID == buttonUnMuteID[i] && slotNumInRow[i] >= 0) - { - TheGameInfo->getSlot(slotNumInRow[i])->mute(FALSE); - PopulateInGameDiplomacyPopup(); - break; - } - } - break; - - } - - //--------------------------------------------------------------------------------------------- - default: - return MSG_IGNORED; - - } - - return MSG_HANDLED; - -} - -void PopulateInGameDiplomacyPopup() -{ - if (!TheGameInfo) - return; - - Int rowNum = 0; - for (Int slotNum=0; slotNumgetConstSlot(slotNum); - if (slot && slot->isOccupied()) - { - Bool isInGame = false; - // Note - for skirmish, TheNetwork == nullptr. jba. - if (TheNetwork && TheNetwork->isPlayerConnected(slotNum)) { - isInGame = true; - } else if ((TheNetwork == nullptr) && slot->isHuman()) { - // this is a skirmish game and it is the human player. - isInGame = true; - } - if (slot->isAI()) - isInGame = true; - AsciiString playerName; - playerName.format("player%d", slotNum); - Player *player = ThePlayerList->findPlayerWithNameKey(NAMEKEY(playerName)); - Bool isAlive = !TheVictoryConditions->hasSinglePlayerBeenDefeated(player); - Bool isObserver = player->isPlayerObserver(); - - if (slot->isHuman() && TheGameInfo->getLocalSlotNum() != slotNum && isInGame) - { - // show mute button - if (buttonMute[rowNum]) - { - buttonMute[rowNum]->winHide(slot->isMuted()); - } - if (buttonUnMute[rowNum]) - { - buttonUnMute[rowNum]->winHide(!slot->isMuted()); - } - } - else - { - // can't mute self, AI players, or MIA humans - if (buttonMute[rowNum]) - buttonMute[rowNum]->winHide(TRUE); - if (buttonUnMute[rowNum]) - buttonUnMute[rowNum]->winHide(TRUE); - } - - Color playerColor = TheMultiplayerSettings->getColor(slot->getApparentColor())->getColor(); - Color backColor = GameMakeColor(0, 0, 0, 255); - Color aliveColor = GameMakeColor(0, 255, 0, 255); - Color deadColor = GameMakeColor(255, 0, 0, 255); - Color observerInGameColor = GameMakeColor(255, 255, 255, 255); - Color goneColor = GameMakeColor(196, 0, 0, 255); - Color observerGoneColor = GameMakeColor(196, 196, 196, 255); - - if (staticTextPlayer[rowNum]) - { - staticTextPlayer[rowNum]->winSetEnabledTextColors( playerColor, backColor ); - GadgetStaticTextSetText(staticTextPlayer[rowNum], slot->getName()); - } - if (staticTextSide[rowNum]) - { - staticTextSide[rowNum]->winSetEnabledTextColors( playerColor, backColor ); - GadgetStaticTextSetText(staticTextSide[rowNum], slot->getApparentPlayerTemplateDisplayName() ); - } - if (staticTextTeam[rowNum]) - { - staticTextTeam[rowNum]->winSetEnabledTextColors( playerColor, backColor ); - AsciiString teamStr; - teamStr.format("Team:%d", slot->getTeamNumber() + 1); - if (slot->isAI() && slot->getTeamNumber() == -1) - teamStr = "Team:AI"; - GadgetStaticTextSetText(staticTextTeam[rowNum], TheGameText->fetch(teamStr) ); - } - if (staticTextStatus[rowNum]) - { - staticTextStatus[rowNum]->winHide(FALSE); - if (isInGame) - { - if (isAlive) - { - staticTextStatus[rowNum]->winSetEnabledTextColors( aliveColor, backColor ); - GadgetStaticTextSetText(staticTextStatus[rowNum], TheGameText->fetch("GUI:PlayerAlive")); - } - else - { - if (isObserver) - { - staticTextStatus[rowNum]->winSetEnabledTextColors( observerInGameColor, backColor ); - GadgetStaticTextSetText(staticTextStatus[rowNum], TheGameText->fetch("GUI:PlayerObserver")); - } - else - { - staticTextStatus[rowNum]->winSetEnabledTextColors( deadColor, backColor ); - GadgetStaticTextSetText(staticTextStatus[rowNum], TheGameText->fetch("GUI:PlayerDead")); - } - } - } - else - { - // not in game - if (isObserver) - { - staticTextStatus[rowNum]->winSetEnabledTextColors( observerGoneColor, backColor ); - GadgetStaticTextSetText(staticTextStatus[rowNum], TheGameText->fetch("GUI:PlayerObserverGone")); - } - else - { - staticTextStatus[rowNum]->winSetEnabledTextColors( goneColor, backColor ); - GadgetStaticTextSetText(staticTextStatus[rowNum], TheGameText->fetch("GUI:PlayerGone")); - } - } - } - - slotNumInRow[rowNum++] = slotNum; - } - } - - while (rowNum < MAX_SLOTS) - { - slotNumInRow[rowNum] = -1; - if (staticTextPlayer[rowNum]) - staticTextPlayer[rowNum]->winHide(TRUE); - if (staticTextSide[rowNum]) - staticTextSide[rowNum]->winHide(TRUE); - if (staticTextTeam[rowNum]) - staticTextTeam[rowNum]->winHide(TRUE); - if (staticTextStatus[rowNum]) - staticTextStatus[rowNum]->winHide(TRUE); - if (buttonMute[rowNum]) - buttonMute[rowNum]->winHide(TRUE); - if (buttonUnMute[rowNum]) - buttonUnMute[rowNum]->winHide(TRUE); - - ++rowNum; - } -} - - - diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp deleted file mode 100644 index ee2000cabae..00000000000 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp +++ /dev/null @@ -1,308 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ExtendedMessageBox.cpp /////////////////////////////////////////////////////////////////// -// Author: Matt Campbell, January 2003 -// Description: We go quiet in 1 day, gold in 15. Poor time to rewrite message boxes, so -// we get this file instead. Phooey. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/GameEngine.h" -#include "Common/NameKeyGenerator.h" -#include "GameClient/WindowLayout.h" -#include "GameClient/Gadget.h" -#include "GameClient/Shell.h" -#include "GameClient/KeyDefs.h" -#include "GameClient/GadgetStaticText.h" -#include "GameClient/GameWindowManager.h" -#include "GameClient/ExtendedMessageBox.h" - -WindowMsgHandledType ExtendedMessageBoxSystem( GameWindow *window, UnsignedInt msg, - WindowMsgData mData1, WindowMsgData mData2 ); - -//------------------------------------------------------------------------------------------------- -/** Create an extended Modal Message Box */ -//------------------------------------------------------------------------------------------------- -static GameWindow *gogoExMessageBox(Int x, Int y, Int width, Int height, UnsignedShort buttonFlags, - UnicodeString titleString, UnicodeString bodyString, void *userData, - MessageBoxFunc yesCallback, - MessageBoxFunc noCallback, - MessageBoxFunc okCallback, - MessageBoxFunc cancelCallback ) -{ - // first check to make sure we have some buttons to display - if(buttonFlags == 0 ) - { - return nullptr; - } - - GameWindow *parent = TheWindowManager->winCreateFromScript( "Menus/MessageBox.wnd" ); - TheWindowManager->winSetModal( parent ); - TheWindowManager->winSetFocus( nullptr ); // make sure we lose focus from other windows even if we refuse focus ourselves - TheWindowManager->winSetFocus( parent ); - - // If the user wants the size to be different then the default - float ratioX, ratioY = 1; - - if( width > 0 && height > 0 ) - { - ICoord2D temp; - //First grab the percent increase/decrease compared to the default size - parent->winGetSize( &temp.x, &temp.y); - ratioX = (float)width / (float)temp.x; - ratioY = (float)height / (float)temp.y; - //Set the window's new size - parent->winSetSize( width, height); - - //Resize/reposition all the children windows based off the ratio - GameWindow *child; - for( child = parent->winGetChild(); child; child = child->winGetNext() ) - { - child->winGetSize(&temp.x, &temp.y); - temp.x =Int(temp.x * ratioX); - temp.y =Int(temp.y * ratioY); - child->winSetSize(temp.x, temp.y); - - child->winGetPosition(&temp.x, &temp.y); - temp.x =Int(temp.x * ratioX); - temp.y =Int(temp.y * ratioY); - child->winSetPosition(temp.x, temp.y); - } - } - - // If the user wants to position the message box somewhere other then default - if( x >= 0 && y >= 0) - parent->winSetPosition(x, y); - - // Reposition the buttons - Int buttonX[3], buttonY[3]; - - //In the layout, buttonOk will be in the first button position - NameKeyType buttonOkID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonOk" ); - GameWindow *buttonOk = TheWindowManager->winGetWindowFromId(parent, buttonOkID); - buttonOk->winGetPosition(&buttonX[0], &buttonY[0]); - - NameKeyType buttonYesID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonYes" ); - GameWindow *buttonYes = TheWindowManager->winGetWindowFromId(parent, buttonYesID); - //buttonNo in the second position - NameKeyType buttonNoID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonNo" ); - GameWindow *buttonNo = TheWindowManager->winGetWindowFromId(parent, buttonNoID); - buttonNo->winGetPosition(&buttonX[1], &buttonY[1]); - - //and buttonCancel in the third - NameKeyType buttonCancelID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonCancel" ); - GameWindow *buttonCancel = TheWindowManager->winGetWindowFromId(parent, buttonCancelID); - buttonCancel->winGetPosition(&buttonX[2], &buttonY[2]); - - //we shouldn't have button OK and Yes on the same dialog - if((buttonFlags & (MSG_BOX_OK | MSG_BOX_YES)) == (MSG_BOX_OK | MSG_BOX_YES) ) - { - DEBUG_CRASH(("Passed in MSG_BOX_OK and MSG_BOX_YES. Big No No.")); - } - - //Position the OK button if we have one - if( (buttonFlags & MSG_BOX_OK) == MSG_BOX_OK) - { - buttonOk->winSetPosition(buttonX[0], buttonY[0]); - buttonOk->winHide(FALSE); - } - else if( (buttonFlags & MSG_BOX_YES) == MSG_BOX_YES) - { - //Position the Yes if we have one - buttonYes->winSetPosition(buttonX[0], buttonY[0]); - buttonYes->winHide(FALSE); - } - - if((buttonFlags & (MSG_BOX_NO | MSG_BOX_CANCEL)) == (MSG_BOX_NO | MSG_BOX_CANCEL) ) - { - //If we have both the No and Cancel button, then the no should go in the middle position - buttonNo->winSetPosition(buttonX[1], buttonY[1]); - buttonCancel->winSetPosition(buttonX[2], buttonY[2]); - buttonNo->winHide(FALSE); - buttonCancel->winHide(FALSE); - } - else if( (buttonFlags & MSG_BOX_NO) == MSG_BOX_NO) - { - //if we just have the no button, then position it in the right most spot - buttonNo->winSetPosition(buttonX[2], buttonY[2]); - buttonNo->winHide(FALSE); - } - else if( (buttonFlags & MSG_BOX_CANCEL) == MSG_BOX_CANCEL) - { - //else if we just have the Cancel button, well, it should always go in the right spot - buttonCancel->winSetPosition(buttonX[2], buttonY[2]); - buttonCancel->winHide(FALSE); - } - - // Fill the text into the text boxes - NameKeyType staticTextTitleID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:StaticTextTitle" ); - GameWindow *staticTextTitle = TheWindowManager->winGetWindowFromId(parent, staticTextTitleID); - GadgetStaticTextSetText(staticTextTitle,titleString); - - NameKeyType staticTextMessageID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:StaticTextMessage" ); - GameWindow *staticTextMessage = TheWindowManager->winGetWindowFromId(parent, staticTextMessageID); - GadgetStaticTextSetText(staticTextMessage,bodyString); - - // create a structure that will pass the functions to - WindowExMessageBoxData *MsgBoxCallbacks = NEW WindowExMessageBoxData; - MsgBoxCallbacks->cancelCallback = cancelCallback; - MsgBoxCallbacks->noCallback = noCallback; - MsgBoxCallbacks->okCallback = okCallback; - MsgBoxCallbacks->yesCallback = yesCallback; - MsgBoxCallbacks->userData = userData; - //pass the structure to the dialog - parent->winSetUserData( MsgBoxCallbacks ); - - parent->winSetSystemFunc(ExtendedMessageBoxSystem); - - //make sure the dialog is showing and bring it to the top - parent->winHide(FALSE); - parent->winBringToTop(); - - return parent; -} - -GameWindow *ExMessageBoxYesNo (UnicodeString titleString,UnicodeString bodyString, void *userData, - MessageBoxFunc yesCallback, MessageBoxFunc noCallback) -{ - return gogoExMessageBox(-1,-1,-1,-1,MSG_BOX_NO | MSG_BOX_YES , titleString, bodyString, userData, yesCallback, noCallback, nullptr, nullptr); -} - -GameWindow *ExMessageBoxYesNoCancel (UnicodeString titleString,UnicodeString bodyString, void *userData, - MessageBoxFunc yesCallback, MessageBoxFunc noCallback, MessageBoxFunc cancelCallback) -{ - return gogoExMessageBox(-1,-1,-1,-1,MSG_BOX_NO | MSG_BOX_YES | MSG_BOX_CANCEL , titleString, bodyString, userData, yesCallback, noCallback, nullptr, cancelCallback); -} - -GameWindow *ExMessageBoxOkCancel (UnicodeString titleString,UnicodeString bodyString, void *userData, - MessageBoxFunc okCallback, MessageBoxFunc cancelCallback) -{ - return gogoExMessageBox(-1,-1,-1,-1,MSG_BOX_OK | MSG_BOX_CANCEL , titleString, bodyString, userData, nullptr, nullptr, okCallback, cancelCallback); -} - -GameWindow *ExMessageBoxOk (UnicodeString titleString,UnicodeString bodyString, void *userData, - MessageBoxFunc okCallback) -{ - return gogoExMessageBox(-1,-1,-1,-1,MSG_BOX_OK, titleString, bodyString, userData, nullptr, nullptr, okCallback, nullptr); -} - -GameWindow *ExMessageBoxCancel (UnicodeString titleString,UnicodeString bodyString, void *userData, - MessageBoxFunc cancelCallback) -{ - return gogoExMessageBox(-1,-1,-1,-1, MSG_BOX_CANCEL, titleString, bodyString, userData, nullptr, nullptr, nullptr, cancelCallback); -} - - - -// PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// - - - -//------------------------------------------------------------------------------------------------- -/** Message Box window system callback */ -//------------------------------------------------------------------------------------------------- -WindowMsgHandledType ExtendedMessageBoxSystem( GameWindow *window, UnsignedInt msg, - WindowMsgData mData1, WindowMsgData mData2 ) -{ - - - switch( msg ) - { - - //--------------------------------------------------------------------------------------------- - case GWM_DESTROY: - { - delete (WindowExMessageBoxData *)window->winGetUserData(); - window->winSetUserData( nullptr ); - break; - - } - - // -------------------------------------------------------------------------------------------- - case GWM_INPUT_FOCUS: - { - - // if we're givin the opportunity to take the keyboard focus we must say we want it - if( mData1 == TRUE ) - *(Bool *)mData2 = TRUE; - - break; - - } - - //--------------------------------------------------------------------------------------------- - case GBM_SELECTED: - { - GameWindow *control = (GameWindow *)mData1; - Int controlID = control->winGetWindowId(); - static NameKeyType buttonOkID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonOk" ); - static NameKeyType buttonYesID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonYes" ); - static NameKeyType buttonNoID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonNo" ); - static NameKeyType buttonCancelID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonCancel" ); - WindowExMessageBoxData *MsgBoxCallbacks = (WindowExMessageBoxData *)window->winGetUserData(); - - MessageBoxReturnType ret = MB_RETURN_CLOSE; - - if( controlID == buttonOkID ) - { - if (MsgBoxCallbacks->okCallback) - ret = MsgBoxCallbacks->okCallback(MsgBoxCallbacks->userData); - } - else if( controlID == buttonYesID ) - { - if (MsgBoxCallbacks->yesCallback) - ret = MsgBoxCallbacks->yesCallback(MsgBoxCallbacks->userData); - } - else if( controlID == buttonNoID ) - { - if (MsgBoxCallbacks->noCallback) - ret = MsgBoxCallbacks->noCallback(MsgBoxCallbacks->userData); - } - else if( controlID == buttonCancelID ) - { - if (MsgBoxCallbacks->cancelCallback) - ret = MsgBoxCallbacks->cancelCallback(MsgBoxCallbacks->userData); - } - - if (ret == MB_RETURN_CLOSE) - TheWindowManager->winDestroy(window); - - break; - - } - - //--------------------------------------------------------------------------------------------- - default: - return MSG_IGNORED; - - } - - return MSG_HANDLED; - -} diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp deleted file mode 100644 index 466b9caebd6..00000000000 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: GameInfoWindow.cpp //////////////////////////////////////////////////////////////////////// -// Author: Chris Huybregts, Feb 2002 -// Description: Game Info window callbacks -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/WindowLayout.h" -#include "GameClient/MapUtil.h" -#include "GameClient/Shell.h" -#include "GameClient/GameWindowManager.h" -#include "GameClient/GadgetListBox.h" -#include "GameClient/GadgetStaticText.h" - -#include "GameClient/GameText.h" -#include "GameClient/GameInfoWindow.h" -#include "Common/MultiplayerSettings.h" -#include "Common/PlayerTemplate.h" -#include "GameNetwork/GameInfo.h" -#include "GameNetwork/LANAPI.h" - - -static GameWindow *parent = nullptr; -static GameWindow *staticTextGameName = nullptr; -static GameWindow *staticTextMapName = nullptr; -static GameWindow *listBoxPlayers = nullptr; -static GameWindow *winCrates = nullptr; -static GameWindow *winSuperWeapons = nullptr; -static GameWindow *winFreeForAll = nullptr; - -static NameKeyType parentID = NAMEKEY_INVALID; -static NameKeyType staticTextGameNameID = NAMEKEY_INVALID; -static NameKeyType staticTextMapNameID = NAMEKEY_INVALID; -static NameKeyType listBoxPlayersID = NAMEKEY_INVALID; -static NameKeyType winCratesID = NAMEKEY_INVALID; -static NameKeyType winSuperWeaponsID = NAMEKEY_INVALID; -static NameKeyType winFreeForAllID = NAMEKEY_INVALID; - -static WindowLayout *gameInfoWindowLayout = nullptr; -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// - -void CreateLANGameInfoWindow( GameWindow *sizeAndPosWin ) -{ - if( !gameInfoWindowLayout ) - gameInfoWindowLayout = TheWindowManager->winCreateLayout( "Menus/GameInfoWindow.wnd" ); - - gameInfoWindowLayout->runInit(); - gameInfoWindowLayout->bringForward(); - gameInfoWindowLayout->hide( TRUE ); - - if( !parent || !sizeAndPosWin ) - return; - Int x, y, width, height; - sizeAndPosWin->winGetScreenPosition(&x,&y); - parent->winSetPosition(x,y); - - sizeAndPosWin->winGetSize( &width, &height ); - parent->winSetSize(width, height); - -} - -void DestroyGameInfoWindow() -{ - if (gameInfoWindowLayout) - { - gameInfoWindowLayout->destroyWindows(); - deleteInstance(gameInfoWindowLayout); - gameInfoWindowLayout = nullptr; - } -} - -void RefreshGameInfoWindow(GameInfo *gameInfo, UnicodeString gameName) -{ - static const Image *randomIcon = TheMappedImageCollection->findImageByName("GameinfoRANDOM"); - static const Image *observerIcon = TheMappedImageCollection->findImageByName("GameinfoOBSRVR"); - if(!gameInfoWindowLayout || !gameInfo ) - return; - - parent->winHide( FALSE ); - parent->winBringToTop(); - - // Set the game name - GadgetStaticTextSetText(staticTextGameName, ((LANGameInfo *)gameInfo)->getPlayerName(0)); - // set the map name - UnicodeString map; - AsciiString asciiMap = gameInfo->getMap(); - asciiMap.toLower(); - std::map::iterator it = TheMapCache->find(asciiMap); - if (it != TheMapCache->end()) - { - map = it->second.m_displayName; - } - else - { - // can happen if the map will have to be transferred... so use the leaf name (srj) - const char *noPath = gameInfo->getMap().reverseFind('\\'); - if (noPath) - { - ++noPath; - } - else - { - noPath = gameInfo->getMap().str(); - } - map.translate(noPath); - } - GadgetStaticTextSetText(staticTextMapName,map); - - // fill in the player list - - GadgetListBoxReset(listBoxPlayers); - - Int numColors = TheMultiplayerSettings->getNumColors(); - Color white = GameMakeColor(255,255,255,255); -// Color grey = GameMakeColor(188,188,188,255); - for (Int i = 0; i < MAX_SLOTS; i ++) - { - Color playerColor = white; - Int color = -1; - Int addedRow; - GameSlot *slot = gameInfo->getSlot(i); - if(!slot || (slot->isOccupied() == FALSE)) - continue; - color = slot->getColor(); - if(color > -1 && color < numColors) - { - MultiplayerColorDefinition *def = TheMultiplayerSettings->getColor(color); - playerColor = def->getColor(); - } - if(slot->isAI()) - { - switch(slot->getState()) - { - case SLOT_EASY_AI: - { - addedRow = GadgetListBoxAddEntryText(listBoxPlayers,TheGameText->fetch("GUI:EasyAI"),playerColor,-1, 1); - break; - } - case SLOT_MED_AI: - { - addedRow = GadgetListBoxAddEntryText(listBoxPlayers,TheGameText->fetch("GUI:MediumAI"),playerColor,-1, 1); - break; - } - case SLOT_BRUTAL_AI: - { - addedRow = GadgetListBoxAddEntryText(listBoxPlayers,TheGameText->fetch("GUI:HardAI"),playerColor,-1, 1); - break; - } - default: - break; - } - } - else if(slot->isHuman()) - { - addedRow = GadgetListBoxAddEntryText(listBoxPlayers, slot->getName(),playerColor,-1,1); - } - Int playerTemplate = slot->getPlayerTemplate(); - if(playerTemplate == PLAYERTEMPLATE_OBSERVER) - { - GadgetListBoxAddEntryImage(listBoxPlayers, observerIcon,addedRow, 0, 22,25); - } - else if(playerTemplate < 0 || playerTemplate >= ThePlayerTemplateStore->getPlayerTemplateCount()) - { - ///< @todo: When we get art that shows player's side, then we'll actually draw the art instead of putting in text - GadgetListBoxAddEntryImage(listBoxPlayers, randomIcon,addedRow, 0, 22,25); - //GadgetListBoxAddEntryText(listBoxPlayers,TheGameText->fetch("GUI:???"),playerColor,addedRow, 0); - } - else - { - const PlayerTemplate *fact = ThePlayerTemplateStore->getNthPlayerTemplate(playerTemplate); - GadgetListBoxAddEntryImage(listBoxPlayers, fact->getSideIconImage(),addedRow, 0, 22,25); - //GadgetListBoxAddEntryText(listBoxPlayers,fact->getDisplayName(),playerColor,addedRow, 0); - } - - } -} - -void HideGameInfoWindow(Bool hide) -{ - if(!parent) - return; - parent->winHide(hide); - -} - -//------------------------------------------------------------------------------------------------- -/** Initialize the GameInfoWindow */ -//------------------------------------------------------------------------------------------------- -void GameInfoWindowInit( WindowLayout *layout, void *userData ) -{ - - parentID = TheNameKeyGenerator->nameToKey( "GameInfoWindow.wnd:ParentGameInfo" ); - staticTextGameNameID = TheNameKeyGenerator->nameToKey( "GameInfoWindow.wnd:StaticTextGameName" ); - staticTextMapNameID = TheNameKeyGenerator->nameToKey( "GameInfoWindow.wnd:StaticTextMapName" ); - listBoxPlayersID = TheNameKeyGenerator->nameToKey( "GameInfoWindow.wnd:ListBoxPlayers" ); - winCratesID = TheNameKeyGenerator->nameToKey( "GameInfoWindow.wnd:WinCrates" ); - winSuperWeaponsID = TheNameKeyGenerator->nameToKey( "GameInfoWindow.wnd:WinSuperWeapons" ); - winFreeForAllID = TheNameKeyGenerator->nameToKey( "GameInfoWindow.wnd:WinFreeForAll" ); - - parent = TheWindowManager->winGetWindowFromId( nullptr, parentID ); - staticTextGameName = TheWindowManager->winGetWindowFromId( parent, staticTextGameNameID ); - staticTextMapName = TheWindowManager->winGetWindowFromId( parent, staticTextMapNameID ); - listBoxPlayers = TheWindowManager->winGetWindowFromId( parent, listBoxPlayersID ); - winCrates = TheWindowManager->winGetWindowFromId( parent, winCratesID ); - winSuperWeapons = TheWindowManager->winGetWindowFromId( parent, winSuperWeaponsID ); - winFreeForAll = TheWindowManager->winGetWindowFromId( parent, winFreeForAllID ); - - GadgetStaticTextSetText(staticTextGameName,UnicodeString::TheEmptyString); - GadgetStaticTextSetText(staticTextMapName,UnicodeString::TheEmptyString); - GadgetListBoxReset(listBoxPlayers); - -} - - -//------------------------------------------------------------------------------------------------- -/** GameInfo window system callback */ -//------------------------------------------------------------------------------------------------- -WindowMsgHandledType GameInfoWindowSystem( GameWindow *window, UnsignedInt msg, - WindowMsgData mData1, WindowMsgData mData2 ) -{ - switch( msg ) - { -// might use these later -// GameWindow *control = (GameWindow *)mData1; -// Int controlID = control->winGetWindowId(); - - - // -------------------------------------------------------------------------------------------- - case GWM_CREATE: - { - - break; - - } - - //--------------------------------------------------------------------------------------------- - case GWM_DESTROY: - { - - break; - - } - - // -------------------------------------------------------------------------------------------- - case GWM_INPUT_FOCUS: - { - - // if we're givin the opportunity to take the keyboard focus we must say we want it - if( mData1 == TRUE ) - *(Bool *)mData2 = TRUE; - - return MSG_HANDLED; - - } - - //--------------------------------------------------------------------------------------------- - default: - return MSG_IGNORED; - - } - - return MSG_HANDLED; - -} - diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp deleted file mode 100644 index 82518dd1b99..00000000000 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: MessageBox.cpp ///////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Westwood Studios Pacific. -// -// Confidential Information -// Copyright (C) 2001 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Project: RTS3 -// -// File name: MessageBox.cpp -// -// Created: Chris Huybregts, June 2001 -// -// Desc: the Message Box control -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/GameEngine.h" -#include "Common/NameKeyGenerator.h" -#include "GameClient/WindowLayout.h" -#include "GameClient/Gadget.h" -#include "GameClient/Shell.h" -#include "GameClient/KeyDefs.h" -#include "GameClient/GameWindowManager.h" -#include "GameClient/MessageBox.h" - - -GameWindow *MessageBoxYesNo(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc yesCallback,GameWinMsgBoxFunc noCallback) ///< convenience function for displaying a Message box with Yes and No buttons -{ - return TheWindowManager->gogoMessageBox(-1,-1,-1,-1,MSG_BOX_NO | MSG_BOX_YES , titleString, bodyString, yesCallback, noCallback, nullptr, nullptr); -} -GameWindow *QuitMessageBoxYesNo(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc yesCallback,GameWinMsgBoxFunc noCallback) ///< convenience function for displaying a Message box with Yes and No buttons -{ - return TheWindowManager->gogoMessageBox(-1,-1,-1,-1,MSG_BOX_NO | MSG_BOX_YES , titleString, bodyString, yesCallback, noCallback, nullptr, nullptr, TRUE); -} - - -GameWindow *MessageBoxYesNoCancel(UnicodeString titleString,UnicodeString bodyString, GameWinMsgBoxFunc yesCallback, GameWinMsgBoxFunc noCallback, GameWinMsgBoxFunc cancelCallback)///< convenience function for displaying a Message box with Yes,No and Cancel buttons -{ - return TheWindowManager->gogoMessageBox(-1,-1,-1,-1,MSG_BOX_NO | MSG_BOX_YES | MSG_BOX_CANCEL , titleString, bodyString, yesCallback, noCallback, nullptr, cancelCallback); -} - - -GameWindow *MessageBoxOkCancel(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc okCallback,GameWinMsgBoxFunc cancelCallback)///< convenience function for displaying a Message box with Ok and Cancel buttons -{ - return TheWindowManager->gogoMessageBox(-1,-1,-1,-1,MSG_BOX_OK | MSG_BOX_CANCEL , titleString, bodyString, nullptr, nullptr, okCallback, cancelCallback); -} - -GameWindow *MessageBoxOk(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc okCallback)///< convenience function for displaying a Message box with Ok button -{ - return TheWindowManager->gogoMessageBox(-1,-1,-1,-1,MSG_BOX_OK, titleString, bodyString, nullptr, nullptr, okCallback, nullptr); -} - - -GameWindow *MessageBoxCancel(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc cancelCallback)///< convenience function for displaying a Message box with Cancel button -{ - return TheWindowManager->gogoMessageBox(-1,-1,-1,-1, MSG_BOX_CANCEL, titleString, bodyString, nullptr, nullptr, nullptr, cancelCallback); -} - - -// PRIVATE DATA /////////////////////////////////////////////////////////////////////////////////// - - - -//------------------------------------------------------------------------------------------------- -/** Message Box window system callback */ -//------------------------------------------------------------------------------------------------- -WindowMsgHandledType MessageBoxSystem( GameWindow *window, UnsignedInt msg, - WindowMsgData mData1, WindowMsgData mData2 ) -{ - - - switch( msg ) - { - - //--------------------------------------------------------------------------------------------- - case GWM_DESTROY: - { - delete (WindowMessageBoxData *)window->winGetUserData(); - window->winSetUserData( nullptr ); - break; - - } - - // -------------------------------------------------------------------------------------------- - case GWM_INPUT_FOCUS: - { - - // if we're givin the opportunity to take the keyboard focus we must say we want it - if( mData1 == TRUE ) - *(Bool *)mData2 = TRUE; - - break; - - } - - //--------------------------------------------------------------------------------------------- - case GBM_SELECTED: - { - GameWindow *control = (GameWindow *)mData1; - Int controlID = control->winGetWindowId(); - static NameKeyType buttonOkID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonOk" ); - static NameKeyType buttonYesID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonYes" ); - static NameKeyType buttonNoID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonNo" ); - static NameKeyType buttonCancelID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonCancel" ); - WindowMessageBoxData *MsgBoxCallbacks = (WindowMessageBoxData *)window->winGetUserData(); - - if( controlID == buttonOkID ) - { - //simple enough,if we have a callback, call it, if not, then just destroy the window - if (MsgBoxCallbacks->okCallback) - MsgBoxCallbacks->okCallback(); - - TheWindowManager->winDestroy(window); - - } - else if( controlID == buttonYesID ) - { - if (MsgBoxCallbacks->yesCallback) - MsgBoxCallbacks->yesCallback(); - TheWindowManager->winDestroy(window); - } - else if( controlID == buttonNoID ) - { - if (MsgBoxCallbacks->noCallback) - MsgBoxCallbacks->noCallback(); - TheWindowManager->winDestroy(window); - } - else if( controlID == buttonCancelID ) - { - if (MsgBoxCallbacks->cancelCallback) - MsgBoxCallbacks->cancelCallback(); - TheWindowManager->winDestroy(window); - } - - break; - - } - - //--------------------------------------------------------------------------------------------- - default: - return MSG_IGNORED; - - } - - return MSG_HANDLED; - -} -//------------------------------------------------------------------------------------------------- -/** Message Box window system callback */ -//------------------------------------------------------------------------------------------------- -WindowMsgHandledType QuitMessageBoxSystem( GameWindow *window, UnsignedInt msg, - WindowMsgData mData1, WindowMsgData mData2 ) -{ - - - switch( msg ) - { - - //--------------------------------------------------------------------------------------------- - case GWM_DESTROY: - { - delete (WindowMessageBoxData *)window->winGetUserData(); - window->winSetUserData( nullptr ); - break; - - } - - // -------------------------------------------------------------------------------------------- - case GWM_INPUT_FOCUS: - { - - // if we're givin the opportunity to take the keyboard focus we must say we want it - if( mData1 == TRUE ) - *(Bool *)mData2 = TRUE; - - break; - - } - - //--------------------------------------------------------------------------------------------- - case GBM_SELECTED: - { - GameWindow *control = (GameWindow *)mData1; - Int controlID = control->winGetWindowId(); - static NameKeyType buttonOkID = TheNameKeyGenerator->nameToKey( "QuitMessageBox.wnd:ButtonOk" ); - static NameKeyType buttonYesID = TheNameKeyGenerator->nameToKey( "QuitMessageBox.wnd:ButtonYes" ); - static NameKeyType buttonNoID = TheNameKeyGenerator->nameToKey( "QuitMessageBox.wnd:ButtonNo" ); - static NameKeyType buttonCancelID = TheNameKeyGenerator->nameToKey( "QuitMessageBox.wnd:ButtonCancel" ); - WindowMessageBoxData *MsgBoxCallbacks = (WindowMessageBoxData *)window->winGetUserData(); - - if( controlID == buttonOkID ) - { - //simple enough,if we have a callback, call it, if not, then just destroy the window - if (MsgBoxCallbacks->okCallback) - MsgBoxCallbacks->okCallback(); - - TheWindowManager->winDestroy(window); - - } - else if( controlID == buttonYesID ) - { - if (MsgBoxCallbacks->yesCallback) - MsgBoxCallbacks->yesCallback(); - TheWindowManager->winDestroy(window); - } - else if( controlID == buttonNoID ) - { - if (MsgBoxCallbacks->noCallback) - MsgBoxCallbacks->noCallback(); - TheWindowManager->winDestroy(window); - } - else if( controlID == buttonCancelID ) - { - if (MsgBoxCallbacks->cancelCallback) - MsgBoxCallbacks->cancelCallback(); - TheWindowManager->winDestroy(window); - } - - break; - - } - - //--------------------------------------------------------------------------------------------- - default: - return MSG_IGNORED; - - } - - return MSG_HANDLED; - -} diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp deleted file mode 100644 index 45dd45f9913..00000000000 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ShellMenuScheme.cpp ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Jul 2002 -// -// Filename: ShellMenuScheme.cpp -// -// author: Chris Huybregts -// -// purpose: -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/INI.h" -#include "GameClient/ShellMenuScheme.h" -#include "GameClient/Shell.h" -#include "GameClient/Display.h" -//----------------------------------------------------------------------------- -// DEFINES //////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -const FieldParse ShellMenuSchemeManager::m_shellMenuSchemeFieldParseTable[] = -{ - - { "ImagePart", ShellMenuSchemeManager::parseImagePart, nullptr, 0 }, - { "LinePart", ShellMenuSchemeManager::parseLinePart, nullptr, 0 }, - { nullptr, nullptr, nullptr, 0 } - -}; - -//----------------------------------------------------------------------------- -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -void INI::parseShellMenuSchemeDefinition( INI *ini ) -{ - AsciiString name; - ShellMenuSchemeManager *SMSchemeManager; - ShellMenuScheme *SMScheme; - - // read the name - const char* c = ini->getNextToken(); - name.set( c ); - - // find existing item if present - SMSchemeManager = TheShell->getShellMenuSchemeManager(); - DEBUG_ASSERTCRASH( SMSchemeManager, ("parseShellMenuSchemeDefinition: Unable to Get SMSchemeManager") ); - if( !SMSchemeManager ) - return; - - // If we have a previously allocated control bar, this will return a cleared out pointer to it so we - // can overwrite it - SMScheme = SMSchemeManager->newShellMenuScheme( name ); - - // sanity - DEBUG_ASSERTCRASH( SMScheme, ("parseControlBarSchemeDefinition: Unable to allocate Scheme '%s'", name.str()) ); - - // parse the ini definition - ini->initFromINI( SMScheme, SMSchemeManager->getFieldParse() ); - -} - -ShellMenuSchemeLine::ShellMenuSchemeLine() -{ - m_startPos.x = m_startPos.y = 0; - m_endPos.x = m_endPos.y = 0; - m_color = GAME_COLOR_UNDEFINED; - m_width = 1; -} -ShellMenuSchemeLine::~ShellMenuSchemeLine() -{ -} - -ShellMenuSchemeImage::ShellMenuSchemeImage() -{ - m_name.clear(); - m_position.x = m_position.y = 0; - m_size.x = m_size.x = 0; - m_image = nullptr; -} - -ShellMenuSchemeImage::~ShellMenuSchemeImage() -{ - m_image = nullptr; -} - -ShellMenuScheme::ShellMenuScheme() -{ - -} - -ShellMenuScheme::~ShellMenuScheme() -{ - ShellMenuSchemeImageListIt it = m_imageList.begin(); - while(it != m_imageList.end()) - { - ShellMenuSchemeImage *image = *it; - it = m_imageList.erase( it ); - delete image; - } - - ShellMenuSchemeLineListIt lineIt = m_lineList.begin(); - while(lineIt != m_lineList.end()) - { - ShellMenuSchemeLine *line = *lineIt; - lineIt = m_lineList.erase( lineIt ); - delete line; - } - - -} - -void ShellMenuScheme::addLine( ShellMenuSchemeLine* schemeLine ) -{ - if(!schemeLine) - return; - - m_lineList.push_back( schemeLine ); -} - - -void ShellMenuScheme::addImage( ShellMenuSchemeImage* schemeImage ) -{ - if(!schemeImage) - return; - - m_imageList.push_back( schemeImage ); -} - -void ShellMenuScheme::draw() -{ - - ShellMenuSchemeImageListIt imageIt = m_imageList.begin(); - while(imageIt != m_imageList.end()) - { - ShellMenuSchemeImage *image = *imageIt; - if(image && image->m_image) - { - TheDisplay->drawImage(image->m_image, image->m_position.x, image->m_position.y, - image->m_position.x + image->m_size.x , image->m_position.y + image->m_size.y); - } - ++imageIt; - } - - ShellMenuSchemeLineListIt it = m_lineList.begin(); - while(it != m_lineList.end()) - { - ShellMenuSchemeLine *line = *it; - - if(line) - { - TheDisplay->drawLine(line->m_startPos.x, line->m_startPos.y, line->m_endPos.x, - line->m_endPos.y,line->m_width, line->m_color); - } - ++it; - } - - -} - -ShellMenuSchemeManager::ShellMenuSchemeManager() -{ - m_currentScheme = nullptr; -} - -ShellMenuSchemeManager::~ShellMenuSchemeManager() -{ - m_currentScheme = nullptr; - - - ShellMenuSchemeListIt it = m_schemeList.begin(); - while(it != m_schemeList.end()) - { - ShellMenuScheme *scheme = *it; - it = m_schemeList.erase( it ); - delete scheme; - } - -} - -void ShellMenuSchemeManager::parseImagePart(INI *ini, void *instance, void* /*store*/, const void* /*userData*/) -{ - static const FieldParse myFieldParse[] = - { - { "Position", INI::parseICoord2D, nullptr, offsetof( ShellMenuSchemeImage, m_position ) }, - { "Size", INI::parseICoord2D, nullptr, offsetof( ShellMenuSchemeImage, m_size ) }, - { "ImageName", INI::parseMappedImage, nullptr, offsetof( ShellMenuSchemeImage, m_image ) }, - { nullptr, nullptr, nullptr, 0 } - }; - - ShellMenuSchemeImage *schemeImage = NEW ShellMenuSchemeImage; - ini->initFromINI(schemeImage, myFieldParse); - ((ShellMenuScheme*)instance)->addImage(schemeImage); - -} - -void ShellMenuSchemeManager::parseLinePart(INI *ini, void *instance, void* /*store*/, const void* /*userData*/) -{ - static const FieldParse myFieldParse[] = - { - { "StartPosition", INI::parseICoord2D, nullptr, offsetof( ShellMenuSchemeLine, m_startPos ) }, - { "EndPosition", INI::parseICoord2D, nullptr, offsetof( ShellMenuSchemeLine, m_endPos ) }, - { "Color", INI::parseColorInt, nullptr, offsetof( ShellMenuSchemeLine, m_color ) }, - { "Width", INI::parseInt, nullptr, offsetof( ShellMenuSchemeLine, m_width ) }, - - { nullptr, nullptr, nullptr, 0 } - }; - - ShellMenuSchemeLine *schemeLine = NEW ShellMenuSchemeLine; - ini->initFromINI(schemeLine, myFieldParse); - ((ShellMenuScheme*)instance)->addLine(schemeLine); - -} - -ShellMenuScheme *ShellMenuSchemeManager::newShellMenuScheme(AsciiString name) -{ - ShellMenuSchemeListIt it; - it = m_schemeList.begin(); - name.toLower(); - while(it != m_schemeList.end()) - { - ShellMenuScheme *scheme = *it; - if(scheme->m_name.compare(name) == 0) - { - m_schemeList.erase( it ); - delete scheme; - break; - } - else - ++it; - } - ShellMenuScheme *newScheme = NEW ShellMenuScheme; - newScheme->m_name.set(name); - m_schemeList.push_back(newScheme); - return newScheme; -} - -void ShellMenuSchemeManager::init() -{ - INI ini; - // Read from INI all the ControlBarSchemes - ini.loadFileDirectory( "Data\\INI\\Default\\ShellMenuScheme", INI_LOAD_OVERWRITE, nullptr ); - ini.loadFileDirectory( "Data\\INI\\ShellMenuScheme", INI_LOAD_OVERWRITE, nullptr ); - -} - -void ShellMenuSchemeManager::setShellMenuScheme( AsciiString name ) -{ - if(name.isEmpty()) - { - m_currentScheme = nullptr; - return; - } - - ShellMenuSchemeListIt it; - it = m_schemeList.begin(); - name.toLower(); - while(it != m_schemeList.end()) - { - ShellMenuScheme *scheme = *it; - if(scheme->m_name.compare(name) == 0) - { - m_currentScheme = scheme; - break; - } - ++it; - } -} - -void ShellMenuSchemeManager::draw() -{ - if(m_currentScheme) - m_currentScheme->draw(); -} - -void ShellMenuSchemeManager::update() -{ - -} -//----------------------------------------------------------------------------- -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIDock.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIDock.cpp deleted file mode 100644 index 47781dff2f9..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIDock.cpp +++ /dev/null @@ -1,819 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// AIDock.cpp -// Implementation of docking behavior -// Author: Michael S. Booth, February 2002 -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - - -#include "Common/Module.h" -#include "Common/Player.h" -#include "GameLogic/Object.h" -#include "GameLogic/AIDock.h" -#include "GameLogic/Module/AIUpdate.h" -#include "GameLogic/Module/SupplyTruckAIUpdate.h" -#include "GameLogic/Module/UpdateModule.h" - -//---------------------------------------------------------------------------------------------------------- -/** - * Create an AI state machine. Define all of the states the machine - * can possibly be in, and set the initial (default) state. - */ -AIDockMachine::AIDockMachine( Object *obj ) : StateMachine( obj, "AIDockMachine" ) -{ - static const StateConditionInfo waitForClearanceConditions[] = - { - StateConditionInfo(ableToAdvance, AI_DOCK_ADVANCE_POSITION, nullptr), - StateConditionInfo(nullptr, INVALID_STATE_ID, nullptr) - }; - - // order matters: first state is the default state. - defineState( AI_DOCK_APPROACH, newInstance(AIDockApproachState)( this ), AI_DOCK_WAIT_FOR_CLEARANCE, EXIT_MACHINE_WITH_FAILURE ); - defineState( AI_DOCK_WAIT_FOR_CLEARANCE, newInstance(AIDockWaitForClearanceState)( this ), AI_DOCK_MOVE_TO_ENTRY, EXIT_MACHINE_WITH_FAILURE, waitForClearanceConditions ); - defineState( AI_DOCK_ADVANCE_POSITION, newInstance(AIDockAdvancePositionState)( this ), AI_DOCK_WAIT_FOR_CLEARANCE, EXIT_MACHINE_WITH_FAILURE ); - defineState( AI_DOCK_MOVE_TO_ENTRY, newInstance(AIDockMoveToEntryState)( this ), AI_DOCK_MOVE_TO_DOCK, AI_DOCK_MOVE_TO_EXIT ); - defineState( AI_DOCK_MOVE_TO_DOCK, newInstance(AIDockMoveToDockState)( this ), AI_DOCK_PROCESS_DOCK, AI_DOCK_MOVE_TO_EXIT ); - defineState( AI_DOCK_PROCESS_DOCK, newInstance(AIDockProcessDockState)( this ), AI_DOCK_MOVE_TO_EXIT, AI_DOCK_MOVE_TO_EXIT ); - defineState( AI_DOCK_MOVE_TO_EXIT, newInstance(AIDockMoveToExitState)( this ), AI_DOCK_MOVE_TO_RALLY, EXIT_MACHINE_WITH_FAILURE ); - defineState( AI_DOCK_MOVE_TO_RALLY, newInstance(AIDockMoveToRallyState)( this ), EXIT_MACHINE_WITH_SUCCESS, EXIT_MACHINE_WITH_FAILURE ); - - m_approachPosition = -1; -} - -AIDockMachine::~AIDockMachine() -{ -} - -//----------------------------------------------------------------------------- -void AIDockMachine::halt() -{ - Object *goalObject = getGoalObject(); - - // sanity - if( goalObject != nullptr ) - { - // get dock update interface - DockUpdateInterface *dock = goalObject->getDockUpdateInterface(); - - // We need to say goodbye, or we will leave our spot taken forever. - if( dock != nullptr ) - dock->cancelDock( getOwner() ); - } - - StateMachine::halt(); -} - - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void AIDockMachine::crc( Xfer *xfer ) -{ - StateMachine::crc(xfer); -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer Method */ -// ------------------------------------------------------------------------------------------------ -void AIDockMachine::xfer( Xfer *xfer ) -{ - XferVersion cv = 1; - XferVersion v = cv; - xfer->xferVersion( &v, cv ); - - StateMachine::xfer(xfer); - xfer->xferInt(&m_approachPosition); -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void AIDockMachine::loadPostProcess() -{ - StateMachine::loadPostProcess(); -} - -// State transition conditions ---------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -/* static */ Bool AIDockMachine::ableToAdvance( State *thisState, void* userData ) -{ - Object *goalObject = thisState->getMachineGoalObject(); - AIDockMachine *myMachine = (AIDockMachine *)thisState->getMachine(); - - if( goalObject == nullptr ) - return FALSE; - - DockUpdateInterface *dock = goalObject->getDockUpdateInterface(); - - // if we have nothing to dock with, fail - if( dock == nullptr ) - return FALSE; - - // if the dock says we can advance, then sidetrack to the scoot forward state - if( dock->isClearToAdvance( thisState->getMachineOwner(), myMachine->m_approachPosition ) ) - return TRUE; - - // continue to wait - return FALSE; -} - - -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- - -// ------------------------------------------------------------------------------------------------ -/** Xfer Method */ -// ------------------------------------------------------------------------------------------------ -void AIDockApproachState::xfer( Xfer *xfer ) -{ - // version - XferVersion currentVersion = 2; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - if (version>=2) { - AIInternalMoveToState::xfer(xfer); - } - -} - -//---------------------------------------------------------------------------------------------- -/** - * Approach our waiting spot next to the dock. - */ -StateReturnType AIDockApproachState::onEnter() -{ - Object *goalObject = getMachineGoalObject(); - - // sanity - if( goalObject == nullptr ) - return STATE_FAILURE; - - // get dock update interface - DockUpdateInterface *dock = goalObject->getDockUpdateInterface(); - - // if we have nothing to dock with, fail - if (dock == nullptr) - return STATE_FAILURE; - - // fail if the dock is closed - if( dock->isDockOpen() == FALSE ) - { - dock->cancelDock( getMachineOwner() ); - return STATE_FAILURE; - } - - // get a good place to wait from the dock - Bool reserved = dock->reserveApproachPosition( getMachineOwner(), &m_goalPosition, &(( (AIDockMachine*)getMachine() )->m_approachPosition) ); - if( reserved == FALSE ) - { - // dock is full - return STATE_FAILURE; - } - - AIUpdateInterface *ai = getMachineOwner()->getAIUpdateInterface(); - if (ai) { - ai->ignoreObstacle( nullptr ); - } - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::onEnter(); -} - -//---------------------------------------------------------------------------------------------- -StateReturnType AIDockApproachState::update() -{ - Object *goalObject = getMachineGoalObject(); - - // if we have nothing to dock with, fail - if (goalObject == nullptr) - return STATE_FAILURE; - - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::update(); -} - -//---------------------------------------------------------------------------------------------- -void AIDockApproachState::onExit( StateExitType status ) -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - // tell the dock we have approached - if (dock) - { - // if we were interrupted, let the dock know we're not coming - if (status == EXIT_RESET || dock->isDockOpen() == FALSE) - dock->cancelDock( getMachineOwner() ); - else - dock->onApproachReached( getMachineOwner() ); - } - - // this behavior is an extension of basic MoveTo - AIInternalMoveToState::onExit( status ); -} - -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -/** - * We have approached, now wait at our queue position until the dock says we can enter. - */ -StateReturnType AIDockWaitForClearanceState::onEnter() -{ - m_enterFrame = TheGameLogic->getFrame(); - return STATE_CONTINUE; -} - -/** - * We have approached, now wait at our queue position until the dock says we can enter. - * @todo What if we are pushed off of our queue spot? We need to move back on... (MSB) - */ -StateReturnType AIDockWaitForClearanceState::update() -{ - Object *goalObject = getMachineGoalObject(); - - if( goalObject == nullptr ) - return STATE_FAILURE; - - DockUpdateInterface *dock = goalObject->getDockUpdateInterface(); - - // if we have nothing to dock with, fail - if (dock == nullptr) - return STATE_FAILURE; - - // fail if the dock is closed - if( dock->isDockOpen() == FALSE ) - { - dock->cancelDock( getMachineOwner() ); - return STATE_FAILURE; - } - - // if the dock says we can enter, our wait is over - if (dock->isClearToEnter( getMachineOwner() )) - return STATE_SUCCESS; - - if (m_enterFrame + 30*LOGICFRAMES_PER_SECOND < TheGameLogic->getFrame()) { - return STATE_FAILURE; - } - // continue to wait - return STATE_CONTINUE; -} - -//---------------------------------------------------------------------------------------------- -void AIDockWaitForClearanceState::onExit( StateExitType status ) -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - // if we were interrupted, let the dock know we're not coming - if (dock && (dock->isDockOpen() == FALSE || status == EXIT_RESET)) - dock->cancelDock( getMachineOwner() ); -} - -//---------------------------------------------------------------------------------------------- -void AIDockWaitForClearanceState::xfer(Xfer *xfer ) -{ - XferVersion cv = 2; - XferVersion v = cv; - xfer->xferVersion( &v, cv ); - if (v >= 2) { - xfer->xferUnsignedInt(&m_enterFrame); - } else { - m_enterFrame = TheGameLogic->getFrame(); - } -} -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- - -//---------------------------------------------------------------------------------------------- -/** - * Advance to our next waiting spot next to the dock. - */ -StateReturnType AIDockAdvancePositionState::onEnter() -{ - Object *goalObject = getMachineGoalObject(); - - // sanity - if( goalObject == nullptr ) - return STATE_FAILURE; - - // get dock update interface - DockUpdateInterface *dock = goalObject->getDockUpdateInterface(); - - // if we have nothing to dock with, fail - if (dock == nullptr) - return STATE_FAILURE; - - // fail if the dock is closed - if( dock->isDockOpen() == FALSE ) - { - dock->cancelDock( getMachineOwner() ); - return STATE_FAILURE; - } - - // get a good place to wait from the dock - Bool reserved = dock->advanceApproachPosition( getMachineOwner(), &m_goalPosition, &(( (AIDockMachine*)getMachine() )->m_approachPosition) ); - if( reserved == FALSE ) - { - // dock is full - return STATE_FAILURE; - } - - AIUpdateInterface *ai = getMachineOwner()->getAIUpdateInterface(); - if (ai) { - ai->ignoreObstacle( nullptr ); - } - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::onEnter(); -} - -//---------------------------------------------------------------------------------------------- -StateReturnType AIDockAdvancePositionState::update() -{ - Object *goalObject = getMachineGoalObject(); - - // if we have nothing to dock with, fail - if (goalObject == nullptr) - return STATE_FAILURE; - - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::update(); -} - -//---------------------------------------------------------------------------------------------- -void AIDockAdvancePositionState::onExit( StateExitType status ) -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - // tell the dock we have approached - if (dock) - { - // if we were interrupted, let the dock know we're not coming - if (status == EXIT_RESET || dock->isDockOpen() == FALSE) - dock->cancelDock( getMachineOwner() ); - else - dock->onApproachReached( getMachineOwner() ); - } - - // this behavior is an extension of basic MoveTo - AIInternalMoveToState::onExit( status ); -} - -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- - -//---------------------------------------------------------------------------------------------- -/** - * Move to the dock's entry position. - */ -StateReturnType AIDockMoveToEntryState::onEnter() -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - // if we have nothing to dock with, fail - if (dock == nullptr) - return STATE_FAILURE; - - // fail if the dock is closed - if( dock->isDockOpen() == FALSE ) - { - dock->cancelDock( getMachineOwner() ); - return STATE_FAILURE; - } - - AIUpdateInterface *ai = getMachineOwner()->getAIUpdateInterface(); - if( ai && dock->isAllowPassthroughType() ) - { - ai->ignoreObstacle( getMachineGoalObject() ); - } - - // get the enter position and set as our goal position - dock->getEnterPosition( getMachineOwner(), &m_goalPosition ); - - ( (AIDockMachine*)getMachine() )->m_approachPosition = -1; - - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::onEnter(); -} - -//---------------------------------------------------------------------------------------------- -StateReturnType AIDockMoveToEntryState::update() -{ - // if we have nothing to dock with, fail - if (getMachineGoalObject() == nullptr) - return STATE_FAILURE; - - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::update(); -} - -//---------------------------------------------------------------------------------------------- -void AIDockMoveToEntryState::onExit( StateExitType status ) -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - if (dock) - { - if (dock->isDockOpen() == FALSE || status == EXIT_RESET) - { - // if we were interrupted, let the dock know we're not coming - dock->cancelDock( getMachineOwner() ); - } - else - { - // tell the dock we are at the entrance - dock->onEnterReached( getMachineOwner() ); - } - } - - // this behavior is an extension of basic MoveTo - AIInternalMoveToState::onExit( status ); -} - -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- - -//---------------------------------------------------------------------------------------------- -/** - * Move to the dock's docking position. - */ -StateReturnType AIDockMoveToDockState::onEnter() -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - // if we have nothing to dock with, fail - if (dock == nullptr) - return STATE_FAILURE; - - // fail if the dock is closed - if( dock->isDockOpen() == FALSE ) - { - dock->cancelDock( getMachineOwner() ); - return STATE_FAILURE; - } - - // get the docking position - dock->getDockPosition( getMachineOwner(), &m_goalPosition ); - - AIUpdateInterface *ai = getMachineOwner()->getAIUpdateInterface(); - if( ai && dock->isAllowPassthroughType() ) - { - ai->ignoreObstacle( getMachineGoalObject() ); - setAdjustsDestination(false); - } - - // since we are moving inside the dock, disallow interruptions - getMachine()->lock("AIDockMoveToDockState::onEnter"); - - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::onEnter(); -} - -//---------------------------------------------------------------------------------------------- -StateReturnType AIDockMoveToDockState::update() -{ - Object *goalObject = getMachineGoalObject(); - - // if we have nothing to dock with, fail - if (goalObject == nullptr) - return STATE_FAILURE; - - DockUpdateInterface *dock = goalObject->getDockUpdateInterface(); - if( dock->isDockOpen() == FALSE ) - return STATE_FAILURE; - - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::update(); -} - -//---------------------------------------------------------------------------------------------- -void AIDockMoveToDockState::onExit( StateExitType status ) -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - // tell the dock we are at the docking point - if (dock) - { - - // if we were interrupted, let the dock know we're not coming - if (status == EXIT_RESET || dock->isDockOpen() == FALSE ) - dock->cancelDock( getMachineOwner() ); - else - dock->onDockReached( getMachineOwner() ); - - } - - // unlock the machine - getMachine()->unlock(); - - // this behavior is an extension of basic MoveTo - AIInternalMoveToState::onExit( status ); -} - -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -AIDockProcessDockState::AIDockProcessDockState( StateMachine *machine ) : State( machine, "AIDockProcessDockState" ) -{ - m_nextDockActionFrame = 0; -} - -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -void AIDockProcessDockState::setNextDockActionFrame() -{ - // If we have a SupplyTruck Interface, then we will ask for our specific delay time - SupplyTruckAIInterface *supplyTruck = getMachineOwner()->getAI()->getSupplyTruckAIInterface(); - if( supplyTruck ) - { - m_nextDockActionFrame = TheGameLogic->getFrame() + supplyTruck->getActionDelayForDock( getMachineGoalObject() ); - return; - } - - // The default is that it is simply okay to Action right away - m_nextDockActionFrame = TheGameLogic->getFrame(); -} - -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -StateReturnType AIDockProcessDockState::onEnter() -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - // if we have nothing to dock with, fail - if (dock == nullptr) - return STATE_FAILURE; - - setNextDockActionFrame(); - - return STATE_CONTINUE; -} - -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -/** - * We are now docked. Invoke the dock's action() method until it returns false. - */ -StateReturnType AIDockProcessDockState::update() -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - // if we have nothing to dock with, fail - if (dock == nullptr) - return STATE_FAILURE; - - // Some dockers can have a delay built in - if( TheGameLogic->getFrame() < m_nextDockActionFrame ) - return STATE_CONTINUE; - setNextDockActionFrame(); - - Object *drone = findMyDrone(); - - // invoke the dock's action until it tells us it is done or the dock becomes closed - if( dock->isDockOpen() == false || dock->action( getMachineOwner(), drone ) == false ) - return STATE_SUCCESS; - - return STATE_CONTINUE; -} - -//---------------------------------------------------------------------------------------------- -struct DroneInfo -{ - Object *owner; - Object *drone; - Bool found; -}; - -void findDrone( Object *obj, void *droneInfo ) -{ - DroneInfo *dInfo = (DroneInfo*)droneInfo; - - if( !dInfo->found ) - { - if( obj->isKindOf( KINDOF_DRONE ) && obj->getProducerID() == dInfo->owner->getID() ) - { - dInfo->found = TRUE; - dInfo->drone = obj; - } - } -} - -//---------------------------------------------------------------------------------------------- -Object* AIDockProcessDockState::findMyDrone() -{ - //First do the fast cached check. - Object *drone = TheGameLogic->findObjectByID( m_droneID ); - if( drone ) - { - return drone; - } - - //Nope... look for a drone (perhaps we just finished building one after docking?) - Object *self = getMachineOwner(); - Player *player = self->getControllingPlayer(); - DroneInfo dInfo; - dInfo.found = FALSE; - dInfo.drone = nullptr; - dInfo.owner = self; - - //Iterate the objects in search for a drone with a producer ID of me. - if( player ) - { - player->iterateObjects( findDrone, &dInfo ); - } - - //If we found a drone, store it's ID as cached. - if( dInfo.drone ) - { - m_droneID = dInfo.drone->getID(); - } - return dInfo.drone; -} - -//---------------------------------------------------------------------------------------------- -void AIDockProcessDockState::onExit( StateExitType status ) -{ - // unlock the machine - getMachine()->unlock(); -} - -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- - -//---------------------------------------------------------------------------------------------- -/** - * Move to the dock's exit position. - */ -StateReturnType AIDockMoveToExitState::onEnter() -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - // if we have nothing to dock with, fail - if (dock == nullptr) - return STATE_FAILURE; - - // get the exit position - dock->getExitPosition( getMachineOwner(), &m_goalPosition ); - - AIUpdateInterface *ai = getMachineOwner()->getAIUpdateInterface(); - if( ai && dock->isAllowPassthroughType() ) - { - ai->ignoreObstacle( getMachineGoalObject() ); - setAdjustsDestination(false); - } - - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::onEnter(); -} - -//---------------------------------------------------------------------------------------------- -StateReturnType AIDockMoveToExitState::update() -{ - // if we have nothing to dock with, fail - if (getMachineGoalObject() == nullptr) - return STATE_FAILURE; - - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::update(); -} - -//---------------------------------------------------------------------------------------------- -void AIDockMoveToExitState::onExit( StateExitType status ) -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - // tell the dock we have exited - if (dock) - dock->onExitReached( getMachineOwner() ); - - // unlock the machine - getMachine()->unlock(); - - // this behavior is an extension of basic MoveTo - AIInternalMoveToState::onExit( status ); -} - -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------- - -//---------------------------------------------------------------------------------------------- -/** - * Move to the dock's rally position, if he wants me to. - */ -StateReturnType AIDockMoveToRallyState::onEnter() -{ - Object *goalObject = getMachineGoalObject(); - - DockUpdateInterface *dock = nullptr; - if( goalObject ) - dock = goalObject->getDockUpdateInterface(); - - // if we have nothing to dock with, fail - if (dock == nullptr) - return STATE_FAILURE; - - // if they don't have anywhere to send us, then we are good - if( ! dock->isRallyPointAfterDockType() //Chooses not to - || goalObject->getObjectExitInterface() == nullptr //or can't - || goalObject->getObjectExitInterface()->getRallyPoint() == nullptr //or can't right now. - ) - { - return STATE_SUCCESS; // Success in an Enter is like success in an update. We're all fine here - } - - // get the rally point and set as our goal position - m_goalPosition = *goalObject->getObjectExitInterface()->getRallyPoint(); - - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::onEnter(); -} - -//---------------------------------------------------------------------------------------------- -StateReturnType AIDockMoveToRallyState::update() -{ - // This state is fine with the loss of the goal object after the move starts - - // this behavior is an extension of basic MoveTo - return AIInternalMoveToState::update(); -} - -//---------------------------------------------------------------------------------------------- -void AIDockMoveToRallyState::onExit( StateExitType status ) -{ - // This state is fine with the loss of the goal object after the move starts - - // this behavior is an extension of basic MoveTo - AIInternalMoveToState::onExit( status ); -} - - diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/Squad.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/Squad.cpp deleted file mode 100644 index b8141179e17..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/Squad.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: Squad.cpp -/*---------------------------------------------------------------------------*/ -/* EA Pacific */ -/* Confidential Information */ -/* Copyright (C) 2001 - All Rights Reserved */ -/* DO NOT DISTRIBUTE */ -/*---------------------------------------------------------------------------*/ -/* Project: RTS3 */ -/* File name: Squad.cpp */ -/* Created: John K. McDonald, Jr., 4/19/2002 */ -/* Desc: // @todo */ -/* Revision History: */ -/* 4/19/2002 : Initial creation */ -/*---------------------------------------------------------------------------*/ -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameLogic/Squad.h" - -#include "Common/GameState.h" -#include "Common/Team.h" -#include "Common/Xfer.h" - -#include "GameLogic/AI.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" - - -// addObject ////////////////////////////////////////////////////////////////////////////////////// -void Squad::addObject(Object *objectToAdd) -{ - if (objectToAdd) { - m_objectIDs.push_back(objectToAdd->getID()); - } -} - -// addObjectID //////////////////////////////////////////////////////////////////////////////////// -void Squad::addObjectID(ObjectID objectID) { - m_objectIDs.push_back(objectID); -} - -// removeObject /////////////////////////////////////////////////////////////////////////////////// -void Squad::removeObject(Object *objectToRemove) -{ - if (objectToRemove) { - ObjectID objID; - objID = objectToRemove->getID(); - VecObjectIDIt it = std::find(m_objectIDs.begin(), m_objectIDs.end(), objID); - if (it != m_objectIDs.end()) { - m_objectIDs.erase(it); - } - } -} - -// clearSquad ///////////////////////////////////////////////////////////////////////////////////// -void Squad::clearSquad() { - m_objectIDs.clear(); - m_objectsCached.clear(); -} - -// getAllObjects ////////////////////////////////////////////////////////////////////////////////// -const VecObjectPtr& Squad::getAllObjects() // Not a const function cause we clear away dead object here too -{ - // prunes all null objects - m_objectsCached.clear(); - for (VecObjectIDIt it = m_objectIDs.begin(); it != m_objectIDs.end(); ) { - Object *obj = TheGameLogic->findObjectByID(*it); - if (obj) { - m_objectsCached.push_back(obj); - ++it; - } else { - it = m_objectIDs.erase(it); - } - } - - return m_objectsCached; -} - -// getLiveObjects ///////////////////////////////////////////////////////////////////////////////// -const VecObjectPtr& Squad::getLiveObjects() -{ - // first get all the objects. - // cheat, since we are a member function, and just use m_objectsCached - getAllObjects(); - for (VecObjectPtrIt it = m_objectsCached.begin(); it != m_objectsCached.end(); ) { - if (!(*it)->isSelectable()) { - it = m_objectsCached.erase(it); - } else { - ++it; - } - } - - return m_objectsCached; -} - -// getSizeOfGroup ///////////////////////////////////////////////////////////////////////////////// -Int Squad::getSizeOfGroup() const -{ - return m_objectIDs.size(); -} - -// isOnSquad ////////////////////////////////////////////////////////////////////////////////////// -Bool Squad::isOnSquad(const Object *objToTest) const -{ - // @todo need a faster way to do this. Perhaps a more efficient data structure? - ObjectID objID = objToTest->getID(); - for (VecObjectID::const_iterator cit = m_objectIDs.begin(); cit != m_objectIDs.end(); ++cit) { - if (objID == (*cit)) { - return true; - } - } - - return false; -} - -/** - * There should never be a TeamFromSqaud as Teams are entirely a construct to work with the AI. - * Since things can only be on one Team at a time, creating a Team from an arbitrary Squad will - * cause weird, difficult to reproduce bugs. Please don't do it. - */ - -// squadFromTeam ////////////////////////////////////////////////////////////////////////////////// -void Squad::squadFromTeam(const Team* fromTeam, Bool clearSquadFirst) -{ - if (!fromTeam) { - return; - } - - if (clearSquadFirst) { - m_objectIDs.clear(); - } - - for (DLINK_ITERATOR iter = fromTeam->iterate_TeamMemberList(); !iter.done(); iter.advance()) { - Object *obj = iter.cur(); - m_objectIDs.push_back(obj->getID()); - } -} - -// squadFromAIGroup /////////////////////////////////////////////////////////////////////////////// -void Squad::squadFromAIGroup(const AIGroup* fromAIGroup, Bool clearSquadFirst) -{ - if (!fromAIGroup) { - return; - } - - if (clearSquadFirst) { - m_objectIDs.clear(); - } - - m_objectIDs = fromAIGroup->getAllIDs(); -} - -// aiGroupFromSquad /////////////////////////////////////////////////////////////////////////////// -void Squad::aiGroupFromSquad(AIGroup* aiGroupToFill) -{ - if (!aiGroupToFill) { - return; - } - - // cheat, since we are a member function, and just use m_objectsCached - getLiveObjects(); - for (VecObjectPtr::iterator it = m_objectsCached.begin(); it != m_objectsCached.end(); ++it) { - aiGroupToFill->add((*it)); - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void Squad::crc( Xfer *xfer ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void Squad::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // length of object ID list - UnsignedShort objectCount = m_objectIDs.size(); - xfer->xferUnsignedShort( &objectCount ); - - // object id elements - ObjectID objectID; - if( xfer->getXferMode() == XFER_SAVE ) - { - - // save each object id - VecObjectIDIt it; - for( it = m_objectIDs.begin(); it != m_objectIDs.end(); ++it ) - { - - // save object ID - objectID = *it; - xfer->xferObjectID( &objectID ); - - } - - } - else - { - - // the cached objects list should be empty - if( !m_objectsCached.empty() ) - { - - DEBUG_CRASH(( "Squad::xfer - m_objectsCached should be empty, but is not" )); - throw SC_INVALID_DATA; - - } - - // read all items - for( UnsignedShort i = 0; i < objectCount; ++i ) - { - - // read id - xfer->xferObjectID( &objectID ); - - // put on list - m_objectIDs.push_back( objectID ); - - } - - } - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void Squad::loadPostProcess() -{ - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp deleted file mode 100644 index cb669460092..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp +++ /dev/null @@ -1,366 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: BridgeScaffoldBehavior.cpp /////////////////////////////////////////////////////////////// -// Author: Colin Day, September 2002 -// Desc: Bridge scaffold -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" -#include "Common/Xfer.h" -#include "GameClient/InGameUI.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/BridgeScaffoldBehavior.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -BridgeScaffoldBehavior::BridgeScaffoldBehavior( Thing *thing, const ModuleData *moduleData ) - : UpdateModule( thing, moduleData ) -{ - - m_targetMotion = STM_STILL; - m_createPos.zero(); - m_riseToPos.zero(); - m_buildPos.zero(); - m_targetPos.zero(); - m_lateralSpeed = 1.0f; - m_verticalSpeed = 1.0f; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -BridgeScaffoldBehavior::~BridgeScaffoldBehavior() -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** Set all of the target positions that we're care about as a moving scaffold object */ -// ------------------------------------------------------------------------------------------------ -void BridgeScaffoldBehavior::setPositions( const Coord3D *createPos, - const Coord3D *riseToPos, - const Coord3D *buildPos ) -{ - - m_createPos = *createPos; - m_riseToPos = *riseToPos; - m_buildPos = *buildPos; - -} - -// ------------------------------------------------------------------------------------------------ -/** Set us moving to the right target position for the requested motion type */ -// ------------------------------------------------------------------------------------------------ -void BridgeScaffoldBehavior::setMotion( ScaffoldTargetMotion targetMotion ) -{ - - // save the target motion type - m_targetMotion = targetMotion; - - // given the target motion, pick a destination target - switch( m_targetMotion ) - { - - // -------------------------------------------------------------------------------------------- - case STM_RISE: - case STM_TEAR_DOWN_ACROSS: - m_targetPos = m_riseToPos; - break; - - // -------------------------------------------------------------------------------------------- - case STM_BUILD_ACROSS: - m_targetPos = m_buildPos; - break; - - // -------------------------------------------------------------------------------------------- - case STM_SINK: - m_targetPos = m_createPos; - break; - - } - -} - -// ------------------------------------------------------------------------------------------------ -/** Whatever our current state of motion is, reverse it */ -// ------------------------------------------------------------------------------------------------ -void BridgeScaffoldBehavior::reverseMotion() -{ - - switch( m_targetMotion ) - { - - case STM_STILL: - setMotion( STM_TEAR_DOWN_ACROSS ); - break; - - case STM_RISE: - setMotion( STM_SINK ); - break; - - case STM_BUILD_ACROSS: - setMotion( STM_TEAR_DOWN_ACROSS ); - break; - - case STM_TEAR_DOWN_ACROSS: - setMotion( STM_BUILD_ACROSS ); - break; - - case STM_SINK: - setMotion( STM_RISE ); - break; - - } - -} - -// ------------------------------------------------------------------------------------------------ -/** The update method */ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime BridgeScaffoldBehavior::update() -{ - - // do nothing if we're not in motion - if( m_targetMotion == STM_STILL ) - return UPDATE_SLEEP_NONE; - - // get our info - Object *us = getObject(); - const Coord3D *ourPos = us->getPosition(); - - // compute direction vector from our position to the target position - Coord3D dirV; - dirV.x = m_targetPos.x - ourPos->x; - dirV.y = m_targetPos.y - ourPos->y; - dirV.z = m_targetPos.z - ourPos->z; - - // use normalized direction vector "v" to do the pulling movement - Coord3D v = dirV; - v.normalize(); - - // depending on our motion type, we move at different speeds - Real topSpeed = 1.0f; - Coord3D *start, *end; - switch( m_targetMotion ) - { - - case STM_RISE: - topSpeed = m_verticalSpeed; - start = &m_createPos; - end = &m_riseToPos; - break; - - case STM_SINK: - topSpeed = m_verticalSpeed; - start = &m_riseToPos; - end = &m_createPos; - break; - - case STM_BUILD_ACROSS: - topSpeed = m_lateralSpeed; - start = &m_riseToPos; - end = &m_buildPos; - break; - - case STM_TEAR_DOWN_ACROSS: - topSpeed = m_lateralSpeed; - start = &m_buildPos; - end = &m_riseToPos; - break; - - default: - DEBUG_CRASH(("Unhandled case in BridgeScaffoldBehavior::update()")); - return UPDATE_SLEEP_NONE; - - } - - // adjust speed so it's slower at the end of motion - Coord3D speedVector; - speedVector.x = end->x - start->x; - speedVector.y = end->y - start->y; - speedVector.z = end->z - start->z; - Real totalDistance = speedVector.length() * 0.25f; - speedVector.x = end->x - ourPos->x; - speedVector.y = end->y - ourPos->y; - speedVector.z = end->z - ourPos->z; - Real ourDistance = speedVector.length(); - Real speed = (ourDistance / totalDistance) * topSpeed; - Real minSpeed = topSpeed * 0.08f; - if( speed < minSpeed ) - speed = minSpeed; - if( speed > topSpeed ) - speed = topSpeed; - - // - // make sure that speed can't get so incredibly small that we never finish our - // movement no matter what the speed and distance are - // - if( speed < 0.001f ) - speed = 0.001f; - - // compute the new position given the speed - Coord3D newPos; - newPos.x = v.x * speed + ourPos->x; - newPos.y = v.y * speed + ourPos->y; - newPos.z = v.z * speed + ourPos->z; - - // - // will this new position push us beyond our target destination, we will take the vector - // from the new position to the destination and the vector from our current present position - // tot he destination and dot them together ... if the result is < 0 then we have will - // overshoot the distance if we use the new position - // - Coord3D tooFarVector; - tooFarVector.x = m_targetPos.x - newPos.x; - tooFarVector.y = m_targetPos.y - newPos.y; - tooFarVector.z = m_targetPos.z - newPos.z; - if( tooFarVector.x * dirV.x + tooFarVector.y * dirV.y + tooFarVector.z * dirV.z <= 0.0f ) - { - - // use the destination position - newPos = m_targetPos; - - // - // we have reached our target position, switch motion to the next position in - // the chain (which may be stay still and don't move anymore) - // - switch( m_targetMotion ) - { - - case STM_RISE: setMotion( STM_BUILD_ACROSS ); break; - case STM_BUILD_ACROSS: setMotion( STM_STILL ); break; - case STM_TEAR_DOWN_ACROSS: setMotion( STM_SINK ); break; - - case STM_SINK: - { - - // we are done with a sinking motion, destroy the scaffold object as our job is done - TheGameLogic->destroyObject( us ); - break; - - } - - } - - } - - // set the new position - us->setPosition( &newPos ); - - // do not sleep - return UPDATE_SLEEP_NONE; - -} - -// ------------------------------------------------------------------------------------------------ -/** STATIC MEMBER: - * Helper function to retrieve a bridge scaffold interface from an object if one is present */ -// ------------------------------------------------------------------------------------------------ -BridgeScaffoldBehaviorInterface *BridgeScaffoldBehavior::getBridgeScaffoldBehaviorInterfaceFromObject( Object *obj ) -{ - - // sanity - if( obj == nullptr ) - return nullptr; - - // get the bridge tower behavior interface - BridgeScaffoldBehaviorInterface *bridgeScaffoldInterface = nullptr; - BehaviorModule **bmi; - for( bmi = obj->getBehaviorModules(); *bmi; ++bmi ) - { - - bridgeScaffoldInterface = (*bmi)->getBridgeScaffoldBehaviorInterface(); - if( bridgeScaffoldInterface ) - return bridgeScaffoldInterface; - - } - - // interface not found - return nullptr; - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void BridgeScaffoldBehavior::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void BridgeScaffoldBehavior::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // target motion - xfer->xferUser( &m_targetMotion, sizeof( ScaffoldTargetMotion ) ); - - // create pos - xfer->xferCoord3D( &m_createPos ); - - // rise to pos - xfer->xferCoord3D( &m_riseToPos ); - - // build pos - xfer->xferCoord3D( &m_buildPos ); - - // lateral speed - xfer->xferReal( &m_lateralSpeed ); - - // vertical speed - xfer->xferReal( &m_verticalSpeed ); - - // current target pos - xfer->xferCoord3D( &m_targetPos ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void BridgeScaffoldBehavior::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp deleted file mode 100644 index f82fac2391b..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp +++ /dev/null @@ -1,335 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: BridgeTowerBehavior.cpp ////////////////////////////////////////////////////////////////// -// Author: Colin Day, July 2002 -// Desc: Behavior module for the towers attached to bridges that can be targeted -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameClient/InGameUI.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/BodyModule.h" -#include "GameLogic/Module/BridgeBehavior.h" -#include "GameLogic/Module/BridgeTowerBehavior.h" -#include "GameLogic/TerrainLogic.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -BridgeTowerBehavior::BridgeTowerBehavior( Thing *thing, const ModuleData *moduleData ) - : BehaviorModule( thing, moduleData ) -{ - - m_bridgeID = INVALID_ID; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -BridgeTowerBehavior::~BridgeTowerBehavior() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void BridgeTowerBehavior::setBridge( Object *bridge ) -{ - - if( bridge == nullptr ) - m_bridgeID = INVALID_ID; - else - m_bridgeID = bridge->getID(); - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -ObjectID BridgeTowerBehavior::getBridgeID() -{ - - return m_bridgeID; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void BridgeTowerBehavior::setTowerType( BridgeTowerType type ) -{ - - m_type = type; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void BridgeTowerBehavior::onDamage( DamageInfo *damageInfo ) -{ - Object *bridge = TheGameLogic->findObjectByID( getBridgeID() ); - - // sanity - if( bridge == nullptr ) - return; - - // - // get our body info so we now how much damage percent is being done to us ... we need this - // so that we can propagate the same damage percentage amount the towers and the bridge - // - BodyModuleInterface *body = getObject()->getBodyModule(); - Real damagePercentage = damageInfo->in.m_amount / body->getMaxHealth(); - - // get the bridge behavior module for our bridge - BehaviorModule **bmi; - BridgeBehaviorInterface *bridgeInterface = nullptr; - for( bmi = bridge->getBehaviorModules(); *bmi; ++bmi ) - { - - bridgeInterface = (*bmi)->getBridgeBehaviorInterface(); - if( bridgeInterface ) - break; - - } - DEBUG_ASSERTCRASH( bridgeInterface != nullptr, ("BridgeTowerBehavior::onDamage - no 'BridgeBehaviorInterface' found") ); - if( bridgeInterface ) - { - - // - // damage each of the other towers if the source of this damage isn't from the bridge - // or other towers - // - Object *source = TheGameLogic->findObjectByID( damageInfo->in.m_sourceID ); - if( source == nullptr || - (source->isKindOf( KINDOF_BRIDGE ) == FALSE && - source->isKindOf( KINDOF_BRIDGE_TOWER ) == FALSE) ) - { - - for( Int i = 0; i < BRIDGE_MAX_TOWERS; ++i ) - { - Object *tower; - - tower = TheGameLogic->findObjectByID( bridgeInterface->getTowerID( (BridgeTowerType)i ) ); - if( tower && tower != getObject() ) - { - BodyModuleInterface *towerBody = tower->getBodyModule(); - DamageInfo towerDamage; - - towerDamage.in.m_amount = damagePercentage * towerBody->getMaxHealth(); - towerDamage.in.m_sourceID = getObject()->getID(); // we're now the source - towerDamage.in.m_damageType = damageInfo->in.m_damageType; - towerDamage.in.m_deathType = damageInfo->in.m_deathType; - tower->attemptDamage( &towerDamage ); - - } - - } - - // - // damage bridge object, but make sure it's done through the bridge interface - // so that it doesn't automatically propagate that damage to the towers - // - BodyModuleInterface *bridgeBody = bridge->getBodyModule(); - DamageInfo bridgeDamage; - - bridgeDamage.in.m_amount = damagePercentage * bridgeBody->getMaxHealth(); - bridgeDamage.in.m_sourceID = getObject()->getID(); // we're now the source - bridgeDamage.in.m_damageType = damageInfo->in.m_damageType; - bridgeDamage.in.m_deathType = damageInfo->in.m_deathType; - bridge->attemptDamage( &bridgeDamage ); - - } - - } - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void BridgeTowerBehavior::onHealing( DamageInfo *damageInfo ) -{ - Object *bridge = TheGameLogic->findObjectByID( getBridgeID() ); - - // sanity - if( bridge == nullptr ) - return; - - // - // get our body info so we now how much healing percent is being done to us ... we need this - // so that we can propagate the same healing percentage amount the towers and the bridge - // - BodyModuleInterface *body = getObject()->getBodyModule(); - Real healingPercentage = damageInfo->in.m_amount / body->getMaxHealth(); - - // get the bridge behavior module for our bridge - BehaviorModule **bmi; - BridgeBehaviorInterface *bridgeInterface = nullptr; - for( bmi = bridge->getBehaviorModules(); *bmi; ++bmi ) - { - - bridgeInterface = (*bmi)->getBridgeBehaviorInterface(); - if( bridgeInterface ) - break; - - } - DEBUG_ASSERTCRASH( bridgeInterface != nullptr, ("BridgeTowerBehavior::onHealing - no 'BridgeBehaviorInterface' found") ); - if( bridgeInterface ) - { - - // - // heal each of the other towers if the source of this healing isn't from the bridge - // or other towers - // - Object *source = TheGameLogic->findObjectByID( damageInfo->in.m_sourceID ); - if( source == nullptr || - (source->isKindOf( KINDOF_BRIDGE ) == FALSE && - source->isKindOf( KINDOF_BRIDGE_TOWER ) == FALSE) ) - { - - for( Int i = 0; i < BRIDGE_MAX_TOWERS; ++i ) - { - Object *tower; - - tower = TheGameLogic->findObjectByID( bridgeInterface->getTowerID( (BridgeTowerType)i ) ); - if( tower && tower != getObject() ) - { - BodyModuleInterface *towerBody = tower->getBodyModule(); - tower->attemptHealing(healingPercentage * towerBody->getMaxHealth(), getObject()); - - } - - } - - // - // heal bridge object, but make sure it's done through the bridge interface - // so that it doesn't automatically propagate that healing to the towers. - // - BodyModuleInterface *bridgeBody = bridge->getBodyModule(); - bridge->attemptHealing(healingPercentage * bridgeBody->getMaxHealth(), getObject()); - - } - - } - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void BridgeTowerBehavior::onBodyDamageStateChange( const DamageInfo* damageInfo, - BodyDamageType oldState, - BodyDamageType newState ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void BridgeTowerBehavior::onDie( const DamageInfo *damageInfo ) -{ - - // kill the bridge object, this will kill all the towers - Object *bridge = TheGameLogic->findObjectByID( getBridgeID() ); - if( bridge ) - bridge->kill(); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -/** Given an object, return a bridge tower interface if that object has one */ -// ------------------------------------------------------------------------------------------------ -BridgeTowerBehaviorInterface *BridgeTowerBehavior::getBridgeTowerBehaviorInterfaceFromObject( Object *obj ) -{ - - // sanity - if( obj == nullptr || obj->isKindOf( KINDOF_BRIDGE_TOWER ) == FALSE ) - return nullptr; - - BehaviorModule **bmi; - BridgeTowerBehaviorInterface *bridgeTowerInterface = nullptr; - for( bmi = obj->getBehaviorModules(); *bmi; ++bmi ) - { - - bridgeTowerInterface = (*bmi)->getBridgeTowerBehaviorInterface(); - if( bridgeTowerInterface ) - return bridgeTowerInterface; - - } - - // interface not found - return nullptr; - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void BridgeTowerBehavior::crc( Xfer *xfer ) -{ - - // extend base class - BehaviorModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void BridgeTowerBehavior::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - BehaviorModule::xfer( xfer ); - - // xfer bridge object ID - xfer->xferObjectID( &m_bridgeID ); - - // xfer tower type - xfer->xferUser( &m_type, sizeof( BridgeTowerType ) ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void BridgeTowerBehavior::loadPostProcess() -{ - - // extend base class - BehaviorModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp deleted file mode 100644 index aa3126b588e..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: InstantDeathBehavior.cpp /////////////////////////////////////////////////////////////////////// -// Author: -// Desc: -/////////////////////////////////////////////////////////////////////////////////////////////////// - - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#define DEFINE_SLOWDEATHPHASE_NAMES - -#include "Common/Thing.h" -#include "Common/ThingTemplate.h" -#include "Common/INI.h" -#include "Common/RandomValue.h" -#include "Common/GameLOD.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameClient/FXList.h" -#include "GameClient/InGameUI.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Module/BodyModule.h" -#include "GameLogic/Module/InstantDeathBehavior.h" -#include "GameLogic/Module/AIUpdate.h" -#include "GameLogic/Object.h" -#include "GameLogic/ObjectCreationList.h" -#include "GameLogic/Weapon.h" - -//------------------------------------------------------------------------------------------------- -InstantDeathBehaviorModuleData::InstantDeathBehaviorModuleData() -{ - // redundant. - //m_fx.clear(); - //m_ocls.clear(); - //m_weapons.clear(); -} - -//------------------------------------------------------------------------------------------------- -static void parseFX( INI* ini, void *instance, void * /*store*/, const void* /*userData*/ ) -{ - InstantDeathBehaviorModuleData* self = (InstantDeathBehaviorModuleData*)instance; - for (const char* token = ini->getNextToken(); token; token = ini->getNextTokenOrNull()) - { - const FXList *fxl = TheFXListStore->findFXList((token)); // could be null! this is OK! - self->m_fx.push_back(fxl); - } -} - -//------------------------------------------------------------------------------------------------- -static void parseOCL( INI* ini, void *instance, void * /*store*/, const void* /*userData*/ ) -{ - InstantDeathBehaviorModuleData* self = (InstantDeathBehaviorModuleData*)instance; - for (const char* token = ini->getNextToken(); token; token = ini->getNextTokenOrNull()) - { - const ObjectCreationList *ocl = TheObjectCreationListStore->findObjectCreationList(token); // could be null! this is OK! - self->m_ocls.push_back(ocl); - } -} - -//------------------------------------------------------------------------------------------------- -static void parseWeapon( INI* ini, void *instance, void * /*store*/, const void* /*userData*/ ) -{ - InstantDeathBehaviorModuleData* self = (InstantDeathBehaviorModuleData*)instance; - for (const char* token = ini->getNextToken(); token; token = ini->getNextTokenOrNull()) - { - const WeaponTemplate *wt = TheWeaponStore->findWeaponTemplate(token); // could be null! this is OK! - self->m_weapons.push_back(wt); - } -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void InstantDeathBehaviorModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - DieModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "FX", parseFX, nullptr, 0 }, - { "OCL", parseOCL, nullptr, 0 }, - { "Weapon", parseWeapon, nullptr, 0 }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -InstantDeathBehavior::InstantDeathBehavior( Thing *thing, const ModuleData* moduleData ) : DieModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -InstantDeathBehavior::~InstantDeathBehavior() -{ -} - -//------------------------------------------------------------------------------------------------- -void InstantDeathBehavior::onDie( const DamageInfo *damageInfo ) -{ - if (!isDieApplicable(damageInfo)) - return; - - AIUpdateInterface* ai = getObject()->getAIUpdateInterface(); - if (ai) - { - // has another AI already handled us. (hopefully another InstantDeathBehavior) - if (ai->isAiInDeadState()) - return; - ai->markAsDead(); - } - - const InstantDeathBehaviorModuleData* d = getInstantDeathBehaviorModuleData(); - - size_t idx, listSize; - - listSize = d->m_fx.size(); - if (listSize > 0) - { - idx = (size_t)GameLogicRandomValue(0, listSize-1); - const FXListVec& v = d->m_fx; - DEBUG_ASSERTCRASH(idx>=0&&idxm_ocls.size(); - if (listSize > 0) - { - idx = (size_t)GameLogicRandomValue(0, listSize-1); - const OCLVec& v = d->m_ocls; - DEBUG_ASSERTCRASH(idx>=0&&idxm_weapons.size(); - if (listSize > 0) - { - idx = (size_t)GameLogicRandomValue(0, listSize-1); - const WeaponTemplateVec& v = d->m_weapons; - DEBUG_ASSERTCRASH(idx>=0&&idxcreateAndFireTempWeapon(wt, getObject(), getObject()->getPosition()); - } - } - - TheGameLogic->destroyObject(getObject()); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void InstantDeathBehavior::crc( Xfer *xfer ) -{ - - // extend base class - DieModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void InstantDeathBehavior::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DieModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void InstantDeathBehavior::loadPostProcess() -{ - - // extend base class - DieModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp deleted file mode 100644 index 171fb3ea079..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp +++ /dev/null @@ -1,331 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: OverchargeBehavior.cpp /////////////////////////////////////////////////////////////////// -// Author: Colin Day, June 2002 -// Desc: Objects with this behavior module will get the ability to produce more power -// for a short amount of time, during this "overcharge" state object health is -// slowly reduced -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/Player.h" -#include "Common/PlayerList.h" -#include "Common/Radar.h" -#include "Common/Xfer.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/BodyModule.h" -#include "GameLogic/Module/OverchargeBehavior.h" -#include "GameLogic/Module/PowerPlantUpdate.h" -#include "GameClient/InGameUI.h" - - - -//------------------------------------------------------------------------------------------------- -// ------------------------------------------------------------------------------------------------ -OverchargeBehaviorModuleData::OverchargeBehaviorModuleData() -{ - - m_healthPercentToDrainPerSecond = 0.0f; - m_notAllowedWhenHealthBelowPercent = 0.0f; - -} - -//------------------------------------------------------------------------------------------------- -// ------------------------------------------------------------------------------------------------ -/*static*/ void OverchargeBehaviorModuleData::buildFieldParse( MultiIniFieldParse &p ) -{ - - UpdateModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "HealthPercentToDrainPerSecond", INI::parsePercentToReal, nullptr, offsetof( OverchargeBehaviorModuleData, m_healthPercentToDrainPerSecond ) }, - { "NotAllowedWhenHealthBelowPercent", INI::parsePercentToReal, nullptr, offsetof( OverchargeBehaviorModuleData, m_notAllowedWhenHealthBelowPercent ) }, - { nullptr, nullptr, nullptr, 0 } - }; - - p.add( dataFieldParse ); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -OverchargeBehavior::OverchargeBehavior( Thing *thing, const ModuleData* moduleData ) - : UpdateModule( thing, moduleData ) -{ - - m_overchargeActive = FALSE; - - // start off sleeping forever until we become active - setWakeFrame( getObject(), UPDATE_SLEEP_FOREVER ); - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -OverchargeBehavior::~OverchargeBehavior() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpdateSleepTime OverchargeBehavior::update() -{ - - // if the overcharge is active we need to take away some life - if( m_overchargeActive ) - { - Object *us = getObject(); - - // get mod data - const OverchargeBehaviorModuleData *modData = getOverchargeBehaviorModuleData(); - - // do some damage - BodyModuleInterface *body = us->getBodyModule(); - DamageInfo damageInfo; - damageInfo.in.m_amount = (body->getMaxHealth() * modData->m_healthPercentToDrainPerSecond) / LOGICFRAMES_PER_SECOND; - damageInfo.in.m_sourceID = us->getID(); - damageInfo.in.m_damageType = DAMAGE_PENALTY; - damageInfo.in.m_deathType = DEATH_NORMAL; - us->attemptDamage( &damageInfo ); - - // see if our health is below the allowable threshold - if( body->getHealth() < body->getMaxHealth() * modData->m_notAllowedWhenHealthBelowPercent ) - { - - // turn off the overcharge - enable( FALSE ); - - // do some UI info for the local user if this is theirs - if( us->isLocallyControlled() ) - { - - // print msg - TheInGameUI->message( "GUI:OverchargeExhausted" ); - - // do radar event - TheRadar->createEvent( us->getPosition(), RADAR_EVENT_INFORMATION ); - - } - - // do nothing else - return UPDATE_SLEEP_NONE; - - } - - } - - return UPDATE_SLEEP_NONE; - -} - -// ------------------------------------------------------------------------------------------------ -//------------------------------------------------------------------------------------------------- -void OverchargeBehavior::onDamage( DamageInfo *damageInfo ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** Flip the state of our 'overcharge-ness' */ -// ------------------------------------------------------------------------------------------------ -void OverchargeBehavior::toggle() -{ - - // just toggle using enable() - enable( !m_overchargeActive ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Enable or disable an overcharge */ -// ------------------------------------------------------------------------------------------------ -void OverchargeBehavior::enable( Bool enable ) -{ - Object *us = getObject(); - - if( enable == FALSE ) - { - - // if we're turned on, turn off - if( m_overchargeActive == TRUE ) - { - - // make sure to NOT extend rods for purpose of maintaining proper model condition - PowerPlantUpdateInterface *ppui; - for( BehaviorModule **umi = getObject()->getBehaviorModules(); *umi; ++umi) - { - ppui = (*umi)->getPowerPlantUpdateInterface(); - if( ppui ) - ppui->extendRods(FALSE); - } - - Player *player = us->getControllingPlayer(); - if ( player ) - player->removePowerBonus(us); - - // we are no longer active - m_overchargeActive = FALSE; - - // sleep forever - setWakeFrame( us, UPDATE_SLEEP_FOREVER ); - - } - - } - else - { - - // if we're turned off, turn on - if( m_overchargeActive == FALSE ) - { - - // make sure to extend rods for purpose of maintaining proper model condition - PowerPlantUpdateInterface *ppui; - for( BehaviorModule **umi = getObject()->getBehaviorModules(); *umi; ++umi) - { - ppui = (*umi)->getPowerPlantUpdateInterface(); - if( ppui ) - ppui->extendRods(TRUE); - } - - // add the power bonus - Player *player = us->getControllingPlayer(); - if ( player ) - player->addPowerBonus(us); - - // we are now active - m_overchargeActive = TRUE; - - // need to update every frame now - setWakeFrame( us, UPDATE_SLEEP_NONE ); - - } - - } - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void OverchargeBehavior::onDelete() -{ - - // if we haven't been upgraded there is nothing to clean up - if( m_overchargeActive == FALSE ) - return; - - // remove the power bonus from the player - Player *player = getObject()->getControllingPlayer(); - if( player ) - player->removePowerBonus( getObject() ); - - m_overchargeActive = FALSE; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void OverchargeBehavior::onCapture( Player *oldOwner, Player *newOwner ) -{ - - // do nothing if we haven't upgraded yet - if( m_overchargeActive == FALSE ) - return; - - if (getObject()->isDisabled()) - return; - - // remove power bonus from old owner - if( oldOwner ) - oldOwner->removePowerBonus( getObject() ); - - // add power bonus to the new owner - if( newOwner ) - newOwner->addPowerBonus( getObject() ); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void OverchargeBehavior::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void OverchargeBehavior::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // overcharge active - xfer->xferBool( &m_overchargeActive ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void OverchargeBehavior::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - - // Our effect is a fire and forget effect, not an upgrade state that is itself saved, so need to re-fire. - if (m_overchargeActive) - { - Object* obj = getObject(); - Player* player = obj->getControllingPlayer(); - - if (player && !obj->isDisabled()) - { - player->addPowerBonus(obj); - } - } - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp deleted file mode 100644 index de4d9814abd..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: POWTruckBehavior.cpp ///////////////////////////////////////////////////////////////////// -// Author: Colin Day -// Desc: POW Truck -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameClient/InGameUI.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/AIUpdate.h" -#include "GameLogic/Module/POWTruckAIUpdate.h" -#include "GameLogic/Module/POWTruckBehavior.h" - -#ifdef ALLOW_SURRENDER - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -POWTruckBehaviorModuleData::POWTruckBehaviorModuleData() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -/*static*/ void POWTruckBehaviorModuleData::buildFieldParse( MultiIniFieldParse &p ) -{ - OpenContainModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - - { 0, 0, 0, 0 } - - }; - - p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -POWTruckBehavior::POWTruckBehavior( Thing *thing, const ModuleData *moduleData ) - : OpenContain( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -POWTruckBehavior::~POWTruckBehavior() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void POWTruckBehavior::onCollide( Object *other, const Coord3D *loc, const Coord3D *normal ) -{ - Object *us = getObject(); - - // sanity - if( other == nullptr ) - return; - - // if other isn't slated to be picked up by us, ignore - AIUpdateInterface *otherAi = other->getAIUpdateInterface(); - if( otherAi == nullptr || otherAi->isSurrendered() == FALSE ) - return; - - // get our AI info - AIUpdateInterface *ourAI = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ourAI, ("POWTruckBehavior::onCollide - '%s' has no AI", - us->getTemplate()->getName().str()) ); - POWTruckAIUpdateInterface *powTruckAI = ourAI->getPOWTruckAIUpdateInterface(); - DEBUG_ASSERTCRASH( powTruckAI, ("POWTruckBehavior::onCollide - '%s' has no POWTruckAI", - us->getTemplate()->getName().str()) ); - - // pick up the prisoner - powTruckAI->loadPrisoner( other ); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void POWTruckBehavior::crc( Xfer *xfer ) -{ - - // extend base class - OpenContain::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void POWTruckBehavior::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - OpenContain::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void POWTruckBehavior::loadPostProcess() -{ - - // extend base class - OpenContain::loadPostProcess(); - -} - -#endif diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp deleted file mode 100644 index b6658dde116..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp +++ /dev/null @@ -1,282 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PropagandaCenterBehavior.cpp ///////////////////////////////////////////////////////////// -// Author: Colin Day, August 2002 -// Desc: Propaganda Center Behavior -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/Player.h" -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameClient/InGameUI.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/AIUpdate.h" -#include "GameLogic/Module/PropagandaCenterBehavior.h" - -#ifdef ALLOW_SURRENDER - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -PropagandaCenterBehaviorModuleData::PropagandaCenterBehaviorModuleData() -{ - - m_brainwashDuration = 0; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -/*static*/ void PropagandaCenterBehaviorModuleData::buildFieldParse( MultiIniFieldParse &p ) -{ - PrisonBehaviorModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - - { "BrainwashDuration", INI::parseDurationUnsignedInt, nullptr, offsetof( PropagandaCenterBehaviorModuleData, m_brainwashDuration ) }, - { 0, 0, 0, 0 } - - }; - - p.add( dataFieldParse ); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -PropagandaCenterBehavior::PropagandaCenterBehavior( Thing *thing, const ModuleData *moduleData ) - : PrisonBehavior( thing, moduleData ) -{ - - m_brainwashingSubjectID = INVALID_ID; - m_brainwashingSubjectStartFrame = 0; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -PropagandaCenterBehavior::~PropagandaCenterBehavior() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void PropagandaCenterBehavior::onDelete() -{ - - // extend functionality - PrisonBehavior::onDelete(); - - // - // go through our list of brainwashed objects, and if they are still under our - // control, return them to their original owners - // - for( BrainwashedIDListContIterator it = m_brainwashedList.begin(); - it != m_brainwashedList.end(); - ++it ) - { - Object *obj; - - // get this object - obj = TheGameLogic->findObjectByID( *it ); - if( obj ) - { - - // return this object under the control of the original owner - obj->restoreOriginalTeam(); - - } - - } - - // clear the list - m_brainwashedList.clear(); - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime PropagandaCenterBehavior::update() -{ - Object *us = getObject(); - const PropagandaCenterBehaviorModuleData *modData = getPropagandaCenterBehaviorModuleData(); - - // extend functionality - PrisonBehavior::update(); - - // if we have a prisoner inside, continue the brainwashing on them (one at a time) - if( m_brainwashingSubjectID != INVALID_ID ) - { - Object *brainwashingSubject = TheGameLogic->findObjectByID( m_brainwashingSubjectID ); - - if( brainwashingSubject ) - { - - // if we've been in here long enough, we come out brainwashed - if( TheGameLogic->getFrame() - m_brainwashingSubjectStartFrame >= modData->m_brainwashDuration ) - { - - // only can exit if the prison allows us to - ExitDoorType exitDoor = reserveDoorForExit(brainwashingSubject->getTemplate(), brainwashingSubject); - if(exitDoor != DOOR_NONE_AVAILABLE) - { - - // place this object under the control of the player - Player *player = us->getControllingPlayer(); - DEBUG_ASSERTCRASH( player, ("Brainwashing: No controlling player for '%s'", us->getTemplate()->getName().str()) ); - if( player ) - brainwashingSubject->setTemporaryTeam( player->getDefaultTeam() ); - - // remove any surrender status from this object - AIUpdateInterface *ai = brainwashingSubject->getAIUpdateInterface(); - if( ai ) - ai->setSurrendered( nullptr, FALSE ); - - // add this object to our brainwashed list if we're not already in it - for( BrainwashedIDListIterator it = m_brainwashedList.begin(); - it != m_brainwashedList.end(); ++it ) - if( *it == brainwashingSubject->getID() ) - break; // exit for - - if( it == m_brainwashedList.end() ) - m_brainwashedList.push_front( brainwashingSubject->getID() ); - - // exit the prison - exitObjectViaDoor( brainwashingSubject, exitDoor ); - - } - - } - - } - - } - - // if we have no brainwashing subject, hook one up if we have people inside us - if( m_brainwashingSubjectID == INVALID_ID ) - { - - // find the first object in our containment list - if( getContainList().begin() != getContainList().end() ) - { - Object *obj = getContainList().front(); - - if( obj ) - { - - // assign brainwashing subject on this frame - m_brainwashingSubjectID = obj->getID(); - m_brainwashingSubjectStartFrame = TheGameLogic->getFrame(); - - } - - } - - } - - return UPDATE_SLEEP_NONE; -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void PropagandaCenterBehavior::onRemoving( Object *obj ) -{ - - // if we're removing the brainwashing subject, nullptr the pointer - if( m_brainwashingSubjectID == obj->getID() ) - { - - m_brainwashingSubjectID = INVALID_ID; - m_brainwashingSubjectStartFrame = 0; - - } - - // extend functionality - PrisonBehavior::onRemoving( obj ); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void PropagandaCenterBehavior::crc( Xfer *xfer ) -{ - - // extend base class - PrisonBehavior::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void PropagandaCenterBehavior::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - PrisonBehavior::xfer( xfer ); - - // brainwashing subject - xfer->xferObjectID( &m_brainwashingSubjectID ); - - // brainwashing subject start frame - xfer->xferUnsignedInt( &m_brainwashingSubjectStartFrame ); - - // brainwashed list size and data - xfer->xferSTLObjectIDList( &m_brainwashedList ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void PropagandaCenterBehavior::loadPostProcess() -{ - - // extend base class - PrisonBehavior::loadPostProcess(); - -} - -#endif diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp deleted file mode 100644 index d91b9858f4e..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SupplyWarehouseCripplingBehavior.cpp ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, Septemmber 2002 -// Desc: Behavior that Disables the building on ReallyDamaged edge state, and manages an Update timer to heal -/////////////////////////////////////////////////////////////////////////////////////////////////// - - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/Xfer.h" -#include "GameLogic/Module/SupplyWarehouseCripplingBehavior.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/BodyModule.h" - -//------------------------------------------------------------------------------------------------- -SupplyWarehouseCripplingBehaviorModuleData::SupplyWarehouseCripplingBehaviorModuleData() -{ - m_selfHealSupression = 0; ///< Time since last damage until I can start to heal - m_selfHealDelay = 0; ///< Once I am okay to heal, how often to do so - m_selfHealAmount = 0; ///< And how much -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void SupplyWarehouseCripplingBehaviorModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - - static const FieldParse dataFieldParse[] = - { - { "SelfHealSupression", INI::parseDurationUnsignedInt, nullptr, offsetof(SupplyWarehouseCripplingBehaviorModuleData, m_selfHealSupression) }, - { "SelfHealDelay", INI::parseDurationUnsignedInt, nullptr, offsetof(SupplyWarehouseCripplingBehaviorModuleData, m_selfHealDelay) }, - { "SelfHealAmount", INI::parseReal, nullptr, offsetof(SupplyWarehouseCripplingBehaviorModuleData, m_selfHealAmount) }, - { nullptr, nullptr, nullptr, 0 } - }; - - UpdateModuleData::buildFieldParse(p); - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SupplyWarehouseCripplingBehavior::SupplyWarehouseCripplingBehavior( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - m_healingSupressedUntilFrame = 0; - m_nextHealingFrame = 0; - setWakeFrame(getObject(), UPDATE_SLEEP_FOREVER); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SupplyWarehouseCripplingBehavior::~SupplyWarehouseCripplingBehavior() -{ -} - -//------------------------------------------------------------------------------------------------- -/** Damage has been dealt, this is an opportunity to react to that damage */ -//------------------------------------------------------------------------------------------------- -void SupplyWarehouseCripplingBehavior::onDamage( DamageInfo *damageInfo ) -{ - UnsignedInt now = TheGameLogic->getFrame(); - resetSelfHealSupression(); - setWakeFrame(getObject(), UPDATE_SLEEP(m_healingSupressedUntilFrame - now));// we got hit, time to get up for work after a quick snooze -} - -//------------------------------------------------------------------------------------------------- -void SupplyWarehouseCripplingBehavior::onBodyDamageStateChange(const DamageInfo* damageInfo, BodyDamageType oldState, BodyDamageType newState) -{ - if( newState == BODY_REALLYDAMAGED ) - startCrippledEffects(); - else if( oldState == BODY_REALLYDAMAGED ) - stopCrippledEffects(); -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime SupplyWarehouseCripplingBehavior::update() -{ - // Suppression is handled by sleeping the module, so if I am here, I know it is time to heal. - const SupplyWarehouseCripplingBehaviorModuleData* md = getSupplyWarehouseCripplingBehaviorModuleData(); - UnsignedInt now = TheGameLogic->getFrame(); - m_nextHealingFrame = now + md->m_selfHealDelay; - - getObject()->attemptHealing(md->m_selfHealAmount, nullptr); - - if( getObject()->getBodyModule()->getHealth() == getObject()->getBodyModule()->getMaxHealth() ) - return UPDATE_SLEEP_FOREVER;// this can't be in onHealing, as the healing comes from here - // in the update, and sleep settings in onHealing would be overridden by my return value. - - // Delay between heals is also handled by sleeping the module. How cool is that? - return UPDATE_SLEEP(m_nextHealingFrame - now); -} - -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseCripplingBehavior::resetSelfHealSupression() -{ - const SupplyWarehouseCripplingBehaviorModuleData* md = getSupplyWarehouseCripplingBehaviorModuleData(); - UnsignedInt now = TheGameLogic->getFrame(); - - m_healingSupressedUntilFrame = now + md->m_selfHealSupression; - m_nextHealingFrame = m_healingSupressedUntilFrame; -} - -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseCripplingBehavior::startCrippledEffects() -{ - DockUpdateInterface *myDock = getObject()->getDockUpdateInterface(); - myDock->setDockCrippled( TRUE ); -} - -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseCripplingBehavior::stopCrippledEffects() -{ - DockUpdateInterface *myDock = getObject()->getDockUpdateInterface(); - myDock->setDockCrippled( FALSE ); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseCripplingBehavior::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseCripplingBehavior::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // healing suppressed until frame - xfer->xferUnsignedInt( &m_healingSupressedUntilFrame ); - - // next healing frame - xfer->xferUnsignedInt( &m_nextHealingFrame ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseCripplingBehavior::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Body/HighlanderBody.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Body/HighlanderBody.cpp deleted file mode 100644 index d33b620cf46..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Body/HighlanderBody.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: HighlanderBody.cpp //////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, November 2002 -// Desc: Takes damage according to armor, but can't die from normal damage. Can die from Unresistable though -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/Xfer.h" - -#include "GameLogic/Module/HighlanderBody.h" - -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -HighlanderBody::HighlanderBody( Thing *thing, const ModuleData* moduleData ) - : ActiveBody( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -HighlanderBody::~HighlanderBody() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void HighlanderBody::attemptDamage( DamageInfo *damageInfo ) -{ - // Bind to one hitpoint remaining afterwards, unless it is Unresistable damage - if( damageInfo->in.m_damageType != DAMAGE_UNRESISTABLE ) - damageInfo->in.m_amount = min( damageInfo->in.m_amount, getHealth() - 1 ); - - ActiveBody::attemptDamage(damageInfo); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void HighlanderBody::crc( Xfer *xfer ) -{ - - // extend base class - ActiveBody::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void HighlanderBody::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - ActiveBody::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void HighlanderBody::loadPostProcess() -{ - - // extend base class - ActiveBody::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Body/ImmortalBody.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Body/ImmortalBody.cpp deleted file mode 100644 index ea792a12070..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Body/ImmortalBody.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ImmortalBody.cpp //////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, April 2002 -// Desc: Just like Active Body, but won't let health drop below 1 -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Damage.h" -#include "GameLogic/Module/ImmortalBody.h" - -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ImmortalBody::ImmortalBody( Thing *thing, const ModuleData* moduleData ) - : ActiveBody( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ImmortalBody::~ImmortalBody() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void ImmortalBody::internalChangeHealth( Real delta ) -{ - // Don't let anything changes us to below one hit point - delta = max( delta, -getHealth() + 1 ); - - // extend functionality, but I go first because I can't let you die and then fix it, I must prevent - ActiveBody::internalChangeHealth( delta ); - - // nothing -- never mark it as dead. - DEBUG_ASSERTCRASH( (getHealth() > 0 && !getObject()->isEffectivelyDead() ), ("Immortal objects should never get marked as dead!")); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ImmortalBody::crc( Xfer *xfer ) -{ - - // extend base class - ActiveBody::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ImmortalBody::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - ActiveBody::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ImmortalBody::loadPostProcess() -{ - - // extend base class - ActiveBody::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Body/StructureBody.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Body/StructureBody.cpp deleted file mode 100644 index 5e0b29dc4f9..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Body/StructureBody.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: StructureBody.cpp //////////////////////////////////////////////////////////////////////// -// Author: Colin Day, November 2001 -// Desc: Structure bodies are active bodies specifically for structures that are built -// and/or interactable (is that a world) with the player. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Damage.h" -#include "GameLogic/Module/StructureBody.h" - -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -StructureBody::StructureBody( Thing *thing, const ModuleData* moduleData ) - : ActiveBody( thing, moduleData ) -{ - - m_constructorObjectID = INVALID_ID; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -StructureBody::~StructureBody() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void StructureBody::setConstructorObject( Object *obj ) -{ - - if( obj ) - m_constructorObjectID = obj->getID(); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void StructureBody::crc( Xfer *xfer ) -{ - - // extend base class - ActiveBody::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void StructureBody::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // base class - ActiveBody::xfer( xfer ); - - // constructor object id - xfer->xferObjectID( &m_constructorObjectID ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void StructureBody::loadPostProcess() -{ - - // extend base class - ActiveBody::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp deleted file mode 100644 index b47569661c4..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: MoneyCrateCollide.cpp /////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: A crate that heals everything owned by the collider -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/AudioEventRTS.h" -#include "Common/MiscAudio.h" -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/HealCrateCollide.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -HealCrateCollide::HealCrateCollide( Thing *thing, const ModuleData* moduleData ) : CrateCollide( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -HealCrateCollide::~HealCrateCollide() -{ - -} - -//------------------------------------------------------------------------------------------------- -Bool HealCrateCollide::executeCrateBehavior( Object *other ) -{ - Player* cratePlayer = other->getControllingPlayer(); - cratePlayer->healAllObjects(); - - //Play a crate pickup sound. - AudioEventRTS soundToPlay = TheAudio->getMiscAudio()->m_crateHeal; - soundToPlay.setPosition( other->getPosition() ); - TheAudio->addAudioEvent(&soundToPlay); - - return TRUE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void HealCrateCollide::crc( Xfer *xfer ) -{ - - // extend base class - CrateCollide::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void HealCrateCollide::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - CrateCollide::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void HealCrateCollide::loadPostProcess() -{ - - // extend base class - CrateCollide::loadPostProcess(); - -} - diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp deleted file mode 100644 index bf5585279fc..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ShroudCrateCollide.cpp /////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: A crate that clears the shroud for the pickerupper -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/AudioEventRTS.h" -#include "Common/MiscAudio.h" -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/Module/ShroudCrateCollide.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ShroudCrateCollide::ShroudCrateCollide( Thing *thing, const ModuleData* moduleData ) : CrateCollide( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ShroudCrateCollide::~ShroudCrateCollide() -{ - -} - -//------------------------------------------------------------------------------------------------- -Bool ShroudCrateCollide::executeCrateBehavior( Object *other ) -{ - Player* cratePlayer = other->getControllingPlayer(); - ThePartitionManager->revealMapForPlayer( cratePlayer->getPlayerIndex() ); - - //Play a crate pickup sound. - AudioEventRTS soundToPlay = TheAudio->getMiscAudio()->m_crateShroud; - soundToPlay.setObjectID( other->getID() ); - TheAudio->addAudioEvent(&soundToPlay); - - return TRUE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ShroudCrateCollide::crc( Xfer *xfer ) -{ - - // extend base class - CrateCollide::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ShroudCrateCollide::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - CrateCollide::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ShroudCrateCollide::loadPostProcess() -{ - - // extend base class - CrateCollide::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp deleted file mode 100644 index e2a338c64fa..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: UnitCrateCollide.cpp /////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: A crate that gives n units of type m the the pickerupper -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/AudioEventRTS.h" -#include "Common/MiscAudio.h" -#include "Common/Player.h" -#include "Common/ThingFactory.h" -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/Module/UnitCrateCollide.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UnitCrateCollide::UnitCrateCollide( Thing *thing, const ModuleData* moduleData ) : CrateCollide( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UnitCrateCollide::~UnitCrateCollide() -{ - -} - -//------------------------------------------------------------------------------------------------- -Bool UnitCrateCollide::executeCrateBehavior( Object *other ) -{ - UnsignedInt unitCount = getUnitCrateCollideModuleData()->m_unitCount; - ThingTemplate const *unitType = TheThingFactory->findTemplate( getUnitCrateCollideModuleData()->m_unitType ); - - if( unitType == nullptr ) - { - return FALSE; - } - - for( UnsignedInt unitIndex = 0; unitIndex < unitCount; unitIndex++ ) - { - Team *creationTeam = other->getControllingPlayer()->getDefaultTeam(); - Object *newObj = TheThingFactory->newObject( unitType, creationTeam ); - if( newObj ) - { - Coord3D creationPoint = *other->getPosition(); - /// @todo As a user of the future findLegalPositionAround, I wouldn't mind not having to specify range. I just want a non colliding point. - FindPositionOptions fpOptions; - fpOptions.minRadius = 0.0f; - fpOptions.maxRadius = 20.0f; - ThePartitionManager->findPositionAround( &creationPoint, - &fpOptions, - &creationPoint ); - - newObj->setOrientation( other->getOrientation() ); - newObj->setPosition( &creationPoint ); - } - } - - //Play a crate pickup sound. - AudioEventRTS soundToPlay = TheAudio->getMiscAudio()->m_crateFreeUnit; - soundToPlay.setObjectID( other->getID() ); - TheAudio->addAudioEvent(&soundToPlay); - - return TRUE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void UnitCrateCollide::crc( Xfer *xfer ) -{ - - // extend base class - CrateCollide::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void UnitCrateCollide::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - CrateCollide::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void UnitCrateCollide::loadPostProcess() -{ - - // extend base class - CrateCollide::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp deleted file mode 100644 index 9fb6f3c9c04..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: VeterancyCrateCollide.cpp /////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: A crate that gives a level of experience to all within n distance -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameLogic/ExperienceTracker.h" -#include "GameLogic/Object.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/Module/VeterancyCrateCollide.h" -#include "GameLogic/ScriptEngine.h" -#include "GameLogic/Module/AIUpdate.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -VeterancyCrateCollide::VeterancyCrateCollide( Thing *thing, const ModuleData* moduleData ) : CrateCollide( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -VeterancyCrateCollide::~VeterancyCrateCollide() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -Int VeterancyCrateCollide::getLevelsToGain() const -{ - const VeterancyCrateCollideModuleData* d = getVeterancyCrateCollideModuleData(); - if (!d || !d->m_addsOwnerVeterancy) - return 1; - - // this requires that "regular" is 0, vet is 1, etc. - return (Int)getObject()->getVeterancyLevel(); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -Bool VeterancyCrateCollide::isValidToExecute( const Object *other ) const -{ - const VeterancyCrateCollideModuleData* d = getVeterancyCrateCollideModuleData(); - if( !d ) - { - return false; - } - - if(!CrateCollide::isValidToExecute(other)) - return false; - - if (other->isEffectivelyDead()) - return false; - - if( other->isSignificantlyAboveTerrain() ) - { - return false; - } - - Int levelsToGain = getLevelsToGain(); - if (levelsToGain <= 0) - return false; - - const ExperienceTracker *et = other->getExperienceTracker(); - if( !et || !et->isTrainable() ) - { - //If the other unit can't gain experience, then we can't help promote it! - return false; - } - - if (!et || !et->canGainExpForLevel(levelsToGain)) - return false; - - if( d->m_isPilot ) - { - if( other->getControllingPlayer() != getObject()->getControllingPlayer() ) - { - //This is a pilot and we are checking to make sure the pilot is entering a vehicle on - //the same team. If it's not, then don't allow it.. this is particularly the case for - //pilots attempting to enter civilian vehicles. - return false; - } - - if( other->isUsingAirborneLocomotor() ) - { - // Can't upgrade a helicopter or plane, but we will think we can for a moment while it - // is on the ground from being built. - return false; - } - } - - return true; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -Bool VeterancyCrateCollide::executeCrateBehavior( Object *other ) -{ - //Make sure the pilot is actually *TRYING* to enter the object - //unlike other crates - AIUpdateInterface *ai = (AIUpdateInterface*)getObject()->getAIUpdateInterface(); - const VeterancyCrateCollideModuleData *md = getVeterancyCrateCollideModuleData(); - - if( !ai || ai->getGoalObject() != other ) - { - return false; - } - - Int levelsToGain = getLevelsToGain(); - Real range = md->m_rangeOfEffect; - if (range == 0) - { - // do just the collider - if (other != nullptr) - { - other->getExperienceTracker()->gainExpForLevel( levelsToGain, ( ! md->m_isPilot) ); - } - } - else - { - PartitionFilterSamePlayer othersPlayerFilter( other->getControllingPlayer() ); - PartitionFilterSameMapStatus filterMapStatus(other); - PartitionFilter *filters[] = { &othersPlayerFilter, &filterMapStatus, nullptr }; - ObjectIterator *iter = ThePartitionManager->iterateObjectsInRange( other, range, FROM_CENTER_2D, filters, ITER_FASTEST ); - MemoryPoolObjectHolder hold(iter); - - for( Object *potentialObject = iter->first(); potentialObject; potentialObject = iter->next() ) - { - // This function will give just enough exp for the Object to gain a level, if it can - potentialObject->getExperienceTracker()->gainExpForLevel( levelsToGain, ( ! md->m_isPilot) ); - } - } - - //In order to make things easier for the designers, we are going to transfer the terrorist name - //to the car... so the designer can control the car with their scripts. - if( md->m_isPilot ) - { - TheScriptEngine->transferObjectName( getObject()->getName(), other ); - } - - return TRUE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void VeterancyCrateCollide::crc( Xfer *xfer ) -{ - - // extend base class - CrateCollide::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void VeterancyCrateCollide::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - CrateCollide::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void VeterancyCrateCollide::loadPostProcess() -{ - - // extend base class - CrateCollide::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp deleted file mode 100644 index 82f03df3862..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: FireWeaponCollide.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood April 2002 -// Desc: Shoot something that collides with me every frame with my weapon -/////////////////////////////////////////////////////////////////////////////////////////////////// - - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#define DEFINE_OBJECT_STATUS_NAMES -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/FireWeaponCollide.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void FireWeaponCollideModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - CollideModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "CollideWeapon", INI::parseWeaponTemplate, nullptr, offsetof( FireWeaponCollideModuleData, m_collideWeaponTemplate ) }, - { "FireOnce", INI::parseBool, nullptr, offsetof( FireWeaponCollideModuleData, m_fireOnce ) }, - { "RequiredStatus", ObjectStatusMaskType::parseFromINI, nullptr, offsetof( FireWeaponCollideModuleData, m_requiredStatus ) }, - { "ForbiddenStatus", ObjectStatusMaskType::parseFromINI, nullptr, offsetof( FireWeaponCollideModuleData, m_forbiddenStatus ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -FireWeaponCollide::FireWeaponCollide( Thing *thing, const ModuleData* moduleData ) : - CollideModule( thing, moduleData ), - m_collideWeapon(nullptr) -{ - m_collideWeapon = TheWeaponStore->allocateNewWeapon(getFireWeaponCollideModuleData()->m_collideWeaponTemplate, PRIMARY_WEAPON); - m_everFired = FALSE; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -FireWeaponCollide::~FireWeaponCollide() -{ - deleteInstance(m_collideWeapon); -} - -//------------------------------------------------------------------------------------------------- -/** The die callback. */ -//------------------------------------------------------------------------------------------------- -void FireWeaponCollide::onCollide( Object *other, const Coord3D *loc, const Coord3D *normal ) -{ - if( other == nullptr ) - return; //Don't shoot the ground - - Object *me = getObject(); - - // This will fire at you every frame, because multiple people could be colliding and we want - // to hurt them all. Another solution would be to keep a Map of other->objetIDs and - // delays for each individually. However, this solution here is so quick and simple that it - // warrants the "do it eventually if we need it" clause. - if( shouldFireWeapon() ) - { - m_collideWeapon->loadAmmoNow( me ); - m_collideWeapon->fireWeapon( me, other ); - } -} - -//------------------------------------------------------------------------------------------------- -Bool FireWeaponCollide::shouldFireWeapon() -{ - const FireWeaponCollideModuleData *d = getFireWeaponCollideModuleData(); - - ObjectStatusMaskType status = getObject()->getStatusBits(); - - //We need all required status or else we fail - if( !status.testForAll( d->m_requiredStatus ) ) - return FALSE; - - //If we have any forbidden statii, then fail - if( status.testForAny( d->m_forbiddenStatus ) ) - return FALSE; - - if( m_everFired && d->m_fireOnce ) - return FALSE;// can only fire once ever - - return TRUE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void FireWeaponCollide::crc( Xfer *xfer ) -{ - - // extend base class - CollideModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void FireWeaponCollide::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - CollideModule::xfer( xfer ); - - // weapon - Bool collideWeaponPresent = m_collideWeapon ? TRUE : FALSE; - xfer->xferBool( &collideWeaponPresent ); - if( collideWeaponPresent ) - { - - DEBUG_ASSERTCRASH( m_collideWeapon != nullptr, - ("FireWeaponCollide::xfer - m_collideWeapon present mismatch") ); - xfer->xferSnapshot( m_collideWeapon ); - - } - else - { - - DEBUG_ASSERTCRASH( m_collideWeapon == nullptr, - ("FireWeaponCollide::Xfer - m_collideWeapon missing mismatch" )); - - } - - // ever fired - xfer->xferBool( &m_everFired ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void FireWeaponCollide::loadPostProcess() -{ - - // extend base class - CollideModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/SquishCollide.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/SquishCollide.cpp deleted file mode 100644 index 9a9e20c081b..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/SquishCollide.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SquishCollide.cpp ////////////////////////////////////////////////////////////////////////// -// Author: -// Desc: -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ThingFactory.h" -#include "Common/Xfer.h" -#include "GameLogic/Damage.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/SquishCollide.h" -#include "GameLogic/Module/PhysicsUpdate.h" -#include "GameLogic/Module/HijackerUpdate.h" -#include "GameLogic/Module/SpecialAbilityUpdate.h" -#include "GameLogic/Module/AIUpdate.h" -#include "GameLogic/PartitionManager.h" - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SquishCollide::SquishCollide( Thing *thing, const ModuleData* moduleData ) : CollideModule( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SquishCollide::~SquishCollide() -{ - -} - -//------------------------------------------------------------------------------------------------- -/** Do the collision */ -//------------------------------------------------------------------------------------------------- -void SquishCollide::onCollide( Object *other, const Coord3D *loc, const Coord3D *normal ) -{ - // Note that other == null means "collide with ground" - if (other == nullptr) - return; - - Object *self = getObject(); - AIUpdateInterface *ai = self->getAI(); - if( ai && ai->getGoalObject() == other ) - { - //We are actually targeting the other object to do something to! Don't allow them to crush us in the following - //special circumstances: - - //Hijacking! - static NameKeyType key_HijackerUpdate = NAMEKEY( "HijackerUpdate" ); - HijackerUpdate *hijackUpdate = (HijackerUpdate*)self->findUpdateModule( key_HijackerUpdate ); - if( hijackUpdate ) - { - return; - } - - //TNT hunter placing a charge! - SpecialAbilityUpdate *saUpdate = self->findSpecialAbilityUpdate( SPECIAL_TANKHUNTER_TNT_ATTACK ); - if( saUpdate && saUpdate->isActive() ) - { - return; - } - } - - // order matters: we want to know if IT considers ME to be an ally (a reversal of the usual situation) - if( other->getCrusherLevel() > 0 && other->getRelationship(getObject()) != ALLIES) - { - PhysicsBehavior *otherPhysics = other->getPhysics(); - if (otherPhysics == nullptr) - return; - - // use a 1.0 crush radius so the tank has to actually hit the infantry. - GeometryInfo myGeom = self->getGeometryInfo(); - myGeom.setMajorRadius(1.0f); - myGeom.setMinorRadius(1.0f); - if (!ThePartitionManager->geomCollidesWithGeom(other->getPosition(), other->getGeometryInfo(), other->getOrientation(), - self->getPosition(), myGeom, self->getOrientation())) { - return; - } - - // only squish if tank is moving toward victim - const Coord3D *vel = otherPhysics->getVelocity(); - const Coord3D *pos = other->getPosition(); - const Coord3D *myPos = getObject()->getPosition(); - Coord3D to; - - to.x = myPos->x - pos->x; - to.y = myPos->y - pos->y; - to.z = myPos->z - pos->z; - - if (to.x * vel->x + to.y * vel->y > 0.0f) - { - DamageInfo damageInfo; - damageInfo.in.m_damageType = DAMAGE_CRUSH; - damageInfo.in.m_deathType = DEATH_CRUSHED; - damageInfo.in.m_sourceID = other->getID(); - damageInfo.in.m_amount = HUGE_DAMAGE_AMOUNT; // make sure they die - getObject()->attemptDamage( &damageInfo ); - getObject()->friend_setUndetectedDefector( FALSE );// My secret is out - } - - - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void SquishCollide::crc( Xfer *xfer ) -{ - - // extend base class - CollideModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void SquishCollide::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - CollideModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void SquishCollide::loadPostProcess() -{ - - // extend base class - CollideModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/HealContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/HealContain.cpp deleted file mode 100644 index 5467138df35..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/HealContain.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: HealContain.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Colin Day -// Desc: Objects that are contained inside a heal contain ... get healed! oh my! -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/Xfer.h" -#include "GameLogic/Damage.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/BodyModule.h" -#include "GameLogic/Module/HealContain.h" -#include "GameLogic/Module/UpdateModule.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -HealContainModuleData::HealContainModuleData() -{ - - m_framesForFullHeal = 0; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -/*static*/ void HealContainModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - - OpenContainModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "TimeForFullHeal", INI::parseDurationUnsignedInt, nullptr, offsetof( HealContainModuleData, m_framesForFullHeal ) }, - { nullptr, nullptr, nullptr, 0 } - }; - - p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -HealContain::HealContain( Thing *thing, const ModuleData *moduleData ) - : OpenContain( thing, moduleData ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -HealContain::~HealContain() -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** Per frame update */ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime HealContain::update() -{ - - // extending functionality - /*UpdateSleepTime result =*/ OpenContain::update(); - - // get the module data - const HealContainModuleData *modData = getHealContainModuleData(); - - // - // for each of our objects, we give them a little health each frame so that when the - // the TimeTillHealed is up, the object will exit and be fully healed - // - Bool doneHealing; - Object *obj; - ContainedItemsList::const_iterator it = getContainList().begin(); - while( it != getContainList().end() ) - { - - // get the object - obj = *it; - - // increment the iterator, which allows failure to not cause an infinite loop - ++it; - - // do the healing on this object - doneHealing = doHeal( obj, modData->m_framesForFullHeal ); - - // if we're done healing, we need to remove us from the healing container - if( doneHealing == TRUE ) - { - ExitDoorType exitDoor = reserveDoorForExit(obj->getTemplate(), obj); - if (exitDoor != DOOR_NONE_AVAILABLE) - exitObjectViaDoor( obj, exitDoor ); - } - - } - - return UPDATE_SLEEP_NONE; - -} - -// ------------------------------------------------------------------------------------------------ -/** Do the healing for a single object for a single frame. */ -// ------------------------------------------------------------------------------------------------ -Bool HealContain::doHeal( Object *obj, UnsignedInt framesForFullHeal ) -{ - Bool doneHealing = FALSE; - - // setup the healing damageInfo structure with all but the amount - DamageInfo healInfo; - healInfo.in.m_damageType = DAMAGE_HEALING; - healInfo.in.m_deathType = DEATH_NONE; - healInfo.in.m_sourceID = getObject()->getID(); - - // get body module of the thing to heal - BodyModuleInterface *body = obj->getBodyModule(); - - // if we've been in here long enough ... set our health to max - if( TheGameLogic->getFrame() - obj->getContainedByFrame() >= framesForFullHeal ) - { - - // set the amount to max just to be sure we're at the top - healInfo.in.m_amount = body->getMaxHealth(); - - // set max health - body->attemptHealing( &healInfo ); - - // we're done healing - doneHealing = TRUE; - - } - else - { - - // - // given the *whole* time it would take to heal this object, lets pretend that the - // object is at zero health ... and give it a sliver of health as if it were at 0 health - // and would be fully healed at 'framesForFullHeal' - // - healInfo.in.m_amount = body->getMaxHealth() / (Real)framesForFullHeal; - - // do the healing - body->attemptHealing( &healInfo ); - - } - - // return if we're done healing - return doneHealing; - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void HealContain::crc( Xfer *xfer ) -{ - - // extend base class - OpenContain::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void HealContain::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - OpenContain::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void HealContain::loadPostProcess() -{ - - // extend base class - OpenContain::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/RailedTransportContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/RailedTransportContain.cpp deleted file mode 100644 index 54da7df4b07..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/RailedTransportContain.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RailedTransportContain.cpp /////////////////////////////////////////////////////////////// -// Author: Colin Day, August 2002 -// Desc: Railed Transport Contain Module -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/RailedTransportContain.h" -#include "GameLogic/Module/RailedTransportDockUpdate.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -static RailedTransportDockUpdateInterface *getRailedTransportDockUpdateInterface( Object *obj ) -{ - - // sanity - if( obj == nullptr ) - return nullptr; - - // find us our dock interface - RailedTransportDockUpdateInterface *rtdui = nullptr; - for( BehaviorModule **u = obj->getBehaviorModules(); *u; ++u ) - if( (rtdui = (*u)->getRailedTransportDockUpdateInterface()) != nullptr ) - break; - - return rtdui; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -RailedTransportContain::RailedTransportContain( Thing *thing, const ModuleData *moduleData ) - : TransportContain( thing, moduleData ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -RailedTransportContain::~RailedTransportContain() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void RailedTransportContain::onRemoving( Object *obj ) -{ - - // extend functionality - TransportContain::onRemoving( obj ); - - // once we have removed all our contents we are "open" for docking again for more transportation - if( getContainCount() == 0 ) - { - DockUpdateInterface *dui = getObject()->getDockUpdateInterface(); - if( dui ) - dui->setDockOpen( TRUE ); - - } - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -Bool RailedTransportContain::isSpecificRiderFreeToExit( Object *obj ) -{ - Object *us = getObject(); - - // if we are in transit we cannot exit, when we're in transit, the dock is closed - DockUpdateInterface *dui = us->getDockUpdateInterface(); - if( dui && dui->isDockOpen() == FALSE ) - return FALSE; - - // we can now exit, note we're not extending the base class cause *we* handle it all - return TRUE; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void RailedTransportContain::exitObjectViaDoor( Object *newObj, ExitDoorType exitDoor ) -{ - RailedTransportDockUpdateInterface *rtdui = getRailedTransportDockUpdateInterface(); - - if( rtdui == nullptr ) - return; - - // tell the railed dock to exit ONE object, this one - rtdui->unloadSingleObject( newObj ); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void RailedTransportContain::crc( Xfer *xfer ) -{ - - // extend base class - TransportContain::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void RailedTransportContain::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - TransportContain::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void RailedTransportContain::loadPostProcess() -{ - - // extend base class - TransportContain::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp deleted file mode 100644 index 3139136ca5c..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CreateModule.cpp ///////////////////////////////////////////////////////////////////////// -// Author: Colin Day, October 2002 -// Desc: Create module base class -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" -#include "Common/Xfer.h" -#include "GameLogic/Module/CreateModule.h" - -// ------------------------------------------------------------------------------------------------ -//------------------------------------------------------------------------------------------------- -CreateModule::CreateModule( Thing *thing, const ModuleData* moduleData ) - : BehaviorModule( thing, moduleData ), - m_needToRunOnBuildComplete(TRUE) -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -CreateModule::~CreateModule() -{ - -} - -//------------------------------------------------------------------------------------------------- -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void CreateModule::crc( Xfer *xfer ) -{ - - // extend base class - BehaviorModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void CreateModule::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - BehaviorModule::xfer( xfer ); - - // need to run on build complete - xfer->xferBool( &m_needToRunOnBuildComplete ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void CreateModule::loadPostProcess() -{ - - // extend base class - BehaviorModule::loadPostProcess(); - -} - - diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp deleted file mode 100644 index ae730fdae2f..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PreorderCreate.cpp /////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, December 2002 -// Desc: When a building is created, set the preorder status if necessary -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/PreorderCreate.h" - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -PreorderCreate::PreorderCreate( Thing *thing, const ModuleData* moduleData ) : CreateModule( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -PreorderCreate::~PreorderCreate() -{ - -} - -//------------------------------------------------------------------------------------------------- -void PreorderCreate::onCreate() -{ -} - -//------------------------------------------------------------------------------------------------- -void PreorderCreate::onBuildComplete() -{ - if (getObject()->getControllingPlayer()->didPlayerPreorder()) - { - getObject()->setModelConditionState( MODELCONDITION_PREORDER ); - } - else - { - getObject()->clearModelConditionState( MODELCONDITION_PREORDER ); - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void PreorderCreate::crc( Xfer *xfer ) -{ - - // extend base class - CreateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void PreorderCreate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - CreateModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void PreorderCreate::loadPostProcess() -{ - - // extend base class - CreateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp deleted file mode 100644 index 534f87bfbc7..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SpecialPowerCreate.h ///////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, May 2002 -// Desc: When a building is created, tell special powers to start counting down -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/SpecialPowerCreate.h" -#include "GameLogic/Module/SpecialPowerModule.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SpecialPowerCreate::SpecialPowerCreate( Thing *thing, const ModuleData* moduleData ) : CreateModule( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SpecialPowerCreate::~SpecialPowerCreate() -{ - -} - -//------------------------------------------------------------------------------------------------- -void SpecialPowerCreate::onCreate() -{ -} - -//------------------------------------------------------------------------------------------------- -void SpecialPowerCreate::onBuildComplete() -{ - if( ! shouldDoOnBuildComplete() ) - return; - - CreateModule::onBuildComplete(); // extend - - for (BehaviorModule** m = getObject()->getBehaviorModules(); *m; ++m) - { - SpecialPowerModuleInterface* sp = (*m)->getSpecialPower(); - if (!sp) - continue; - - sp->onSpecialPowerCreation(); - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void SpecialPowerCreate::crc( Xfer *xfer ) -{ - - // extend base class - CreateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void SpecialPowerCreate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - CreateModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void SpecialPowerCreate::loadPostProcess() -{ - - // extend base class - CreateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp deleted file mode 100644 index 33c728dee67..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SupplyCenterCreate.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood Feb 2002 -// Desc: When a Supply Center is created, it needs to update all the Resource brains in all players -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Player.h" -#include "Common/PlayerList.h" -#include "Common/ResourceGatheringManager.h" -#include "Common/Xfer.h" -#include "GameLogic/Module/SupplyCenterCreate.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SupplyCenterCreate::SupplyCenterCreate( Thing *thing, const ModuleData* moduleData ) : CreateModule( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SupplyCenterCreate::~SupplyCenterCreate() -{ - -} - -//------------------------------------------------------------------------------------------------- -void SupplyCenterCreate::onCreate() -{ -} - -//------------------------------------------------------------------------------------------------- -void SupplyCenterCreate::onBuildComplete() -{ - if( ! shouldDoOnBuildComplete() ) - return; - - CreateModule::onBuildComplete(); // extend - - if( ThePlayerList == nullptr ) - return; - - for( Int playerIndex = ThePlayerList->getPlayerCount() - 1; playerIndex >= 0; playerIndex-- ) - { - Player *currentPlayer = ThePlayerList->getNthPlayer( playerIndex ); - if( currentPlayer == nullptr ) - continue; - ResourceGatheringManager *manager = currentPlayer->getResourceGatheringManager(); - if( manager == nullptr ) - continue; - manager->addSupplyCenter( getObject() ); - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void SupplyCenterCreate::crc( Xfer *xfer ) -{ - - // extend base class - CreateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void SupplyCenterCreate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - CreateModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void SupplyCenterCreate::loadPostProcess() -{ - - // extend base class - CreateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp deleted file mode 100644 index 15724c5ad3d..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SupplyWarehouseCreate.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood Feb 2002 -// Desc: When a Supply Center is created, it needs to update all the Resource brains in all players -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Player.h" -#include "Common/PlayerList.h" -#include "Common/ResourceGatheringManager.h" -#include "Common/Xfer.h" -#include "GameLogic/Module/SupplyWarehouseCreate.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SupplyWarehouseCreate::SupplyWarehouseCreate( Thing *thing, const ModuleData* moduleData ) : CreateModule( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SupplyWarehouseCreate::~SupplyWarehouseCreate() -{ - -} - -//------------------------------------------------------------------------------------------------- -void SupplyWarehouseCreate::onCreate() -{ - // Warehouses are never Built. - if( ThePlayerList == nullptr ) - return; - - for( Int playerIndex = ThePlayerList->getPlayerCount() - 1; playerIndex >= 0; playerIndex-- ) - { - Player *currentPlayer = ThePlayerList->getNthPlayer( playerIndex ); - if( currentPlayer == nullptr ) - continue; - ResourceGatheringManager *manager = currentPlayer->getResourceGatheringManager(); - if( manager == nullptr ) - continue; - manager->addSupplyWarehouse( getObject() ); - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseCreate::crc( Xfer *xfer ) -{ - - // extend base class - CreateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseCreate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - CreateModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseCreate::loadPostProcess() -{ - - // extend base class - CreateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp deleted file mode 100644 index 3a380bac6de..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: VeterancyGainCreate.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, August 2002 -// Desc: On creation, will set Object's veterancy level if required Science is present. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#define DEFINE_VETERANCY_NAMES // for TheVeterancyNames[] -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameLogic/ExperienceTracker.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/VeterancyGainCreate.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -VeterancyGainCreateModuleData::VeterancyGainCreateModuleData() -{ - m_startingLevel = LEVEL_REGULAR; - m_scienceRequired = SCIENCE_INVALID; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void VeterancyGainCreateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - CreateModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "StartingLevel", INI::parseIndexList, TheVeterancyNames, offsetof( VeterancyGainCreateModuleData, m_startingLevel ) }, - { "ScienceRequired", INI::parseScience, nullptr, offsetof( VeterancyGainCreateModuleData, m_scienceRequired ) }, - { nullptr, nullptr, nullptr, 0 } - }; - - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -VeterancyGainCreate::VeterancyGainCreate( Thing *thing, const ModuleData* moduleData ) : CreateModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -VeterancyGainCreate::~VeterancyGainCreate() -{ - -} - -//------------------------------------------------------------------------------------------------- -/** The create callback. */ -//------------------------------------------------------------------------------------------------- -void VeterancyGainCreate::onCreate() -{ - - // When produced normally, this Object will ask the Player if the correct Science is known for it - // to set its level to the given level - - const VeterancyGainCreateModuleData *md = getVeterancyGainCreateModuleData(); - Player *myPlayer = getObject()->getControllingPlayer(); - if( myPlayer && (md->m_scienceRequired == SCIENCE_INVALID || - myPlayer->hasScience( md->m_scienceRequired )) ) - { - ExperienceTracker* myExp = getObject()->getExperienceTracker(); - if( myExp && myExp->isTrainable() ) - { - // srj sez: use "setMin" here so that we never lose levels - myExp->setMinVeterancyLevel( md->m_startingLevel, false );// sVL can override isTrainable, but this module should not. - } - } - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void VeterancyGainCreate::crc( Xfer *xfer ) -{ - - // extend base class - CreateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void VeterancyGainCreate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - CreateModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void VeterancyGainCreate::loadPostProcess() -{ - - // extend base class - CreateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Damage/BoneFXDamage.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Damage/BoneFXDamage.cpp deleted file mode 100644 index 9c7b47754fe..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Damage/BoneFXDamage.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: BoneFXDamage.cpp /////////////////////////////////////////////////////////////////// -// Author: Bryan Cleveland, March 2002 -// Desc: Damage module that goes with BoneFX update -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/BoneFXDamage.h" -#include "GameLogic/Module/BoneFXUpdate.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -BoneFXDamage::BoneFXDamage( Thing *thing, const ModuleData* moduleData ) - : DamageModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -BoneFXDamage::~BoneFXDamage() -{ - -} - -//------------------------------------------------------------------------------------------------- -void BoneFXDamage::onObjectCreated() -{ - static NameKeyType key_BoneFXUpdate = NAMEKEY("BoneFXUpdate"); - BoneFXUpdate* bfxu = (BoneFXUpdate*)getObject()->findUpdateModule(key_BoneFXUpdate); - if (bfxu == nullptr) - { - DEBUG_ASSERTCRASH(bfxu != nullptr, ("BoneFXDamage requires BoneFXUpdate")); - throw INI_INVALID_DATA; - } -} - -//------------------------------------------------------------------------------------------------- -/** Switching damage states */ -//------------------------------------------------------------------------------------------------- -void BoneFXDamage::onBodyDamageStateChange( const DamageInfo *damageInfo, - BodyDamageType oldState, - BodyDamageType newState ) -{ - static NameKeyType key_BoneFXUpdate = NAMEKEY("BoneFXUpdate"); - BoneFXUpdate* bfxu = (BoneFXUpdate*)getObject()->findUpdateModule(key_BoneFXUpdate); - if (bfxu) - bfxu->changeBodyDamageState(oldState, newState); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void BoneFXDamage::crc( Xfer *xfer ) -{ - - // extend base class - DamageModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void BoneFXDamage::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DamageModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void BoneFXDamage::loadPostProcess() -{ - - // extend base class - DamageModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Damage/DamageModule.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Damage/DamageModule.cpp deleted file mode 100644 index bf69a7e357a..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Damage/DamageModule.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DamageModule.cpp ///////////////////////////////////////////////////////////////////////// -// Author: Colin Day, September 2002 -// Desc: Damage Module base class -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" -#include "Common/Xfer.h" -#include "GameLogic/Module/DamageModule.h" - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void DamageModule::crc( Xfer *xfer ) -{ - - // extend base class - BehaviorModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer Method */ -// ------------------------------------------------------------------------------------------------ -void DamageModule::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // call base class - BehaviorModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void DamageModule::loadPostProcess() -{ - - // call base class - BehaviorModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Destroy/DestroyModule.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Destroy/DestroyModule.cpp deleted file mode 100644 index 22610d932aa..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Destroy/DestroyModule.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DestroyModule.cpp //////////////////////////////////////////////////////////////////////// -// Author: Colin Day, October 2002 -// Desc: Destroy module base class -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" -#include "Common/Xfer.h" -#include "GameLogic/Module/DestroyModule.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -DestroyModule::DestroyModule( Thing *thing, const ModuleData* moduleData ) - : BehaviorModule( thing, moduleData ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -DestroyModule::~DestroyModule() -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void DestroyModule::crc( Xfer *xfer ) -{ - - // extend base class - BehaviorModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void DestroyModule::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - BehaviorModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void DestroyModule::loadPostProcess() -{ - - // extend base class - BehaviorModule::loadPostProcess(); - -} - diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp deleted file mode 100644 index 025beb71e4e..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CreateCrateDie.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, February 2002 -// Desc: A chance to create a crate on death according to certain condition checks -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/PlayerList.h" -#include "Common/Player.h" -#include "Common/RandomValue.h" -#include "Common/ThingFactory.h" -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameLogic/CrateSystem.h" -#include "GameLogic/ExperienceTracker.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/Module/CreateCrateDie.h" -#include "GameLogic/Module/AIUpdate.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -CreateCrateDie::CreateCrateDie( Thing *thing, const ModuleData* moduleData ) : DieModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -CreateCrateDie::~CreateCrateDie() -{ -} - -void CreateCrateDieModuleData::parseCrateData( INI* ini, void *instance, void * /*store*/, const void* /*userData*/ ) -{ - CreateCrateDieModuleData* self = (CreateCrateDieModuleData*)instance; - - AsciiString crateName = ini->getNextToken(); - - self->m_crateNameList.push_back( crateName ); -} - -//------------------------------------------------------------------------------------------------- -/** The die callback. */ -//------------------------------------------------------------------------------------------------- -void CreateCrateDie::onDie( const DamageInfo * damageInfo ) -{ - if (!isDieApplicable(damageInfo)) - return; - - CrateTemplate const *currentCrateData = nullptr; - Object *killer = TheGameLogic->findObjectByID( damageInfo->in.m_sourceID ); - Object *me = getObject(); - - if( killer && killer->getRelationship( me ) == ALLIES ) - return; //Nope, no crate for killing ally at all. - - for( AsciiStringListConstIterator iter = getCreateCrateDieModuleData()->m_crateNameList.begin(); - iter != getCreateCrateDieModuleData()->m_crateNameList.end(); - iter++ - ) - { - currentCrateData = TheCrateSystem->findCrateTemplate( *iter ); - if( currentCrateData ) - { - if( ! testCreationChance( currentCrateData ) ) - continue;// always test this - - if( (currentCrateData->m_veterancyLevel != LEVEL_INVALID) && ! testVeterancyLevel( currentCrateData ) ) - continue; //If this is set up to test and it fails - - if( KINDOFMASK_ANY_SET(currentCrateData->m_killedByTypeKindof) && !testKillerType( currentCrateData, killer ) ) - continue; //If this is set up to test and it fails - - if( (currentCrateData->m_killerScience != SCIENCE_INVALID) && !testKillerScience( currentCrateData, killer ) ) - continue; //If this is set up to test and it fails - - Object *crate = createCrate( currentCrateData );//Make the crate - if( crate ) - { - // Design needs to set ownership of crates sometimes - if( currentCrateData->m_isOwnedByMaker ) - { - crate->setTeam( me->getControllingPlayer()->getDefaultTeam() ); - } - - if (killer) - { - // If the killer is a computer controlled player, notify that the crate exists. - if (killer->getControllingPlayer() && - killer->getControllingPlayer()->getPlayerType()==PLAYER_COMPUTER) - { - AIUpdateInterface *ai = killer->getAIUpdateInterface(); - if (ai) - { - ai->notifyCrate( crate->getID() ); - } - } - } - } - } - } -} - -Bool CreateCrateDie::testCreationChance( CrateTemplate const *currentCrateData ) -{ - Real testAgainst = currentCrateData->m_creationChance; - Real testWith = GameLogicRandomValueReal( 0, 1 ); - - return testWith < testAgainst; -} - -Bool CreateCrateDie::testVeterancyLevel( CrateTemplate const *currentCrateData ) -{ - VeterancyLevel testAgainst = currentCrateData->m_veterancyLevel; - VeterancyLevel testWith = getObject()->getVeterancyLevel(); - - return testAgainst == testWith; -} - -Bool CreateCrateDie::testKillerType( CrateTemplate const *currentCrateData, Object *killer ) -{ - if( killer == nullptr ) - return FALSE; - - // Must match the whole group of bits set in the KilledBy description (most likely One). - if( ! killer->getTemplate()->isKindOfMulti( currentCrateData->m_killedByTypeKindof, KINDOFMASK_NONE ) ) - return FALSE; - - return TRUE; -} - -Bool CreateCrateDie::testKillerScience( CrateTemplate const *currentCrateData, Object *killer ) -{ - if( killer == nullptr ) - return FALSE; - - // killer's player must have the listed science - Player *killerPlayer = killer->getControllingPlayer(); - - if( killerPlayer == nullptr ) - return FALSE; - - if( ! killerPlayer->hasScience( currentCrateData->m_killerScience ) ) - return FALSE; - - return TRUE; -} - -Object *CreateCrateDie::createCrate( CrateTemplate const *currentCrateData ) -{ - Coord3D centerPoint = *getObject()->getPosition(); - PathfindLayerEnum layer = getObject()->getLayer(); - - // CreationChance is used for the success of this block, but this block can have any number of potential actual crates - Real multipleCratePick = GameLogicRandomValueReal( 0, 1 ); - Real multipleCrateRunningTotal = 0; - AsciiString crateName; - - for( crateCreationEntryConstIterator iter = currentCrateData->m_possibleCrates.begin(); - iter != currentCrateData->m_possibleCrates.end(); - iter++ - ) - { - multipleCrateRunningTotal += (*iter).crateChance; - if( multipleCrateRunningTotal > multipleCratePick ) - { - // Run through the list of possibles, and if the sum of the chances is greater than my random pick, - // then this is the correct one. (This simulates contiguous %, or weighted distribution) - crateName = (*iter).crateName; - break; - } - } - // At this point, I could very well have a "" for the type, if the Designer didn't make the sum of chances 1 - - ThingTemplate const *crateType = TheThingFactory->findTemplate( crateName ); - if( crateType == nullptr ) - return nullptr; - - Bool spotFound = FALSE; - Coord3D creationPoint; - FindPositionOptions fpOptions; - - fpOptions.minRadius = 0.0f; - fpOptions.maxRadius = 5.0f; - fpOptions.relationshipObject = getObject(); - fpOptions.flags = FPF_IGNORE_ALLY_OR_NEUTRAL_UNITS; // So the dead guy won't block, nor will his dead hulk. - if (layer != LAYER_GROUND) { - creationPoint = centerPoint; - spotFound = true; - } else if( ThePartitionManager->findPositionAround( ¢erPoint, &fpOptions, &creationPoint ) ) - { - spotFound = TRUE; - } - else - { - // If the tight ignore units scan fails, then try a great big scan so we appear on the edge - // of the large dead thing (building rubble) - fpOptions.minRadius = 0.0f; - fpOptions.maxRadius = 125.0f; - fpOptions.relationshipObject = nullptr; - fpOptions.flags = FPF_NONE; - if( ThePartitionManager->findPositionAround( ¢erPoint, &fpOptions, &creationPoint ) ) - { - spotFound = TRUE; - } - } - - if( spotFound ) - { - Object *newCrate = TheThingFactory->newObject( crateType, nullptr ); - newCrate->setPosition( &creationPoint ); - newCrate->setOrientation( GameLogicRandomValueReal( 0, 2*PI ) ); - newCrate->setLayer(layer); - - Drawable *crateDrawable = newCrate->getDrawable(); - - if( crateDrawable ) - { - crateDrawable->setTerrainDecal(TERRAIN_DECAL_CRATE); - crateDrawable->setTerrainDecalSize(2.5f * newCrate->getGeometryInfo().getMajorRadius(), - 2.5f * newCrate->getGeometryInfo().getMajorRadius() ) ; - crateDrawable->setTerrainDecalFadeTarget(1.0f, 0.03f); - } - - return newCrate; - } - return nullptr; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void CreateCrateDie::crc( Xfer *xfer ) -{ - - // extend base class - DieModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void CreateCrateDie::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DieModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void CreateCrateDie::loadPostProcess() -{ - - // extend base class - DieModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp deleted file mode 100644 index c9cf0b74561..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CrushDie.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, November 2001 -// Desc: Crush Die module -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Player.h" -#include "Common/PlayerList.h" -#include "Common/RandomValue.h" -#include "Common/ThingFactory.h" -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/BodyModule.h" -#include "GameLogic/Module/CrushDie.h" - -//------------------------------------------------------------------------------------------------- -// Figure out which crush point was hit so the correct crushed object can be swapped in - -// Figure out which crush point was hit so the correct crushed object can be swapped in -static CrushEnum crushLocationCheck( Object* crusherObject, Object* victimObject ) -{ - if( (crusherObject == nullptr) || (victimObject == nullptr) ) - return NO_CRUSH; - - Bool frontCrushed = victimObject->getBodyModule()->getFrontCrushed(); - Bool backCrushed = victimObject->getBodyModule()->getBackCrushed(); - -// const Coord3D *dir = crusherObject->getUnitDirectionVector2D(); - const Coord3D *otherDir = victimObject->getUnitDirectionVector2D(); - const Coord3D *pos = crusherObject->getPosition(); - const Coord3D *otherPos = victimObject->getPosition(); - - Real crushPointOffsetDistance = victimObject->getGeometryInfo().getMajorRadius() * 0.5; - - Coord3D crushPointOffset; - crushPointOffset.x = otherDir->x * crushPointOffsetDistance; - crushPointOffset.y = otherDir->y * crushPointOffsetDistance; - crushPointOffset.z = 0; - - Coord3D comparisonCoord; - Real dx, dy; - - CrushEnum retval = NO_CRUSH; - Real bestDist = 99999; - - // PhysicsCollide has already done the logic of which point to smoosh and waited until we crossed that point - // so at this point we just need to know which crush point is closest. - - if( !frontCrushed && !backCrushed ) - { - // Check the middle crush point - comparisonCoord = *otherPos;//copy so can move to each crush point - - dx = comparisonCoord.x - pos->x; - dy = comparisonCoord.y - pos->y; - Real dist = (Real)( dx*dx + dy*dy ); - - //otherwise we want to make sure we get the closest valid crush point - retval = TOTAL_CRUSH; - bestDist = dist; - } - - if( !frontCrushed ) - { - // Check the front point. - comparisonCoord = *otherPos; - comparisonCoord.x += crushPointOffset.x; - comparisonCoord.y += crushPointOffset.y; - - dx = comparisonCoord.x - pos->x; - dy = comparisonCoord.y - pos->y; - Real dist = (Real)( dx*dx + dy*dy ); - - if( dist < bestDist )//closer - { - if( backCrushed ) - { - retval = TOTAL_CRUSH; - bestDist = dist; - } - else - { - retval = FRONT_END_CRUSH; - bestDist = dist; - } - } - } - - if( !backCrushed ) - { - // Check back point - comparisonCoord = *otherPos; - comparisonCoord.x -= crushPointOffset.x; - comparisonCoord.y -= crushPointOffset.y; - - dx = comparisonCoord.x - pos->x; - dy = comparisonCoord.y - pos->y; - Real dist = (Real)( dx*dx + dy*dy ); - - if( dist < bestDist )//closer - { - if( frontCrushed ) - { - retval = TOTAL_CRUSH; - bestDist = dist; - } - else - { - retval = BACK_END_CRUSH; - bestDist = dist; - } - } - } - - return retval; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -CrushDie::CrushDie( Thing *thing, const ModuleData* moduleData ) : DieModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -CrushDie::~CrushDie() -{ - -} - -//------------------------------------------------------------------------------------------------- -/** The die callback. */ -//------------------------------------------------------------------------------------------------- -void CrushDie::onDie( const DamageInfo * damageInfo ) -{ - if (!isDieApplicable(damageInfo)) - return; - - DEBUG_ASSERTCRASH(damageInfo->in.m_damageType == DAMAGE_CRUSH, ("this should only be used for crush damage")); - if (damageInfo->in.m_damageType != DAMAGE_CRUSH) - return; - - Object *damageDealer = TheGameLogic->findObjectByID( damageInfo->in.m_sourceID ); - DEBUG_ASSERTCRASH(damageDealer,("You must have a damageDealer source for this effect")); - - CrushEnum crushType = damageDealer ? crushLocationCheck(damageDealer, getObject()) : TOTAL_CRUSH; - - if (crushType != NO_CRUSH) - { - if (getCrushDieModuleData()->m_crushSounds[crushType].getEventName().isEmpty() == false) - { - // be sure that 0==never, 100==always - // MDC: moving to GameLogicRandomValue. This does not need to be synced, but having it so makes searches *so* much nicer. - if (GameLogicRandomValue(0, 99) < getCrushDieModuleData()->m_crushSoundPercent[crushType]) - { - AudioEventRTS crushSound(getCrushDieModuleData()->m_crushSounds[crushType]); - crushSound.setObjectID(getObject()->getID()); - TheAudio->addAudioEvent(&crushSound); - } - } - { - Object *me = getObject(); - - if (me) - { - me->getBodyModule()->setFrontCrushed(crushType == TOTAL_CRUSH || crushType == FRONT_END_CRUSH); - me->getBodyModule()->setBackCrushed(crushType == TOTAL_CRUSH || crushType == BACK_END_CRUSH); - - ModelConditionFlags newCrushed; - newCrushed.set(MODELCONDITION_FRONTCRUSHED, (crushType == TOTAL_CRUSH || crushType == FRONT_END_CRUSH)); - newCrushed.set(MODELCONDITION_BACKCRUSHED, crushType == TOTAL_CRUSH || crushType == BACK_END_CRUSH); - - me->getDrawable()->clearAndSetModelConditionFlags( - MAKE_MODELCONDITION_MASK2(MODELCONDITION_BACKCRUSHED, MODELCONDITION_FRONTCRUSHED), - newCrushed); - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void CrushDie::crc( Xfer *xfer ) -{ - - // extend base class - DieModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void CrushDie::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DieModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void CrushDie::loadPostProcess() -{ - - // extend base class - DieModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/DamDie.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/DamDie.cpp deleted file mode 100644 index 990211e6700..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/DamDie.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DamDie.cpp /////////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, April 2002 -// Desc: The big water dam dying -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/RandomValue.h" -#include "Common/Xfer.h" -#include "GameClient/ParticleSys.h" -#include "GameClient/TerrainVisual.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/AIUpdate.h" -#include "GameLogic/Module/DamDie.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -DamDieModuleData::DamDieModuleData() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -/*static*/ void DamDieModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - - DieModuleData::buildFieldParse( p ); - -// static const FieldParse dataFieldParse[] = -// { -// { 0, 0, 0, 0 } -// }; -// -// p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -DamDie::DamDie( Thing *thing, const ModuleData *moduleData ) - :DieModule( thing, moduleData ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -DamDie::~DamDie() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void DamDie::onDie( const DamageInfo *damageInfo ) -{ - if (!isDieApplicable(damageInfo)) - return; - - // enable all the water wave objects on the map - Object *obj; - for( obj = TheGameLogic->getFirstObject(); obj; obj = obj->getNextObject() ) - { - - // only care about water waves - if( obj->isKindOf( KINDOF_WAVEGUIDE ) == FALSE ) - continue; - - // clear any disabled status of the water wave - obj->clearDisabled( DISABLED_DEFAULT ); - - } - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void DamDie::crc( Xfer *xfer ) -{ - - // extend base class - DieModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void DamDie::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DieModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void DamDie::loadPostProcess() -{ - - // extend base class - DieModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/DieModule.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/DieModule.cpp deleted file mode 100644 index f268fe33d03..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/DieModule.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DieModule.cpp //////////////////////////////////////////////////////////////////////////// -// Author: -// Desc: -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#define DEFINE_OBJECT_STATUS_NAMES -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/ExperienceTracker.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Module/DieModule.h" -#include "GameLogic/Object.h" - - - - - -//------------------------------------------------------------------------------------------------- -DieMuxData::DieMuxData() : - m_deathTypes(DEATH_TYPE_FLAGS_ALL), - m_veterancyLevels(VETERANCY_LEVEL_FLAGS_ALL) -{ -} - -//------------------------------------------------------------------------------------------------- -const FieldParse* DieMuxData::getFieldParse() -{ - static const FieldParse dataFieldParse[] = - { - { "DeathTypes", INI::parseDeathTypeFlags, nullptr, offsetof( DieMuxData, m_deathTypes ) }, - { "VeterancyLevels", INI::parseVeterancyLevelFlags, nullptr, offsetof( DieMuxData, m_veterancyLevels ) }, - { "ExemptStatus", ObjectStatusMaskType::parseFromINI, nullptr, offsetof( DieMuxData, m_exemptStatus ) }, - { "RequiredStatus", ObjectStatusMaskType::parseFromINI, nullptr, offsetof( DieMuxData, m_requiredStatus ) }, - { nullptr, nullptr, nullptr, 0 } - }; - return dataFieldParse; -} - -//------------------------------------------------------------------------------------------------- -Bool DieMuxData::isDieApplicable(const Object* obj, const DamageInfo *damageInfo) const -{ - // wrong death type? punt - if (!getDeathTypeFlag(m_deathTypes, damageInfo->in.m_deathType)) - return false; - - // wrong vet level? punt - if (!getVeterancyLevelFlag(m_veterancyLevels, obj->getVeterancyLevel())) - return false; - - // all 'exempt' bits must be clear for us to run. - if( !obj->getStatusBits().testForNone( m_exemptStatus ) ) - return false; - - // all 'required' bits must be set for us to run. - if( !obj->getStatusBits().testForAll( m_requiredStatus ) ) - return false; - - return true; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void DieModule::crc( Xfer *xfer ) -{ - - // extend base class - BehaviorModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer Method */ -// ------------------------------------------------------------------------------------------------ -void DieModule::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // call base class - BehaviorModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void DieModule::loadPostProcess() -{ - - // call base class - BehaviorModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/EjectPilotDie.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/EjectPilotDie.cpp deleted file mode 100644 index 8e220c31f02..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/EjectPilotDie.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: EjectPilotDie.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, April 2002 -// Desc: Create an object upon this object's death -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/GameAudio.h" -#include "Common/Player.h" -#include "Common/ThingFactory.h" -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Module/EjectPilotDie.h" -#include "GameLogic/ExperienceTracker.h" -#include "GameLogic/Object.h" -#include "GameLogic/ObjectCreationList.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -EjectPilotDieModuleData::EjectPilotDieModuleData() : - m_oclInAir(nullptr), - m_oclOnGround(nullptr), - m_invulnerableTime(0) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void EjectPilotDieModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - DieModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "AirCreationList", INI::parseObjectCreationList, nullptr, offsetof( EjectPilotDieModuleData, m_oclInAir ) }, - { "GroundCreationList", INI::parseObjectCreationList, nullptr, offsetof( EjectPilotDieModuleData, m_oclOnGround ) }, - { "InvulnerableTime", INI::parseDurationUnsignedInt, nullptr, offsetof(EjectPilotDieModuleData, m_invulnerableTime ) }, - - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -EjectPilotDie::EjectPilotDie( Thing *thing, const ModuleData* moduleData ) : DieModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -EjectPilotDie::~EjectPilotDie() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -/*static*/ void EjectPilotDie::ejectPilot(const ObjectCreationList* ocl, const Object* dyingObject, const Object* damageDealer) -{ - if (!ocl || !dyingObject) - return; // it's OK for damageDealer to be null - - ObjectCreationList::create(ocl, dyingObject, damageDealer); - - AudioEventRTS voiceEject = *(dyingObject->getTemplate()->getPerUnitSound("VoiceEject")); - voiceEject.setPosition( dyingObject->getPosition() ); - voiceEject.setPlayerIndex( dyingObject->getControllingPlayer()->getPlayerIndex() ); - TheAudio->addAudioEvent(&voiceEject); - - AudioEventRTS soundEject = *(dyingObject->getTemplate()->getPerUnitSound("SoundEject")); - soundEject.setPosition( dyingObject->getPosition() ); - TheAudio->addAudioEvent(&soundEject); -} - -//------------------------------------------------------------------------------------------------- -/** The die callback. */ -//------------------------------------------------------------------------------------------------- -void EjectPilotDie::onDie( const DamageInfo * damageInfo ) -{ - if (!isDieApplicable(damageInfo)) - return; - Object* damageDealer = TheGameLogic->findObjectByID( damageInfo->in.m_sourceID ); - const EjectPilotDieModuleData* d = getEjectPilotDieModuleData(); - const ObjectCreationList* ocl = getObject()->isSignificantlyAboveTerrain() ? d->m_oclInAir : d->m_oclOnGround; - ejectPilot(ocl, getObject(), damageDealer); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void EjectPilotDie::crc( Xfer *xfer ) -{ - - // extend base class - DieModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void EjectPilotDie::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DieModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void EjectPilotDie::loadPostProcess() -{ - - // extend base class - DieModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/KeepObjectDie.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/KeepObjectDie.cpp deleted file mode 100644 index cf55f235157..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/KeepObjectDie.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: KeepObjectDie.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, November 2002 -// Desc: Die module for things that want to leave rubble in the world and don't have other die -// modules. This fixes civilian buildings that don't have garrison contains. Garrison -// contains have a die module built in, so these buildings need something. Without it -// they default to the destroydie module which outright removes the object. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Module/KeepObjectDie.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -KeepObjectDie::KeepObjectDie( Thing *thing, const ModuleData* moduleData ) : DieModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -KeepObjectDie::~KeepObjectDie() -{ -} - -//------------------------------------------------------------------------------------------------- -/** The die callback. */ -//------------------------------------------------------------------------------------------------- -void KeepObjectDie::onDie( const DamageInfo *damageInfo ) -{ - if( !isDieApplicable(damageInfo) ) - { - return; - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void KeepObjectDie::crc( Xfer *xfer ) -{ - - // extend base class - DieModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void KeepObjectDie::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DieModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void KeepObjectDie::loadPostProcess() -{ - - // extend base class - DieModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp deleted file mode 100644 index 918b6be67ee..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SpecialPowerCompletionDie.cpp //////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, May 2002 -// Desc: Die method responsible for telling TheScriptEngine that a special power has been completed -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Player.h" -#include "Common/SpecialPower.h" -#include "Common/Xfer.h" -#include "GameLogic/Module/SpecialPowerCompletionDie.h" -#include "GameLogic/Object.h" -#include "GameLogic/ScriptEngine.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SpecialPowerCompletionDie::SpecialPowerCompletionDie( Thing *thing, const ModuleData* moduleData ) : DieModule( thing, moduleData ) -{ - m_creatorID = INVALID_ID; - m_creatorSet = FALSE; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SpecialPowerCompletionDie::~SpecialPowerCompletionDie() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void SpecialPowerCompletionDie::onDie( const DamageInfo *damageInfo ) -{ - if (!isDieApplicable(damageInfo)) - return; - notifyScriptEngine(); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void SpecialPowerCompletionDie::notifyScriptEngine() -{ - if (m_creatorID != INVALID_ID) - { - TheScriptEngine->notifyOfCompletedSpecialPower( - getObject()->getControllingPlayer()->getPlayerIndex(), - getSpecialPowerCompletionDieModuleData()->m_specialPowerTemplate->getName(), - m_creatorID); - } -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void SpecialPowerCompletionDie::setCreator( ObjectID creatorID ) -{ - if (!m_creatorSet) - { - m_creatorSet = TRUE; - m_creatorID = creatorID; - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void SpecialPowerCompletionDie::crc( Xfer *xfer ) -{ - - // extend base class - DieModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void SpecialPowerCompletionDie::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DieModule::xfer( xfer ); - - // creator id - xfer->xferObjectID( &m_creatorID ); - - // creator set - xfer->xferBool( &m_creatorSet ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void SpecialPowerCompletionDie::loadPostProcess() -{ - - // extend base class - DieModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/UpgradeDie.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/UpgradeDie.cpp deleted file mode 100644 index 42e34b3e279..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/UpgradeDie.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: UpgradeDie.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, August 2002 -// Desc: When object dies, the parent object is freed of the specified object upgrade field. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ThingTemplate.h" -#include "Common/Upgrade.h" -#include "Common/Xfer.h" - -#include "GameClient/Drawable.h" - -#include "GameLogic/GameLogic.h" -#include "GameLogic/Module/UpgradeDie.h" -#include "GameLogic/Object.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpgradeDie::UpgradeDie( Thing *thing, const ModuleData* moduleData ) : DieModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpgradeDie::~UpgradeDie() -{ -} - -//------------------------------------------------------------------------------------------------- -/** The die callback. */ -//------------------------------------------------------------------------------------------------- -void UpgradeDie::onDie( const DamageInfo *damageInfo ) -{ - if (!isDieApplicable(damageInfo)) - return; - //Look for the object that created me. - Object *producer = TheGameLogic->findObjectByID( getObject()->getProducerID() ); - if( producer ) - { - //Okay, we found our parent... now look for the upgrade. - const UpgradeTemplate *upgrade = TheUpgradeCenter->findUpgrade( getUpgradeDieModuleData()->m_upgradeName ); - - if( upgrade ) - { - //We found the upgrade, now see if the parent object has it set... - if( producer->hasUpgrade( upgrade ) ) - { - //Cool, now remove it. - producer->removeUpgrade( upgrade ); - } - else - { - DEBUG_CRASH( ("Object %s just died, but is trying to free upgrade %s in it's producer %s%s", - getObject()->getTemplate()->getName().str(), - getUpgradeDieModuleData()->m_upgradeName.str(), - producer->getTemplate()->getName().str(), - ", which the producer doesn't have. This is used in cases where the producer builds an upgrade that can die... like ranger building scout drones.") ); - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void UpgradeDie::crc( Xfer *xfer ) -{ - - // extend base class - DieModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void UpgradeDie::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DieModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void UpgradeDie::loadPostProcess() -{ - - // extend base class - DieModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp deleted file mode 100644 index 0ec622b25a0..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectDefectionHelper.cpp //////////////////////////////////////////////////////////////// -// Author: Colin Day, Steven Johnson - September 2002 -// Desc: Object helper module -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" -#include "Common/MiscAudio.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/ObjectDefectionHelper.h" - - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -ObjectDefectionHelper::~ObjectDefectionHelper() -{ -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime ObjectDefectionHelper::update() -{ - Object* obj = getObject(); - Drawable* draw = obj->getDrawable(); - - // if we are here, we should be an undetected defector, but - // just in case someone has changed us behind our backs... - if (!obj->getIsUndetectedDefector()) - return UPDATE_SLEEP_FOREVER; - - UnsignedInt now = TheGameLogic->getFrame(); - if (now >= m_defectionDetectionEnd) - { - obj->friend_setUndetectedDefector(FALSE); - - // timer has reached zero, so we flash white once!!!! -- lorenzen - if (draw && m_doDefectorFX) - { - RGBColor white = {1,1,1}; - if (draw) - draw->flashAsSelected( &white ); //Whew! that's easier, now, isn't it! - - - AudioEventRTS defectorVulnerableSound = TheAudio->getMiscAudio()->m_defectorTimerDingSound; - defectorVulnerableSound.setObjectID( obj->getID() ); - TheAudio->addAudioEvent(&defectorVulnerableSound); - } - return UPDATE_SLEEP_FOREVER; // hey, we're done. - } - - // dead or attacking... our cover is blown. - if( obj->isEffectivelyDead() || obj->getStatusBits().test( OBJECT_STATUS_IS_FIRING_WEAPON ) ) - { - // PLEASE NOTE: - // checking the is_attacking statusbit above, only handles weapon related attacks... - // I also set m_undetectedDefector = FALSE in the groupDoSpecialPower[...]() functions; - obj->friend_setUndetectedDefector(FALSE); - return UPDATE_SLEEP_FOREVER; // hey, we're done. - } - - if (draw && m_doDefectorFX) // skip fx if merely 'invulnerable' - { - Bool lastPhase = ( ((Int)m_defectionDetectionFlashPhase) & 1 );// were we in a flashy phase last frame? - UnsignedInt timeLeft = m_defectionDetectionEnd - now; - m_defectionDetectionFlashPhase += 0.5f * ( 1.0f - ((Real)timeLeft / DEFECTION_DETECTION_TIME_MAX ) ); - Bool thisPhase = ( ((Int)m_defectionDetectionFlashPhase) & 1 );// are we in a flashy phase this frame? - - if ( lastPhase && ( ! thisPhase ) ) - { - draw->flashAsSelected(); //Whew! that's easier, now, isn't it! - - AudioEventRTS defectorTimerSound = TheAudio->getMiscAudio()->m_defectorTimerTickSound; - defectorTimerSound.setObjectID( obj->getID() ); - TheAudio->addAudioEvent(&defectorTimerSound); - - } - } - - return UPDATE_SLEEP_NONE; -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void ObjectDefectionHelper::startDefectionTimer(UnsignedInt numFrames, Bool withDefectorFX) -{ - Object* obj = getObject(); - - if (!obj->getIsUndetectedDefector()) - { - setWakeFrame(obj, UPDATE_SLEEP_FOREVER); - return; - } - - UnsignedInt now = TheGameLogic->getFrame(); - m_defectionDetectionStart = now; - m_defectionDetectionEnd = now + numFrames; - m_defectionDetectionFlashPhase = 0.0f; - m_doDefectorFX = withDefectorFX; - - setWakeFrame(obj, UPDATE_SLEEP_NONE); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ObjectDefectionHelper::crc( Xfer *xfer ) -{ - - // object helper crc - ObjectHelper::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info; - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ObjectDefectionHelper::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // object helper base class - ObjectHelper::xfer( xfer ); - - // detection start - xfer->xferUnsignedInt( &m_defectionDetectionStart ); - - // detection end - xfer->xferUnsignedInt( &m_defectionDetectionEnd ); - - // flash phase - xfer->xferReal( &m_defectionDetectionFlashPhase ); - - // do defector fx - xfer->xferBool( &m_doDefectorFX ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ObjectDefectionHelper::loadPostProcess() -{ - - // object helper base class - ObjectHelper::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectHelper.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectHelper.cpp deleted file mode 100644 index e217bb4cfb0..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectHelper.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectHelper.cpp ///////////////////////////////////////////////////////////////////////// -// Author: Colin Day, Steven Johnson, September 2002 -// Desc: Object helper module base class -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" -#include "Common/Xfer.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/ObjectHelper.h" - - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -ObjectHelper::~ObjectHelper() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void ObjectHelper::sleepUntil(UnsignedInt when) -{ - if( getObject()->getStatusBits().test( OBJECT_STATUS_DESTROYED ) ) - return; - - // note the setWakeFrame(NEVER) actually awakens immediately, since NEVER==0. - // when we get NEVER in this case, we really want to sleep forever. - // so just special case it. - UpdateSleepTime wakeDelay = (when == NEVER || when == FOREVER) ? - UPDATE_SLEEP_FOREVER : - UPDATE_SLEEP(when - TheGameLogic->getFrame()); - setWakeFrame(getObject(), wakeDelay); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ObjectHelper::crc( Xfer *xfer ) -{ - - // update module crc - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/* Xfer method - * Version Info: - * 1: Initial Version */ -// ------------------------------------------------------------------------------------------------ -void ObjectHelper::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // update module xfer - UpdateModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ObjectHelper::loadPostProcess() -{ - - // update module post process - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp deleted file mode 100644 index a7c6265be8b..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectRepulsorHelper.cpp ////////////////////////////////////////////////////////////////////// -// Author: Steven Johnson, December 2002 -// Desc: Repulsor helper -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/ObjectRepulsorHelper.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -ObjectRepulsorHelper::~ObjectRepulsorHelper() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime ObjectRepulsorHelper::update() -{ - // if we ever get here, clear this. - getObject()->clearStatus( MAKE_OBJECT_STATUS_MASK( OBJECT_STATUS_REPULSOR ) ); - - // then go back to sleep until we are forcibly awakened. - return UPDATE_SLEEP_FOREVER; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ObjectRepulsorHelper::crc( Xfer *xfer ) -{ - - // object helper crc - ObjectHelper::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info; - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ObjectRepulsorHelper::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // object helper base class - ObjectHelper::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ObjectRepulsorHelper::loadPostProcess() -{ - - // object helper base class - ObjectHelper::loadPostProcess(); - -} - diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp deleted file mode 100644 index 901da04112a..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectSMCHelper.cpp ////////////////////////////////////////////////////////////////////// -// Author: Colin Day, Steven Johnson, September 2002 -// Desc: SMC helper -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/ObjectSMCHelper.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -ObjectSMCHelper::~ObjectSMCHelper() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime ObjectSMCHelper::update() -{ - // if we ever get here, stop this. - getObject()->clearSpecialModelConditionStates(); - - // then go back to sleep until we are forcibly awakened. - return UPDATE_SLEEP_FOREVER; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ObjectSMCHelper::crc( Xfer *xfer ) -{ - - // object helper crc - ObjectHelper::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info; - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ObjectSMCHelper::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // object helper base class - ObjectHelper::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ObjectSMCHelper::loadPostProcess() -{ - - // object helper base class - ObjectHelper::loadPostProcess(); - -} - diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp deleted file mode 100644 index 1505de394d7..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectSMCHelper.cpp ////////////////////////////////////////////////////////////////////// -// Author: Colin Day, Steven Johnson, September 2002 -// Desc: Weapon status helper -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" -#include "Common/Xfer.h" -#include "GameLogic/Module/ObjectWeaponStatusHelper.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -ObjectWeaponStatusHelper::~ObjectWeaponStatusHelper() -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ObjectWeaponStatusHelper::crc( Xfer *xfer ) -{ - - // object helper crc - ObjectHelper::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info; - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ObjectWeaponStatusHelper::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // object helper base class - ObjectHelper::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ObjectWeaponStatusHelper::loadPostProcess() -{ - - // object helper base class - ObjectHelper::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp deleted file mode 100644 index db27e81bbda..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SpecialAbility.cpp ///////////////////////////////////////////////////////////// -// Author: Kris Morness, July 2002 -// Desc: This is the class that handles processing of any special attack from a unit. There are -// many different styles and rules for various attacks. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/SpecialAbility.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -SpecialAbility::SpecialAbility( Thing *thing, const ModuleData *moduleData ) - : SpecialPowerModule( thing, moduleData ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -SpecialAbility::~SpecialAbility() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void SpecialAbility::doSpecialPowerAtLocation( const Coord3D *loc, Real angle, UnsignedInt commandOptions ) -{ - if (getObject()->isDisabled()) - return; - - // sanity - if( loc == nullptr ) - return; - - // call the base class action cause we are *EXTENDING* functionality - SpecialPowerModule::doSpecialPowerAtLocation( loc, angle, commandOptions ); -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void SpecialAbility::doSpecialPowerAtObject( Object *obj, UnsignedInt commandOptions ) -{ - if (getObject()->isDisabled()) - return; - - if (!obj) - return; - - // call the base class action cause we are *EXTENDING* functionality - SpecialPowerModule::doSpecialPowerAtObject( obj, commandOptions ); -} - - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void SpecialAbility::doSpecialPower( UnsignedInt commandOptions ) -{ - if (getObject()->isDisabled()) - return; - - // call the base class action cause we are *EXTENDING* functionality - SpecialPowerModule::doSpecialPower( commandOptions ); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void SpecialAbility::crc( Xfer *xfer ) -{ - - // extend base class - SpecialPowerModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void SpecialAbility::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - SpecialPowerModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void SpecialAbility::loadPostProcess() -{ - - // extend base class - SpecialPowerModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp deleted file mode 100644 index a1bde14fe4c..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SpyVisionSpecialPower.cpp ///////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, September 2002 -// Desc: Special Power will spy on the vision of all enemy players. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/ContainModule.h" -#include "GameLogic/Module/SpyVisionSpecialPower.h" -#include "GameLogic/Module/SpyVisionUpdate.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -SpyVisionSpecialPowerModuleData::SpyVisionSpecialPowerModuleData() -{ - - m_baseDurationInFrames = 0; - m_bonusDurationPerCapturedInFrames = 0; - m_maxDurationInFrames = 0; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void SpyVisionSpecialPowerModuleData::buildFieldParse( MultiIniFieldParse &p ) -{ - SpecialPowerModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "BaseDuration", INI::parseDurationUnsignedInt, nullptr, offsetof( SpyVisionSpecialPowerModuleData, m_baseDurationInFrames ) }, - { "BonusDurationPerCaptured", INI::parseDurationUnsignedInt, nullptr, offsetof( SpyVisionSpecialPowerModuleData, m_bonusDurationPerCapturedInFrames ) }, - { "MaxDuration", INI::parseDurationUnsignedInt, nullptr, offsetof( SpyVisionSpecialPowerModuleData, m_maxDurationInFrames ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add( dataFieldParse ); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -SpyVisionSpecialPower::SpyVisionSpecialPower( Thing *thing, const ModuleData *moduleData ) - : SpecialPowerModule( thing, moduleData ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -SpyVisionSpecialPower::~SpyVisionSpecialPower() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void SpyVisionSpecialPower::doSpecialPower( UnsignedInt commandOptions ) -{ - if (getObject()->isDisabled()) - return; - - // call the base class action cause we are *EXTENDING* functionality - SpecialPowerModule::doSpecialPower( commandOptions ); - - - // get the source of this power - Object *source = getObject(); - - // get module data - const SpyVisionSpecialPowerModuleData *modData = getSpyVisionSpecialPowerModuleData(); - - // - // the SpyVision special power increases in range and duration of effect the more - // units we have captured within us - // - UnsignedInt duration = modData->m_baseDurationInFrames; - ContainModuleInterface *contain = source->getContain(); - if( contain ) - { - // for every captured unit we get a bonus - duration += contain->getContainCount() * modData->m_bonusDurationPerCapturedInFrames; - - // cap at the max - if( duration > modData->m_maxDurationInFrames ) - duration = modData->m_maxDurationInFrames; - } - - static const NameKeyType key_SpyVisionUpdate = NAMEKEY( "SpyVisionUpdate" ); - SpyVisionUpdate *update = (SpyVisionUpdate*)source->findUpdateModule( key_SpyVisionUpdate ); - if( !update ) - { - return; - } - - update->activateSpyVision( duration ); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void SpyVisionSpecialPower::crc( Xfer *xfer ) -{ - - // extend base class - SpecialPowerModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void SpyVisionSpecialPower::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - SpecialPowerModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void SpyVisionSpecialPower::loadPostProcess() -{ - - // extend base class - SpecialPowerModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp deleted file mode 100644 index dc83acdf5db..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp +++ /dev/null @@ -1,917 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: POWTruckAIUpdate.cpp ///////////////////////////////////////////////////////////////////// -// Author: Colin Day -// Desc: AI for the POW Truck -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ActionManager.h" -#include "Common/GlobalData.h" -#include "Common/Money.h" -#include "Common/Player.h" -#include "Common/ThingTemplate.h" -#include "GameClient/InGameUI.h" -#include "GameLogic/AIPathfind.h" -#include "GameLogic/Locomotor.h" -#include "GameLogic/Object.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/Module/AIUpdate.h" -#include "GameLogic/Module/OpenContain.h" -#include "GameLogic/Module/POWTruckAIUpdate.h" - -#ifdef ALLOW_SURRENDER - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC ///////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -POWTruckAIUpdateModuleData::POWTruckAIUpdateModuleData() -{ - - m_boredTimeInFrames = 0; - m_hangAroundPrisonDistance = 0; - -} - -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdateModuleData::buildFieldParse( MultiIniFieldParse &p ) -{ - AIUpdateModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "BoredTime", INI::parseDurationUnsignedInt, nullptr, offsetof( POWTruckAIUpdateModuleData, m_boredTimeInFrames ) }, - { "AtPrisonDistance", INI::parseReal, nullptr, offsetof( POWTruckAIUpdateModuleData, m_hangAroundPrisonDistance ) }, - { 0, 0, 0, 0 } - }; - - p.add( dataFieldParse ); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC ///////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -POWTruckAIUpdate::POWTruckAIUpdate( Thing *thing, const ModuleData *moduleData ) - : AIUpdateInterface( thing, moduleData ) -{ - - m_aiMode = AUTOMATIC; - m_currentTask = POW_TRUCK_TASK_WAITING; - m_targetID = INVALID_ID; - m_prisonID = INVALID_ID; - m_enteredWaitingFrame = 0; - m_lastFindFrame = 0; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -POWTruckAIUpdate::~POWTruckAIUpdate() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void POWTruckAIUpdate::onDelete() -{ - -} - -// ------------------------------------------------------------------------------------------------ -//------------------------------------------------------------------------------------------------- -void POWTruckAIUpdate::aiDoCommand( const AICommandParms *parms ) -{ - - if (!isAllowedToRespondToAiCommands(parms)) - return; - - // if the command is from a player, stop whatever we might be doing and accept the new command - if( parms->m_cmdSource == CMD_FROM_PLAYER ) - { - - // stop - aiIdle( CMD_FROM_AI ); - - // set our task to waiting - setTask( POW_TRUCK_TASK_WAITING ); - - } - - switch( parms->m_cmd ) - { - - // -------------------------------------------------------------------------------------------- - case AICMD_PICK_UP_PRISONER: - { - - privatePickUpPrisoner( parms->m_obj, parms->m_cmdSource ); - break; - - } - - // -------------------------------------------------------------------------------------------- - case AICMD_RETURN_PRISONERS: - { - - privateReturnPrisoners( parms->m_obj, parms->m_cmdSource ); - break; - - } - - // -------------------------------------------------------------------------------------------- - default: - { - - // call the default do command - AIUpdateInterface::aiDoCommand( parms ); - break; - - } - - } - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpdateSleepTime POWTruckAIUpdate::update() -{ - - // we are ultra accurate - if( getCurLocomotor() ) - getCurLocomotor()->setUltraAccurate( TRUE ); - - // extend the regular ai update module - UpdateSleepTime result; - result = AIUpdateInterface::update(); - - // being able to path through units makes the POW truck more effective - // but we're getting rid of this functionality (CBD 10-10-2002) -// setCanPathThroughUnits(true); - - // do our own logic - switch( m_currentTask ) - { - - case POW_TRUCK_TASK_WAITING: - updateWaiting(); - break; - case POW_TRUCK_TASK_FIND_TARGET: - updateFindTarget(); - break; - case POW_TRUCK_TASK_COLLECTING_TARGET: - updateCollectingTarget(); - break; - case POW_TRUCK_TASK_RETURNING_PRISONERS: - updateReturnPrisoners(); - break; - default: - DEBUG_CRASH(( "POWTruckAIUpdate::update - Unknown current task '%d'", m_currentTask )); - break; - - } - - return UPDATE_SLEEP_NONE; - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PROTECTED ////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -/** Set our current task */ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::setTask( POWTruckTask task, Object *taskObject ) -{ - POWTruckTask oldTask = m_currentTask; - - // sanity, POW_TRUCK_TASK_COLLECTING_TARGET and POW_TRUCK_TASK_RETURNING_PRISONERS require taskObject parameters - if( (task == POW_TRUCK_TASK_COLLECTING_TARGET || task == POW_TRUCK_TASK_RETURNING_PRISONERS) && - taskObject == nullptr ) - { - - DEBUG_CRASH(( "POWTruckAIUpdate::setTask - Illegal arguments" )); - setTask( POW_TRUCK_TASK_WAITING ); - return; - - } - - // when leaving the collecting target state, we need to do some bookkeeping - if( oldTask == POW_TRUCK_TASK_COLLECTING_TARGET ) - { - - // target cleanup - m_targetID = INVALID_ID; - - } - - // to be clean, when leaving the POW_TRUCK_TASK_RETURNING_PRISONERS state, clear out the prison ID we were watching - if( oldTask == POW_TRUCK_TASK_RETURNING_PRISONERS ) - m_prisonID = INVALID_ID; - - // we store IDs for some tasks - if( task == POW_TRUCK_TASK_COLLECTING_TARGET ) - { - - // save ID of our target - m_targetID = taskObject->getID(); - - // mark this target as slated for pickup - DEBUG_ASSERTCRASH( taskObject->getAIUpdateInterface(), ("POWTruckAIUpdate::setTask - '%s' has no ai module", - taskObject->getTemplate()->getName().str()) ); - - } - else if( task == POW_TRUCK_TASK_RETURNING_PRISONERS ) - { - - // save ID of the prison we're going to - m_prisonID = taskObject->getID(); - - } - else if( task == POW_TRUCK_TASK_WAITING ) - { - - // mark the frame and always go idle - m_enteredWaitingFrame = TheGameLogic->getFrame(); - - } - - // store the new current task - m_currentTask = task; - -} - -// ------------------------------------------------------------------------------------------------ -/** Set this unit into automatic or manual AI mode, when automatic the AI will look for - * prisoners, collect them, and bring them back automatically. When in manual, the - * player must direct the actions of the unit explicitly */ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::setAIMode( POWTruckAIMode mode ) -{ - - // save the mode - m_aiMode = mode; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::privatePickUpPrisoner( Object *prisoner, CommandSourceType cmdSource ) -{ - - // if 'prisoner' is not a valid target for picking up don't bother going forward - if( validateTarget( prisoner ) == FALSE ) - return; - - // - // we will now try to pick up this target ... if the command was from a player then - // we are no longer in automatic mode and will not return to automatic mode until - // the player issues the command for us to return back to prison - // - // CBD: Disabling this whole manual thing for now - // - if( FALSE && cmdSource == CMD_FROM_PLAYER ) - setAIMode( MANUAL ); - else - setAIMode( AUTOMATIC ); - - // set our task as picking up our target and save the target ID - setTask( POW_TRUCK_TASK_COLLECTING_TARGET, prisoner ); - - // move to the target - ignoreObstacle( prisoner ); - if( getCurLocomotor() ) - getCurLocomotor()->setUltraAccurate( TRUE ); - aiMoveToObject( prisoner, CMD_FROM_AI ); - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::privateReturnPrisoners( Object *prison, CommandSourceType cmdSource ) -{ - - // when receiving this command from the player, we will always enter AUTOMATIC ai mode - if( cmdSource == CMD_FROM_PLAYER ) - setAIMode( AUTOMATIC ); - - // if no prison is provided, find one if possible - if( prison == nullptr ) - prison = findBestPrison(); - - // still no prison, nothing to do - if( prison == nullptr ) - return; - - // set us into the return prisoners "state" - setTask( POW_TRUCK_TASK_RETURNING_PRISONERS, prison ); - - // dock with the prison - if( getCurLocomotor() ) - getCurLocomotor()->setUltraAccurate( TRUE ); - aiDock( prison, cmdSource ); - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::updateWaiting() -{ - - // if we're manual control ... do nothing - if( m_aiMode == MANUAL ) - return; - - // get our info - Object *us = getObject(); - AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateWaiting - '%s' has no ai", - us->getTemplate()->getName().str()) ); - - // - // if we're not idle we don't consider ourselves waiting ... we could be moving from - // a players command, or just about anything ... so just keep updating the m_enteredWaitingFrame - // to the current frame until we actually become idle and start to wait - // - if( ai->isIdle() == FALSE ) - m_enteredWaitingFrame = TheGameLogic->getFrame(); - - // get module data - const POWTruckAIUpdateModuleData *modData = getPOWTruckAIUpdateModuleData(); - - // if enough time has passed we're bored of waiting, try to find another target - if( TheGameLogic->getFrame() - m_enteredWaitingFrame > modData->m_boredTimeInFrames ) - setTask( POW_TRUCK_TASK_FIND_TARGET ); - -} - -static const UnsignedInt FIND_DELAY = LOGICFRAMES_PER_SECOND * 1; -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::updateFindTarget() -{ - - // we never find targets when in manual ai mode - DEBUG_ASSERTCRASH( m_aiMode != MANUAL, ("POWTruckAIUpdate::updateFindTarget - We shouldn't be here with a manual ai mode") ); - if( m_aiMode == MANUAL ) - return; - - // don't do this too often - if( TheGameLogic->getFrame() - m_lastFindFrame < FIND_DELAY ) - return; - - // we've now done a find - m_lastFindFrame = TheGameLogic->getFrame(); - - // get our info - Object *us = getObject(); - AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateFindTarget - '%s' has no ai", - us->getTemplate()->getName().str()) ); - - // if we're full we should return to prison - ContainModuleInterface *contain = us->getContain(); - if( contain && contain->getContainCount() == contain->getContainMax() ) - { - - doReturnPrisoners(); - return; - - } - - // find closest target not already targeted for pickup by another POW truck - Object *target = findBestTarget(); - - // if target exists, go get it - if( target ) - { - - // send the pickup command - ai->aiPickUpPrisoner( target, CMD_FROM_AI ); - - } - else - { - - // no target exists, if we have prisoners return them - if( contain->getContainCount() != 0 ) - doReturnPrisoners(); - else - doReturnToPrison( nullptr ); - - } - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::updateCollectingTarget() -{ - - // validate our target is still OK to collect - Object *target = TheGameLogic->findObjectByID( m_targetID ); - if( validateTarget( target ) == FALSE ) - { - - // find more prisoners or wait for player intervention - if( m_aiMode == AUTOMATIC ) - setTask( POW_TRUCK_TASK_FIND_TARGET ); - else - setTask( POW_TRUCK_TASK_WAITING ); - - return; - - } - - // we should never become idle while collecting a target, if we do, find a target - Object *us = getObject(); - AIUpdateInterface *ai = us->getAIUpdateInterface(); - if( ai->isIdle() ) - { - - if( m_aiMode == AUTOMATIC ) - setTask( POW_TRUCK_TASK_FIND_TARGET ); - else - setTask( POW_TRUCK_TASK_WAITING ); - - } - -/* - // - // when we're close to the target, we tell the target to start walking toward - // us ... if they're not idle we don't do this as they are already moving - // - Object *us = getObject(); - AIUpdateInterface *targetAI = target->getAIUpdateInterface(); - if( targetAI->isIdle() ) - { - - // are we close enough to tell them to start moving to us - Real distSq = pow( us->getGeometryInfo().getBoundingSphereRadius() * 2.0f, 2 ); - if( ThePartitionManager->getDistanceSquared( us, target, FROM_CENTER_2D ) <= distSq ) - { - - // tell them to start moving to us - targetAI->aiMoveToObject( us, CMD_FROM_AI ); - - } - - } -*/ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -struct PrisonerReturnData -{ - Object *source; ///< objects will be removed from source and put into dest - Object *dest; ///< objects will be removed from source and put into dest -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -static void putContainedInPrison( Object *obj, void *userData ) -{ - PrisonerReturnData *returnData = (PrisonerReturnData *)userData; - - // sanity - DEBUG_ASSERTCRASH( returnData != nullptr && returnData->source != nullptr && returnData->dest != nullptr, - ("putContainedInPrison: Invalid arguments") ); - - // take 'obj' out of the source - ContainModuleInterface *sourceContain = returnData->source->getContain(); - if( sourceContain ) - { - sourceContain->removeFromContain( obj ); - } - - // put 'obj' into dest - ContainModuleInterface *destContain = returnData->dest->getContain(); - if( destContain ) - { - destContain->addToContain( obj ); - } - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::updateReturnPrisoners() -{ - Object *us = getObject(); - AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateReturnPrisoners - '%s' has no AI", - us->getTemplate()->getName().str()) ); - - // get the prison we're returning to - Object *prison = TheGameLogic->findObjectByID( m_prisonID ); - - // prison has gone away, do this all over again - if( prison == nullptr ) - { - - doReturnPrisoners(); - return; - - } - - // we should not go idle, we should collide with the prison to return the prisoners - if( ai->isIdle() ) - doReturnPrisoners(); - -} - -// ------------------------------------------------------------------------------------------------ -/** Is the object 'target' a valid target for collection */ -// ------------------------------------------------------------------------------------------------ -Bool POWTruckAIUpdate::validateTarget( const Object *target ) -{ - - return TheActionManager->canPickUpPrisoner( getObject(), target, getLastCommandSource() ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Initiate a return prisoners contained in us to prison */ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::doReturnPrisoners() -{ - - // find the closest prison - Object *prison = findBestPrison(); - - // if no prison is available, nothing to do - if( prison == nullptr ) - { - - setTask( POW_TRUCK_TASK_WAITING ); - return; - - } - - // start the prisoner return process - Object *us = getObject(); - AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::doReturnPrisoners - '%s' has no AI", - us->getTemplate()->getName().str()) ); - ai->aiReturnPrisoners( prison, CMD_FROM_AI ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Initiate a return of our empty truck back near the closest prison */ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::doReturnToPrison( Object *prison ) -{ - - // - // the great thing about this logic is that there isn't a state to "return to prison", we - // just go into waiting, find a prison if we can, and tell the AI to move there - // - setTask( POW_TRUCK_TASK_WAITING ); - - // find the closest prison if one was not provided - if( prison == nullptr ) - prison = findBestPrison(); - - // if no prison found forget it - if( prison == nullptr ) - return; - - // get our info - Object *us = getObject(); - const POWTruckAIUpdateModuleData *modData = getPOWTruckAIUpdateModuleData(); - - // if we're close enough to it then just stay here - Real distSq = ThePartitionManager->getDistanceSquared( us, prison, FROM_CENTER_2D ); - if( distSq <= modData->m_hangAroundPrisonDistance * modData->m_hangAroundPrisonDistance ) - return; - - // dock us with the prison - aiDock( prison, CMD_FROM_AI ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Find the best prison for us to use given our current position */ -// ------------------------------------------------------------------------------------------------ -Object *POWTruckAIUpdate::findBestPrison() -{ - - ObjectID prisonID = getObject()->getProducerID(); - if( prisonID == INVALID_ID ) - return nullptr; - - // find prison object - Object *prison = TheGameLogic->findObjectByID( prisonID ); - - return prison; - -} - -// ------------------------------------------------------------------------------------------------ -/** Find the best prisoner for us to go pick up given our current situation */ -// ------------------------------------------------------------------------------------------------ -Object *POWTruckAIUpdate::findBestTarget() -{ - const Object *us = getObject(); - Player *player = us->getControllingPlayer(); - - // sanity - if( player == nullptr ) - return nullptr; - - // get our info - const AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::findBestTarget- '%s' has no AI", - us->getTemplate()->getName().str()) ); - - // scan all objects, there is no range - Object *other; - Real closestTargetDistSq = HUGE_DIST; - Object *closestTarget = nullptr; - for( other = TheGameLogic->getFirstObject(); other; other = other->getNextObject() ) - { - - // - // run this target through our validation scheme and don't pick it in the first - // place if it's not a valid target for us - // - if( validateTarget( other ) == FALSE ) - continue; - - // ignore targets that we cannot pathfind to as we will never be able to pick them up - if( isQuickPathAvailable( other->getPosition() ) == FALSE ) - continue; - - // is this target closer than the one we've found so far - Real distSq = ThePartitionManager->getDistanceSquared( us, other, FROM_CENTER_2D ); - if( closestTarget == nullptr || distSq < closestTargetDistSq ) - { - - // we must be able to pathfind to this target - if( TheAI->pathfinder()->quickDoesPathExist( ai->getLocomotorSet(), - us->getPosition(), - other->getPosition() ) == TRUE ) - { - - // this is our new closest target - closestTarget = other; - closestTargetDistSq = distSq; - - } - - } - - } - - return closestTarget; - -} - -// ------------------------------------------------------------------------------------------------ -/** We are choosing to pass a structure through the iterate function to unload the - * prisoners because it's more flexible in that, perhaps someday in the future, we - * could fail to add an object to the prison (maybe it's full or something), and in - * that case it's better to manually do actions each time a successful - * add happens rather than figure it out from before counts and after counts of the truck */ -// ------------------------------------------------------------------------------------------------ -struct PrisonUnloadData -{ - - Object *sourceTruck; - Object *destPrison; - UnsignedInt bounty; - -}; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -static void putPrisonersInPrison( Object *obj, void *userData ) -{ - PrisonUnloadData *prisonUnloadData = (PrisonUnloadData *)userData; - Object *prison = prisonUnloadData->destPrison; - - // sanity - DEBUG_ASSERTCRASH( prison, ("putPrisonersInPrison: null user data") ); - DEBUG_ASSERTCRASH( obj->getContainedBy() != nullptr, - ("putPrisonersInPrison: Prisoner '%s' is not contained by anything, it should be contained by a POW truck", - obj->getTemplate()->getName().str()) ); - - // extra super sanity, just so that we don't crash ... this is in the assert above - if( obj->getContainedBy() == nullptr ) - return; - - // take 'obj' out of the truck - ContainModuleInterface *sourceContain = obj->getContainedBy()->getContain(); - if( sourceContain ) - { - sourceContain->removeFromContain( obj ); - } - - // put 'obj' into 'prison' - ContainModuleInterface *destContain = prison->getContain(); - if( destContain ) - { - destContain->addToContain( obj ); - } - - // add up bounty for this prisoner - Player *prisonerOwningPlayer = obj->getControllingPlayer(); - prisonUnloadData->bounty += TheGlobalData->m_prisonBountyMultiplier * - obj->getTemplate()->calcCostToBuild( prisonerOwningPlayer ); - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::unloadPrisonersToPrison( Object *prison ) -{ - Object *us = getObject(); - - // sanity - if( prison == nullptr ) - return; - - // get contain modules - ContainModuleInterface *truckContain = us->getContain(); - - // sanity - DEBUG_ASSERTCRASH( prison->getContain(), ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain", - prison->getTemplate()->getName().str()) ); - DEBUG_ASSERTCRASH( prison->getContain()->asOpenContain(), - ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain", - prison->getTemplate()->getName().str()) ); - DEBUG_ASSERTCRASH( truckContain, ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain", - us->getTemplate()->getName().str()) ); - DEBUG_ASSERTCRASH( truckContain->asOpenContain(), - ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain", - us->getTemplate()->getName().str()) ); - - // put the prisoners in the prison - PrisonUnloadData prisonUnloadData; - prisonUnloadData.sourceTruck = us; - prisonUnloadData.destPrison = prison; - prisonUnloadData.bounty = 0; - truckContain->iterateContained( putPrisonersInPrison, &prisonUnloadData, FALSE ); - - // if the destination prison collects a bounty, award that to the player - if( prison->isKindOf( KINDOF_COLLECTS_PRISON_BOUNTY ) && - prisonUnloadData.bounty > 0 ) - { - Player *player = us->getControllingPlayer(); - - if( player ) - { - Money *money = player->getMoney(); - - if( money ) - { - - // deposit the money - money->deposit( prisonUnloadData.bounty ); - player->getScoreKeeper()->addMoneyEarned( prisonUnloadData.bounty ); - - // display text above the building - Color moneyColor = TheGlobalData->m_prisonBountyTextColor; - UnicodeString moneyString; - Coord3D pos = *prison->getPosition(); - - pos.z += prison->getGeometryInfo().getMaxHeightAbovePosition(); - moneyString.format( TheGameText->fetch( "GUI:AddCash" ), prisonUnloadData.bounty ); - TheInGameUI->addFloatingText( moneyString, &pos, moneyColor ); - - } - - } - - } - - // set our state to waiting and become idle - setTask( POW_TRUCK_TASK_WAITING ); - -} - -// ------------------------------------------------------------------------------------------------ -/** We have arrived at a prisoner to load into us ... do it */ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::loadPrisoner( Object *prisoner ) -{ - Object *us = getObject(); - - // sanity - if( prisoner == nullptr ) - return; - - // validate that we can load this prisoner - if( validateTarget( prisoner ) == FALSE ) - return; - - // sanity check ... make sure we have room - ContainModuleInterface *contain = us->getContain(); - if( contain && contain->getContainCount() == contain->getContainMax() ) - { - - // we're full ... return to prison - doReturnPrisoners(); - return; - - } - - // add object to our containment - contain->addToContain( prisoner ); - - // - // removed the surrendered status of these prisoners to false, that way if the truck - // is killed, the prison blows up releasing all the prisoners, whatever, they will - // behave as normal - // - AIUpdateInterface *prisonerAI = prisoner->getAIUpdateInterface(); - if( prisonerAI ) - prisonerAI->setSurrendered( nullptr, FALSE ); - - // done adding prisoner, for automatic AI find another target, for manual just wait - if( m_aiMode == AUTOMATIC ) - setTask( POW_TRUCK_TASK_FIND_TARGET ); - else - setTask( POW_TRUCK_TASK_WAITING ); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::crc( Xfer *xfer ) -{ - // extend base class - AIUpdateInterface::crc(xfer); -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::xfer( Xfer *xfer ) -{ - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - AIUpdateInterface::xfer(xfer); - - xfer->xferUser(&m_aiMode, sizeof(m_aiMode)); - xfer->xferUser(&m_currentTask, sizeof(m_currentTask)); - xfer->xferObjectID(&m_targetID); - xfer->xferObjectID(&m_prisonID); - xfer->xferUnsignedInt(&m_enteredWaitingFrame); - xfer->xferUnsignedInt(&m_lastFindFrame); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void POWTruckAIUpdate::loadPostProcess() -{ - // extend base class - AIUpdateInterface::loadPostProcess(); -} - -#endif diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp deleted file mode 100644 index 7c09ab4b574..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp +++ /dev/null @@ -1,416 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RailedTransportAIUpdate.cpp ////////////////////////////////////////////////////////////// -// Author: Colin Day, August 2002 -// Desc: Railed Transport AI -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ThingTemplate.h" -#include "Common/GameState.h" -#include "GameLogic/Locomotor.h" -#include "GameLogic/Module/RailedTransportAIUpdate.h" -#include "GameLogic/Module/RailedTransportDockUpdate.h" -#include "GameLogic/Object.h" - -// TYPES ////////////////////////////////////////////////////////////////////////////////////////// -static const Int INVALID_PATH = -1; - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -RailedTransportAIUpdateModuleData::RailedTransportAIUpdateModuleData() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void RailedTransportAIUpdateModuleData::buildFieldParse( MultiIniFieldParse &p ) -{ - AIUpdateModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "PathPrefixName", INI::parseAsciiString, nullptr, offsetof( RailedTransportAIUpdateModuleData, m_pathPrefixName ) }, - { nullptr, nullptr, nullptr, 0 } - }; - - p.add( dataFieldParse ); - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -RailedTransportAIUpdate::RailedTransportAIUpdate( Thing *thing, const ModuleData *moduleData ) - : AIUpdateInterface( thing, moduleData ) -{ - - m_inTransit = FALSE; - for( Int i = 0; i < MAX_WAYPOINT_PATHS; ++i ) - { - - m_path[ i ].startWaypointID = 0; - m_path[ i ].endWaypointID = 0; - - } - m_numPaths = 0; - m_currentPath = INVALID_PATH; - m_waypointDataLoaded = FALSE; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -RailedTransportAIUpdate::~RailedTransportAIUpdate() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void RailedTransportAIUpdate::loadWaypointData() -{ - const RailedTransportAIUpdateModuleData *modData = getRailedTransportAIUpdateModuleData(); - - // find all the possible waypoint paths we can use - Waypoint *start, *end; - AsciiString name; - for( Int i = 0; i < MAX_WAYPOINT_PATHS; ++i ) - { - - // find start waypoint - name.format( "%sStart%02d", modData->m_pathPrefixName.str(), i + 1 ); - start = TheTerrainLogic->getWaypointByName( name ); - - // find end waypoint - name.format( "%sEnd%02d", modData->m_pathPrefixName.str(), i + 1 ); - end = TheTerrainLogic->getWaypointByName( name ); - - // if we have a start and an end, we have a valid path - if( start && end ) - { - - m_path[ i ].startWaypointID = start->getID(); - m_path[ i ].endWaypointID = end->getID(); - m_numPaths++; - - } - - } - - // waypoint data is loaded - m_waypointDataLoaded = TRUE; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void RailedTransportAIUpdate::pickAndMoveToInitialLocation() -{ - Object *us = getObject(); - const Coord3D *ourPos = us->getPosition(); - - // select the path with the closest ending waypoint to our location - Waypoint *waypoint, *closestEndWaypoint = nullptr; - Int closestPath = INVALID_PATH; - Real closestDist = 99999999.9f; - for( Int i = 0; i < m_numPaths; ++i ) - { - - // get this waypoint - waypoint = TheTerrainLogic->getWaypointByID( m_path[ i ].endWaypointID ); - if( waypoint ) - { - Coord3D v; - - // vector from us to waypoint - v.x = waypoint->getLocation()->x - ourPos->x; - v.y = waypoint->getLocation()->y - ourPos->y; - v.z = waypoint->getLocation()->z - ourPos->z; - - // what is the distance - Real dist = v.length(); - - // if this distance is smaller, use this one - if( dist < closestDist ) - { - - closestDist = dist; - closestPath = i; - closestEndWaypoint = waypoint; - - } - - } - - } - - // a path must have been found - DEBUG_ASSERTCRASH( closestPath != INVALID_PATH, - ("No suitable starting waypoint path could be found for '%s'", - us->getTemplate()->getName().str()) ); - - // follow the waypoint path to its destination end point - aiFollowWaypointPath( closestEndWaypoint, CMD_FROM_AI ); - - // this is now our current path - m_currentPath = closestPath; - - // we are now "in transit" - setInTransit( TRUE ); - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime RailedTransportAIUpdate::update() -{ - Object *us = getObject(); - - // load the waypoint data if not loaded - if( m_waypointDataLoaded == FALSE ) - loadWaypointData(); - - // extend base class - UpdateSleepTime result; - result = AIUpdateInterface::update(); - - // railed transports move ultra accurate like - Locomotor *currentLocomotor = getCurLocomotor(); - if( currentLocomotor ) - currentLocomotor->setUltraAccurate( TRUE ); - - // - // if we have no current path selected pick one and move to the end waypoint of that - // path. this will set us up in an initial position at the end of the closest path - // so that stuff can be loaded into us - // - if( m_currentPath == INVALID_PATH && m_numPaths > 0 ) - pickAndMoveToInitialLocation(); - - // - // if we're in transit, see if we're close enough to the destination waypoint to be - // considered as "there" and open up the dock - // - if( m_inTransit ) - { - - // sanity - DEBUG_ASSERTCRASH( m_currentPath != INVALID_PATH, - ("RailedTransportAIUpdate: Invalid current path '%s'", m_currentPath) ); - - // get our target waypoint - Waypoint *waypoint = TheTerrainLogic->getWaypointByID( m_path[ m_currentPath ].endWaypointID ); - - // sanity - DEBUG_ASSERTCRASH( waypoint, ("RailedTransportAIUpdate: Invalid target waypoint") ); - - if (waypoint) - { - // how far away are we from the target waypoint - const Coord3D *start = us->getPosition(); - const Coord3D *end = waypoint->getLocation(); - Coord3D v; - v.x = end->x - start->x; - v.y = end->y - start->y; - v.z = end->z - start->z; - Real dist = v.length(); - if( dist <= 5.0f || isIdle() ) - { - - // we are no longer in transit - setInTransit( FALSE ); - - } - } - else - { - setInTransit( FALSE ); - } - - } - - return UPDATE_SLEEP_NONE; - -} - -// ------------------------------------------------------------------------------------------------ -//------------------------------------------------------------------------------------------------- -void RailedTransportAIUpdate::aiDoCommand( const AICommandParms *parms ) -{ - - // if not allowed to respond to any command get out of here - if( isAllowedToRespondToAiCommands(parms) == FALSE ) - return; - - // we ignore all commands from the player except the one to start a transit and to unload - if( parms->m_cmdSource == CMD_FROM_PLAYER && - parms->m_cmd != AICMD_EXECUTE_RAILED_TRANSPORT && - parms->m_cmd != AICMD_EVACUATE ) - return; - - // call the default do command - AIUpdateInterface::aiDoCommand( parms ); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// PRIVATE //////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void RailedTransportAIUpdate::setInTransit( Bool inTransit ) -{ - Object *us = getObject(); - DockUpdateInterface *dui = us->getDockUpdateInterface(); - - // open up the dock - if( dui ) - dui->setDockOpen( !inTransit ); - - // no longer in transit - m_inTransit = inTransit; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void RailedTransportAIUpdate::privateExecuteRailedTransport( CommandSourceType cmdSource ) -{ - Object *us = getObject(); - - // - // find us our railed dock interface, note that we MUST go through the modules here because - // if we just call the method getReailedTransportDockUpdateInterface, it will execute - // the method for *THIS AI UPDATE MODULE* which of course is not our dock update - // - RailedTransportDockUpdateInterface *rtdui = nullptr; - for( BehaviorModule **u = us->getBehaviorModules(); *u; ++u ) - if( (rtdui = (*u)->getRailedTransportDockUpdateInterface()) != nullptr ) - break; - - // if we've in the process of loading or unloading anything we can't do a transport sequence - if( rtdui == nullptr || rtdui->isLoadingOrUnloading() ) - return; - - // pick the next path - if( ++m_currentPath >= m_numPaths ) - m_currentPath = 0; - - // find the start waypoint for our current path - Waypoint *startWaypoint = TheTerrainLogic->getWaypointByID( m_path[ m_currentPath ].startWaypointID ); - DEBUG_ASSERTCRASH( startWaypoint, ("RailedTransportAIUpdate: Start waypoint not found") ); - - // follow this waypoint path - aiFollowWaypointPath( startWaypoint, CMD_FROM_AI ); - - // we are now in transit - setInTransit( TRUE ); - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -void RailedTransportAIUpdate::privateEvacuate( Int exposeStealthUnits, CommandSourceType cmdSource ) -{ - Object *us = getObject(); - - // - // find us our railed dock interface, note that we MUST go through the modules here because - // if we just call the method getReailedTransportDockUpdateInterface, it will execute - // the method for *THIS AI UPDATE MODULE* which of course is not our dock update - // - RailedTransportDockUpdateInterface *rtdui = nullptr; - for( BehaviorModule **u = us->getBehaviorModules(); *u; ++u ) - if( (rtdui = (*u)->getRailedTransportDockUpdateInterface()) != nullptr ) - break; - - // sanity - if( rtdui == nullptr ) - return; - - // can't unload when in transit - if( m_inTransit == TRUE ) - return; - - // cannot evacuate when we're loading or unloading anything - if( rtdui->isLoadingOrUnloading() ) - return; - - // start the manual undocking process - rtdui->unloadAll(); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void RailedTransportAIUpdate::crc( Xfer *xfer ) -{ - // extend base class - AIUpdateInterface::crc(xfer); -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void RailedTransportAIUpdate::xfer( Xfer *xfer ) -{ - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - AIUpdateInterface::xfer(xfer); - - xfer->xferBool(&m_inTransit); - xfer->xferInt(&m_numPaths); - if (m_numPaths > MAX_WAYPOINT_PATHS) { - DEBUG_CRASH(("m_numPaths %d exceeds limit %d.", m_numPaths, MAX_WAYPOINT_PATHS)); - throw SC_INVALID_DATA; - } - Int i; - for (i=0; ixferUnsignedInt(&m_path[i].startWaypointID); - xfer->xferUnsignedInt(&m_path[i].endWaypointID); - } - xfer->xferInt(&m_currentPath); - xfer->xferBool(&m_waypointDataLoaded); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void RailedTransportAIUpdate::loadPostProcess() -{ - // extend base class - AIUpdateInterface::loadPostProcess(); -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp deleted file mode 100644 index 3eebfcf717d..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// WanderAIUpdate.cpp ////////// -// Will give self random move commands -// Author: Graham Smallwood, April 2002 - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/RandomValue.h" -#include "GameLogic/Module/WanderAIUpdate.h" -#include "GameLogic/Object.h" - -//------------------------------------------------------------------------------------------------- -AIStateMachine* WanderAIUpdate::makeStateMachine() -{ - return newInstance(AIStateMachine)( getObject(), "WanderAIUpdateMachine"); -} - -//------------------------------------------------------------------------------------------------- -WanderAIUpdate::WanderAIUpdate( Thing *thing, const ModuleData* moduleData ) : AIUpdateInterface( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -WanderAIUpdate::~WanderAIUpdate() -{ - -} - -//------------------------------------------------------------------------------------------------- -UpdateSleepTime WanderAIUpdate::update() -{ - // If I'm standing still, move somewhere - if (isIdle()) - { - Coord3D dest = *(getObject()->getPosition()); - dest.x += GameLogicRandomValue( 5, 50 ); - dest.y += GameLogicRandomValue( 5, 50 ); - aiMoveToPosition( &dest, CMD_FROM_AI ); - } - - // extend - /*UpdateSleepTime ret =*/ AIUpdateInterface::update(); - //return (mine < ret) ? mine : ret; - /// @todo srj -- someday, make sleepy. for now, must not sleep. - return UPDATE_SLEEP_NONE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void WanderAIUpdate::crc( Xfer *xfer ) -{ - // extend base class - AIUpdateInterface::crc(xfer); -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void WanderAIUpdate::xfer( Xfer *xfer ) -{ - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - AIUpdateInterface::xfer(xfer); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void WanderAIUpdate::loadPostProcess() -{ - // extend base class - AIUpdateInterface::loadPostProcess(); -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/CheckpointUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/CheckpointUpdate.cpp deleted file mode 100644 index 24be8fecb10..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/CheckpointUpdate.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CheckpointUpdate.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Mark Lorenzen, August 2002 -// Desc: Opens gate when (ally near && ( ! enemy near) ) -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/PerfTimer.h" -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameLogic/Module/CheckpointUpdate.h" -#include "GameLogic/Object.h" -#include "GameClient/Drawable.h" -#include "GameLogic/AI.h" -#include "GameLogic/Module/AIUpdate.h" - -//------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -CheckpointUpdate::CheckpointUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ), -m_allyNear(false), -m_enemyNear(false), -m_enemyScanDelay(0), -m_maxMinorRadius(0) -{ - m_maxMinorRadius = getObject()->getGeometryInfo().getMinorRadius(); - - // bias a random amount so everyone doesn't spike at once - m_enemyScanDelay += GameLogicRandomValue(0, getCheckpointUpdateModuleData()->m_enemyScanDelayTime); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -CheckpointUpdate::~CheckpointUpdate() -{ -} - -//------------------------------------------------------------------------------------------------- -/** - * Look around us for enemies. - */ -void CheckpointUpdate::checkForAlliesAndEnemies() -{ - // periodic enemy checks - if (m_enemyScanDelay == 0 || TRUE) - { - m_enemyScanDelay = getCheckpointUpdateModuleData()->m_enemyScanDelayTime; - - // Kind of weird, but we have to set the geometry extents to the max extent - //before checking for nearest enemies and allies, or else the stretch reaction - //to finding one will oscillate states open->closed->open... - Object *obj = getObject(); - GeometryInfo geom = obj->getGeometryInfo(); - Real restoreSpecialRadius = geom.getMinorRadius(); - geom.setMinorRadius( m_maxMinorRadius ); - obj->setGeometryInfo( geom ); - - Object *enemy, *ally = nullptr; - Real visionRange = obj->getVisionRange(); - - enemy = TheAI->findClosestEnemy( obj, visionRange, 0 ); - m_enemyNear = (enemy != nullptr); - - ally = TheAI->findClosestAlly( obj, visionRange, 0 ); - m_allyNear = (ally != nullptr); - - // here we restore the radius so that other units can path past the open gate - geom.setMinorRadius( restoreSpecialRadius ); - obj->setGeometryInfo( geom ); - - } - else - { - --m_enemyScanDelay; - } -} - -//------------------------------------------------------------------------------------------------- -///< Sit around until an enemy gets near. -//------------------------------------------------------------------------------------------------- -UpdateSleepTime CheckpointUpdate::update() -{ -/// @todo srj use SLEEPY_UPDATE here - - Bool wasAnAlly = m_allyNear; - Bool wasAnEnemy = m_enemyNear; - - checkForAlliesAndEnemies(); - - Bool change = ( (wasAnAlly != m_allyNear) || (wasAnEnemy != m_enemyNear) ); - Bool open = ( ( ! m_enemyNear) && m_allyNear ); - Object *obj = getObject(); - Drawable *draw = obj->getDrawable(); - - if ( draw ) - { - if ( change ) - { - if ( open ) - { - // change the state of the art to open the door! - if( draw ) - { - /// @todo srj -- for now, this assumes at most one door - draw->clearAndSetModelConditionState( MODELCONDITION_DOOR_1_CLOSING, MODELCONDITION_DOOR_1_OPENING ); - } - } - else //closed, then - { - // change the state of the art to close the door! - if( draw ) - { - /// @todo srj -- for now, this assumes at most one door - draw->clearAndSetModelConditionState( MODELCONDITION_DOOR_1_OPENING, MODELCONDITION_DOOR_1_CLOSING ); - } - } - - } - - GeometryInfo geom = obj->getGeometryInfo(); - - /// @todo ask steven about the distance covered always being zero - // Real animScrubScalar = draw->getAnimationScrubScalar(); - // geom.setMinorRadius( m_maxMinorRadius * animScrubScalar ); - - // THis method is more accidental than above, but it works for an unimportant thing like checkpoint - Real radius = geom.getMinorRadius(); - - if ( open ) - { - if ( radius > 0 ) geom.setMinorRadius( radius - 0.333f ); - } - else //closed - { - if ( radius < m_maxMinorRadius ) geom.setMinorRadius( radius + 0.333f ); - } - - - obj->setGeometryInfo( geom ); - - } - - return UPDATE_SLEEP_NONE; - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void CheckpointUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void CheckpointUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // enemy near - xfer->xferBool( &m_enemyNear ); - - // ally near - xfer->xferBool( &m_allyNear ); - - // max minor radius - xfer->xferReal( &m_maxMinorRadius ); - - // enemy scan delay - xfer->xferUnsignedInt( &m_enemyScanDelay ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void CheckpointUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp deleted file mode 100644 index 8a23910d7d3..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp +++ /dev/null @@ -1,371 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CleanupHazardUpdate.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, August 2002 -// Desc: Update module to handle independent targeting of hazards to cleanup. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#define DEFINE_WEAPONSLOTTYPE_NAMES - -#include "Common/RandomValue.h" -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/Object.h" -#include "GameLogic/ObjectIter.h" -#include "GameLogic/Module/CleanupHazardUpdate.h" -#include "GameLogic/Module/PhysicsUpdate.h" -#include "GameLogic/Weapon.h" -#include "GameLogic/WeaponSet.h" -#include "GameLogic/Module/AIUpdate.h" - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -CleanupHazardUpdateModuleData::CleanupHazardUpdateModuleData() -{ - m_weaponSlot = PRIMARY_WEAPON; - m_scanFrames = 0; - m_scanRange = 0.0f; -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void CleanupHazardUpdateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - ModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "WeaponSlot", INI::parseLookupList, TheWeaponSlotTypeNamesLookupList, offsetof( CleanupHazardUpdateModuleData, m_weaponSlot ) }, - { "ScanRate", INI::parseDurationUnsignedInt, nullptr, offsetof( CleanupHazardUpdateModuleData, m_scanFrames ) }, - { "ScanRange", INI::parseReal, nullptr, offsetof( CleanupHazardUpdateModuleData, m_scanRange ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -CleanupHazardUpdate::CleanupHazardUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - m_bestTargetID = INVALID_ID; - m_nextScanFrames = 0; - m_nextShotAvailableInFrames = 0; - m_inRange = false; - m_weaponTemplate = nullptr; - m_moveRange = 0.0f; - m_pos.zero(); - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -CleanupHazardUpdate::~CleanupHazardUpdate() -{ - -} - - -//------------------------------------------------------------------------------------------------- -void CleanupHazardUpdate::onObjectCreated() -{ - const CleanupHazardUpdateModuleData *data = getCleanupHazardUpdateModuleData(); - Object *self = getObject(); - - //Make sure we have a weapon template - self->setWeaponSetFlag( WEAPONSET_VETERAN ); - Weapon *weapon = self->getWeaponInWeaponSlot( data->m_weaponSlot ); - if( !weapon ) - { - DEBUG_CRASH( ("CleanupHazardUpdate for %s doesn't have a valid weapon template", - getObject()->getTemplate()->getName().str() ) ); - return; - } - m_weaponTemplate = weapon->getTemplate(); - - //Make sure our firing range is smaller than the scan range. - WeaponBonus bonus; - bonus.clear(); - Real attackRange = m_weaponTemplate->getAttackRange( bonus ); - if( data->m_scanRange <= attackRange ) - { - DEBUG_CRASH( ("CleanupHazardUpdate for %s requires the scan range (%.1f) being larger than the firing range (%.1f)", - getObject()->getTemplate()->getName().str(), data->m_scanRange, attackRange ) ); - } -} - -//------------------------------------------------------------------------------------------------- -/** The update callback. */ -//------------------------------------------------------------------------------------------------- -UpdateSleepTime CleanupHazardUpdate::update() -{ -/// @todo srj use SLEEPY_UPDATE here - const CleanupHazardUpdateModuleData *data = getCleanupHazardUpdateModuleData(); - Object *obj = getObject(); - - //Make sure we are "busy" for scripting purposes if the unit is cleaning up an area. - if( m_moveRange > 0.0f ) - { - //Means we are cleaning up an AREA, not just things immediately in range. - AIUpdateInterface *ai = obj->getAI(); - if( ai ) - { - if( ai->isIdle() ) - { - //Keep him busy even though he's not moving -- he might be cleaning up. - ai->aiBusy( CMD_FROM_AI ); - } - else if( ai->getLastCommandSource() != CMD_FROM_AI ) - { - //Either the player or a script gave a NEW order so abandon the cleanup area cause. - m_moveRange = 0.0f; - return UPDATE_SLEEP_NONE; - } - } - } - - //Optimized firing at acquired target - if( m_nextScanFrames > 0 ) - { - m_nextScanFrames--; - fireWhenReady(); //Only happens if something is tracked. - return UPDATE_SLEEP_NONE; - } - m_nextScanFrames = data->m_scanFrames; - - //Periodic scanning (expensive) - if( scanClosestTarget() ) - { - //1 frame can make a big difference so fire ASAP! - fireWhenReady(); - } - else if( m_moveRange ) - { - //There's nothing nearby, so if we are cleaning up an area versus hazards - //immediately in range, set the AI to idle so it can advance to the next script! - AIUpdateInterface *ai = obj->getAI(); - if( ai && (ai->isIdle() || ai->isBusy()) ) - { - Real fDist = sqrt( ThePartitionManager->getDistanceSquared( obj, &m_pos, FROM_CENTER_2D ) ); - if( fDist < 25.0f ) - { - //Abort clean area because there's nothing left to clean! - m_moveRange = 0.0f; - } - else - { - //Abort clean area AFTER we move back to our initial position! - ai->aiMoveToPosition( &m_pos, CMD_FROM_AI ); - } - } - } - return UPDATE_SLEEP_NONE; -} - -//------------------------------------------------------------------------------------------------- -void CleanupHazardUpdate::fireWhenReady() -{ - const CleanupHazardUpdateModuleData *data = getCleanupHazardUpdateModuleData(); - Object *self = getObject(); - - //Track our target (this code prevents the object from moving beyond range) - //If we are ordered to clean an area, then range doesn't matter because - //we allow the unit to move to the area. - Object *target = TheGameLogic->findObjectByID( m_bestTargetID ); - if( target && m_moveRange == 0.0f ) - { - WeaponBonus bonus; - bonus.clear(); - Real fireRange = m_weaponTemplate->getAttackRange( bonus ); - Object *me = getObject(); - Real fDist = sqrt( ThePartitionManager->getDistanceSquared( me, target, FROM_CENTER_2D ) ); - if( fDist < fireRange ) - { - //We are currently in range! - m_inRange = true; - } - else - { - if( m_inRange ) - { - //We were in range last frame, but the target has moved out of firing range, so - //re-evaluate by forcing a new scan. - m_nextScanFrames = GameLogicRandomValue( 0, 3 ); - m_bestTargetID = INVALID_ID; - if( !m_nextScanFrames ) - { - scanClosestTarget(); - m_nextScanFrames = data->m_scanFrames; - target = nullptr; //Set target to nullptr so we don't shoot at it (might be out of range) - } - } - else - { - //Not in range - m_inRange = false; - } - } - } - - if( m_nextShotAvailableInFrames > 0 ) - { - //We can't fire this frame. - m_nextShotAvailableInFrames--; - return; - } - - //Fire control! - if( target ) - { - AIUpdateInterface *ai = self->getAI(); - if( ai ) - { - if( ai->isIdle() || ai->isBusy() ) - { - // lock it just till the weapon is empty or the attack is "done" - self->setWeaponLock( data->m_weaponSlot, LOCKED_TEMPORARILY ); - ai->aiAttackObject( target, NO_MAX_SHOTS_LIMIT, CMD_FROM_AI ); - } - } - } -} - -//------------------------------------------------------------------------------------------------- -Object* CleanupHazardUpdate::scanClosestTarget() -{ - const CleanupHazardUpdateModuleData *data = getCleanupHazardUpdateModuleData(); - Object *me = getObject(); - Object *bestTargetInRange = nullptr; - m_bestTargetID = INVALID_ID; - - PartitionFilterAcceptByKindOf kindFilter(MAKE_KINDOF_MASK(KINDOF_CLEANUP_HAZARD), KINDOFMASK_NONE); - PartitionFilterSameMapStatus filterMapStatus(getObject()); - PartitionFilter* filters[] = { &kindFilter, &filterMapStatus, nullptr }; - - if( m_moveRange > 0.0f ) - { - //Look for targets around the target position only (but add scan range and move range). - //This case only happens when we are performing a cleanup area command. - bestTargetInRange = ThePartitionManager->getClosestObject( &m_pos, data->m_scanRange + m_moveRange, FROM_CENTER_2D, filters ); - } - else - { - //Look for targets near me -- passive default. - bestTargetInRange = ThePartitionManager->getClosestObject( me->getPosition(), data->m_scanRange, FROM_CENTER_2D, filters ); - } - - if( bestTargetInRange ) - { - m_bestTargetID = bestTargetInRange->getID(); - } - return bestTargetInRange; -} - -//------------------------------------------------------------------------------------------------- -//This allows the unit to cleanup an area until clean, then the AI goes idle. -//------------------------------------------------------------------------------------------------- -void CleanupHazardUpdate::setCleanupAreaParameters( const Coord3D *pos, Real range ) -{ - Object *obj = getObject(); - AIUpdateInterface *ai = obj->getAI(); - - //Setting the move range triggers that passive conditions for it to be allowed to move - //from the specified position. - m_moveRange = range; - m_pos = *pos; - - if( ai ) - { - //CMD_FROM_AI important because it'll abort when other types are used -- like if a player - //or script orders the unit to do something else, we need a way to cancel this passive - //situation. - ai->aiMoveToPosition( pos, CMD_FROM_AI ); - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void CleanupHazardUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void CleanupHazardUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // best target id - xfer->xferObjectID( &m_bestTargetID ); - - // in range - xfer->xferBool( &m_inRange ); - - // next scan frames - xfer->xferInt( &m_nextScanFrames ); - - // next shot available in frames - xfer->xferInt( &m_nextShotAvailableInFrames ); - - // don't need to save weapon template, it's retrieved onObjectCreated - // const WeaponTemplate *m_weaponTemplate; - - // pos - xfer->xferCoord3D( &m_pos ); - - // move range - xfer->xferReal( &m_moveRange ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void CleanupHazardUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DeletionUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DeletionUpdate.cpp deleted file mode 100644 index 1066509132d..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DeletionUpdate.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DeletionUpdate.cpp ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, August 2002 -// Desc: Update that will count down a lifetime and destroy object when it reaches zero -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" -#include "Common/RandomValue.h" -#include "Common/Xfer.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/DeletionUpdate.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -DeletionUpdate::DeletionUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - m_dieFrame = 0; - const DeletionUpdateModuleData* d = getDeletionUpdateModuleData(); - UnsignedInt delay = calcSleepDelay(d->m_minFrames, d->m_maxFrames); - setWakeFrame(getObject(), UPDATE_SLEEP(delay)); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -DeletionUpdate::~DeletionUpdate() -{ -} - - -//#define CRISS_CROSS_GEOMETRY - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void DeletionUpdate::setLifetimeRange( UnsignedInt minFrames, UnsignedInt maxFrames ) -{ - -#if defined RTS_DEBUG && defined CRISS_CROSS_GEOMETRY - setWakeFrame(getObject(), UPDATE_SLEEP(2)); -#else - UnsignedInt delay = calcSleepDelay(minFrames, maxFrames); - setWakeFrame(getObject(), UPDATE_SLEEP(delay)); -#endif -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UnsignedInt DeletionUpdate::calcSleepDelay(UnsignedInt minFrames, UnsignedInt maxFrames) -{ - UnsignedInt delay = GameLogicRandomValue( minFrames, maxFrames ); - if (delay < 1) delay = 1; - m_dieFrame = TheGameLogic->getFrame() + delay; - return delay; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpdateSleepTime DeletionUpdate::update() -{ - // Destroy (NOT kill) if time is up -#if defined RTS_DEBUG && defined CRISS_CROSS_GEOMETRY - Object *obj = getObject(); - if (obj) - { - GeometryInfo geom = geom=obj->getGeometryInfo(); - geom.setMajorRadius(obj->getGeometryInfo().getMinorRadius());// CRIS - geom.setMinorRadius(obj->getGeometryInfo().getMajorRadius());// CROSS - obj->setGeometryInfo(geom); - } - - if (TheGameLogic->getFrame() > m_dieFrame) - { - TheGameLogic->destroyObject( getObject() ); - return UPDATE_SLEEP_FOREVER; - } - - - return UPDATE_SLEEP(2); -#else - TheGameLogic->destroyObject( getObject() ); - return UPDATE_SLEEP_FOREVER; -#endif -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void DeletionUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void DeletionUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // die frame - xfer->xferUnsignedInt( &m_dieFrame ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void DeletionUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp deleted file mode 100644 index 0f8c8ec1c1d..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PrisonDockUpdate.cpp ///////////////////////////////////////////////////////////////////// -// Author: Colin Day, August 2002 -// Desc: Dock update for prison structures -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/ContainModule.h" -#include "GameLogic/Module/POWTruckAIUpdate.h" -#include "GameLogic/Module/PrisonDockUpdate.h" - -#ifdef ALLOW_SURRENDER - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -PrisonDockUpdate::PrisonDockUpdate( Thing *thing, const ModuleData* moduleData ) - : DockUpdate( thing, moduleData ) -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -PrisonDockUpdate::~PrisonDockUpdate() -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** Do the action while docked - * Return TRUE to continue the docking process - * Return FALSE to complete the dockin process */ -// ------------------------------------------------------------------------------------------------ -Bool PrisonDockUpdate::action( Object *docker, Object *drone ) -{ - - // sanity - if( docker == nullptr ) - return FALSE; - - // if docker has no contents, do nothing and stop the dock process - ContainModuleInterface *contain = docker->getContain(); - if( contain && contain->getContainCount() == 0 ) - return FALSE; - - // unload the prisoners from the docker into us - AIUpdateInterface *ai = docker->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("'%s' docking with prison has no AI", - docker->getTemplate()->getName().str()) ); - POWTruckAIUpdateInterface *powAI = ai->getPOWTruckAIUpdateInterface(); - DEBUG_ASSERTCRASH( powAI, ("'s' docking with prison has no POW Truck AI", - docker->getTemplate()->getName().str()) ); - - powAI->unloadPrisonersToPrison( getObject() ); - - // end docking - return FALSE; - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void PrisonDockUpdate::crc( Xfer *xfer ) -{ - - // extend base class - DockUpdate::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void PrisonDockUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DockUpdate::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void PrisonDockUpdate::loadPostProcess() -{ - - // extend base class - DockUpdate::loadPostProcess(); - -} - -#endif diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp deleted file mode 100644 index 9cd2f550672..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RepairDockUpdate.h /////////////////////////////////////////////////////////////////////// -// Author: Colin Day, June 2002 -// Desc: The action of docking with a structure for repairs -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/BodyModule.h" -#include "GameLogic/Module/RepairDockUpdate.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -RepairDockUpdateModuleData::RepairDockUpdateModuleData() -{ - - m_framesForFullHeal = 1.0f; // 1 frame, instant heal by default (keeps away from divide by 0's) - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -/*static*/ void RepairDockUpdateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - - DockUpdateModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "TimeForFullHeal", INI::parseDurationReal, nullptr, offsetof( RepairDockUpdateModuleData, m_framesForFullHeal ) }, - { nullptr, nullptr, nullptr, 0 } - }; - - p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -RepairDockUpdate::RepairDockUpdate( Thing *thing, const ModuleData* moduleData ) - : DockUpdate( thing, moduleData ) -{ - - m_lastRepair = INVALID_ID; - m_healthToAddPerFrame = 0.0f; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -RepairDockUpdate::~RepairDockUpdate() -{ - -} - -// ------------------------------------------------------------------------------------------------ -/** Do the action while docked - * Return TRUE to continue the docking process - * Return FALSE to complete the dockin process */ -// ------------------------------------------------------------------------------------------------ -Bool RepairDockUpdate::action( Object *docker, Object *drone ) -{ - - // sanity - if( docker == nullptr ) - return FALSE; - - // get our module data - const RepairDockUpdateModuleData *modData = getRepairDockUpdateModuleData(); - - // get the body module for the docker - BodyModuleInterface *body = docker->getBodyModule(); - - // - // no matter if the object is damaged just a little bit, or on the brink of death, we will - // heal the object over a fixed amount of *TIME* that is specified in the INI file. Whenever - // we get a new docker, given its current health we figure out how much health we will add - // to this docked object each frame so that it is fully healed after the correct amount - // of time has passed - // - if( m_lastRepair == 0 ) - { - - // save ID of this docker as the last docker - m_lastRepair = docker->getID(); - - // - // figure out how much health we need to add each frame to this object so that it's - // fully healed at the right time - // - m_healthToAddPerFrame = (body->getMaxHealth() - body->getHealth()) / modData->m_framesForFullHeal; - - } - - // if we're at max health we're done - if( body->getHealth() >= body->getMaxHealth() ) - { - - // repair is complete, clear our last docker - m_lastRepair = INVALID_ID; - - // returning false will complete the docking process - return FALSE; - - } - - // give us some health buddy - DamageInfo healingInfo; - healingInfo.in.m_amount = m_healthToAddPerFrame; - healingInfo.in.m_sourceID = getObject()->getID(); - healingInfo.in.m_damageType = DAMAGE_HEALING; - healingInfo.in.m_deathType = DEATH_NONE; - body->attemptHealing( &healingInfo ); - if( drone ) - { - body = drone->getBodyModule(); - healingInfo.in.m_amount = body->getMaxHealth(); - body->attemptHealing( &healingInfo ); - } - - // stay docked - return TRUE; - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void RepairDockUpdate::crc( Xfer *xfer ) -{ - - // extend base class - DockUpdate::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void RepairDockUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DockUpdate::xfer( xfer ); - - // last repair - xfer->xferObjectID( &m_lastRepair ); - - // health to add per frame - xfer->xferReal( &m_healthToAddPerFrame ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void RepairDockUpdate::loadPostProcess() -{ - - // extend base class - DockUpdate::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp deleted file mode 100644 index 62ac01c158a..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SupplyWarehouseDockUpdate.h ///////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood Feb 2002 -// Desc: The action of this dock update is identifying who is docking and either taking Boxes away or giving them -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/GlobalData.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/Module/SupplyWarehouseDockUpdate.h" -#include "GameLogic/Module/SupplyTruckAIUpdate.h" -#include "GameLogic/Object.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/AIPathfind.h" - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -SupplyWarehouseDockUpdateModuleData::SupplyWarehouseDockUpdateModuleData() -{ - m_startingBoxesData = 1; - m_deleteWhenEmpty = FALSE; -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -/*static*/ void SupplyWarehouseDockUpdateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - - DockUpdateModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "StartingBoxes", INI::parseInt, nullptr, offsetof( SupplyWarehouseDockUpdateModuleData, m_startingBoxesData ) }, - { "DeleteWhenEmpty", INI::parseBool, nullptr, offsetof( SupplyWarehouseDockUpdateModuleData, m_deleteWhenEmpty ) }, - { nullptr, nullptr, nullptr, 0 } - }; - - p.add(dataFieldParse); - -} - - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -SupplyWarehouseDockUpdate::SupplyWarehouseDockUpdate( Thing *thing, const ModuleData* moduleData ) : DockUpdate( thing, moduleData ) -{ - m_boxesStored = getSupplyWarehouseDockUpdateModuleData()->m_startingBoxesData; -} - -SupplyWarehouseDockUpdate::~SupplyWarehouseDockUpdate() -{ -} - -void SupplyWarehouseDockUpdate::onObjectCreated() -{ - Drawable *draw = getObject()->getDrawable(); - if( draw ) - { - draw->updateDrawableSupplyStatus( getSupplyWarehouseDockUpdateModuleData()->m_startingBoxesData, m_boxesStored ); - } -} - -Bool SupplyWarehouseDockUpdate::action( Object* docker, Object *drone ) -{ - if( m_boxesStored == 0 ) - return FALSE; - - // Make sure that the docker is at least reasonably close to the dock. - // Basically, one bounding diameter of space or less between us. - Real closeEnoughSqr = sqr(docker->getGeometryInfo().getBoundingCircleRadius()*2); - Real curDistSqr = ThePartitionManager->getDistanceSquared(docker, getObject(), FROM_BOUNDINGSPHERE_2D); - if (curDistSqr > closeEnoughSqr) { - DEBUG_LOG(("Failing dock, dist %f, not close enough(%f).", sqrt(curDistSqr), sqrt(closeEnoughSqr))); - // Make it twitch a little. - Coord3D newPos = *docker->getPosition(); - Real range = 0.4*PATHFIND_CELL_SIZE_F; - newPos.x += GameLogicRandomValue(-range, range); - newPos.y += GameLogicRandomValue(-range, range); - docker->setPosition(&newPos); - return FALSE; //not close enough. - } - - --m_boxesStored;// so the docker sees that I am shy by one box (or empty) from within his gainOneBox() - - SupplyTruckAIInterface *ai = docker->getAIUpdateInterface()->getSupplyTruckAIInterface(); - if( ai && ai->gainOneBox( m_boxesStored ) ) - { - if( m_boxesStored == 0 && getSupplyWarehouseDockUpdateModuleData()->m_deleteWhenEmpty ) - { - TheGameLogic->destroyObject( getObject() ); - return FALSE; //Yer done. And so am I. - } - else - { - Drawable *draw = getObject()->getDrawable(); - if( draw ) - { - draw->updateDrawableSupplyStatus( getSupplyWarehouseDockUpdateModuleData()->m_startingBoxesData, m_boxesStored ); - } - } - - return TRUE; - } - else - ++m_boxesStored; //take it back, since there was noone to gain the box - //this is important so that I have one less boxes as perceived by the docker when he gains one - - - return FALSE; -} - -void SupplyWarehouseDockUpdate::setDockCrippled( Bool setting ) -{ - // At this level, Crippling means I kill any activeDocker between enter and exit. - if( setting ) - { - if( m_activeDocker != INVALID_ID ) - { - Object *victim = TheGameLogic->findObjectByID( m_activeDocker ); - if( victim ) - { - if( m_dockerInside ) - { - if( !victim->isUsingAirborneLocomotor() ) - victim->kill(); - } - else - { - // Else, he was between Approach and Enter. Lucky guy. Tell him to stop, but then - // remind him that he wants to try again later - SupplyTruckAIInterface* supplyTruckAI = victim->getAI()->getSupplyTruckAIInterface(); - if( supplyTruckAI ) - { - victim->getAI()->aiIdle( CMD_FROM_AI ); - supplyTruckAI->setForceWantingState( TRUE ); - } - } - } - } - } - - DockUpdate::setDockCrippled( setting ); -} - -void SupplyWarehouseDockUpdate::setCashValue( Int cashValue ) -{ - // A script can tell us our set value, and we need to figure out the boxes needed to provide that. - m_boxesStored = ceil(cashValue / (float)TheGlobalData->m_baseValuePerSupplyBox); - Drawable *draw = getObject()->getDrawable(); - if( draw ) - { - draw->updateDrawableSupplyStatus( getSupplyWarehouseDockUpdateModuleData()->m_startingBoxesData, m_boxesStored ); - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseDockUpdate::crc( Xfer *xfer ) -{ - - // extend base class - DockUpdate::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseDockUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - DockUpdate::xfer( xfer ); - - // boxes stored - xfer->xferInt( &m_boxesStored ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void SupplyWarehouseDockUpdate::loadPostProcess() -{ - - // extend base class - DockUpdate::loadPostProcess(); - - // update the drawable supply status - const SupplyWarehouseDockUpdateModuleData *modData = getSupplyWarehouseDockUpdateModuleData(); - Object *us = getObject(); - Drawable *draw = us->getDrawable(); - if( draw ) - draw->updateDrawableSupplyStatus( modData->m_startingBoxesData, m_boxesStored ); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp deleted file mode 100644 index 754c4dde5dc..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: DynamicGeometryInfoUpdate.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, April 2002 -// Desc: Update module that changes the object's GeometryInfo -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameLogic/Module/DynamicGeometryInfoUpdate.h" -#include "GameLogic/Object.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -DynamicGeometryInfoUpdateModuleData::DynamicGeometryInfoUpdateModuleData() -{ - - m_initialDelay = 0; - - m_initialHeight = 0; - m_initialMajorRadius = 0; - m_initialMinorRadius = 0; - - m_finalHeight = 0; - m_finalMajorRadius = 0; - m_finalMinorRadius = 0; - - m_transitionTime = 1; - m_reverseAtTransitionTime = FALSE; - -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void DynamicGeometryInfoUpdateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - ModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - - { "InitialDelay", INI::parseDurationUnsignedInt, nullptr, offsetof(DynamicGeometryInfoUpdateModuleData, m_initialDelay) }, - - { "InitialHeight", INI::parseReal, nullptr, offsetof(DynamicGeometryInfoUpdateModuleData, m_initialHeight) }, - { "InitialMajorRadius", INI::parseReal, nullptr, offsetof(DynamicGeometryInfoUpdateModuleData, m_initialMajorRadius) }, - { "InitialMinorRadius", INI::parseReal, nullptr, offsetof(DynamicGeometryInfoUpdateModuleData, m_initialMinorRadius) }, - - { "FinalHeight", INI::parseReal, nullptr, offsetof(DynamicGeometryInfoUpdateModuleData, m_finalHeight) }, - { "FinalMajorRadius", INI::parseReal, nullptr, offsetof(DynamicGeometryInfoUpdateModuleData, m_finalMajorRadius) }, - { "FinalMinorRadius", INI::parseReal, nullptr, offsetof(DynamicGeometryInfoUpdateModuleData, m_finalMinorRadius) }, - - { "TransitionTime", INI::parseDurationUnsignedInt, nullptr, offsetof(DynamicGeometryInfoUpdateModuleData, m_transitionTime) }, - { "ReverseAtTransitionTime", INI::parseBool, nullptr, offsetof( DynamicGeometryInfoUpdateModuleData, m_reverseAtTransitionTime ) }, - - { nullptr, nullptr, nullptr, 0 } - - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -DynamicGeometryInfoUpdate::DynamicGeometryInfoUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - DynamicGeometryInfoUpdateModuleData *modData = (DynamicGeometryInfoUpdateModuleData *)moduleData; - m_startingDelayCountdown = modData->m_initialDelay; - m_startingDelayCountdown = max( m_startingDelayCountdown, 1u ); - m_timeActive = 0; - - m_started = FALSE; - m_finished = FALSE; - - m_reverseAtTransitionTime = modData->m_reverseAtTransitionTime; - m_switchedDirections = FALSE; - - // record in our instance what initial and final height are - m_initialHeight = modData->m_initialHeight; - m_initialMajorRadius = modData->m_initialMajorRadius; - m_initialMinorRadius = modData->m_initialMinorRadius; - m_finalHeight = modData->m_finalHeight; - m_finalMajorRadius = modData->m_finalMajorRadius; - m_finalMinorRadius = modData->m_finalMinorRadius; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -DynamicGeometryInfoUpdate::~DynamicGeometryInfoUpdate() -{ -} - -//------------------------------------------------------------------------------------------------- -/** The update callback. */ -//------------------------------------------------------------------------------------------------- -UpdateSleepTime DynamicGeometryInfoUpdate::update() -{ -/// @todo srj use SLEEPY_UPDATE here - if( m_finished ) - return UPDATE_SLEEP_NONE; - - if( !m_started ) - { - - m_startingDelayCountdown--; - if( m_startingDelayCountdown > 0 ) - return UPDATE_SLEEP_NONE; - - m_started = TRUE; - - } - - // Either we've been running, or we just started right now. Doesn't matter. - const DynamicGeometryInfoUpdateModuleData *data = getDynamicGeometryInfoUpdateModuleData(); - Object *me = getObject(); - Real newHeight, newMajor, newMinor; - - Real ratio = (float)m_timeActive / (float)data->m_transitionTime; - - newHeight = m_initialHeight + (ratio * (m_finalHeight - m_initialHeight)); - newMajor = m_initialMajorRadius + (ratio * (m_finalMajorRadius - m_initialMajorRadius)); - newMinor = m_initialMinorRadius + (ratio * (m_finalMinorRadius - m_initialMinorRadius)); - - // make a new geometry info with the new values - const GeometryInfo oldGeom = me->getGeometryInfo(); - GeometryInfo newGeom( oldGeom.getGeomType(), oldGeom.getIsSmall(), newHeight, newMajor, newMinor ); - me->setGeometryInfo( newGeom ); - - // we've not been active another frame .. increment out counter - m_timeActive++; - - // greater, so an update that is exactly right will be done - if( m_timeActive > data->m_transitionTime ) - { - - // if we're supposed to reverse at transition time do so now if we haven't already - if( m_reverseAtTransitionTime == TRUE ) - { - - // switch directions, reset time active, and turn off the switch at transition time - m_switchedDirections = TRUE; - m_timeActive = 0; - m_reverseAtTransitionTime = FALSE; - - // swap the initial and final values - m_initialHeight = data->m_finalHeight; - m_initialMajorRadius = data->m_finalMajorRadius; - m_initialMinorRadius = data->m_finalMinorRadius; - m_finalHeight = data->m_initialHeight; - m_finalMajorRadius = data->m_initialMajorRadius; - m_finalMinorRadius = data->m_initialMinorRadius; - - } - else - { - - // no switch needed ... we're all done - m_finished = TRUE; - - } - - } - - return UPDATE_SLEEP_NONE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void DynamicGeometryInfoUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void DynamicGeometryInfoUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // starting delay countdown - xfer->xferUnsignedInt( &m_startingDelayCountdown ); - - // time active - xfer->xferUnsignedInt( &m_timeActive ); - - // started - xfer->xferBool( &m_started ); - - // finished - xfer->xferBool( &m_finished ); - - // reverse at transition time - xfer->xferBool( &m_reverseAtTransitionTime ); - - // direction - xfer->xferUser( &m_direction, sizeof( DynamicGeometryDirection ) ); - - // switched directions - xfer->xferBool( &m_switchedDirections ); - - // initial height - xfer->xferReal( &m_initialHeight ); - - // initial major radius - xfer->xferReal( &m_initialMajorRadius ); - - // initial minor radius - xfer->xferReal( &m_initialMinorRadius ); - - // final height - xfer->xferReal( &m_finalHeight ); - - // final major radius - xfer->xferReal( &m_finalMajorRadius ); - - // final minor radius - xfer->xferReal( &m_finalMinorRadius ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void DynamicGeometryInfoUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/EnemyNearUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/EnemyNearUpdate.cpp deleted file mode 100644 index 452fc0ba450..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/EnemyNearUpdate.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: EnemyNearUpdate.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, December 2002 -// Desc: Reacts when an enemy is within range -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/PerfTimer.h" -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/Module/EnemyNearUpdate.h" -#include "GameLogic/Object.h" -#include "GameLogic/AI.h" -#include "GameLogic/Module/AIUpdate.h" - -//------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -EnemyNearUpdate::EnemyNearUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ), - m_enemyNear(false), - m_enemyScanDelay(0) -{ - // bias a random amount so everyone doesn't spike at once - m_enemyScanDelay += GameLogicRandomValue(0, getEnemyNearUpdateModuleData()->m_enemyScanDelayTime); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -EnemyNearUpdate::~EnemyNearUpdate() -{ -} - - -//------------------------------------------------------------------------------------------------- -/** - * Look around us for enemies. - */ -void EnemyNearUpdate::checkForEnemies() -{ - // periodic enemy checks - if (m_enemyScanDelay == 0) - { - m_enemyScanDelay = getEnemyNearUpdateModuleData()->m_enemyScanDelayTime; - - Real visionRange = getObject()->getVisionRange(); - Object* enemy = TheAI->findClosestEnemy( getObject(), visionRange, AI::CAN_SEE ); - m_enemyNear = (enemy != nullptr); - } - else - { - --m_enemyScanDelay; - } -} - -//------------------------------------------------------------------------------------------------- -///< Sit around until an enemy gets near. -//------------------------------------------------------------------------------------------------- -UpdateSleepTime EnemyNearUpdate::update() -{ -/// @todo srj use SLEEPY_UPDATE here - Bool enemyWasNear = m_enemyNear; - - checkForEnemies(); - - if (m_enemyNear && !enemyWasNear) - { - // change the state of the art to an "enemy near" state - Drawable *draw = getObject()->getDrawable(); - if( draw ) - draw->setModelConditionState( MODELCONDITION_ENEMYNEAR ); - } - else if (!m_enemyNear && enemyWasNear) - { - // change the state of the art to an idle state - Drawable *draw = getObject()->getDrawable(); - if( draw ) - draw->clearModelConditionState( MODELCONDITION_ENEMYNEAR ); - } - return UPDATE_SLEEP_NONE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void EnemyNearUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void EnemyNearUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // enemy scan delay - xfer->xferUnsignedInt( &m_enemyScanDelay ); - - // enemy near - xfer->xferBool( &m_enemyNear ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void EnemyNearUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp deleted file mode 100644 index 111c2c0b953..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp +++ /dev/null @@ -1,220 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: FireSpreadUpdate.cpp ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, April 2002 -// Desc: Update looks for ::Aflame and explicitly ignites someone nearby if set -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/RandomValue.h" -#include "Common/Xfer.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/ObjectCreationList.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/Module/FireSpreadUpdate.h" -#include "GameLogic/Module/FlammableUpdate.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -// This is a one sided query, as in I am not checking for "Flammable By Me", I'm simply testing for a property -class PartitionFilterFlammable : public PartitionFilter -{ -public: - - PartitionFilterFlammable(){ } - - virtual Bool allow(Object *objOther) override; -#if defined(RTS_DEBUG) - virtual const char* debugGetName() override { return "PartitionFilterFlammable"; } -#endif -}; - -//------------------------------------------------------------------------------------------------- -Bool PartitionFilterFlammable::allow(Object *objOther) -{ - // It must be burnable in general, and burnable now - static NameKeyType key_FlammableUpdate = NAMEKEY("FlammableUpdate"); - FlammableUpdate* fu = (FlammableUpdate*)objOther->findUpdateModule(key_FlammableUpdate); - if (fu == nullptr) - return FALSE; - - if( ! fu->wouldIgnite() ) - return FALSE; - - return TRUE; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -FireSpreadUpdateModuleData::FireSpreadUpdateModuleData() -{ - m_minSpreadTryDelayData = 0; - m_maxSpreadTryDelayData = 0; - m_oclEmbers = nullptr; - m_spreadTryRange = 0; -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void FireSpreadUpdateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - UpdateModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "OCLEmbers", INI::parseObjectCreationList, nullptr, offsetof( FireSpreadUpdateModuleData, m_oclEmbers ) }, - { "MinSpreadDelay", INI::parseDurationUnsignedInt, nullptr, offsetof( FireSpreadUpdateModuleData, m_minSpreadTryDelayData ) }, - { "MaxSpreadDelay", INI::parseDurationUnsignedInt, nullptr, offsetof( FireSpreadUpdateModuleData, m_maxSpreadTryDelayData ) }, - { "SpreadTryRange", INI::parseReal, nullptr, offsetof( FireSpreadUpdateModuleData, m_spreadTryRange ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -FireSpreadUpdate::FireSpreadUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - setWakeFrame(getObject(), UPDATE_SLEEP_FOREVER); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -FireSpreadUpdate::~FireSpreadUpdate() -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpdateSleepTime FireSpreadUpdate::update() -{ - const FireSpreadUpdateModuleData* d = getFireSpreadUpdateModuleData(); - Object* me = getObject(); - - if( !me->getStatusBits().test( OBJECT_STATUS_AFLAME ) ) - return UPDATE_SLEEP_FOREVER; // not on fire -- sleep forever - { - ObjectCreationList::create( d->m_oclEmbers, getObject(), nullptr ); - - if( d->m_spreadTryRange != 0 ) - { - // This will spread fire explicitly - PartitionFilterFlammable fFilter; - PartitionFilter *filters[] = { &fFilter, nullptr }; - -// SimpleObjectIterator *iter = nullptr; -// iter = ThePartitionManager->iterateObjectsInRange(getObject(), -// d->m_spreadTryRange, -// FROM_CENTER_3D, -// filters, -// ITER_SORTED_NEAR_TO_FAR -// ); -// MemoryPoolObjectHolder hold(iter); -// Object *objectToLight = iter->first(); -// -// srj sez: the above code is stupid and slow. since we only want the closest object, -// just ask for that; the above has to find ALL objects in range, but we ignore all -// but the first (closest). -// - Object* objectToLight = ThePartitionManager->getClosestObject(getObject(), d->m_spreadTryRange, FROM_CENTER_3D, filters); - if( objectToLight ) - { - static NameKeyType key_FlammableUpdate = NAMEKEY("FlammableUpdate"); - FlammableUpdate* fu = (FlammableUpdate*)objectToLight->findUpdateModule(key_FlammableUpdate); - if( fu ) - fu->tryToIgnite(); - } - } - - return UPDATE_SLEEP(calcNextSpreadDelay()); - } -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void FireSpreadUpdate::startFireSpreading() -{ - if( !getObject()->getStatusBits().test( OBJECT_STATUS_AFLAME ) ) - return; // sorry, must be on fire - - setWakeFrame(getObject(), UPDATE_SLEEP(calcNextSpreadDelay())); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UnsignedInt FireSpreadUpdate::calcNextSpreadDelay() -{ - const FireSpreadUpdateModuleData* d = getFireSpreadUpdateModuleData(); - UnsignedInt delay = GameLogicRandomValue( d->m_minSpreadTryDelayData, d->m_maxSpreadTryDelayData ); - if (delay < 1) - delay = 1; - return delay; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void FireSpreadUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void FireSpreadUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void FireSpreadUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp deleted file mode 100644 index 85783ba4a4f..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp +++ /dev/null @@ -1,340 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: FlammableUpdate.cpp ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, April 2002 -// Desc: Update that manages Aflame and Burned statuses and their effects -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/AudioEventRTS.h" -#include "Common/GameAudio.h" -#include "Common/Xfer.h" - -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/BodyModule.h" -#include "GameLogic/Module/FlammableUpdate.h" -#include "GameLogic/Module/FireSpreadUpdate.h" - -//------------------------------------------------------------------------------------------------- -FlammableUpdateModuleData::FlammableUpdateModuleData() -{ - m_burnedDelay = 0; - m_aflameDuration = 0; - m_aflameDamageDelay = 0; - m_aflameDamageAmount = 0; - m_burningSoundName.clear(); - m_flameDamageLimitData = 20.0f; - m_flameDamageExpirationDelay = LOGICFRAMES_PER_SECOND * 2; -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void FlammableUpdateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - UpdateModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "BurnedDelay", INI::parseDurationUnsignedInt, nullptr, offsetof( FlammableUpdateModuleData, m_burnedDelay ) }, - { "AflameDuration", INI::parseDurationUnsignedInt, nullptr, offsetof( FlammableUpdateModuleData, m_aflameDuration ) }, - { "AflameDamageDelay", INI::parseDurationUnsignedInt, nullptr, offsetof( FlammableUpdateModuleData, m_aflameDamageDelay ) }, - { "AflameDamageAmount", INI::parseInt, nullptr, offsetof( FlammableUpdateModuleData, m_aflameDamageAmount ) }, - { "BurningSoundName", INI::parseAsciiString, nullptr, offsetof( FlammableUpdateModuleData, m_burningSoundName) }, - { "FlameDamageLimit", INI::parseReal, nullptr, offsetof( FlammableUpdateModuleData, m_flameDamageLimitData ) }, - { "FlameDamageExpiration", INI::parseDurationUnsignedInt, nullptr, offsetof( FlammableUpdateModuleData, m_flameDamageExpirationDelay ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -FlammableUpdate::FlammableUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - m_status = FS_NORMAL; - m_aflameEndFrame = 0; - m_burnedEndFrame = 0; - m_damageEndFrame = 0; - m_audioHandle = 0; - m_flameDamageLimit = getFlammableUpdateModuleData()->m_flameDamageLimitData; - m_flameSource = INVALID_ID; - m_lastFlameDamageDealt = 0; - - setWakeFrame(getObject(), UPDATE_SLEEP_FOREVER); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -FlammableUpdate::~FlammableUpdate() -{ - stopBurningSound(); -} - -//------------------------------------------------------------------------------------------------- -/** Damage has been dealt, this is an opportunity to reach to that damage */ -//------------------------------------------------------------------------------------------------- -void FlammableUpdate::onDamage( DamageInfo *damageInfo ) -{ - if( damageInfo->in.m_damageType == DAMAGE_FLAME || damageInfo->in.m_damageType == DAMAGE_PARTICLE_BEAM ) - { - UnsignedInt now = TheGameLogic->getFrame(); - if( now - getFlammableUpdateModuleData()->m_flameDamageExpirationDelay > m_lastFlameDamageDealt ) - { - // If it has been a long time since our last flame damage, reset the threshold - m_flameDamageLimit = getFlammableUpdateModuleData()->m_flameDamageLimitData; - } - m_lastFlameDamageDealt = now; -#if RETAIL_COMPATIBLE_CRC || PRESERVE_NO_XP_FROM_FLAME_KILLS - m_flameSource = getObject()->getID(); -#else - // TheSuperHackers @bugfix Stubbjax 03/09/2025 Allow flame damage to award xp to the flame source. - m_flameSource = damageInfo->in.m_sourceID; -#endif - - Object *me = getObject(); - if( !me->getStatusBits().test( OBJECT_STATUS_AFLAME ) && !me->getStatusBits().test( OBJECT_STATUS_BURNED ) ) - { - // If I'm not on fire, and I haven't burned up, see if I should try to catch fire. - m_flameDamageLimit -= damageInfo->out.m_actualDamageDealt; - if( m_flameDamageLimit <= 0 ) - { - tryToIgnite(); - } - } - } -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpdateSleepTime FlammableUpdate::update() -{ - Object *me = getObject(); - DEBUG_ASSERTCRASH(m_status == FS_AFLAME, ("hmm, should be aflame")); - - UnsignedInt now = TheGameLogic->getFrame(); - const FlammableUpdateModuleData *data = getFlammableUpdateModuleData(); - - if( m_damageEndFrame != 0 && now >= m_damageEndFrame ) - { - m_damageEndFrame = now + data->m_aflameDamageDelay; - doAflameDamage(); - } - - if( m_burnedEndFrame != 0 && now >= m_burnedEndFrame ) - { - // So this status is set, but I am still aflame on an independent timer. - me->setStatus( MAKE_OBJECT_STATUS_MASK( OBJECT_STATUS_BURNED ) ); - me->setModelConditionState( MODELCONDITION_SMOLDERING ); - } - - if( m_aflameEndFrame != 0 && now >= m_aflameEndFrame ) - { - // This is the important one. I am no longer on fire. - if( me->getStatusBits().test( OBJECT_STATUS_BURNED ) ) - { - // If I am burned, then I will never catch fire again. - m_status = FS_BURNED; - } - else - { - // otherwise I am free to burn again - m_status = FS_NORMAL; - } - stopBurningSound(); - me->clearStatus( MAKE_OBJECT_STATUS_MASK( OBJECT_STATUS_AFLAME ) ); - me->getBodyModule()->setAflame( FALSE ); - me->clearModelConditionState( MODELCONDITION_AFLAME ); - } - - return calcSleepTime(); -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime FlammableUpdate::calcSleepTime() -{ - UnsignedInt now = TheGameLogic->getFrame(); - if (m_status == FS_AFLAME && m_aflameEndFrame != 0 && m_aflameEndFrame > now) - { - UnsignedInt soonest = m_aflameEndFrame; - if (m_burnedEndFrame != 0 && m_burnedEndFrame < soonest && m_burnedEndFrame > now) soonest = m_burnedEndFrame; - if (m_damageEndFrame != 0 && m_damageEndFrame < soonest && m_damageEndFrame > now) soonest = m_damageEndFrame; - DEBUG_ASSERTCRASH(soonest - now > 0, ("hmm")); - // UPDATE_SLEEP requires a count-of-frames, not an absolute-frame, so subtract 'now' - return UPDATE_SLEEP(soonest - now); - } - else - { - return UPDATE_SLEEP_FOREVER; - } -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void FlammableUpdate::tryToIgnite() -{ - if( m_status == FS_NORMAL ) - { - Object *me = getObject(); - me->setStatus( MAKE_OBJECT_STATUS_MASK( OBJECT_STATUS_AFLAME ) ); - me->getBodyModule()->setAflame( TRUE ); - me->setModelConditionState( MODELCONDITION_AFLAME ); - startBurningSound(); - - // bleah. this sucks. (srj) - static const NameKeyType key_FireSpreadUpdate = NAMEKEY("FireSpreadUpdate"); - FireSpreadUpdate* fu = (FireSpreadUpdate*)getObject()->findUpdateModule(key_FireSpreadUpdate); - if (fu != nullptr) - { - fu->startFireSpreading(); - } - - m_status = FS_AFLAME; - - const FlammableUpdateModuleData *data = getFlammableUpdateModuleData(); - UnsignedInt now = TheGameLogic->getFrame(); - m_aflameEndFrame = now + data->m_aflameDuration; - m_burnedEndFrame = data->m_burnedDelay ? now + data->m_burnedDelay : 0; - m_damageEndFrame = data->m_aflameDamageDelay ? now + data->m_aflameDamageDelay : 0; - - setWakeFrame(getObject(), calcSleepTime()); - } -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void FlammableUpdate::doAflameDamage() -{ - const FlammableUpdateModuleData *data = getFlammableUpdateModuleData(); - - DamageInfo info; - info.in.m_amount = data->m_aflameDamageAmount; - info.in.m_sourceID = m_flameSource; - info.in.m_damageType = DAMAGE_FLAME; - info.in.m_deathType = DEATH_BURNED; - - getObject()->attemptDamage( &info ); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void FlammableUpdate::startBurningSound() -{ - const FlammableUpdateModuleData *data = getFlammableUpdateModuleData(); - - AudioEventRTS audio(data->m_burningSoundName, getObject()->getID()); - m_audioHandle = TheAudio->addAudioEvent( &audio ); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void FlammableUpdate::stopBurningSound() -{ - if (m_audioHandle) - { - TheAudio->removeAudioEvent( m_audioHandle ); - m_audioHandle = 0; - } -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -Bool FlammableUpdate::wouldIgnite() -{ - if( m_status == FS_NORMAL ) - return TRUE; - - return FALSE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void FlammableUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version - * 2. TheSuperHackers @tweak Serialize flame source - */ -// ------------------------------------------------------------------------------------------------ -void FlammableUpdate::xfer( Xfer *xfer ) -{ - - // version -#if RETAIL_COMPATIBLE_XFER_SAVE - XferVersion currentVersion = 1; -#else - XferVersion currentVersion = 2; -#endif - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // flammability status - xfer->xferUser( &m_status, sizeof( FlammabilityStatusType ) ); - - // aflame end frame - xfer->xferUnsignedInt( &m_aflameEndFrame ); - - // burned end frame - xfer->xferUnsignedInt( &m_burnedEndFrame ); - - // damage end frame - xfer->xferUnsignedInt( &m_damageEndFrame ); - - // flame damage limit - xfer->xferReal( &m_flameDamageLimit ); - - // last flame damage dealt - xfer->xferUnsignedInt( &m_lastFlameDamageDealt ); - - if (version >= 2) - { - xfer->xferObjectID(&m_flameSource); - } -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void FlammableUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FloatUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FloatUpdate.cpp deleted file mode 100644 index 29f256c4801..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/FloatUpdate.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: FloatUpdate.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, May 2002 -// Desc: Float on top of da water!!! -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/TerrainLogic.h" -#include "GameLogic/Module/FloatUpdate.h" -#include "GameLogic/GameLogic.h" - -#include "GameClient/Drawable.h" - - - - - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -FloatUpdateModuleData::FloatUpdateModuleData() -{ - - m_enabled = FALSE; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -/*static*/ void FloatUpdateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - - UpdateModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "Enabled", INI::parseBool, nullptr, offsetof( FloatUpdateModuleData, m_enabled ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -FloatUpdate::FloatUpdate( Thing *thing, const ModuleData *moduleData ) - :UpdateModule( thing, moduleData ) -{ - - // save our initial enabled status based on INI settings - m_enabled = ((FloatUpdateModuleData *)moduleData)->m_enabled; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -FloatUpdate::~FloatUpdate() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime FloatUpdate::update() -{ -/// @todo srj use SLEEPY_UPDATE here - - // if we're not enabled, do nothing - if( m_enabled == TRUE ) - { - // get object position - const Coord3D *pos = getObject()->getPosition(); - - // get the height of the water here - Real waterZ; - TheTerrainLogic->isUnderwater( pos->x, pos->y, &waterZ ); - - // snap to the water surface - Coord3D newPos; - newPos.x = pos->x; - newPos.y = pos->y; - newPos.z = waterZ; - getObject()->setPosition( &newPos ); - - } - - Drawable *draw = getObject()->getDrawable(); - if (draw) - { - - Real angle = INT_TO_REAL(TheGameLogic->getFrame()); - Real yaw = sin(angle * 0.0291f) * 0.05f; - Real pitch = sin(angle * 0.0515f) * 0.05f; - - Matrix3D mx = *draw->getInstanceMatrix(); - - Real zRot = mx.Get_Z_Rotation(); - mx.Make_Identity(); - mx.Rotate_Z(zRot); - mx.Rotate_Y(yaw); - mx.Rotate_X(pitch); - - draw->setInstanceMatrix(&mx); - } - - return UPDATE_SLEEP_NONE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void FloatUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void FloatUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // enabled - xfer->xferBool( &m_enabled ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void FloatUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp deleted file mode 100644 index 64f71f39a40..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: HeightDieUpdate.cpp ////////////////////////////////////////////////////////////////////// -// Author: Objects that will die when the are a certain height above the terrain or objects -// Desc: Colin Day, April 2002 -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameClient/InGameUI.h" -#include "GameClient/ParticleSys.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/TerrainLogic.h" -#include "GameLogic/Module/ContainModule.h" -#include "GameLogic/Module/HeightDieUpdate.h" -#include "GameLogic/Module/PhysicsUpdate.h" - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -HeightDieUpdateModuleData::HeightDieUpdateModuleData() -{ - - m_targetHeightAboveTerrain = 0.0f; - m_targetHeightIncludesStructures = FALSE; - m_onlyWhenMovingDown = FALSE; - m_destroyAttachedParticlesAtHeight = -1.0f; - m_snapToGroundOnDeath = FALSE; - m_initialDelay = 0; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void HeightDieUpdateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - - UpdateModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "TargetHeight", INI::parseReal, nullptr, offsetof( HeightDieUpdateModuleData, m_targetHeightAboveTerrain ) }, - { "TargetHeightIncludesStructures", INI::parseBool, nullptr, offsetof( HeightDieUpdateModuleData, m_targetHeightIncludesStructures ) }, - { "OnlyWhenMovingDown", INI::parseBool, nullptr, offsetof( HeightDieUpdateModuleData, m_onlyWhenMovingDown ) }, - { "DestroyAttachedParticlesAtHeight", INI::parseReal, nullptr, offsetof( HeightDieUpdateModuleData, m_destroyAttachedParticlesAtHeight ) }, - { "SnapToGroundOnDeath", INI::parseBool, nullptr, offsetof( HeightDieUpdateModuleData, m_snapToGroundOnDeath ) }, - { "InitialDelay", INI::parseDurationUnsignedInt, nullptr, offsetof( HeightDieUpdateModuleData, m_initialDelay ) }, - { nullptr, nullptr, nullptr, 0 } - - }; - - p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -HeightDieUpdate::HeightDieUpdate( Thing *thing, const ModuleData* moduleData ) - : UpdateModule( thing, moduleData ) -{ - m_hasDied = FALSE; - m_particlesDestroyed = FALSE; - m_lastPosition.x = -1.0f; - m_lastPosition.y = -1.0f; - m_lastPosition.z = -1.0f; - m_earliestDeathFrame = UINT_MAX; - // m_lastPosition = *thing->getPosition(); - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -HeightDieUpdate::~HeightDieUpdate() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpdateSleepTime HeightDieUpdate::update() -{ - UnsignedInt now = TheGameLogic->getFrame(); - if( m_earliestDeathFrame == UINT_MAX ) - m_earliestDeathFrame = now + getHeightDieUpdateModuleData()->m_initialDelay; - - // If at least a one frame delay has been set, then stop for a while - if( m_earliestDeathFrame > now ) - return UPDATE_SLEEP_NONE; - - // do nothing if we're contained within other objects ... like a transport - if( getObject()->getContainedBy() != nullptr ) - { - - // keep track of our last position even though we're not doing anything yet - m_lastPosition = *getObject()->getPosition(); - - // get outta here - return UPDATE_SLEEP_NONE; - - } - - // get the module data - const HeightDieUpdateModuleData *modData = getHeightDieUpdateModuleData(); - - // get our current position - const Coord3D *pos = getObject()->getPosition(); - - Bool directionOK = TRUE; - if( m_hasDied == FALSE ) - { - - if( modData->m_onlyWhenMovingDown ) - { - - if( pos->z >= m_lastPosition.z ) - directionOK = FALSE; - - } - - // get the terrain height - Real terrainHeightAtPos = TheTerrainLogic->getGroundHeight( pos->x, pos->y ); - - // if including structures, check for bridges - if (modData->m_targetHeightIncludesStructures) - { - PathfindLayerEnum layer = TheTerrainLogic->getHighestLayerForDestination(pos); - if (layer != LAYER_GROUND) - { - Real layerHeight = TheTerrainLogic->getLayerHeight(pos->x, pos->y, layer); - if (layerHeight > terrainHeightAtPos) - terrainHeightAtPos = layerHeight; - } - } - - // - // our target height to die at is by default the height specified in the INI entry above - // the terrain ... we may change our target height if we care about dying above - // objects under us (see below) - // - Real targetHeight = terrainHeightAtPos + modData->m_targetHeightAboveTerrain; - - // - // if we consider objects under us ... we will die when we are the specified distance above - // those objects - // - if( modData->m_targetHeightIncludesStructures == TRUE ) - { - - // scan all objects in the radius of our extent and find the tallest height among them - PartitionFilterAcceptByKindOf filter1( MAKE_KINDOF_MASK( KINDOF_STRUCTURE ),KINDOFMASK_NONE ); - PartitionFilter *filters[] = { &filter1, nullptr }; - Real range = getObject()->getGeometryInfo().getBoundingCircleRadius(); - ObjectIterator *iter = ThePartitionManager->iterateObjectsInRange( getObject(), - range, - FROM_BOUNDINGSPHERE_3D, - filters ); - MemoryPoolObjectHolder hold( iter ); - Object *obj; - - Real tallestHeight = 0.0f; - Real thisHeight; - for( obj = iter->first(); obj; obj = iter->next() ) - { - - // ignore ourselves - if( obj == getObject() ) - continue; - - // store the height of the tallest object under us - thisHeight = obj->getGeometryInfo().getMaxHeightAbovePosition(); - - if( thisHeight > tallestHeight ) - tallestHeight = thisHeight; - - } - - // - // our target height is either the height above the terrain as specified by the INI - // entry for the object that has this update ... or it is the building height of the - // tallest thing under us - // - if( tallestHeight > modData->m_targetHeightAboveTerrain ) - targetHeight = tallestHeight + terrainHeightAtPos; - - } - - // if we are below the target height ... DIE! - if( pos->z < targetHeight && directionOK ) - { - - // if we're supposed to snap us to the ground on death do so - // AND: even if we're not snapping to ground, be sure we don't go BELOW ground - if( modData->m_snapToGroundOnDeath || pos->z < terrainHeightAtPos ) - { - Coord3D ground; - - ground.x = pos->x; - ground.y = pos->y; - ground.z = terrainHeightAtPos; - getObject()->setPosition( &ground ); - - } - - // kill the object - getObject()->kill(); - - // we have died ... don't do this again - m_hasDied = TRUE; - - } - - } - - // - // if our height is below the destroy attached particles height above the terrain, clean - // them up from the particle system - // - if( m_particlesDestroyed == FALSE && pos->z < modData->m_destroyAttachedParticlesAtHeight && (m_hasDied || directionOK) ) - { - - // destroy them - TheParticleSystemManager->destroyAttachedSystems( getObject() ); - - // don't do this again - m_particlesDestroyed = TRUE; - - } - - // save our current position as the last position we monitored - m_lastPosition = *pos; - - return UPDATE_SLEEP_NONE; - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void HeightDieUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version - * 2: m_earliestDeathFrame -*/ -// ------------------------------------------------------------------------------------------------ -void HeightDieUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 2; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // has died - xfer->xferBool( &m_hasDied ); - - // particles destroyed - xfer->xferBool( &m_particlesDestroyed ); - - // last position - xfer->xferCoord3D( &m_lastPosition ); - - if( version >= 2 ) - xfer->xferUnsignedInt( &m_earliestDeathFrame ); - else - m_earliestDeathFrame = 0; - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void HeightDieUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HijackerUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HijackerUpdate.cpp deleted file mode 100644 index 41de00aac76..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HijackerUpdate.cpp +++ /dev/null @@ -1,261 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// -// FILE: HijackerUpdate.cpp -// Author: Mark Lorenzen, July 2002 -// Desc: Allows hijacker to keep with his hijacked vehicle (though hidden) until it dies, then -// to become a hijacker once more -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Player.h" -#include "Common/ThingFactory.h" -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/HijackerUpdate.h" -#include "GameLogic/Module/AIUpdate.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/Module/EjectPilotDie.h" -#include "GameLogic/Module/ContainModule.h" -#include "GameLogic/ExperienceTracker.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -HijackerUpdate::HijackerUpdate( Thing *thing, const ModuleData *moduleData ) : UpdateModule( thing, moduleData ) -{ - m_targetID = INVALID_ID; - setUpdate( FALSE ); - setIsInVehicle( FALSE ); - m_wasTargetAirborne = false; - m_ejectPos.zero(); -// m_ejectPilotDMI = nullptr; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -HijackerUpdate::~HijackerUpdate() -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpdateSleepTime HijackerUpdate::update() -{ -/// @todo srj use SLEEPY_UPDATE here - - if ( ! m_update) // have not flagged for updating - { - return UPDATE_SLEEP_NONE; - } - - if (m_isInVehicle) - { - Object *obj = getObject(); - - // If hijacker has hijacked a vehicle, he needs to move along with it... - //Continually reset position of hijacker to match the position of the target. - Object *target = getTargetObject(); - if( target ) - { - // @todo I think we should test for ! IsEffectivelyDead() as well, here - obj->setPosition( target->getPosition() ); - m_wasTargetAirborne = target->isSignificantlyAboveTerrain(); - m_ejectPos = *target->getPosition(); - - // So, if while I am driving this American war vehicle, I gain skill points, I get to keep them when I wreck the vehicle - ExperienceTracker *targetExp = target->getExperienceTracker(); - ExperienceTracker *jackerExp = obj->getExperienceTracker(); - if ( targetExp && jackerExp ) - { - VeterancyLevel highestLevel = MAX(targetExp->getVeterancyLevel(),jackerExp->getVeterancyLevel()); - jackerExp->setVeterancyLevel( highestLevel ); - targetExp->setVeterancyLevel( highestLevel ); - } - - } - else // the car we have been "driving" is dead now, and has safely ejected us - { - { - - - //THIS BLOCK RESTORES HIJACKER TO PARTITION MANAGER AND UNHIDES HIM - ThePartitionManager->registerObject( obj ); - - if( obj->getDrawable() ) - { - // so it is time to unhide ourselves and be a pedestrian hijacker again - obj->getDrawable()->setDrawableHidden( false ); - } - - // We won't come back here until and unless we have hijacked another vehicle - obj->clearStatus( MAKE_OBJECT_STATUS_MASK3( OBJECT_STATUS_NO_COLLISIONS, OBJECT_STATUS_MASKED, OBJECT_STATUS_UNSELECTABLE ) ); - - AIUpdateInterface* ai = obj->getAIUpdateInterface(); - if ( ai ) - { - ai->aiIdle( CMD_FROM_AI ); - } - - if (m_wasTargetAirborne) - { - const ThingTemplate* putInContainerTmpl = TheThingFactory->findTemplate(getHijackerUpdateModuleData()->m_parachuteName); - DEBUG_ASSERTCRASH(putInContainerTmpl,("DeliverPayload: PutInContainer %s not found!",getHijackerUpdateModuleData()->m_parachuteName.str())); - if (putInContainerTmpl) - { - Object* container = TheThingFactory->newObject( putInContainerTmpl, obj->getTeam() ); - container->setPosition(&m_ejectPos); - if (container->getContain()->isValidContainerFor(obj, true)) - { - container->getContain()->addToContain(obj); - } - else - { - DEBUG_CRASH(("DeliverPayload: PutInContainer %s is full, or not valid for the payload!",getHijackerUpdateModuleData()->m_parachuteName.str())); - } - } - - } - - - } - - setTargetObject( nullptr ); - setIsInVehicle( FALSE ); - setUpdate( FALSE ); - m_wasTargetAirborne = false; - - } - - } - else // not in vehicle - { - m_wasTargetAirborne = false; - } - - return UPDATE_SLEEP_NONE; -} - - - -void HijackerUpdate::setTargetObject( const Object *object ) -{ - if( object ) - { - m_targetID = object->getID(); - - // here we also test the target to see whether it ejects pilots - // when it dies... if so, stores a pointer to that diemoduleinterface - // nullptr if not... - -// BehaviorModule **dmi = nullptr; -// for( dmi = object->getBehaviorModules(); *dmi; ++dmi ) -// { -// m_ejectPilotDMI = (*dmi)->getEjectPilotDieInterface(); -// if( m_ejectPilotDMI ) -// return; -// } // end for dmi - } - else - { - m_targetID = INVALID_ID; -// m_ejectPilotDMI = nullptr; - } - -} - -Object* HijackerUpdate::getTargetObject() const -{ - if( m_targetID != INVALID_ID ) - { - return TheGameLogic->findObjectByID( m_targetID ); - } - return nullptr; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void HijackerUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void HijackerUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // target ID - xfer->xferObjectID( &m_targetID ); - - // eject pos - xfer->xferCoord3D( &m_ejectPos ); - - // update - xfer->xferBool( &m_update ); - - // is in vehicle - xfer->xferBool( &m_isInVehicle ); - - // was target airborne - xfer->xferBool( &m_wasTargetAirborne ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void HijackerUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - - // set the target object, this will also tie up the m_ejectPilotDMI pointer - Object *obj = TheGameLogic->findObjectByID( m_targetID ); - setTargetObject( obj ); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/LifetimeUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/LifetimeUpdate.cpp deleted file mode 100644 index 3a13907165c..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/LifetimeUpdate.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: LifetimeUpdate.cpp /////////////////////////////////////////////////////////////////////// -// Author: Colin Day, December 2001 -// Desc: Update that will count down a lifetime and destroy object when it reaches zero -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/RandomValue.h" -#include "Common/Xfer.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Module/LifetimeUpdate.h" -#include "GameLogic/Object.h" - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -LifetimeUpdate::LifetimeUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - const LifetimeUpdateModuleData* d = getLifetimeUpdateModuleData(); - m_dieFrame = 0; - UnsignedInt delay; - if( getObject()->isKindOf( KINDOF_HULK ) && TheGameLogic->getHulkMaxLifetimeOverride() != -1 ) - { - delay = calcSleepDelay( TheGameLogic->getHulkMaxLifetimeOverride(), TheGameLogic->getHulkMaxLifetimeOverride() ); - } - else - { - delay = calcSleepDelay(d->m_minFrames, d->m_maxFrames); - } - - setWakeFrame(getObject(), UPDATE_SLEEP(delay)); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -LifetimeUpdate::~LifetimeUpdate() -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void LifetimeUpdate::setLifetimeRange( UnsignedInt minFrames, UnsignedInt maxFrames ) -{ - UnsignedInt delay = calcSleepDelay(minFrames, maxFrames); - setWakeFrame(getObject(), UPDATE_SLEEP(delay)); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UnsignedInt LifetimeUpdate::calcSleepDelay(UnsignedInt minFrames, UnsignedInt maxFrames) -{ - UnsignedInt delay = GameLogicRandomValue( minFrames, maxFrames ); - if (delay < 1) delay = 1; - m_dieFrame = TheGameLogic->getFrame() + delay; - return delay; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpdateSleepTime LifetimeUpdate::update() -{ - // Kill (NOT destroy) if time is up - getObject()->kill(); - return UPDATE_SLEEP_FOREVER; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void LifetimeUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void LifetimeUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // die frame - xfer->xferUnsignedInt( &m_dieFrame ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void LifetimeUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp deleted file mode 100644 index f1317b0d8e7..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp +++ /dev/null @@ -1,463 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// MobMemberSlavedUpdate.cpp /////////////////////////////////////////////////////////////////////////// -// Will obey spawner... or die trying -// Author: Mark Lorenzen, August 2002 -// Desc: Slaved unit(s) remain close to their master. Used by angry Mob members (various) -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/InGameUI.h"// selection logic -#include "GameClient/Drawable.h" -#include "Common/RandomValue.h" -#include "Common/Xfer.h" -#include "GameClient/ParticleSys.h" -#include "GameLogic/AIPathfind.h" -#include "GameLogic/Damage.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Locomotor.h" -#include "GameLogic/Object.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/TerrainLogic.h" -#include "GameLogic/Module/AIUpdate.h" -#include "GameLogic/Module/BodyModule.h" -#include "GameLogic/Module/MobMemberSlavedUpdate.h" -#include "GameLogic/Module/SpawnBehavior.h" -#include "Common/ThingFactory.h" -#include "Common/ThingTemplate.h" - - - - - -#define STRAY_MULTIPLIER 2.0f // Multiplier from stating diestance from tunnel, to max distance from - -const Real CLOSE_ENOUGH = 15; // Our moveTo commands and pathfinding can't handle people in the way, so quit trying to hump someone on your spot -const Real CLOSE_ENOUGH_SQR = (CLOSE_ENOUGH * CLOSE_ENOUGH); - -//------------------------------------------------------------------------------------------------- -MobMemberSlavedUpdate::MobMemberSlavedUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - - m_slaver = INVALID_ID; - m_framesToWait = GameLogicRandomValue(0,20); - - // MDC: moving to GameLogicRandomValue. This does not need to be synced, but having it so makes searches *so* much nicer. - m_personalColor.red = GameLogicRandomValueReal( 0.2f, 0.4f ); - m_personalColor.green = GameLogicRandomValueReal( 0.2f, 0.4f ); - m_personalColor.blue = GameLogicRandomValueReal( 0.2f, 0.4f ); - -// Drawable *myDraw = getObject()->getDrawable(); -// if ( myDraw ) -// myDraw->colorTint( &m_personalColor ); - - m_mobState = MOB_STATE_NONE; - m_primaryVictimID = INVALID_ID; - m_squirrellinessRatio = 0; - m_isSelfTasking = FALSE; - m_catchUpCrisisTimer = 0; - - // MDC: moving to GameLogicRandomValue. This does not need to be synced, but having it so makes searches *so* much nicer. - //getObject()->getDrawable()->setInstanceScale(GameLogicRandomValueReal( 5.0f, 1.5f )); - -} - -//------------------------------------------------------------------------------------------------- -MobMemberSlavedUpdate::~MobMemberSlavedUpdate() -{ -} - -//------------------------------------------------------------------------------------------------- -void MobMemberSlavedUpdate::onObjectCreated() -{ - - const MobMemberSlavedUpdateModuleData* data = getMobMemberSlavedUpdateModuleData(); - m_squirrellinessRatio = MIN(MAX_SQUIRRELLINESS, MAX(0, data->m_squirrellinessRatio)); - -} - -//------------------------------------------------------------------------------------------------- -void MobMemberSlavedUpdate::onEnslave( const Object *slaver ) -{ - startSlavedEffects( slaver ); -} - -//------------------------------------------------------------------------------------------------- -void MobMemberSlavedUpdate::onSlaverDie( const DamageInfo *info ) -{ - stopSlavedEffects(); -} - -//------------------------------------------------------------------------------------------------- -void MobMemberSlavedUpdate::onSlaverDamage( const DamageInfo *info ) -{ - // Only slaves with a ProneUpdate will even care. - AIUpdateInterface *ai = getObject()->getAIUpdateInterface(); - if( ai ) - ai->aiGoProne( info, CMD_FROM_AI ); -} - - -//------------------------------------------------------------------------------------------------- -UpdateSleepTime MobMemberSlavedUpdate::update() -{ -/// @todo srj use SLEEPY_UPDATE here - - const MobMemberSlavedUpdateModuleData* data = getMobMemberSlavedUpdateModuleData(); - Object *me = getObject(); - if( !me ) - { - return UPDATE_SLEEP_NONE; - } - - Object *master = TheGameLogic->findObjectByID( m_slaver ); - if( master == nullptr ) - { - stopSlavedEffects(); - - //TheGameLogic->destroyObject( me ); - me->kill(); - return UPDATE_SLEEP_NONE; // you cannot return SLEEP_FOREVER unless you make yourself sleepy... - } - - AIUpdateInterface *myAI = me->getAIUpdateInterface(); - AIUpdateInterface *masterAI = master->getAIUpdateInterface(); - if( ! myAI || ! masterAI) - { - return UPDATE_SLEEP_NONE; - } - - Drawable *myDraw = me->getDrawable(); - Drawable *masterDraw = master->getDrawable(); - if ( ! myDraw || ! masterDraw) - { - return UPDATE_SLEEP_NONE; - } - -// myDraw->colorTint( &m_personalColor ); - - - const ModelConditionFlags flags = myDraw->getModelConditionFlags(); - if (flags.anyIntersectionWith(MAKE_MODELCONDITION_MASK(MODELCONDITION_WEAPONSET_PLAYER_UPGRADE))) - { - ModelConditionFlags clearFlags; - clearFlags.clear(); - clearFlags.set( MODELCONDITION_RELOADING_A ); - clearFlags.set( MODELCONDITION_BETWEEN_FIRING_SHOTS_A ); - clearFlags.set( MODELCONDITION_PREATTACK_A ); - clearFlags.set( MODELCONDITION_FIRING_A ); - clearFlags.set( MODELCONDITION_USING_WEAPON_A ); - myDraw->clearModelConditionFlags( clearFlags ); - } - - - - if ( ++m_framesToWait < 16) - return UPDATE_SLEEP_NONE; - - m_framesToWait = 0; - - - Locomotor *locomotor = myAI->getCurLocomotor(); - if( !locomotor ) - { - return UPDATE_SLEEP_NONE; - } - - Object *victim = getObject()->getAIUpdateInterface()->getCurrentVictim(); - Object *masterVictim = master->getAIUpdateInterface()->getCurrentVictim(); - - if (masterVictim) - { - m_primaryVictimID = masterVictim->getID(); - } - - Object *primaryVictim = TheGameLogic->findObjectByID(m_primaryVictimID); - - - //now, we don't know if master is standing still or going somewhere, so - Real masterPathDistToGoal = masterAI->getLocomotorDistanceToGoal(); - Real myPathDistToGoal = myAI->getLocomotorDistanceToGoal(); - - - Real catchUpRadiusSquared = ThePartitionManager->getDistanceSquared( me, master, FROM_CENTER_3D ); - // I'm too far from the nexus... I need to catch up now! - if( catchUpRadiusSquared > sqr( data->m_mustCatchUpRadius ) ) - { - - if ( masterAI->isMoving() )// master is on the move - { - if ( masterPathDistToGoal > myPathDistToGoal ) // I'm getting ahead of master, need to slow down - myAI->chooseLocomotorSet(LOCOMOTORSET_WANDER); - else - myAI->chooseLocomotorSet(LOCOMOTORSET_PANIC); // I'm lagging, so I need to snap to it! - - Coord3D nuPos = *masterAI->getGoalPosition(); - - if ( nuPos.length() < 1.0f ) //if a nasty error has sent me to map origin - { - myAI->aiMoveToPosition( master->getPosition(), CMD_FROM_AI ); // NASTY BEEHIVE EFFECT - } - else - { - Coord3D goalDelta = *myAI->getGoalPosition(); - goalDelta.sub( nuPos ); - - if ( goalDelta.length() > 5.0f * PATHFIND_CELL_SIZE_F )// only if I am not headed there already - { - myAI->aiMoveToPosition( &nuPos, CMD_FROM_AI ); // Whither thou goest... THis causes the mob to reconverge - } - } - - // on the fly, instead of doubling back to reconverge - } - else // master is still, so let's re group in a hurry - { - myAI->chooseLocomotorSet(LOCOMOTORSET_PANIC); - myAI->aiMoveToPosition( master->getPosition(), CMD_FROM_AI ); - - } - - - - if (catchUpRadiusSquared > sqr( data->m_mustCatchUpRadius * 3))// I am critically far, now! - { - ++ m_catchUpCrisisTimer; // I'm way too far from the nexus this frame - - if ( m_catchUpCrisisTimer > data->m_catchUpCrisisBailTime) - { - me->kill(); - return UPDATE_SLEEP_NONE; - - // Here is the rethink: - // If the nexus has outrun me to the target by so much, // - // lets make the nexus come to me, and try to return to where I find it -// Coord3D masterPosition = *master->getPosition(); -// master->setPosition( me->getPosition() ); -// if ( ! masterAI->isMoving() ) -// { -// masterAI->aiMoveToPosition( &masterPosition, CMD_FROM_AI ); -// } -// m_catchUpCrisisTimer = 0; - } - else if ( m_catchUpCrisisTimer > data->m_catchUpCrisisBailTime/3 ) - { - myAI->aiMoveToPosition( master->getPosition(), CMD_FROM_AI ); // NASTY BEEHIVE EFFECT - } - } - - - } - else if ( myAI->isMoving() ) // we're all on a trip, together - { - - m_catchUpCrisisTimer = 0; // I'm not too far from the nexus this frame - - Int seed = GameLogicRandomValue( 0, 10 ); - if ( seed == 1 ) - myAI->chooseLocomotorSet(LOCOMOTORSET_WANDER); - else if ( seed == 2 ) - myAI->chooseLocomotorSet(LOCOMOTORSET_PANIC); - else if ( seed == 3 ) - myAI->chooseLocomotorSet(LOCOMOTORSET_NORMAL); - // else if ( seed >= 5 ) // go towards mommy's goal - // { - // Coord3D destination = *me->getPosition(); - // TheAI->pathfinder()->adjustToPossibleDestination(me, myAI->getLocomotorSet(), &destination); - // myAI->aiMoveToPosition( &destination, CMD_FROM_AI ); // reconverge - // } - - } - else // give me something to do while I'm standing here... - { - m_catchUpCrisisTimer = 0; // I'm not too far from the nexus this frame - - SpawnBehaviorInterface *spawnerBehavior = master->getSpawnBehaviorInterface(); - - if ( spawnerBehavior ) // if I have a mommy - { - - if ( masterAI->isIdle() ) // if controlling player has pressed stop, we stop! That's it! - { - myAI->aiIdle(CMD_FROM_AI); - primaryVictim = nullptr; - m_primaryVictimID = INVALID_ID; - return UPDATE_SLEEP_NONE; - } - - if ( spawnerBehavior->maySpawnSelfTaskAI( m_squirrellinessRatio ) ) // if mommy says it is okay - { - if ( myAI->getLastCommandSource() != CMD_FROM_AI ) // I may have been told to attack directly more recently - { - Object *newTarget = myAI->getNextMoodTarget( FALSE, FALSE ); - if ( newTarget && ( newTarget != victim) ) // if there is someone else around to attack - { - victim = newTarget; - myAI->aiAttackObject( newTarget, 999, CMD_FROM_AI ); // go ahead and do it - m_isSelfTasking = TRUE; - } - } - - } - - if ( ! victim ) // If I still don't have anyone to shoot at - { - if ( primaryVictim ) // I remember the last target - { - myAI->aiAttackObject( primaryVictim, 999, CMD_FROM_AI ); - } - else if( ! masterAI->isAttacking())// there Is no previous target and master isn't attacking - { - /// myAI->aiIdle( CMD_FROM_AI );// auto acquire mode - } - m_isSelfTasking = FALSE; - } - } - else - { - DEBUG_ASSERTCRASH(( spawnerBehavior != nullptr ),("Hey!, why for this mob member got no spawner? MLorenzen")); - } - } - - return UPDATE_SLEEP_NONE; -} - - -//------------------------------------------------------------------------------------------------- -// We are too far from nexus, so we need to catch-up -//------------------------------------------------------------------------------------------------- -void MobMemberSlavedUpdate::doCatchUpLogic( Coord3D *pos ) -{ - Coord3D nuPos; - const MobMemberSlavedUpdateModuleData* data = getMobMemberSlavedUpdateModuleData(); - // recalc where we want to be if we wander around - Real randomDirection = GameLogicRandomValue( 0, 2*PI ); - Real randomRadius = GameLogicRandomValue( 0, data->m_noNeedToCatchUpRadius ); - nuPos.set(*pos); - nuPos.x += randomRadius * Cos( randomDirection ); - nuPos.y += randomRadius * Sin( randomDirection ); - nuPos.z = TheTerrainLogic->getGroundHeight( nuPos.x, nuPos.y ); - - AIUpdateInterface *ai = getObject()->getAIUpdateInterface(); - if( ai ) - { - ai->aiMoveToPosition( &nuPos, CMD_FROM_AI ); - } - - setMobState(MOB_STATE_CATCHING_UP); - -} - - - - -//------------------------------------------------------------------------------------------------- -void MobMemberSlavedUpdate::startSlavedEffects( const Object *slaver ) -{ - if( slaver == nullptr ) - return; - - m_slaver = slaver->getID(); - - // mark selves as not selectable - //getObject()->setStatus( OBJECT_STATUS_UNSELECTABLE ); - -} - -//------------------------------------------------------------------------------------------------- -void MobMemberSlavedUpdate::stopSlavedEffects() -{ - m_slaver = INVALID_ID; - - /// @todo Just a thought. Our Status bits on objects really need to be reference counts so you don't clear someone else's flag - getObject()->clearStatus( MAKE_OBJECT_STATUS_MASK( OBJECT_STATUS_UNSELECTABLE ) ); - getObject()->clearDisabled( DISABLED_HELD ); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void MobMemberSlavedUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void MobMemberSlavedUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // slaves - xfer->xferObjectID( &m_slaver ); - - // frames to wait - xfer->xferInt( &m_framesToWait ); - - // mob state - xfer->xferUser( &m_mobState, sizeof( MobStates ) ); - - // personal color - xfer->xferRGBColor( &m_personalColor ); - - // primary victim - xfer->xferObjectID( &m_primaryVictimID ); - - // squirrelliness ration - xfer->xferReal( &m_squirrellinessRatio ); - - // is self tasking - xfer->xferBool( &m_isSelfTasking ); - - // catch up crisis timer - xfer->xferUnsignedInt( &m_catchUpCrisisTimer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void MobMemberSlavedUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp deleted file mode 100644 index d6093b52d8d..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp +++ /dev/null @@ -1,528 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: NeutronMissileSlowDeathBehavior.cpp //////////////////////////////////////////////////////// -// Author: Colin Day, April 2002 -// Desc: Update module for the neutron missile superweapon object -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/GameState.h" -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameClient/FXList.h" -#include "GameClient/Drawable.h" -#include "GameClient/GameClient.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/ObjectIter.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/Module/FlammableUpdate.h" -#include "GameLogic/Module/PhysicsUpdate.h" -#include "GameLogic/Module/NeutronMissileSlowDeathUpdate.h" -#include "GameLogic/Module/ToppleUpdate.h" -#include "GameLogic/TerrainLogic.h" - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -NeutronMissileSlowDeathBehaviorModuleData::NeutronMissileSlowDeathBehaviorModuleData() -{ - - for( Int i = 0; i < MAX_NEUTRON_BLASTS; ++i ) - { - - m_blastInfo[ i ].enabled = FALSE; - m_blastInfo[ i ].delay = 0.0f; - m_blastInfo[ i ].scorchDelay = 0.0f; - m_blastInfo[ i ].innerRadius = 0.0f; - m_blastInfo[ i ].outerRadius = 0.0f; - m_blastInfo[ i ].maxDamage = 0.0f; - m_blastInfo[ i ].minDamage = 0.0f; - m_blastInfo[ i ].toppleSpeed = 0.0f; - m_blastInfo[ i ].pushForceMag = 0.0f; - - } - m_scorchSize = 0.0f; - m_fxList = nullptr; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -/*static*/ void NeutronMissileSlowDeathBehaviorModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - - SlowDeathBehaviorModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "ScorchMarkSize", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_scorchSize ) }, - { "FXList", INI::parseFXList, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_fxList ) }, - - { "Blast1Enabled", INI::parseBool, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_1 ].enabled ) }, - { "Blast1Delay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_1 ].delay ) }, - { "Blast1ScorchDelay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_1 ].scorchDelay ) }, - { "Blast1InnerRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_1 ].innerRadius ) }, - { "Blast1OuterRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_1 ].outerRadius ) }, - { "Blast1MaxDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_1 ].maxDamage ) }, - { "Blast1MinDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_1 ].minDamage ) }, - { "Blast1ToppleSpeed", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_1 ].toppleSpeed ) }, - { "Blast1PushForce", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_1 ].pushForceMag ) }, - - { "Blast2Enabled", INI::parseBool, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_2 ].enabled ) }, - { "Blast2Delay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_2 ].delay ) }, - { "Blast2ScorchDelay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_2 ].scorchDelay ) }, - { "Blast2InnerRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_2 ].innerRadius ) }, - { "Blast2OuterRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_2 ].outerRadius ) }, - { "Blast2MaxDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_2 ].maxDamage ) }, - { "Blast2MinDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_2 ].minDamage ) }, - { "Blast2ToppleSpeed", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_2 ].toppleSpeed ) }, - { "Blast2PushForce", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_2 ].pushForceMag ) }, - - { "Blast3Enabled", INI::parseBool, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_3 ].enabled ) }, - { "Blast3Delay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_3 ].delay ) }, - { "Blast3ScorchDelay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_3 ].scorchDelay ) }, - { "Blast3InnerRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_3 ].innerRadius ) }, - { "Blast3OuterRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_3 ].outerRadius ) }, - { "Blast3MaxDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_3 ].maxDamage ) }, - { "Blast3MinDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_3 ].minDamage ) }, - { "Blast3ToppleSpeed", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_3 ].toppleSpeed ) }, - { "Blast3PushForce", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_3 ].pushForceMag ) }, - - { "Blast4Enabled", INI::parseBool, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_4 ].enabled ) }, - { "Blast4Delay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_4 ].delay ) }, - { "Blast4ScorchDelay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_4 ].scorchDelay ) }, - { "Blast4InnerRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_4 ].innerRadius ) }, - { "Blast4OuterRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_4 ].outerRadius ) }, - { "Blast4MaxDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_4 ].maxDamage ) }, - { "Blast4MinDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_4 ].minDamage ) }, - { "Blast4ToppleSpeed", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_4 ].toppleSpeed ) }, - { "Blast4PushForce", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_4 ].pushForceMag ) }, - - { "Blast5Enabled", INI::parseBool, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_5 ].enabled ) }, - { "Blast5Delay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_5 ].delay ) }, - { "Blast5ScorchDelay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_5 ].scorchDelay ) }, - { "Blast5InnerRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_5 ].innerRadius ) }, - { "Blast5OuterRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_5 ].outerRadius ) }, - { "Blast5MaxDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_5 ].maxDamage ) }, - { "Blast5MinDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_5 ].minDamage ) }, - { "Blast5ToppleSpeed", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_5 ].toppleSpeed ) }, - { "Blast5PushForce", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_5 ].pushForceMag ) }, - - { "Blast6Enabled", INI::parseBool, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_6 ].enabled ) }, - { "Blast6Delay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_6 ].delay ) }, - { "Blast6ScorchDelay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_6 ].scorchDelay ) }, - { "Blast6InnerRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_6 ].innerRadius ) }, - { "Blast6OuterRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_6 ].outerRadius ) }, - { "Blast6MaxDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_6 ].maxDamage ) }, - { "Blast6MinDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_6 ].minDamage ) }, - { "Blast6ToppleSpeed", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_6 ].toppleSpeed ) }, - { "Blast6PushForce", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_6 ].pushForceMag ) }, - - { "Blast7Enabled", INI::parseBool, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_7 ].enabled ) }, - { "Blast7Delay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_7 ].delay ) }, - { "Blast7ScorchDelay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_7 ].scorchDelay ) }, - { "Blast7InnerRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_7 ].innerRadius ) }, - { "Blast7OuterRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_7 ].outerRadius ) }, - { "Blast7MaxDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_7 ].maxDamage ) }, - { "Blast7MinDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_7 ].minDamage ) }, - { "Blast7ToppleSpeed", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_7 ].toppleSpeed ) }, - { "Blast7PushForce", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_7 ].pushForceMag ) }, - - { "Blast8Enabled", INI::parseBool, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_8 ].enabled ) }, - { "Blast8Delay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_8 ].delay ) }, - { "Blast8ScorchDelay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_8 ].scorchDelay ) }, - { "Blast8InnerRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_8 ].innerRadius ) }, - { "Blast8OuterRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_8 ].outerRadius ) }, - { "Blast8MaxDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_8 ].maxDamage ) }, - { "Blast8MinDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_8 ].minDamage ) }, - { "Blast8ToppleSpeed", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_8 ].toppleSpeed ) }, - { "Blast8PushForce", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_8 ].pushForceMag ) }, - - { "Blast9Enabled", INI::parseBool, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_9 ].enabled ) }, - { "Blast9Delay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_9 ].delay ) }, - { "Blast9ScorchDelay", INI::parseDurationReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_9 ].scorchDelay ) }, - { "Blast9InnerRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_9 ].innerRadius ) }, - { "Blast9OuterRadius", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_9 ].outerRadius ) }, - { "Blast9MaxDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_9 ].maxDamage ) }, - { "Blast9MinDamage", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_9 ].minDamage ) }, - { "Blast9ToppleSpeed", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_9 ].toppleSpeed ) }, - { "Blast9PushForce", INI::parseReal, nullptr, offsetof( NeutronMissileSlowDeathBehaviorModuleData, m_blastInfo[ NEUTRON_BLAST_9 ].pushForceMag ) }, - - { nullptr, nullptr, nullptr, 0 } - }; - - p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -NeutronMissileSlowDeathBehavior::NeutronMissileSlowDeathBehavior( Thing *thing, const ModuleData *moduleData ) - : SlowDeathBehavior( thing, moduleData ) -{ - Int i; - - m_scorchPlaced = FALSE; - m_activationFrame = 0; - for( i = 0; i < MAX_NEUTRON_BLASTS; i++ ) - { - - m_completedBlasts[ i ] = FALSE; - m_completedScorchBlasts[ i ] = FALSE; - - } - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -NeutronMissileSlowDeathBehavior::~NeutronMissileSlowDeathBehavior() -{ - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime NeutronMissileSlowDeathBehavior::update() -{ -/// @todo srj use SLEEPY_UPDATE here - // get the module data - const NeutronMissileSlowDeathBehaviorModuleData *modData = getNeutronMissileSlowDeathBehaviorModuleData(); - - // call the base class cause we're extending functionality - SlowDeathBehavior::update(); - - // get out of here if we're not activated yet - if( isSlowDeathActivated() == FALSE ) - return UPDATE_SLEEP_NONE; - - // get the current frame - UnsignedInt currFrame = TheGameLogic->getFrame(); - - // when we become activated we want to do a few things - if( m_activationFrame == 0 ) - { - Coord3D pos; - const Coord3D *missilePos = getObject()->getPosition(); - - // get the position to play the effect at on the ground - pos.x = missilePos->x; - pos.y = missilePos->y; - pos.z = TheTerrainLogic->getGroundHeight( pos.x, pos.y ); - - // record the frame - m_activationFrame = currFrame; - - FXList::doFXPos( modData->m_fxList, &pos ); - } - - // see if it's time for any explosions - for( Int i = 0; i < MAX_NEUTRON_BLASTS; i++ ) - { - - // if this blast is not enabled we will not bother with it - if( modData->m_blastInfo[ i ].enabled == FALSE ) - continue; - - // has the time of this blast come - if( m_completedBlasts[ i ] == FALSE && - (currFrame - m_activationFrame > modData->m_blastInfo[ i ].delay) ) - { - - // do the blast - doBlast( &modData->m_blastInfo[ i ] ); - - // mark this blast as complete now - m_completedBlasts[ i ] = TRUE; - - } - - // has the time for a scorch blast come - if( m_completedScorchBlasts[ i ] == FALSE && - (currFrame - m_activationFrame > modData->m_blastInfo[ i ].scorchDelay) ) - { - - // do the scorch blast - doScorchBlast( &modData->m_blastInfo[ i ] ); - - // mark this scorch blast as complete now - m_completedScorchBlasts[ i ] = TRUE; - - } - - } - - return UPDATE_SLEEP_NONE; - -} - -// ------------------------------------------------------------------------------------------------ -/** Do a single blast for the bomb */ -// ------------------------------------------------------------------------------------------------ -void NeutronMissileSlowDeathBehavior::doBlast( const BlastInfo *blastInfo ) -{ - - // sanity - if( blastInfo == nullptr ) - return; - - // get the module data - const NeutronMissileSlowDeathBehaviorModuleData *modData = getNeutronMissileSlowDeathBehaviorModuleData(); - - // get the object and position - Object *missile = getObject(); - const Coord3D *missilePos = missile->getPosition(); - - // setup a damage info structure to do some damage - DamageInfo damageInfo; - damageInfo.in.m_damageType = DAMAGE_EXPLOSION; - damageInfo.in.m_deathType = DEATH_EXPLODED; - damageInfo.in.m_sourceID = missile->getID(); - damageInfo.in.m_amount = blastInfo->minDamage; - - // scan objects around us and do damage to objects we have "passed over" and are behind us - if( blastInfo->outerRadius ) - { - ObjectIterator *iter = ThePartitionManager->iterateObjectsInRange( missilePos, - blastInfo->outerRadius, - FROM_CENTER_2D, - nullptr ); - MemoryPoolObjectHolder hold( iter ); - Object *other; - const Coord3D *otherPos; - Coord3D forceVector; - Real dist; - for( other = iter->first(); other; other = iter->next() ) - { - - // get other position - otherPos = other->getPosition(); - - // compute vector from the missile to other object - forceVector.x = otherPos->x - missilePos->x; - forceVector.y = otherPos->y - missilePos->y; - forceVector.z = otherPos->z - missilePos->z; - - // try to topple other object - other->topple( &forceVector, blastInfo->toppleSpeed, TOPPLE_OPTIONS_NO_BOUNCE | - TOPPLE_OPTIONS_NO_FX ); - - // - // compute how much damage we're going to do to this object ... if the object - // is inside the inner radius we do the full damage. Outside of the inner radius - // we do a percentage based on how far away from the inner radius it is, but we - // will always do at least blastInfo->minDamage amount of damage - // - dist = forceVector.length(); - if( dist <= blastInfo->innerRadius ) - damageInfo.in.m_amount = blastInfo->maxDamage; - else - { - Real percent; - - percent = 1.0f - ((dist - blastInfo->innerRadius) / (blastInfo->outerRadius - blastInfo->innerRadius + 0.01f)); - damageInfo.in.m_amount = blastInfo->maxDamage * percent; - if( damageInfo.in.m_amount < blastInfo->minDamage ) - damageInfo.in.m_amount = blastInfo->minDamage; - - } - - // do actual damage - if( damageInfo.in.m_amount ) - { - - // do damage - other->attemptDamage( &damageInfo ); - - // place a scorch mark if we haven't already - if( m_scorchPlaced == FALSE ) - { - - TheGameClient->addScorch( missilePos, modData->m_scorchSize, SCORCH_1 ); - m_scorchPlaced = TRUE; - - } - - } - -/* - // apply a small force to the object from the shockwave center - PhysicsBehavior *physics = other->getPhysics(); - if( physics ) - { - Coord3D physicsForce = forceVector; - - // normalize the physics force - physicsForce.normalize(); - - // - // change the magnitude of the physics force to the force amount we want to apply from - // the shockwave - // - physicsForce.x *= blastInfo->pushForceMag; - physicsForce.y *= blastInfo->pushForceMag; - physicsForce.z *= blastInfo->pushForceMag; - - // apply the force - physics->applyForce( &physicsForce ); - - } -*/ - - } - - } - -} - -// ------------------------------------------------------------------------------------------------ -/** Do a scorch blast event ... this doesn't do actual damage, but it "scorches" things */ -// ------------------------------------------------------------------------------------------------ -void NeutronMissileSlowDeathBehavior::doScorchBlast( const BlastInfo *blastInfo ) -{ - - // sanity - if( blastInfo == nullptr ) - return; - - // get the module data -// const NeutronMissileSlowDeathBehaviorModuleData *modData = getNeutronMissileSlowDeathBehaviorModuleData(); - - // get the object and position - Object *missile = getObject(); - const Coord3D *missilePos = missile->getPosition(); - - // scan objects around us and do damage to objects we have "passed over" and are behind us - if( blastInfo->outerRadius ) - { - ObjectIterator *iter = ThePartitionManager->iterateObjectsInRange( missilePos, - blastInfo->outerRadius, - FROM_CENTER_2D, - nullptr ); - MemoryPoolObjectHolder hold( iter ); - Object *other; - for( other = iter->first(); other; other = iter->next() ) - { - - // set things aflame - ///@todo can't to this now, flames eat too many particles - // static NameKeyType flammableKey = NAMEKEY( "FlammableUpdate" ); - // FlammableUpdate *update = (FlammableUpdate *)other->findUpdateModule( flammableKey ); - // if( update ) - // update->tryToIgnite(); - - // set model condition as all burnt up - other->setModelConditionState( MODELCONDITION_BURNED ); - - // remove the shadows from trees - if( other->isKindOf( KINDOF_SHRUBBERY ) ) - { - Drawable *draw = other->getDrawable(); - - if( draw ) - draw->setShadowsEnabled( FALSE ); - - } - - } - - } - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void NeutronMissileSlowDeathBehavior::crc( Xfer *xfer ) -{ - - // extend base class - SlowDeathBehavior::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void NeutronMissileSlowDeathBehavior::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - SlowDeathBehavior::xfer( xfer ); - - // activation frame - xfer->xferUnsignedInt( &m_activationFrame ); - - // size of MAX_NEUTRON_BLASTS since we use it for two arrays here - UnsignedByte maxNeutronBlasts = MAX_NEUTRON_BLASTS; - xfer->xferUnsignedByte( &maxNeutronBlasts ); - if( maxNeutronBlasts != MAX_NEUTRON_BLASTS ) - { - - DEBUG_CRASH(( "NeutronMissileSlowDeathBehavior::xfer - Size of MAX_NEUTRON_BLASTS has changed, you must version this xfer code and then you can remove this error message" )); - throw SC_INVALID_DATA; - - } - - // completed blasts - UnsignedByte i; - for( i = 0; i < maxNeutronBlasts; ++i ) - xfer->xferBool( &m_completedBlasts[ i ] ); - - // completed scorch blasts - for( i = 0; i < maxNeutronBlasts; ++i ) - xfer->xferBool( &m_completedScorchBlasts[ i ] ); - - // scorch placed - xfer->xferBool( &m_scorchPlaced ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void NeutronMissileSlowDeathBehavior::loadPostProcess() -{ - - // extend base class - SlowDeathBehavior::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp deleted file mode 100644 index 0ed06531400..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PilotFindVehicleUpdate.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, August 2002 -// Desc: Update module to handle independent targeting of hazards to cleanup. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#define DEFINE_WEAPONSLOTTYPE_NAMES - -#include "GameClient/Drawable.h" - -#include "Common/ActionManager.h" -#include "Common/Player.h" -#include "Common/RandomValue.h" -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" - -#include "GameLogic/GameLogic.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/Object.h" -#include "GameLogic/ObjectIter.h" -#include "GameLogic/Module/PilotFindVehicleUpdate.h" -#include "GameLogic/Module/AIUpdate.h" -#include "GameLogic/Module/CollideModule.h" - - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -PilotFindVehicleUpdateModuleData::PilotFindVehicleUpdateModuleData() -{ - m_scanFrames = 0; - m_scanRange = 0.0f; - m_minHealth = 0.5f; -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void PilotFindVehicleUpdateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - ModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "ScanRate", INI::parseDurationUnsignedInt, nullptr, offsetof( PilotFindVehicleUpdateModuleData, m_scanFrames ) }, - { "ScanRange", INI::parseReal, nullptr, offsetof( PilotFindVehicleUpdateModuleData, m_scanRange ) }, - { "MinHealth", INI::parseReal, nullptr, offsetof( PilotFindVehicleUpdateModuleData, m_minHealth ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -PilotFindVehicleUpdate::PilotFindVehicleUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - m_didMoveToBase = false; - setWakeFrame(getObject(), UPDATE_SLEEP_NONE); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -PilotFindVehicleUpdate::~PilotFindVehicleUpdate() -{ - -} - - -//------------------------------------------------------------------------------------------------- -void PilotFindVehicleUpdate::onObjectCreated() -{ - -} - -//------------------------------------------------------------------------------------------------- -/** The update callback. */ -//------------------------------------------------------------------------------------------------- -UpdateSleepTime PilotFindVehicleUpdate::update() -{ - - Object *obj = getObject(); - if (obj->getControllingPlayer()->getPlayerType() == PLAYER_HUMAN) { - // This is an ai only behavior. - return UPDATE_SLEEP_FOREVER; - } - const PilotFindVehicleUpdateModuleData *data = getPilotFindVehicleUpdateModuleData(); - - AIUpdateInterface *ai = obj->getAI(); - if (ai==nullptr) return UPDATE_SLEEP_FOREVER; - - if( !ai->isIdle() ) - { - return UPDATE_SLEEP(data->m_scanFrames); - } - - //Periodic scanning (expensive) - Object *upgradeUnit = scanClosestTarget(); - if(upgradeUnit) - { - ai->aiEnter(upgradeUnit, CMD_FROM_AI); - m_didMoveToBase = false; - } else { - Coord3D pos; - // Try moving to base 1 time. - if (!m_didMoveToBase && obj->getControllingPlayer()->getAiBaseCenter(&pos)) { - ai->aiMoveToPosition(&pos, CMD_FROM_AI); - m_didMoveToBase = true; - } - } - return UPDATE_SLEEP(data->m_scanFrames); -} - - -//------------------------------------------------------------------------------------------------- -Object* PilotFindVehicleUpdate::scanClosestTarget() -{ - const PilotFindVehicleUpdateModuleData *data = getPilotFindVehicleUpdateModuleData(); - Object *me = getObject(); - - PartitionFilterAcceptByKindOf kindFilter(MAKE_KINDOF_MASK(KINDOF_VEHICLE), KINDOFMASK_NONE); - PartitionFilterAlive aliveFilter; - PartitionFilterPlayer playerFilter(me->getControllingPlayer(), true); - PartitionFilterSameMapStatus filterMapStatus(getObject()); - PartitionFilter *filters[5]; - filters[0] = &kindFilter; - filters[1] = &aliveFilter; - filters[2] = &playerFilter; - filters[3] = &filterMapStatus; - filters[4] = nullptr; - - ObjectIterator *iter = ThePartitionManager->iterateObjectsInRange( me->getPosition(), data->m_scanRange, - FROM_CENTER_2D, filters, ITER_SORTED_NEAR_TO_FAR ); - MemoryPoolObjectHolder hold(iter); - - for( Object *other = iter->first(); other; other = iter->next() ) - { - // Check health. - BodyModuleInterface *body = other->getBodyModule(); - if (!body) continue; - // If we're real healthy, don't bother looking for healing. - if (body->getHealth() < body->getMaxHealth()*data->m_minHealth) - { - continue; - } - // first, see if we'd like to collide with 'other' - for (BehaviorModule** m = me->getBehaviorModules(); *m; ++m) - { - CollideModuleInterface* collide = (*m)->getCollide(); - if (!collide) - continue; - - if( collide->wouldLikeToCollideWith( other ) ) - { - return other; - } - } - } - return nullptr; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void PilotFindVehicleUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void PilotFindVehicleUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // did move to base - xfer->xferBool( &m_didMoveToBase ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void PilotFindVehicleUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PowerPlantUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PowerPlantUpdate.cpp deleted file mode 100644 index de277a4994f..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PowerPlantUpdate.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PowerPlantUpdate.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Amit Kumar, August 2002 -// Desc: Updating the power plant -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ModelState.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameClient/InGameUI.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/PowerPlantUpdate.h" - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -PowerPlantUpdateModuleData::PowerPlantUpdateModuleData() -{ - - m_rodsExtendTime = 0; - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -PowerPlantUpdate::PowerPlantUpdate( Thing *thing, const ModuleData *moduleData ) - : UpdateModule( thing, moduleData ) -{ - - m_extended = FALSE; - setWakeFrame(getObject(), UPDATE_SLEEP_FOREVER); - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -PowerPlantUpdate::~PowerPlantUpdate() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void PowerPlantUpdate::extendRods( Bool extend ) -{ - if (extend) - { - if (!m_extended) - { - const PowerPlantUpdateModuleData *modData = getPowerPlantUpdateModuleData(); - - // set the model condition for radar extension - Drawable *draw = getObject()->getDrawable(); - if( draw ) - draw->setModelConditionState( MODELCONDITION_POWER_PLANT_UPGRADING ); - - m_extended = TRUE; - setWakeFrame(getObject(), UPDATE_SLEEP(modData->m_rodsExtendTime)); - } - } - else - { - // they de-extend instantly. - Drawable *draw = getObject()->getDrawable(); - if( draw ) - draw->clearModelConditionFlags( MAKE_MODELCONDITION_MASK2( MODELCONDITION_POWER_PLANT_UPGRADING, - MODELCONDITION_POWER_PLANT_UPGRADED) ); - - m_extended = FALSE; - setWakeFrame(getObject(), UPDATE_SLEEP_FOREVER); - } - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpdateSleepTime PowerPlantUpdate::update() -{ - // remove the extending condition and set the extended condition - Drawable *draw = getObject()->getDrawable(); - if( draw ) - draw->clearAndSetModelConditionState( MODELCONDITION_POWER_PLANT_UPGRADING, - MODELCONDITION_POWER_PLANT_UPGRADED ); - - m_extended = TRUE; - return UPDATE_SLEEP_FOREVER; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void PowerPlantUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void PowerPlantUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // extend complete - xfer->xferBool( &m_extended ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void PowerPlantUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp deleted file mode 100644 index 4be24cd0867..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp +++ /dev/null @@ -1,349 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: QueueProductionExitUpdate.cpp ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, January, 2002 -// Desc: Hand off produced Units to me so I can Exit them into the world with my specific style -// This instance refuses to spit a second out until the first is clear -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/RandomValue.h" -#include "Common/ThingTemplate.h" -#include "Common/Xfer.h" -#include "Lib/BaseType.h" -#include "GameLogic/AI.h" -#include "GameLogic/AIPathfind.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/AIUpdate.h" -#include "GameLogic/Module/PhysicsUpdate.h" -#include "GameLogic/Module/QueueProductionExitUpdate.h" - -//------------------------------------------------------------------------------------------------- -QueueProductionExitUpdate::QueueProductionExitUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - m_currentDelay = 0; - - m_creationClearDistance = 0; - m_rallyPoint.zero(); - // no rally point has been set - m_rallyPointExists = false; - m_currentBurstCount = 0; - const QueueProductionExitUpdateModuleData* md = getQueueProductionExitUpdateModuleData(); - if (md) //sanity - { - m_currentBurstCount = md->m_initialBurst; - } -} - -//------------------------------------------------------------------------------------------------- -QueueProductionExitUpdate::~QueueProductionExitUpdate() -{ -} - -//------------------------------------------------------------------------------------------------- -void QueueProductionExitUpdate::exitObjectViaDoor( Object *newObj, ExitDoorType exitDoor ) -{ - DEBUG_ASSERTCRASH(exitDoor == DOOR_1, ("multiple exit doors not supported here")); - - Object *creationObject = getObject(); - if (creationObject) - { - const QueueProductionExitUpdateModuleData* md = getQueueProductionExitUpdateModuleData(); - - Real exitAngle = creationObject->getOrientation(); - const Matrix3D *transform = creationObject->getTransformMatrix(); - Vector3 loc; - Coord3D createPoint; - - // - // calculate the position to create the object at, we take the coord specified - // in INI which is in model space, rotate it to match the building angle - // and translate for building location via a transform call - // - loc.Set( md->m_unitCreatePoint.x, md->m_unitCreatePoint.y, md->m_unitCreatePoint.z ); - transform->Transform_Vector( *transform, loc, &loc ); - - Bool creationInAir = FALSE; - if( TheTerrainLogic ) - { - if( loc.Z != TheTerrainLogic->getGroundHeight( loc.X, loc.Y ) ) - creationInAir = TRUE; - } - // make sure the point is on the terrain - if( creationInAir && !md->m_allowAirborneCreationData ) - loc.Z = TheTerrainLogic ? TheTerrainLogic->getGroundHeight( loc.X, loc.Y ) : 0.0f; - - // we need it in Coord3D form - createPoint.x = loc.X; - createPoint.y = loc.Y; - createPoint.z = loc.Z; - - newObj->setPosition( &createPoint ); - newObj->setOrientation( exitAngle ); - - // - // Objects that are created in the air from producers that are in the air get - // a kick that will make their starting speed equal mine. - // - PhysicsBehavior *newObjectPhysics = newObj->getPhysics(); - PhysicsBehavior *myPhysics = creationObject->getPhysics(); - - if( (myPhysics != nullptr) && creationInAir && (newObjectPhysics != nullptr) ) - { - Coord3D startingForce = *myPhysics->getVelocity(); - startingForce.x *= newObjectPhysics->getMass(); - startingForce.y *= newObjectPhysics->getMass(); - startingForce.z *= newObjectPhysics->getMass(); - newObjectPhysics->applyMotiveForce( &startingForce ); - - const Real STARTING_PITCH_COEFF = 0.04f; - Real pitchRate = newObjectPhysics->getCenterOfMassOffset() * STARTING_PITCH_COEFF; - newObjectPhysics->setPitchRate( pitchRate ); - } - - - /** @todo This really should be automatically wrapped up in an activation sequence - for objects in general */ - // tell the AI about it - TheAI->pathfinder()->addObjectToPathfindMap( newObj ); - Coord3D tmp; - getNaturalRallyPoint(tmp); - // Grid it. - TheAI->pathfinder()->snapPosition(newObj, &tmp); - std::vector exitPath; - exitPath.push_back(tmp); - - AIUpdateInterface *ai = newObj->getAIUpdateInterface(); - if (m_rallyPointExists) - { - tmp = m_rallyPoint; - if (ai && ai->isDoingGroundMovement()) - { - if (TheAI->pathfinder()->adjustDestination(newObj, ai->getLocomotorSet(), &tmp)) - exitPath.push_back(tmp); - - } - } else { - // Double the destination to keep redguards from stacking. - exitPath.push_back(tmp); - } - if (ai) { - ai->aiFollowExitProductionPath( &exitPath, creationObject, CMD_FROM_AI ); - } - m_currentDelay = md->m_exitDelayData; - - if (m_currentBurstCount) - m_currentBurstCount--; // fewer and fewer units to burst - - } - -} - - -Bool QueueProductionExitUpdate::getExitPosition( Coord3D& exitPosition ) const -{ - const Object *obj = getObject(); - if (!obj) - return FALSE; - - const Matrix3D *transform = obj->getTransformMatrix(); - - const QueueProductionExitUpdateModuleData *md = getQueueProductionExitUpdateModuleData(); - - Vector3 loc; - loc.Set( md->m_unitCreatePoint.x, md->m_unitCreatePoint.y, md->m_unitCreatePoint.z ); - transform->Transform_Vector( *transform, loc, &loc ); - - exitPosition.x = loc.X; - exitPosition.y = loc.Y; - exitPosition.z = loc.Z; - - return TRUE; - -} - - -//------------------------------------------------------------------------------------------------- -ExitDoorType QueueProductionExitUpdate::reserveDoorForExit( const ThingTemplate* objType, Object *specificObject ) -{ - return isFreeToExit() ? DOOR_1 : DOOR_NONE_AVAILABLE; -} - -//------------------------------------------------------------------------------------------------- -void QueueProductionExitUpdate::unreserveDoorForExit( ExitDoorType exitDoor ) -{ - /* nothing */ -} - -//------------------------------------------------------------------------------------------------- -Bool QueueProductionExitUpdate::isFreeToExit() const -{ - Bool stillBursting = (m_currentBurstCount > 0); - Bool stillDelaying = (m_currentDelay != 0); - - if ( stillBursting ) - { - return TRUE; - } - - return ( ! stillDelaying ); -} - -//------------------------------------------------------------------------------------------------- -UpdateSleepTime QueueProductionExitUpdate::update() -{ - // This update needs to decide when we are again free to exit something - if (isFreeToExit()) - { - m_currentDelay = 0; - return UPDATE_SLEEP_NONE; - } - - m_currentDelay--; - return UPDATE_SLEEP_NONE; -} - -//------------------------------------------------------------------------------------------------- -void QueueProductionExitUpdate::exitObjectByBudding( Object *newObj, Object *budHost ) -{ - if (budHost) // object has provided a host for us - { - const Coord3D *newPos = budHost->getPosition(); - Real newAngle = budHost->getOrientation(); - PathfindLayerEnum newLayer = budHost->getLayer(); - - newObj->setPosition( newPos ); - newObj->setOrientation( newAngle ); - newObj->setLayer(newLayer); - - } - else // we need to just copy the host object - { - newObj->setPosition( getObject()->getPosition() ); - newObj->setOrientation( getObject()->getOrientation() ); - } - - //This causes the formation to break like billard balls - AIUpdateInterface *ai = newObj->getAI(); - if (ai) - { - ai->aiMoveToPosition( newObj->getPosition(), CMD_FROM_AI );// IOW, I cant stay here, if somebody else is here - } - - const QueueProductionExitUpdateModuleData* data = getQueueProductionExitUpdateModuleData(); - m_currentDelay = data->m_exitDelayData; - - if (m_currentBurstCount) - m_currentBurstCount--; // fewer and fewer units to burst - -} - - - - - -Bool QueueProductionExitUpdate::getNaturalRallyPoint( Coord3D& rallyPoint, Bool offset ) const -{ - const QueueProductionExitUpdateModuleData *data = getQueueProductionExitUpdateModuleData(); - Vector3 p; - - // - // get the natural rally point from the INI definition, this coord is in model space relative - // to the model (0,0,0) - // - p.X = data->m_naturalRallyPoint.x; - p.Y = data->m_naturalRallyPoint.y; - p.Z = data->m_naturalRallyPoint.z; - - if ( offset ) - { - Vector3 offset = p; - offset.Normalize(); - offset *= (2*PATHFIND_CELL_SIZE_F); - p+=offset; - } - - // transform the point into world space - const Matrix3D *transform = getObject()->getTransformMatrix(); - transform->Transform_Vector( *transform, p, &p ); - rallyPoint.x = p.X; rallyPoint.y = p.Y; rallyPoint.z = p.Z; - return TRUE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void QueueProductionExitUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void QueueProductionExitUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // current delay - xfer->xferUnsignedInt( &m_currentDelay ); - - // rally point - xfer->xferCoord3D( &m_rallyPoint ); - - // rally point exists - xfer->xferBool( &m_rallyPointExists ); - - // creation clear distance - xfer->xferReal( &m_creationClearDistance ); - - // current burst count - xfer->xferUnsignedInt( &m_currentBurstCount ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void QueueProductionExitUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp deleted file mode 100644 index 987880e996b..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SpawnPointProductionExitUpdate.cpp ///////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, April 2002 -// Desc: Hand off produced Units to me so I can Exit them into the world with my specific style -// This instance puts guys at named bones. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/AI.h" -#include "GameLogic/AIPathfind.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/TerrainLogic.h" -#include "GameLogic/Module/SpawnPointProductionExitUpdate.h" - -#include "WWMath/matrix3d.h" ///< @todo Replace with our own matrix library - -//------------------------------------------------------------------------------------------------- -SpawnPointProductionExitUpdate::SpawnPointProductionExitUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - m_bonesInitialized = FALSE; - m_spawnPointCount = 0; - for( Int positionIndex = 0; positionIndex < MAX_SPAWN_POINTS; positionIndex++ ) - { - m_worldCoordSpawnPoints[positionIndex].zero(); - m_worldAngleSpawnPoints[positionIndex] = 0.0f; - m_spawnPointOccupier[positionIndex] = INVALID_ID; - } - setWakeFrame(getObject(), UPDATE_SLEEP_FOREVER); -} - -//------------------------------------------------------------------------------------------------- -SpawnPointProductionExitUpdate::~SpawnPointProductionExitUpdate() -{ -} - -//------------------------------------------------------------------------------------------------- -void SpawnPointProductionExitUpdate::exitObjectViaDoor( Object *newObj, ExitDoorType exitDoor ) -{ - DEBUG_ASSERTCRASH(exitDoor == DOOR_1, ("multiple exit doors not supported here")); - - if( !m_bonesInitialized ) - initializeBonePositions(); - - Object *creationObject = getObject(); - if (creationObject) - { - Int positionIndex = 0; - for( ; positionIndex < m_spawnPointCount; positionIndex++ ) - { - if( m_spawnPointOccupier[positionIndex] == INVALID_ID ) - break; - } - if( positionIndex == m_spawnPointCount ) - { - DEBUG_CRASH( ("A SpawnPoint exit thought it had room but then failed") ); - return; - } - - Coord3D createPoint; - Real createAngle; - - // Get the location from our bone array - createPoint = m_worldCoordSpawnPoints[positionIndex]; - - // make sure the point is on the terrain - createPoint.z = TheTerrainLogic ? TheTerrainLogic->getLayerHeight( createPoint.x, createPoint.y, creationObject->getLayer()) : 0.0f; - - // get the angle - createAngle = m_worldAngleSpawnPoints[positionIndex]; - - // record him as taking this spot - m_spawnPointOccupier[positionIndex] = newObj->getID(); - - // put him there - newObj->setPosition( &createPoint ); - newObj->setOrientation( createAngle ); - newObj->setLayer(creationObject->getLayer()); - - /** @todo This really should be automatically wrapped up in an activation sequence - for objects in general */ - // tell the AI about it - TheAI->pathfinder()->addObjectToPathfindMap( newObj ); - - // You are stuck here, little man. - newObj->setDisabled( DISABLED_HELD ); - } -} - -//------------------------------------------------------------------------------------------------- -ExitDoorType SpawnPointProductionExitUpdate::reserveDoorForExit( const ThingTemplate* objType, Object *specificObject ) -{ - if( !m_bonesInitialized ) - initializeBonePositions(); - - if( !m_bonesInitialized ) - return DOOR_NONE_AVAILABLE; // Init failure - - revalidateOccupiers(); - - for( Int positionIndex = 0; positionIndex < m_spawnPointCount; positionIndex++ ) - { - if( m_spawnPointOccupier[positionIndex] == INVALID_ID ) - return DOOR_1; - } - - return DOOR_NONE_AVAILABLE; -} - -//------------------------------------------------------------------------------------------------- -void SpawnPointProductionExitUpdate::unreserveDoorForExit( ExitDoorType exitDoor ) -{ - /* nothing */ -} - -//------------------------------------------------------------------------------------------------- -void SpawnPointProductionExitUpdate::initializeBonePositions() -{ - Object *me = getObject(); - Drawable *myDrawable = me->getDrawable(); - - // This fundamental failure will result in this never ever thinking it is free - if( myDrawable == nullptr ) - return; - - Matrix3D boneTransforms[MAX_SPAWN_POINTS]; - Int matrixIndex = 0; - for( ; matrixIndex < MAX_SPAWN_POINTS; matrixIndex++ ) - boneTransforms[matrixIndex].Make_Identity(); - - // Get all the bones of the right name - const SpawnPointProductionExitUpdateModuleData* md = getSpawnPointProductionExitUpdateModuleData(); - m_spawnPointCount = myDrawable->getPristineBonePositions( md->m_spawnPointBoneNameData.str(), 1, nullptr, boneTransforms, MAX_SPAWN_POINTS ); - - for( matrixIndex = 0; matrixIndex < m_spawnPointCount; matrixIndex++ ) - { - Matrix3D *currentTransform = &(boneTransforms[matrixIndex]); - // Convert their matrix one by one - me->convertBonePosToWorldPos( nullptr, currentTransform, nullptr, currentTransform ); - - // Then save the world coord and angle - m_worldCoordSpawnPoints[matrixIndex].x = currentTransform->Get_X_Translation(); - m_worldCoordSpawnPoints[matrixIndex].y = currentTransform->Get_Y_Translation(); - m_worldCoordSpawnPoints[matrixIndex].z = 0; //set at creation time - - m_worldAngleSpawnPoints[matrixIndex] = currentTransform->Get_Z_Rotation(); - } - - m_bonesInitialized = TRUE; -} - -//------------------------------------------------------------------------------------------------- -void SpawnPointProductionExitUpdate::revalidateOccupiers() -{ - for( Int positionIndex = 0; positionIndex < m_spawnPointCount; positionIndex++ ) - { - if( m_spawnPointOccupier[positionIndex] == INVALID_ID ) - continue; - - if( TheGameLogic->findObjectByID( m_spawnPointOccupier[positionIndex] ) == nullptr ) - m_spawnPointOccupier[positionIndex] = INVALID_ID; - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void SpawnPointProductionExitUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void SpawnPointProductionExitUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // - // we can ignore all the data with the bone position arrays and spawn point counts - // because this module will load them lazily - // - // Bool m_bonesInitialized; ///< To prevent creation bugs, only init the World coords when first asked for one - // Int m_spawnPointCount; ///< How many in the array are actually live and valid - // Coord3D m_worldCoordSpawnPoints[MAX_SPAWN_POINTS];///< Where my little friends will be created - // Real m_worldAngleSpawnPoints[MAX_SPAWN_POINTS]; ///< And what direction they should face - - // spawn point occupants - xfer->xferUser( &m_spawnPointOccupier, sizeof( ObjectID ) * MAX_SPAWN_POINTS ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void SpawnPointProductionExitUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProneUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProneUpdate.cpp deleted file mode 100644 index 0461e0d9517..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProneUpdate.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ProneUpdate.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: Update module to encapsulate what it means to be "prone" -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" - -#include "GameClient/Drawable.h" - -#include "GameLogic/Damage.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/ProneUpdate.h" - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ProneUpdateModuleData::ProneUpdateModuleData() : - m_damageToFramesRatio(1.0f) -{ -} - -//------------------------------------------------------------------------------------------------- -/*static*/ void ProneUpdateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - ModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "DamageToFramesRatio", INI::parseReal, nullptr, offsetof(ProneUpdateModuleData, m_damageToFramesRatio) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -ProneUpdate::ProneUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - m_proneFrames = 0; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ProneUpdate::~ProneUpdate() -{ - -} - -//------------------------------------------------------------------------------------------------- -/** The update callback. */ -//------------------------------------------------------------------------------------------------- -UpdateSleepTime ProneUpdate::update() -{ -/// @todo srj use SLEEPY_UPDATE here - if( m_proneFrames > 0 ) - { - m_proneFrames--; - if( m_proneFrames == 0 ) - stopProneEffects(); - } - return UPDATE_SLEEP_NONE; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void ProneUpdate::goProne( const DamageInfo *damageInfo ) -{ - //add to the prone time - Bool wasProne = (m_proneFrames > 0); - Int damageTaken = damageInfo->out.m_actualDamageDealt; - m_proneFrames += damageTaken * getProneUpdateModuleData()->m_damageToFramesRatio; - - if( !wasProne && (m_proneFrames > 0) ) - startProneEffects(); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void ProneUpdate::startProneEffects() -{ - Object *me = getObject(); - me->getDrawable()->setModelConditionState( MODELCONDITION_PRONE ); - me->setStatus( MAKE_OBJECT_STATUS_MASK( OBJECT_STATUS_NO_ATTACK ) ); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void ProneUpdate::stopProneEffects() -{ - Object *me = getObject(); - me->getDrawable()->clearModelConditionState( MODELCONDITION_PRONE ); - me->clearStatus( MAKE_OBJECT_STATUS_MASK( OBJECT_STATUS_NO_ATTACK ) ); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ProneUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ProneUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // prone frames - xfer->xferInt( &m_proneFrames ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ProneUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} - diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/RadarUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/RadarUpdate.cpp deleted file mode 100644 index fd0fab45a7f..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/RadarUpdate.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RadarUpdate.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, April 2002 -// Desc: Updating a radar on an object -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// USER INCLUDES ////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ModelState.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/RadarUpdate.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -RadarUpdateModuleData::RadarUpdateModuleData() -{ - - m_radarExtendTime = 0.0f; - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -RadarUpdate::RadarUpdate( Thing *thing, const ModuleData *moduleData ) - : UpdateModule( thing, moduleData ) -{ - - m_radarActive = FALSE; - m_extendDoneFrame = 0; - m_extendComplete = FALSE; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -RadarUpdate::~RadarUpdate() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void RadarUpdate::extendRadar() -{ - const RadarUpdateModuleData *modData = getRadarUpdateModuleData(); - - // set the model condition for radar extension - Drawable *draw = getObject()->getDrawable(); - if( draw ) - draw->setModelConditionState( MODELCONDITION_RADAR_EXTENDING ); - - // mark the frame that the extension will be done on - m_extendDoneFrame = TheGameLogic->getFrame() + modData->m_radarExtendTime; - - //Change this to make the radar active after extension... - m_radarActive = true; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpdateSleepTime RadarUpdate::update() -{ -/// @todo srj use SLEEPY_UPDATE here - - // if no extend frame nothing to do - if( m_extendDoneFrame == 0 ) - return UPDATE_SLEEP_NONE; - - // check to see if our extension is already done - if( m_extendComplete == TRUE ) - return UPDATE_SLEEP_NONE; - - // see if it's time to stop the extension - if( TheGameLogic->getFrame() > m_extendDoneFrame ) - { - - // mark extend as done - m_extendComplete = TRUE; - m_extendDoneFrame = 0; // just to be clean - - // remove the extending condition and set the extended condition - Drawable *draw = getObject()->getDrawable(); - if( draw ) - draw->clearAndSetModelConditionState( MODELCONDITION_RADAR_EXTENDING, - MODELCONDITION_RADAR_UPGRADED ); - - } - - return UPDATE_SLEEP_NONE; - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void RadarUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void RadarUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // extend done frame - xfer->xferUnsignedInt( &m_extendDoneFrame ); - - // extend complete - xfer->xferBool( &m_extendComplete ); - - // radar active - xfer->xferBool( &m_radarActive ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void RadarUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} - diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp deleted file mode 100644 index 00853f96524..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RadiusDecalUpdate.cpp /////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/RandomValue.h" -#include "Common/Xfer.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/Module/RadiusDecalUpdate.h" -#include "GameLogic/Object.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -RadiusDecalUpdate::RadiusDecalUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModule( thing, moduleData ) -{ - m_deliveryDecal.clear(); - m_killWhenNoLongerAttacking = false; - setWakeFrame(getObject(), UPDATE_SLEEP_FOREVER); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -RadiusDecalUpdate::~RadiusDecalUpdate() -{ - m_deliveryDecal.clear(); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void RadiusDecalUpdate::createRadiusDecal( const RadiusDecalTemplate& tmpl, Real radius, const Coord3D& pos ) -{ - m_deliveryDecal.clear(); - tmpl.createRadiusDecal(pos, radius, getObject()->getControllingPlayer(), m_deliveryDecal); - setWakeFrame(getObject(), m_deliveryDecal.isEmpty() ? UPDATE_SLEEP_FOREVER : UPDATE_SLEEP_NONE); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void RadiusDecalUpdate::killRadiusDecal() -{ - m_deliveryDecal.clear(); - setWakeFrame(getObject(), UPDATE_SLEEP_FOREVER); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UpdateSleepTime RadiusDecalUpdate::update() -{ - if (m_killWhenNoLongerAttacking && !getObject()->testStatus( OBJECT_STATUS_IS_ATTACKING )) - { - m_deliveryDecal.clear(); - return UPDATE_SLEEP_FOREVER; - } - - m_deliveryDecal.update(); - return UPDATE_SLEEP_NONE; -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void RadiusDecalUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void RadiusDecalUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // decal, if any - m_deliveryDecal.xferRadiusDecal(xfer); - - xfer->xferBool(&m_killWhenNoLongerAttacking); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void RadiusDecalUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp deleted file mode 100644 index 30b216a4484..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp +++ /dev/null @@ -1,475 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: TensileFormationUpdate.cpp ////////////////////////////////////////////////////////////////////////// -// Author: Mark Lorenzen, November 2002 -// Desc: Springy formation movement like that of say, an avalanche -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "Common/AudioEventRTS.h" - -#include "GameLogic/Object.h" -#include "GameLogic/TerrainLogic.h" -#include "GameLogic/Module/TensileFormationUpdate.h" -#include "GameLogic/Module/BodyModule.h" -#include "GameLogic/PartitionManager.h" -#include "GameLogic/GameLogic.h" -#include "GameLogic/AI.h" -#include "GameLogic/AIPathfind.h" - -#include "GameClient/TerrainVisual.h" -#include "GameClient/Drawable.h" - - - - - -#define MAP_XY_FACTOR (10.0f) //How wide and tall each height map square is in world space. -#define MAP_HEIGHT_SCALE (MAP_XY_FACTOR/16.0f) //divide all map heights by 8. - - - - - -//--------------------------------------------------------------------------------- -TensileFormationUpdate* getTFU( Object *obj ) -{ - static NameKeyType theTFUKey = TheNameKeyGenerator->nameToKey( "TensileFormationUpdate" ); - TensileFormationUpdate* tfu = (TensileFormationUpdate *)obj->findUpdateModule( theTFUKey ); - return tfu; -} - -class PartitionFilterTensileFormationMember : public PartitionFilter -{ -private: - Object* m_obj; - -public: - PartitionFilterTensileFormationMember( Object* obj ) : m_obj( obj ) { } -#if defined(RTS_DEBUG) - virtual const char* debugGetName() override { return "PartitionFilterTensileFormationMember"; } -#endif - virtual Bool allow( Object *objOther ) override - { - return ( getTFU( objOther ) != nullptr ); - } -}; - - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -TensileFormationUpdateModuleData::TensileFormationUpdateModuleData() -{ - - m_enabled = FALSE; - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -/*static*/ void TensileFormationUpdateModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - - UpdateModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "Enabled", INI::parseBool, nullptr, offsetof( TensileFormationUpdateModuleData, m_enabled ) }, - { "CrackSound", INI::parseAudioEventRTS, nullptr, offsetof( TensileFormationUpdateModuleData, m_crackSound) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -TensileFormationUpdate::TensileFormationUpdate( Thing *thing, const ModuleData *moduleData ) - :UpdateModule( thing, moduleData ) -{ - - - const TensileFormationUpdateModuleData *modData = getTensileFormationUpdateModuleData(); - - // save our initial enabled status based on INI settings - m_enabled = ((TensileFormationUpdateModuleData *)moduleData)->m_enabled; - m_inertia.set(0,0,0); - m_linksInited = FALSE; - m_motionlessCounter = 0; - m_life = 0; - m_lowestSlideElevation = 255.0f; - - for ( int t = 0; t < 4; ++t) - { - m_links[ t ].id = INVALID_ID; - m_links[ t ].tensor.set(0,0,0); - } - - m_crackSound = modData->m_crackSound; - m_crackSound.setObjectID( getObject()->getID() ) ; - - TheAI->pathfinder()->createAWallFromMyFootprint( getObject() ); // Temporarily treat this object as an obstacle. - - - //Coord3D pos = *getObject()->getPosition(); - //if ( pos.z > 80) - //{ - // pos.z = 80 + ( ( pos.z - 80 ) * 2); - // getObject()->setPosition( &pos ); - //} - - - -} - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -TensileFormationUpdate::~TensileFormationUpdate() -{ - -} - - - -void TensileFormationUpdate::initLinks() -{ - - m_linksInited = TRUE; - - Object *obj = getObject(); - if ( !obj ) - return; - - PartitionFilterTensileFormationMember tfmFilter( getObject() ); - PartitionFilter *filters[] = { &tfmFilter, nullptr }; - SimpleObjectIterator *iter = nullptr; - iter = ThePartitionManager->iterateObjectsInRange(getObject(), 1000.0f, FROM_BOUNDINGSPHERE_3D, filters); - MemoryPoolObjectHolder hold(iter); - - Real closestDistance = 99999.9f; - Real thisDistance = 99999.9f; - const Coord3D *myPos = obj->getPosition(); - - for (Object* other = iter->first(); other; other = iter->next()) - { - const Coord3D *theirPos = other->getPosition(); - Coord3D delta = { theirPos->x - myPos->x, theirPos->y - myPos->y, theirPos->z - myPos->z }; - - thisDistance = delta.length(); - if ( closestDistance > thisDistance ) - { - closestDistance = thisDistance; - - //push a new link - for ( int t = 3; t > 0; --t ) - m_links[ t ] = m_links[ t-1 ]; - - m_links[ 0 ].id = other->getID(); - m_links[ 0 ].tensor = delta; - } - } - - //ICoord2D gridPos; - //gridPos.x = REAL_TO_INT_FLOOR(getObject()->getPosition()->x/MAP_XY_FACTOR); - //gridPos.y = REAL_TO_INT_FLOOR(getObject()->getPosition()->y/MAP_XY_FACTOR); - //TheTerrainVisual->setRawMapHeight(&gridPos, 500); - - getObject()->setOrientation(GameLogicRandomValueReal(-PI,PI)); - -} - - - - - - -// ------------------------------------------------------------------------------------------------ -// ------------------------------------------------------------------------------------------------ -UpdateSleepTime TensileFormationUpdate::update() -{ - - if ( ! m_linksInited ) - initLinks(); - - - - if( m_enabled == FALSE ) - { - //We are all going to sit here idle and do not much of anything until one of us gets hurt - BodyModuleInterface *body = getObject()->getBodyModule(); - BodyDamageType bdt = body->getDamageState(); - - if ( bdt >= BODY_DAMAGED ) - { - //THen the hurt one (maybe me) will tell every other member of the formation to enable - //So we will start moving - setEnabled( TRUE ); - - TheAI->pathfinder()->removeWallFromMyFootprint( getObject() ); // Undo createAWallFromMyFootprint. - - - //ALert players of disaster happening - if ( ! m_crackSound.isCurrentlyPlaying()) - m_crackSound.setPlayingHandle(TheAudio->addAudioEvent( &m_crackSound )); - - } - else - return UPDATE_SLEEP(30); - } - - - Drawable *draw = getObject()->getDrawable(); - if ( ! draw ) - return UPDATE_SLEEP_NONE; - - if (++m_life > 300) - { - draw->clearModelConditionFlags(MAKE_MODELCONDITION_MASK(MODELCONDITION_MOVING)); - draw->clearModelConditionFlags(MAKE_MODELCONDITION_MASK(MODELCONDITION_FREEFALL)); - draw->clearModelConditionFlags(MAKE_MODELCONDITION_MASK(MODELCONDITION_POST_COLLAPSE)); - - BodyModuleInterface *body = getObject()->getBodyModule(); - body->setDamageState( BODY_RUBBLE ); - - - TheAI->pathfinder()->createAWallFromMyFootprint( getObject() ); // Temporarily treat this object as an obstacle. - - return UPDATE_SLEEP_FOREVER; - } - - - if ( m_life%30 == 29 ) - propagateDislodgement( TRUE ); - - - //APPLY PHYSICS=========================== - const Coord3D *pos = getObject()->getPosition(); - - Coord3D normal = { 0.0f, 0.0f, 1.0f }; - TheTerrainLogic->getGroundHeight(pos->x, pos->y, &normal); // which way does the ground slope? - - Coord3D slope = { normal.x, normal.y, 0.0f}; - Real steepness = 1.0f - normal.z; - slope.scale( 0.3f + steepness); - - m_inertia.add( slope ); - - Real friction = 0.95f; - m_inertia.scale( friction ); - - - - Coord3D newPos; - newPos.x = pos->x + m_inertia.x;//flow down the slope - newPos.y = pos->y + m_inertia.y; - newPos.z = TheTerrainLogic->getGroundHeight(newPos.x, newPos.y);//rest on surface here - - - - Object *tree = ThePartitionManager->getClosestObject( &newPos, getObject()->getGeometryInfo().getMajorRadius(), FROM_CENTER_2D ); - if (tree->isKindOf( KINDOF_SHRUBBERY )) - tree->topple( &m_inertia, m_inertia.length(), 1 );//No Bounce - - - - //APPLY TENSORS=========================== - Coord3D tensorSum = { 0, 0, 0 }; - for ( int t = 0; t < 4; ++t ) - { - Object *other = TheGameLogic->findObjectByID( m_links[ t ].id ); - - if ( other ) - { - Coord3D desiredPos = *other->getPosition(); - - Coord3D tensor = m_links[ t ].tensor; - - desiredPos.sub( tensor ); - - //Coord3D desiredPos = { theirPos->x - m_links[ t ].tensor.x, theirPos->y - m_links[ t ].tensor.y, theirPos->z - m_links[ t ].tensor.z }; - - newPos.x = newPos.x*0.93f + desiredPos.x*0.07f; - newPos.y = newPos.y*0.93f + desiredPos.y*0.07f; - newPos.z = MIN( m_lowestSlideElevation, TheTerrainLogic->getGroundHeight(newPos.x, newPos.y) );//rest on surface here - - tensor.normalize(); - tensorSum.add( tensor ); - - } - - } - - tensorSum.normalize(); - - Coord3D inertiaNormal = m_inertia; - inertiaNormal.normalize(); - - - - - - - - - - draw->setModelConditionFlags(MAKE_MODELCONDITION_MASK(MODELCONDITION_POST_COLLAPSE)); - - if ( m_life < 200 ) - draw->setModelConditionFlags(MAKE_MODELCONDITION_MASK(MODELCONDITION_MOVING)); - else - draw->clearModelConditionFlags(MAKE_MODELCONDITION_MASK(MODELCONDITION_MOVING)); - - if ( fabs( pos->z - newPos.z ) > 0.2f && m_life < 100) - draw->setModelConditionFlags(MAKE_MODELCONDITION_MASK(MODELCONDITION_FREEFALL)); - else - draw->clearModelConditionFlags(MAKE_MODELCONDITION_MASK(MODELCONDITION_FREEFALL)); - -// { -// RGBColor cyan = {0,1,1}; -// draw->flashAsSelected(&cyan); -// } - - - - //else - //m_motionlessCounter = 0; - - - //if ( newPos.z > 80) - // newPos.z = 80 + ( ( newPos.z - 80 ) * 2); - - - m_lowestSlideElevation = newPos.z; - getObject()->setPosition( &newPos ); - - - - return UPDATE_SLEEP_NONE; -} - - - - - -//------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------- -void TensileFormationUpdate::propagateDislodgement ( Bool enabled ) -{ - PartitionFilterTensileFormationMember tfmFilter( getObject() ); - PartitionFilter *filters[] = { &tfmFilter, nullptr }; - SimpleObjectIterator *iter = nullptr; - iter = ThePartitionManager->iterateObjectsInRange(getObject(), 100.0f, FROM_BOUNDINGSPHERE_3D, filters); - MemoryPoolObjectHolder hold(iter); - for (Object* other = iter->first(); other; other = iter->next()) - { - - //Object *other = TheGameLogic->findObjectByID( m_links[ t ].id ); - if ( other ) - { - BodyModuleInterface *body = other->getBodyModule(); - if ( body ) - { - body->setDamageState( BODY_DAMAGED ); - } - } - - - //TensileFormationUpdate* tfu = getTFU(other); - //if ( tfu != nullptr ) - //{ - // tfu->setEnabled( enabled ); - //} - } - - for ( int t = 0; t < 4; ++t ) - { - Object *other = TheGameLogic->findObjectByID( m_links[ t ].id ); - if ( other ) - { - BodyModuleInterface *body = other->getBodyModule(); - if ( body ) - { - body->setDamageState( BODY_DAMAGED ); - } - } - } - - - -} - - - - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void TensileFormationUpdate::crc( Xfer *xfer ) -{ - - // extend base class - UpdateModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void TensileFormationUpdate::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpdateModule::xfer( xfer ); - - // enabled - xfer->xferBool( &m_enabled ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void TensileFormationUpdate::loadPostProcess() -{ - - // extend base class - UpdateModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp deleted file mode 100644 index 1e05c0d6e1a..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ActiveShroudUpgrade.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, July 2002 -// Desc: An upgrade that modifies the object's ShroudRange. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameLogic/Module/ActiveShroudUpgrade.h" -#include "GameLogic/Object.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ActiveShroudUpgradeModuleData::ActiveShroudUpgradeModuleData() -{ - - m_newShroudRange = 0.0f; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -/* static */ void ActiveShroudUpgradeModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - UpgradeModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "NewShroudRange", INI::parseReal, nullptr, offsetof( ActiveShroudUpgradeModuleData, m_newShroudRange ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ActiveShroudUpgrade::ActiveShroudUpgrade( Thing *thing, const ModuleData* moduleData ) : - UpgradeModule( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ActiveShroudUpgrade::~ActiveShroudUpgrade() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void ActiveShroudUpgrade::upgradeImplementation() -{ - // Set my object's ability to actively shroud. - if( getActiveShroudUpgradeModuleData() ) - { - getObject()->setShroudRange( getActiveShroudUpgradeModuleData()->m_newShroudRange ); - getObject()->handlePartitionCellMaintenance();// To shroud where I am without waiting. - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ActiveShroudUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ActiveShroudUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ActiveShroudUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp deleted file mode 100644 index 597c1b887cb..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: CostModifierUpgrade.cpp ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: Aug 2002 -// -// Filename: CostModifierUpgrade.cpp -// -// author: Chris Huybregts -// -// purpose: Upgrade that modifies the cost by a certain percentage -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameLogic/Module/CostModifierUpgrade.h" -#include "GameLogic/Object.h" -#include "Common/BitFlagsIO.h" -//----------------------------------------------------------------------------- -// DEFINES //////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -CostModifierUpgradeModuleData::CostModifierUpgradeModuleData() -{ - - m_kindOf = KINDOFMASK_NONE; - m_percentage = 0; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -/* static */ void CostModifierUpgradeModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - UpgradeModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "EffectKindOf", KindOfMaskType::parseFromINI, nullptr, offsetof( CostModifierUpgradeModuleData, m_kindOf ) }, - { "Percentage", INI::parsePercentToReal, nullptr, offsetof( CostModifierUpgradeModuleData, m_percentage ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -CostModifierUpgrade::CostModifierUpgrade( Thing *thing, const ModuleData* moduleData ) : - UpgradeModule( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -CostModifierUpgrade::~CostModifierUpgrade() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void CostModifierUpgrade::onDelete() -{ - - // if we haven't been upgraded there is nothing to clean up - if( isAlreadyUpgraded() == FALSE ) - return; - - // remove the radar from the player - Player *player = getObject()->getControllingPlayer(); - if( player ) - player->removeKindOfProductionCostChange(getCostModifierUpgradeModuleData()->m_kindOf,getCostModifierUpgradeModuleData()->m_percentage ); - - // this upgrade module is now "not upgraded" - setUpgradeExecuted(FALSE); - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void CostModifierUpgrade::onCapture( Player *oldOwner, Player *newOwner ) -{ - - // do nothing if we haven't upgraded yet - if( isAlreadyUpgraded() == FALSE ) - return; - - // remove radar from old player and add to new player - if( oldOwner ) - { - - oldOwner->removeKindOfProductionCostChange(getCostModifierUpgradeModuleData()->m_kindOf,getCostModifierUpgradeModuleData()->m_percentage ); - setUpgradeExecuted(FALSE); - - } - if( newOwner ) - { - - newOwner->addKindOfProductionCostChange(getCostModifierUpgradeModuleData()->m_kindOf,getCostModifierUpgradeModuleData()->m_percentage ); - setUpgradeExecuted(TRUE); - - } - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void CostModifierUpgrade::upgradeImplementation() -{ - Player *player = getObject()->getControllingPlayer(); - - // update the player with another TypeOfProductionCostChange - player->addKindOfProductionCostChange(getCostModifierUpgradeModuleData()->m_kindOf,getCostModifierUpgradeModuleData()->m_percentage ); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void CostModifierUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void CostModifierUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void CostModifierUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp deleted file mode 100644 index b23cfcf7c71..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ExperienceScalarUpgrade.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, September 2002 -// Desc: UpgradeModule that adds a scalar to the object's experience gain. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/ExperienceTracker.h" -#include "GameLogic/Module/ExperienceScalarUpgrade.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ExperienceScalarUpgradeModuleData::ExperienceScalarUpgradeModuleData() -{ - m_addXPScalar = 0.0f; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void ExperienceScalarUpgradeModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - - UpgradeModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "AddXPScalar", INI::parseReal, nullptr, offsetof( ExperienceScalarUpgradeModuleData, m_addXPScalar ) }, - { nullptr, nullptr, nullptr, 0 } - }; - - p.add(dataFieldParse); - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ExperienceScalarUpgrade::ExperienceScalarUpgrade( Thing *thing, const ModuleData* moduleData ) : UpgradeModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ExperienceScalarUpgrade::~ExperienceScalarUpgrade() -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void ExperienceScalarUpgrade::upgradeImplementation() -{ - const ExperienceScalarUpgradeModuleData *data = getExperienceScalarUpgradeModuleData(); - - //Simply add the xp scalar to the xp tracker! - Object *obj = getObject(); - ExperienceTracker *xpTracker = obj->getExperienceTracker(); - if( xpTracker ) - { - xpTracker->setExperienceScalar( xpTracker->getExperienceScalar() + data->m_addXPScalar ); - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ExperienceScalarUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ExperienceScalarUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ExperienceScalarUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp deleted file mode 100644 index 3f6330eecec..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: LocomotorSetUpgrade.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: UpgradeModule that sets a weapon set bit for the Best Fit weapon set chooser to discover -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/LocomotorSetUpgrade.h" -#include "GameLogic/Module/AIUpdate.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -LocomotorSetUpgrade::LocomotorSetUpgrade( Thing *thing, const ModuleData* moduleData ) : UpgradeModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -LocomotorSetUpgrade::~LocomotorSetUpgrade() -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void LocomotorSetUpgrade::upgradeImplementation() -{ - AIUpdateInterface* ai = getObject()->getAIUpdateInterface(); - if (ai) - ai->setLocomotorUpgrade(true); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void LocomotorSetUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void LocomotorSetUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void LocomotorSetUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp deleted file mode 100644 index a9fbf946960..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: MaxHealthUpgrade.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Kris Morness, September 2002 -// Desc: UpgradeModule that adds a scalar to the object's experience gain. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#define DEFINE_MAXHEALTHCHANGETYPE_NAMES -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/ExperienceTracker.h" -#include "GameLogic/Module/MaxHealthUpgrade.h" -#include "GameLogic/Module/BodyModule.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -MaxHealthUpgradeModuleData::MaxHealthUpgradeModuleData() -{ - m_addMaxHealth = 0.0f; - m_maxHealthChangeType = SAME_CURRENTHEALTH; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void MaxHealthUpgradeModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - - UpgradeModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "AddMaxHealth", INI::parseReal, nullptr, offsetof( MaxHealthUpgradeModuleData, m_addMaxHealth ) }, - { "ChangeType", INI::parseIndexList, TheMaxHealthChangeTypeNames, offsetof( MaxHealthUpgradeModuleData, m_maxHealthChangeType ) }, - { nullptr, nullptr, nullptr, 0 } - }; - - p.add(dataFieldParse); - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -MaxHealthUpgrade::MaxHealthUpgrade( Thing *thing, const ModuleData* moduleData ) : UpgradeModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -MaxHealthUpgrade::~MaxHealthUpgrade() -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void MaxHealthUpgrade::upgradeImplementation() -{ - const MaxHealthUpgradeModuleData *data = getMaxHealthUpgradeModuleData(); - - //Simply add the xp scalar to the xp tracker! - Object *obj = getObject(); - - BodyModuleInterface *body = obj->getBodyModule(); - if( body ) - { - body->setMaxHealth( body->getMaxHealth() + data->m_addMaxHealth, data->m_maxHealthChangeType ); - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void MaxHealthUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void MaxHealthUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void MaxHealthUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp deleted file mode 100644 index d21da9be017..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: ObjectCreationUpgrade.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Matthew D. Campbell, April 2002 -// Desc: upgrades that spawn OCLs -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ModelState.h" -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/Module/ObjectCreationUpgrade.h" -#include "GameLogic/Object.h" -#include "GameLogic/ObjectCreationList.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ObjectCreationUpgradeModuleData::ObjectCreationUpgradeModuleData() -{ - - m_ocl = nullptr; - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -/* static */ void ObjectCreationUpgradeModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - UpgradeModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "UpgradeObject", INI::parseObjectCreationList, nullptr, offsetof( ObjectCreationUpgradeModuleData, m_ocl ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ObjectCreationUpgrade::ObjectCreationUpgrade( Thing *thing, const ModuleData* moduleData ) : - UpgradeModule( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -ObjectCreationUpgrade::~ObjectCreationUpgrade() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void ObjectCreationUpgrade::onDelete() -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void ObjectCreationUpgrade::upgradeImplementation() -{ - // spawn everything in the OCL - if (getObjectCreationUpgradeModuleData() && getObjectCreationUpgradeModuleData()->m_ocl) - { - ObjectCreationList::create((getObjectCreationUpgradeModuleData()->m_ocl), getObject(), nullptr); - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void ObjectCreationUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void ObjectCreationUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void ObjectCreationUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp deleted file mode 100644 index 7abd5f9091c..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: PowerPlantUpgrade.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Amit Kumar, August 2002 -// Desc: Power plant upgrades -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ModelState.h" -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameClient/InGameUI.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/PowerPlantUpdate.h" -#include "GameLogic/Module/PowerPlantUpgrade.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -PowerPlantUpgrade::PowerPlantUpgrade( Thing *thing, const ModuleData* moduleData ) : - UpgradeModule( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -PowerPlantUpgrade::~PowerPlantUpgrade() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void PowerPlantUpgrade::onDelete() -{ - - // if we haven't been upgraded there is nothing to clean up - if( isAlreadyUpgraded() == FALSE ) - return; - - // remove the power bonus from the player - Player *player = getObject()->getControllingPlayer(); - if( player ) - player->removePowerBonus( getObject() ); - - // this upgrade module is now "not upgraded" - setUpgradeExecuted(FALSE); - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void PowerPlantUpgrade::onCapture( Player *oldOwner, Player *newOwner ) -{ - - // do nothing if we haven't upgraded yet - if( isAlreadyUpgraded() == FALSE ) - return; - - if (getObject()->isDisabled()) - return; - - // remove power bonus from old owner - if( oldOwner ) - { - - oldOwner->removePowerBonus( getObject() ); - setUpgradeExecuted(FALSE); - - } - - // add power bonus to the new owner - if( newOwner ) - { - - newOwner->addPowerBonus( getObject() ); - setUpgradeExecuted(TRUE); - - } - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void PowerPlantUpgrade::upgradeImplementation() -{ - - Player *player = getObject()->getControllingPlayer(); - - // add the new power production to the object - if( player ) - player->addPowerBonus(getObject()); - - - PowerPlantUpdateInterface *ppui; - for( BehaviorModule **umi = getObject()->getBehaviorModules(); *umi; ++umi) - { - ppui = (*umi)->getPowerPlantUpdateInterface(); - if( ppui ) - ppui->extendRods(TRUE); - } - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void PowerPlantUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void PowerPlantUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void PowerPlantUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - - // Most upgrade modules have state change effects that are themselves saved. This one is a fire and forget. - // So we need to re-fire on load if we are turned on. - if (isAlreadyUpgraded()) - { - Object* obj = getObject(); - Player* player = obj->getControllingPlayer(); - - if (player && !obj->isDisabled()) - { - player->addPowerBonus(obj); - } - } - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp deleted file mode 100644 index 1a501916dc0..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: RadarUpgrade.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Colin Day, March 2002 -// Desc: Radar upgrades -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/ModelState.h" -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/RadarUpdate.h" -#include "GameLogic/Module/RadarUpgrade.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void RadarUpgradeModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - UpgradeModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "DisableProof", INI::parseBool, nullptr, offsetof( RadarUpgradeModuleData, m_isDisableProof ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -RadarUpgrade::RadarUpgrade( Thing *thing, const ModuleData* moduleData ) : - UpgradeModule( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -RadarUpgrade::~RadarUpgrade() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void RadarUpgrade::onDelete() -{ - const RadarUpgradeModuleData *md = getRadarUpgradeModuleData(); - - // if we haven't been upgraded there is nothing to clean up - if( isAlreadyUpgraded() == FALSE ) - return; - - // If we're currently disabled, we shouldn't do anything, because we've already done it. - if ( getObject()->isDisabled() ) - return; - - // remove the radar from the player - Player *player = getObject()->getControllingPlayer(); - if( player ) - player->removeRadar( md->m_isDisableProof ); - - // this upgrade module is now "not upgraded" - setUpgradeExecuted(FALSE); - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void RadarUpgrade::onCapture( Player *oldOwner, Player *newOwner ) -{ - const RadarUpgradeModuleData *md = getRadarUpgradeModuleData(); - - // do nothing if we haven't upgraded yet - if( isAlreadyUpgraded() == FALSE ) - return; - - // If we're currently disabled, we shouldn't do anything, because we've already done it. - if ( getObject()->isDisabled() ) - return; - - // remove radar from old player and add to new player - if( oldOwner ) - { - - oldOwner->removeRadar( md->m_isDisableProof ); - setUpgradeExecuted(FALSE); - - } - if( newOwner ) - { - - newOwner->addRadar( md->m_isDisableProof ); - setUpgradeExecuted(TRUE); - - } - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void RadarUpgrade::upgradeImplementation() -{ - const RadarUpgradeModuleData *md = getRadarUpgradeModuleData(); - - Player *player = getObject()->getControllingPlayer(); - - // update the player with another radar facility - player->addRadar( md->m_isDisableProof ); - - // find the radar update module of this object - NameKeyType radarUpdateKey = NAMEKEY( "RadarUpdate" ); - RadarUpdate *radarUpdate = (RadarUpdate *)getObject()->findUpdateModule( radarUpdateKey ); - if( radarUpdate ) - radarUpdate->extendRadar(); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void RadarUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void RadarUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void RadarUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp deleted file mode 100644 index 8be8f993835..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: StatusBitsUpgrade.cpp ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: May 2002 -// -// Filename: StatusBitsUpgrade.cpp -// -// author: Steven Johnson -// -// purpose: -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#define DEFINE_OBJECT_STATUS_NAMES -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/StatusBitsUpgrade.h" - -//----------------------------------------------------------------------------- -// DEFINES //////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void StatusBitsUpgradeModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - UpgradeModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "StatusToSet", ObjectStatusMaskType::parseFromINI, nullptr, offsetof( StatusBitsUpgradeModuleData, m_statusToSet ) }, - { "StatusToClear", ObjectStatusMaskType::parseFromINI, nullptr, offsetof( StatusBitsUpgradeModuleData, m_statusToClear ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -StatusBitsUpgrade::StatusBitsUpgrade( Thing *thing, const ModuleData* moduleData ) : UpgradeModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -StatusBitsUpgrade::~StatusBitsUpgrade() -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void StatusBitsUpgrade::upgradeImplementation() -{ - Object *obj = getObject(); - obj->setStatus( getStatusBitsUpgradeModuleData()->m_statusToSet ); - obj->clearStatus( getStatusBitsUpgradeModuleData()->m_statusToClear ); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void StatusBitsUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void StatusBitsUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void StatusBitsUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp deleted file mode 100644 index 8857dd7d646..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: SubObjectsUpgrade.cpp ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// Created: September 2002 -// -// Filename: SubObjectsUpgrade.cpp -// -// Author: Kris Morness -// -// Purpose: Shows or hides a list of subobjects based on upgrade statii. It -// will override any animation subobjects states. -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#define DEFINE_OBJECT_STATUS_NAMES -#include "Common/Player.h" -#include "Common/Xfer.h" -#include "GameClient/Drawable.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/SubObjectsUpgrade.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void SubObjectsUpgradeModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - UpgradeModuleData::buildFieldParse(p); - - static const FieldParse dataFieldParse[] = - { - { "ShowSubObjects", INI::parseAsciiStringVectorAppend, nullptr, offsetof( SubObjectsUpgradeModuleData, m_showSubObjectNames ) }, - { "HideSubObjects", INI::parseAsciiStringVectorAppend, nullptr, offsetof( SubObjectsUpgradeModuleData, m_hideSubObjectNames ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SubObjectsUpgrade::SubObjectsUpgrade( Thing *thing, const ModuleData* moduleData ) : UpgradeModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -SubObjectsUpgrade::~SubObjectsUpgrade() -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void SubObjectsUpgrade::upgradeImplementation() -{ - const SubObjectsUpgradeModuleData *data = getSubObjectsUpgradeModuleData(); - UpgradeMaskType activation, conflicting; - getUpgradeActivationMasks( activation, conflicting ); - - //First make sure we have the right combination of upgrades - - if( getObject()->getObjectCompletedUpgradeMask().testForAny( conflicting ) ) - { - //If it has ANY of the conflicting OBJECT upgrades, then don't do it! - return; - } - if( getObject()->getControllingPlayer()->getCompletedUpgradeMask().testForAny( conflicting ) ) - { - //If it has ANY of the conflicting PLAYER upgrades, then don't do it! - return; - } - - Object *obj = getObject(); - Drawable *draw = obj->getDrawable(); - if( draw ) - { - std::vector::const_iterator subObjectName; - Bool updateSubObjects = false; - - //Show these subobjects - for( subObjectName = data->m_showSubObjectNames.begin(); subObjectName != data->m_showSubObjectNames.end(); ++subObjectName ) - { - draw->showSubObject( *subObjectName, true ); - updateSubObjects = true; - } - - //Hide these subobjects - for( subObjectName = data->m_hideSubObjectNames.begin(); subObjectName != data->m_hideSubObjectNames.end(); ++subObjectName ) - { - draw->showSubObject( *subObjectName, false ); - updateSubObjects = true; - } - - if( updateSubObjects ) - { - draw->updateSubObjects(); - } - } -} - -//------------------------------------------------------------------------------------------------ -void SubObjectsUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -//------------------------------------------------------------------------------------------------ -// Xfer method -// Version Info: -// 1: Initial version -//------------------------------------------------------------------------------------------------ -void SubObjectsUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -//------------------------------------------------------------------------------------------------ -void SubObjectsUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp deleted file mode 100644 index 73a0d8f0dee..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: UnpauseSpecialPowerUpgrade.cpp /////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, August 2002 -// Desc: An upgrade that starts the timer on a Special Power module, so you can have them -// dependent on upgrades on the logic side, like NEED_UPGRADE does on the client side by disabling -// the button. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" -#include "Common/SpecialPower.h" -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/SpecialPowerModule.h" -#include "GameLogic/Module/UnpauseSpecialPowerUpgrade.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UnpauseSpecialPowerUpgradeModuleData::UnpauseSpecialPowerUpgradeModuleData() -{ - m_specialPower = nullptr; -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -/* static */ void UnpauseSpecialPowerUpgradeModuleData::buildFieldParse(MultiIniFieldParse& p) -{ - UpgradeModuleData::buildFieldParse( p ); - - static const FieldParse dataFieldParse[] = - { - { "SpecialPowerTemplate", INI::parseSpecialPowerTemplate, nullptr, offsetof( UnpauseSpecialPowerUpgradeModuleData, m_specialPower ) }, - { nullptr, nullptr, nullptr, 0 } - }; - p.add(dataFieldParse); - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UnpauseSpecialPowerUpgrade::UnpauseSpecialPowerUpgrade( Thing *thing, const ModuleData* moduleData ) : - UpgradeModule( thing, moduleData ) -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -UnpauseSpecialPowerUpgrade::~UnpauseSpecialPowerUpgrade() -{ - -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void UnpauseSpecialPowerUpgrade::upgradeImplementation() -{ - for (BehaviorModule** m = getObject()->getBehaviorModules(); *m; ++m) - { - SpecialPowerModuleInterface* sp = (*m)->getSpecialPower(); - if (!sp) - continue; - - if( sp->getSpecialPowerTemplate() == getUnpauseSpecialPowerUpgradeModuleData()->m_specialPower ) - sp->pauseCountdown( FALSE ); - } -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void UnpauseSpecialPowerUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void UnpauseSpecialPowerUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void UnpauseSpecialPowerUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp deleted file mode 100644 index 867ce918b38..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: WeaponBonusUpgrade.cpp ///////////////////////////////////////////////// -//----------------------------------------------------------------------------- -// -// Electronic Arts Pacific. -// -// Confidential Information -// Copyright (C) 2002 - All Rights Reserved -// -//----------------------------------------------------------------------------- -// -// created: May 2002 -// -// Filename: WeaponBonusUpgrade.cpp -// -// author: Chris Huybregts -// -// purpose: -// -//----------------------------------------------------------------------------- -/////////////////////////////////////////////////////////////////////////////// - -//----------------------------------------------------------------------------- -// SYSTEM INCLUDES //////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// USER INCLUDES ////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/WeaponBonusUpgrade.h" -#include "GameLogic/Weapon.h" - -//----------------------------------------------------------------------------- -// DEFINES //////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -WeaponBonusUpgrade::WeaponBonusUpgrade( Thing *thing, const ModuleData* moduleData ) : UpgradeModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -WeaponBonusUpgrade::~WeaponBonusUpgrade() -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void WeaponBonusUpgrade::upgradeImplementation() -{ - // Very simple; just need to flag the Object as having the player upgrade, and the WeaponSet chooser - // will do the work of picking the right one from ini. This comment is as long as the code. - Object *obj = getObject(); - obj->setWeaponBonusCondition( WEAPONBONUSCONDITION_PLAYER_UPGRADE ); - -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void WeaponBonusUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void WeaponBonusUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void WeaponBonusUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp deleted file mode 100644 index ac829b8355d..00000000000 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -// FILE: WeaponSetUpgrade.cpp ///////////////////////////////////////////////////////////////////////////// -// Author: Graham Smallwood, March 2002 -// Desc: UpgradeModule that sets a weapon set bit for the Best Fit weapon set chooser to discover -/////////////////////////////////////////////////////////////////////////////////////////////////// - -// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "Common/Xfer.h" -#include "GameLogic/Object.h" -#include "GameLogic/Module/WeaponSetUpgrade.h" - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -WeaponSetUpgrade::WeaponSetUpgrade( Thing *thing, const ModuleData* moduleData ) : UpgradeModule( thing, moduleData ) -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -WeaponSetUpgrade::~WeaponSetUpgrade() -{ -} - -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -void WeaponSetUpgrade::upgradeImplementation() -{ - // Very simple; just need to flag the Object as having the player upgrade, and the WeaponSet chooser - // will do the work of picking the right one from ini. This comment is as long as the code. - Object *obj = getObject(); - obj->setWeaponSetFlag( WEAPONSET_PLAYER_UPGRADE ); -} - -// ------------------------------------------------------------------------------------------------ -/** CRC */ -// ------------------------------------------------------------------------------------------------ -void WeaponSetUpgrade::crc( Xfer *xfer ) -{ - - // extend base class - UpgradeModule::crc( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Xfer method - * Version Info: - * 1: Initial version */ -// ------------------------------------------------------------------------------------------------ -void WeaponSetUpgrade::xfer( Xfer *xfer ) -{ - - // version - XferVersion currentVersion = 1; - XferVersion version = currentVersion; - xfer->xferVersion( &version, currentVersion ); - - // extend base class - UpgradeModule::xfer( xfer ); - -} - -// ------------------------------------------------------------------------------------------------ -/** Load post process */ -// ------------------------------------------------------------------------------------------------ -void WeaponSetUpgrade::loadPostProcess() -{ - - // extend base class - UpgradeModule::loadPostProcess(); - -} diff --git a/GeneralsMD/Code/GameEngine/CMakeLists.txt b/GeneralsMD/Code/GameEngine/CMakeLists.txt index 15a0c29c58c..54bd3df7233 100644 --- a/GeneralsMD/Code/GameEngine/CMakeLists.txt +++ b/GeneralsMD/Code/GameEngine/CMakeLists.txt @@ -12,8 +12,8 @@ set(GAMEENGINE_SRC # Include/Common/AudioRequest.h # Include/Common/AudioSettings.h Include/Common/BattleHonors.h - Include/Common/BezFwdIterator.h - Include/Common/BezierSegment.h +# Include/Common/BezFwdIterator.h +# Include/Common/BezierSegment.h Include/Common/BitFlags.h Include/Common/BitFlagsIO.h Include/Common/BorderColors.h @@ -22,18 +22,18 @@ set(GAMEENGINE_SRC Include/Common/CommandLine.h # Include/Common/crc.h # Include/Common/CRCDebug.h - Include/Common/CriticalSection.h +# Include/Common/CriticalSection.h Include/Common/CustomMatchPreferences.h - Include/Common/DamageFX.h - Include/Common/DataChunk.h +# Include/Common/DamageFX.h +# Include/Common/DataChunk.h # Include/Common/Debug.h - Include/Common/Dict.h - Include/Common/Directory.h - Include/Common/DisabledTypes.h - Include/Common/DiscreteCircle.h +# Include/Common/Dict.h +# Include/Common/Directory.h +# Include/Common/DisabledTypes.h +# Include/Common/DiscreteCircle.h Include/Common/DrawModule.h # Include/Common/DynamicAudioEventInfo.h - Include/Common/encrypt.h +# Include/Common/encrypt.h Include/Common/Energy.h # Include/Common/Errors.h # Include/Common/file.h @@ -51,25 +51,25 @@ set(GAMEENGINE_SRC Include/Common/GameState.h Include/Common/GameStateMap.h # Include/Common/GameType.h - Include/Common/Geometry.h +# Include/Common/Geometry.h Include/Common/GlobalData.h - Include/Common/Handicap.h +# Include/Common/Handicap.h Include/Common/IgnorePreferences.h # Include/Common/INI.h Include/Common/INIException.h - Include/Common/KindOf.h +# Include/Common/KindOf.h Include/Common/LadderPreferences.h - Include/Common/Language.h +# Include/Common/Language.h Include/Common/LatchRestore.h - Include/Common/List.h +# Include/Common/List.h # Include/Common/LocalFile.h # Include/Common/LocalFileSystem.h # Include/Common/MapObject.h Include/Common/MapReaderWriterInfo.h Include/Common/MessageStream.h - Include/Common/MiniLog.h +# Include/Common/MiniLog.h # Include/Common/MiscAudio.h - Include/Common/MissionStats.h +# Include/Common/MissionStats.h Include/Common/ModelState.h Include/Common/Module.h Include/Common/ModuleFactory.h @@ -82,13 +82,13 @@ set(GAMEENGINE_SRC Include/Common/Override.h Include/Common/PartitionSolver.h Include/Common/PerfMetrics.h - Include/Common/PerfTimer.h +# Include/Common/PerfTimer.h Include/Common/Player.h - Include/Common/PlayerList.h +# Include/Common/PlayerList.h Include/Common/PlayerTemplate.h Include/Common/ProductionPrerequisite.h Include/Common/QuickmatchPreferences.h - Include/Common/QuotedPrintable.h +# Include/Common/QuotedPrintable.h # Include/Common/Radar.h # Include/Common/RAMFile.h # Include/Common/RandomValue.h @@ -96,9 +96,9 @@ set(GAMEENGINE_SRC # Include/Common/ReplaySimulation.h Include/Common/Registry.h Include/Common/ResourceGatheringManager.h - Include/Common/Science.h +# Include/Common/Science.h Include/Common/ScopedMutex.h - Include/Common/ScoreKeeper.h +# Include/Common/ScoreKeeper.h # Include/Common/simpleplayer.h Include/Common/SkirmishBattleHonors.h Include/Common/SkirmishPreferences.h @@ -107,7 +107,7 @@ set(GAMEENGINE_SRC Include/Common/SpecialPower.h Include/Common/SpecialPowerMaskType.h Include/Common/SpecialPowerType.h - Include/Common/StackDump.h +# Include/Common/StackDump.h Include/Common/StateMachine.h Include/Common/StatsCollector.h # Include/Common/STLTypedefs.h @@ -115,7 +115,7 @@ set(GAMEENGINE_SRC # Include/Common/SubsystemInterface.h Include/Common/Team.h Include/Common/Terrain.h - Include/Common/TerrainTypes.h +# Include/Common/TerrainTypes.h Include/Common/Thing.h Include/Common/ThingFactory.h Include/Common/ThingSort.h @@ -123,10 +123,10 @@ set(GAMEENGINE_SRC Include/Common/TunnelTracker.h # Include/Common/UnicodeString.h Include/Common/UnitTimings.h - Include/Common/Upgrade.h +# Include/Common/Upgrade.h # Include/Common/urllaunch.h # Include/Common/UserPreferences.h - Include/Common/version.h +# Include/Common/version.h Include/Common/WellKnownKeys.h # Include/Common/WorkerProcess.h # Include/Common/Xfer.h @@ -147,7 +147,7 @@ set(GAMEENGINE_SRC # Include/GameClient/ControlBarScheme.h # Include/GameClient/Credits.h # Include/GameClient/DebugDisplay.h - Include/GameClient/Diplomacy.h +# Include/GameClient/Diplomacy.h Include/GameClient/DisconnectMenu.h # Include/GameClient/Display.h # Include/GameClient/DisplayString.h @@ -155,9 +155,9 @@ set(GAMEENGINE_SRC Include/GameClient/Drawable.h Include/GameClient/DrawableInfo.h # Include/GameClient/DrawGroupInfo.h - Include/GameClient/EstablishConnectionsMenu.h +# Include/GameClient/EstablishConnectionsMenu.h Include/GameClient/Eva.h - Include/GameClient/ExtendedMessageBox.h +# Include/GameClient/ExtendedMessageBox.h Include/GameClient/FontDesc.h # Include/GameClient/FXList.h # Include/GameClient/Gadget.h @@ -173,7 +173,7 @@ set(GAMEENGINE_SRC # Include/GameClient/GadgetTextEntry.h Include/GameClient/GameClient.h # Include/GameClient/GameFont.h - Include/GameClient/GameInfoWindow.h +# Include/GameClient/GameInfoWindow.h # Include/GameClient/GameText.h # Include/GameClient/GameWindow.h # Include/GameClient/GameWindowGlobal.h @@ -197,7 +197,7 @@ set(GAMEENGINE_SRC # Include/GameClient/LoadScreen.h # Include/GameClient/LookAtXlat.h # Include/GameClient/MapUtil.h - Include/GameClient/MessageBox.h +# Include/GameClient/MessageBox.h # Include/GameClient/MetaEvent.h # Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h # Include/GameClient/Module/BeaconClientUpdate.h @@ -214,7 +214,7 @@ set(GAMEENGINE_SRC Include/GameClient/Shadow.h Include/GameClient/Shell.h Include/GameClient/ShellHooks.h - Include/GameClient/ShellMenuScheme.h +# Include/GameClient/ShellMenuScheme.h # Include/GameClient/Smudge.h # Include/GameClient/Snow.h # Include/GameClient/Statistics.h @@ -228,7 +228,7 @@ set(GAMEENGINE_SRC # Include/GameClient/WindowXlat.h # Include/GameClient/WinInstanceData.h Include/GameLogic/AI.h - Include/GameLogic/AIDock.h +# Include/GameLogic/AIDock.h Include/GameLogic/AIGuard.h Include/GameLogic/AIGuardRetaliate.h # Include/GameLogic/AIPathfind.h @@ -250,7 +250,7 @@ set(GAMEENGINE_SRC Include/GameLogic/LocomotorSet.h # Include/GameLogic/LogicRandomValue.h Include/GameLogic/Module/ActiveBody.h - Include/GameLogic/Module/ActiveShroudUpgrade.h +# Include/GameLogic/Module/ActiveShroudUpgrade.h Include/GameLogic/Module/AIUpdate.h Include/GameLogic/Module/AnimationSteeringUpdate.h Include/GameLogic/Module/ArmorUpgrade.h @@ -265,64 +265,64 @@ set(GAMEENGINE_SRC Include/GameLogic/Module/BattlePlanUpdate.h Include/GameLogic/Module/BehaviorModule.h Include/GameLogic/Module/BodyModule.h - Include/GameLogic/Module/BoneFXDamage.h +# Include/GameLogic/Module/BoneFXDamage.h Include/GameLogic/Module/BoneFXUpdate.h Include/GameLogic/Module/BridgeBehavior.h - Include/GameLogic/Module/BridgeScaffoldBehavior.h - Include/GameLogic/Module/BridgeTowerBehavior.h +# Include/GameLogic/Module/BridgeScaffoldBehavior.h +# Include/GameLogic/Module/BridgeTowerBehavior.h Include/GameLogic/Module/BunkerBusterBehavior.h Include/GameLogic/Module/CashBountyPower.h Include/GameLogic/Module/CashHackSpecialPower.h Include/GameLogic/Module/CaveContain.h - Include/GameLogic/Module/CheckpointUpdate.h +# Include/GameLogic/Module/CheckpointUpdate.h Include/GameLogic/Module/ChinookAIUpdate.h Include/GameLogic/Module/CleanupAreaPower.h - Include/GameLogic/Module/CleanupHazardUpdate.h +# Include/GameLogic/Module/CleanupHazardUpdate.h Include/GameLogic/Module/CollideModule.h Include/GameLogic/Module/CommandButtonHuntUpdate.h Include/GameLogic/Module/CommandSetUpgrade.h Include/GameLogic/Module/ContainModule.h Include/GameLogic/Module/ConvertToCarBombCrateCollide.h Include/GameLogic/Module/ConvertToHijackedVehicleCrateCollide.h - Include/GameLogic/Module/CostModifierUpgrade.h +# Include/GameLogic/Module/CostModifierUpgrade.h Include/GameLogic/Module/CountermeasuresBehavior.h Include/GameLogic/Module/CrateCollide.h - Include/GameLogic/Module/CreateCrateDie.h - Include/GameLogic/Module/CreateModule.h +# Include/GameLogic/Module/CreateCrateDie.h +# Include/GameLogic/Module/CreateModule.h Include/GameLogic/Module/CreateObjectDie.h - Include/GameLogic/Module/CrushDie.h - Include/GameLogic/Module/DamageModule.h - Include/GameLogic/Module/DamDie.h +# Include/GameLogic/Module/CrushDie.h +# Include/GameLogic/Module/DamageModule.h +# Include/GameLogic/Module/DamDie.h Include/GameLogic/Module/DefaultProductionExitUpdate.h Include/GameLogic/Module/DefectorSpecialPower.h - Include/GameLogic/Module/DeletionUpdate.h +# Include/GameLogic/Module/DeletionUpdate.h Include/GameLogic/Module/DeliverPayloadAIUpdate.h Include/GameLogic/Module/DemoralizeSpecialPower.h Include/GameLogic/Module/DemoTrapUpdate.h Include/GameLogic/Module/DeployStyleAIUpdate.h Include/GameLogic/Module/DestroyDie.h - Include/GameLogic/Module/DestroyModule.h - Include/GameLogic/Module/DieModule.h +# Include/GameLogic/Module/DestroyModule.h +# Include/GameLogic/Module/DieModule.h Include/GameLogic/Module/DockUpdate.h Include/GameLogic/Module/DozerAIUpdate.h Include/GameLogic/Module/DumbProjectileBehavior.h - Include/GameLogic/Module/DynamicGeometryInfoUpdate.h +# Include/GameLogic/Module/DynamicGeometryInfoUpdate.h Include/GameLogic/Module/DynamicShroudClearingRangeUpdate.h - Include/GameLogic/Module/EjectPilotDie.h +# Include/GameLogic/Module/EjectPilotDie.h Include/GameLogic/Module/EMPUpdate.h - Include/GameLogic/Module/EnemyNearUpdate.h - Include/GameLogic/Module/ExperienceScalarUpgrade.h +# Include/GameLogic/Module/EnemyNearUpdate.h +# Include/GameLogic/Module/ExperienceScalarUpgrade.h Include/GameLogic/Module/FireOCLAfterWeaponCooldownUpdate.h - Include/GameLogic/Module/FireSpreadUpdate.h +# Include/GameLogic/Module/FireSpreadUpdate.h Include/GameLogic/Module/FirestormDynamicGeometryInfoUpdate.h - Include/GameLogic/Module/FireWeaponCollide.h +# Include/GameLogic/Module/FireWeaponCollide.h Include/GameLogic/Module/FireWeaponPower.h Include/GameLogic/Module/FireWeaponUpdate.h Include/GameLogic/Module/FireWeaponWhenDamagedBehavior.h Include/GameLogic/Module/FireWeaponWhenDeadBehavior.h - Include/GameLogic/Module/FlammableUpdate.h +# Include/GameLogic/Module/FlammableUpdate.h Include/GameLogic/Module/FlightDeckBehavior.h - Include/GameLogic/Module/FloatUpdate.h +# Include/GameLogic/Module/FloatUpdate.h Include/GameLogic/Module/FXListDie.h Include/GameLogic/Module/GarrisonContain.h Include/GameLogic/Module/GenerateMinefieldBehavior.h @@ -330,79 +330,79 @@ set(GAMEENGINE_SRC Include/GameLogic/Module/GrantStealthBehavior.h Include/GameLogic/Module/GrantUpgradeCreate.h Include/GameLogic/Module/HackInternetAIUpdate.h - Include/GameLogic/Module/HealContain.h - Include/GameLogic/Module/HealCrateCollide.h - Include/GameLogic/Module/HeightDieUpdate.h +# Include/GameLogic/Module/HealContain.h +# Include/GameLogic/Module/HealCrateCollide.h +# Include/GameLogic/Module/HeightDieUpdate.h Include/GameLogic/Module/HelicopterSlowDeathUpdate.h Include/GameLogic/Module/HelixContain.h - Include/GameLogic/Module/HighlanderBody.h - Include/GameLogic/Module/HijackerUpdate.h +# Include/GameLogic/Module/HighlanderBody.h +# Include/GameLogic/Module/HijackerUpdate.h Include/GameLogic/Module/HiveStructureBody.h Include/GameLogic/Module/HordeUpdate.h - Include/GameLogic/Module/ImmortalBody.h +# Include/GameLogic/Module/ImmortalBody.h Include/GameLogic/Module/InactiveBody.h - Include/GameLogic/Module/InstantDeathBehavior.h +# Include/GameLogic/Module/InstantDeathBehavior.h Include/GameLogic/Module/InternetHackContain.h Include/GameLogic/Module/JetAIUpdate.h Include/GameLogic/Module/JetSlowDeathBehavior.h - Include/GameLogic/Module/KeepObjectDie.h +# Include/GameLogic/Module/KeepObjectDie.h Include/GameLogic/Module/LaserUpdate.h - Include/GameLogic/Module/LifetimeUpdate.h +# Include/GameLogic/Module/LifetimeUpdate.h Include/GameLogic/Module/LockWeaponCreate.h - Include/GameLogic/Module/LocomotorSetUpgrade.h - Include/GameLogic/Module/MaxHealthUpgrade.h +# Include/GameLogic/Module/LocomotorSetUpgrade.h +# Include/GameLogic/Module/MaxHealthUpgrade.h Include/GameLogic/Module/MinefieldBehavior.h Include/GameLogic/Module/MissileAIUpdate.h Include/GameLogic/Module/MissileLauncherBuildingUpdate.h - Include/GameLogic/Module/MobMemberSlavedUpdate.h +# Include/GameLogic/Module/MobMemberSlavedUpdate.h Include/GameLogic/Module/MobNexusContain.h Include/GameLogic/Module/ModelConditionUpgrade.h Include/GameLogic/Module/MoneyCrateCollide.h Include/GameLogic/Module/NeutronBlastBehavior.h - Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h +# Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h Include/GameLogic/Module/NeutronMissileUpdate.h - Include/GameLogic/Module/ObjectCreationUpgrade.h - Include/GameLogic/Module/ObjectDefectionHelper.h - Include/GameLogic/Module/ObjectHelper.h - Include/GameLogic/Module/ObjectRepulsorHelper.h - Include/GameLogic/Module/ObjectSMCHelper.h - Include/GameLogic/Module/ObjectWeaponStatusHelper.h +# Include/GameLogic/Module/ObjectCreationUpgrade.h +# Include/GameLogic/Module/ObjectDefectionHelper.h +# Include/GameLogic/Module/ObjectHelper.h +# Include/GameLogic/Module/ObjectRepulsorHelper.h +# Include/GameLogic/Module/ObjectSMCHelper.h +# Include/GameLogic/Module/ObjectWeaponStatusHelper.h Include/GameLogic/Module/OCLSpecialPower.h Include/GameLogic/Module/OCLUpdate.h Include/GameLogic/Module/OpenContain.h - Include/GameLogic/Module/OverchargeBehavior.h +# Include/GameLogic/Module/OverchargeBehavior.h Include/GameLogic/Module/OverlordContain.h Include/GameLogic/Module/ParachuteContain.h Include/GameLogic/Module/ParkingPlaceBehavior.h Include/GameLogic/Module/ParticleUplinkCannonUpdate.h Include/GameLogic/Module/PassengersFireUpgrade.h Include/GameLogic/Module/PhysicsUpdate.h - Include/GameLogic/Module/PilotFindVehicleUpdate.h +# Include/GameLogic/Module/PilotFindVehicleUpdate.h Include/GameLogic/Module/PointDefenseLaserUpdate.h Include/GameLogic/Module/PoisonedBehavior.h - Include/GameLogic/Module/PowerPlantUpdate.h - Include/GameLogic/Module/PowerPlantUpgrade.h - Include/GameLogic/Module/POWTruckAIUpdate.h - Include/GameLogic/Module/POWTruckBehavior.h - Include/GameLogic/Module/PreorderCreate.h +# Include/GameLogic/Module/PowerPlantUpdate.h +# Include/GameLogic/Module/PowerPlantUpgrade.h +# Include/GameLogic/Module/POWTruckAIUpdate.h +# Include/GameLogic/Module/POWTruckBehavior.h +# Include/GameLogic/Module/PreorderCreate.h Include/GameLogic/Module/PrisonBehavior.h - Include/GameLogic/Module/PrisonDockUpdate.h +# Include/GameLogic/Module/PrisonDockUpdate.h Include/GameLogic/Module/ProductionUpdate.h Include/GameLogic/Module/ProjectileStreamUpdate.h - Include/GameLogic/Module/ProneUpdate.h - Include/GameLogic/Module/PropagandaCenterBehavior.h +# Include/GameLogic/Module/ProneUpdate.h +# Include/GameLogic/Module/PropagandaCenterBehavior.h Include/GameLogic/Module/PropagandaTowerBehavior.h - Include/GameLogic/Module/QueueProductionExitUpdate.h - Include/GameLogic/Module/RadarUpdate.h - Include/GameLogic/Module/RadarUpgrade.h - Include/GameLogic/Module/RadiusDecalUpdate.h - Include/GameLogic/Module/RailedTransportAIUpdate.h - Include/GameLogic/Module/RailedTransportContain.h +# Include/GameLogic/Module/QueueProductionExitUpdate.h +# Include/GameLogic/Module/RadarUpdate.h +# Include/GameLogic/Module/RadarUpgrade.h +# Include/GameLogic/Module/RadiusDecalUpdate.h +# Include/GameLogic/Module/RailedTransportAIUpdate.h +# Include/GameLogic/Module/RailedTransportContain.h Include/GameLogic/Module/RailedTransportDockUpdate.h Include/GameLogic/Module/RailroadGuideAIUpdate.h Include/GameLogic/Module/RebuildHoleBehavior.h Include/GameLogic/Module/RebuildHoleExposeDie.h - Include/GameLogic/Module/RepairDockUpdate.h +# Include/GameLogic/Module/RepairDockUpdate.h Include/GameLogic/Module/ReplaceObjectUpgrade.h Include/GameLogic/Module/RiderChangeContain.h Include/GameLogic/Module/SabotageCommandCenterCrateCollide.h @@ -414,62 +414,62 @@ set(GAMEENGINE_SRC Include/GameLogic/Module/SabotageSupplyCenterCrateCollide.h Include/GameLogic/Module/SabotageSupplyDropzoneCrateCollide.h Include/GameLogic/Module/SalvageCrateCollide.h - Include/GameLogic/Module/ShroudCrateCollide.h +# Include/GameLogic/Module/ShroudCrateCollide.h Include/GameLogic/Module/SlavedUpdate.h Include/GameLogic/Module/SlowDeathBehavior.h Include/GameLogic/Module/SmartBombTargetHomingUpdate.h Include/GameLogic/Module/SpawnBehavior.h - Include/GameLogic/Module/SpawnPointProductionExitUpdate.h - Include/GameLogic/Module/SpecialAbility.h +# Include/GameLogic/Module/SpawnPointProductionExitUpdate.h +# Include/GameLogic/Module/SpecialAbility.h Include/GameLogic/Module/SpecialAbilityUpdate.h - Include/GameLogic/Module/SpecialPowerCompletionDie.h - Include/GameLogic/Module/SpecialPowerCreate.h +# Include/GameLogic/Module/SpecialPowerCompletionDie.h +# Include/GameLogic/Module/SpecialPowerCreate.h Include/GameLogic/Module/SpecialPowerModule.h Include/GameLogic/Module/SpecialPowerUpdateModule.h Include/GameLogic/Module/SpectreGunshipDeploymentUpdate.h Include/GameLogic/Module/SpectreGunshipUpdate.h - Include/GameLogic/Module/SpyVisionSpecialPower.h +# Include/GameLogic/Module/SpyVisionSpecialPower.h Include/GameLogic/Module/SpyVisionUpdate.h - Include/GameLogic/Module/SquishCollide.h - Include/GameLogic/Module/StatusBitsUpgrade.h +# Include/GameLogic/Module/SquishCollide.h +# Include/GameLogic/Module/StatusBitsUpgrade.h Include/GameLogic/Module/StatusDamageHelper.h Include/GameLogic/Module/StealthDetectorUpdate.h Include/GameLogic/Module/StealthUpdate.h Include/GameLogic/Module/StealthUpgrade.h Include/GameLogic/Module/StickyBombUpdate.h - Include/GameLogic/Module/StructureBody.h +# Include/GameLogic/Module/StructureBody.h Include/GameLogic/Module/StructureCollapseUpdate.h Include/GameLogic/Module/StructureToppleUpdate.h Include/GameLogic/Module/SubdualDamageHelper.h - Include/GameLogic/Module/SubObjectsUpgrade.h - Include/GameLogic/Module/SupplyCenterCreate.h +# Include/GameLogic/Module/SubObjectsUpgrade.h +# Include/GameLogic/Module/SupplyCenterCreate.h Include/GameLogic/Module/SupplyCenterDockUpdate.h Include/GameLogic/Module/SupplyCenterProductionExitUpdate.h Include/GameLogic/Module/SupplyTruckAIUpdate.h - Include/GameLogic/Module/SupplyWarehouseCreate.h - Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h - Include/GameLogic/Module/SupplyWarehouseDockUpdate.h +# Include/GameLogic/Module/SupplyWarehouseCreate.h +# Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h +# Include/GameLogic/Module/SupplyWarehouseDockUpdate.h Include/GameLogic/Module/TechBuildingBehavior.h Include/GameLogic/Module/TempWeaponBonusHelper.h - Include/GameLogic/Module/TensileFormationUpdate.h +# Include/GameLogic/Module/TensileFormationUpdate.h Include/GameLogic/Module/ToppleUpdate.h Include/GameLogic/Module/TransitionDamageFX.h Include/GameLogic/Module/TransportAIUpdate.h Include/GameLogic/Module/TransportContain.h Include/GameLogic/Module/TunnelContain.h Include/GameLogic/Module/UndeadBody.h - Include/GameLogic/Module/UnitCrateCollide.h - Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h +# Include/GameLogic/Module/UnitCrateCollide.h +# Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h Include/GameLogic/Module/UpdateModule.h - Include/GameLogic/Module/UpgradeDie.h +# Include/GameLogic/Module/UpgradeDie.h Include/GameLogic/Module/UpgradeModule.h - Include/GameLogic/Module/VeterancyCrateCollide.h - Include/GameLogic/Module/VeterancyGainCreate.h - Include/GameLogic/Module/WanderAIUpdate.h +# Include/GameLogic/Module/VeterancyCrateCollide.h +# Include/GameLogic/Module/VeterancyGainCreate.h +# Include/GameLogic/Module/WanderAIUpdate.h Include/GameLogic/Module/WaveGuideUpdate.h Include/GameLogic/Module/WeaponBonusUpdate.h - Include/GameLogic/Module/WeaponBonusUpgrade.h - Include/GameLogic/Module/WeaponSetUpgrade.h +# Include/GameLogic/Module/WeaponBonusUpgrade.h +# Include/GameLogic/Module/WeaponSetUpgrade.h Include/GameLogic/Module/WorkerAIUpdate.h Include/GameLogic/Object.h Include/GameLogic/ObjectCreationList.h @@ -485,7 +485,7 @@ set(GAMEENGINE_SRC Include/GameLogic/ScriptEngine.h Include/GameLogic/Scripts.h Include/GameLogic/SidesList.h - Include/GameLogic/Squad.h +# Include/GameLogic/Squad.h Include/GameLogic/TerrainLogic.h Include/GameLogic/TurretAI.h Include/GameLogic/VictoryConditions.h @@ -556,15 +556,15 @@ set(GAMEENGINE_SRC # Source/Common/Audio/GameSounds.cpp #Source/Common/Audio/simpleplayer.cpp # unused #Source/Common/Audio/urllaunch.cpp # unused - Source/Common/Bezier/BezFwdIterator.cpp - Source/Common/Bezier/BezierSegment.cpp +# Source/Common/Bezier/BezFwdIterator.cpp +# Source/Common/Bezier/BezierSegment.cpp Source/Common/BitFlags.cpp Source/Common/CommandLine.cpp # Source/Common/crc.cpp # Source/Common/CRCDebug.cpp - Source/Common/DamageFX.cpp - Source/Common/Dict.cpp - Source/Common/DiscreteCircle.cpp +# Source/Common/DamageFX.cpp +# Source/Common/Dict.cpp +# Source/Common/DiscreteCircle.cpp Source/Common/GameEngine.cpp Source/Common/GameLOD.cpp Source/Common/GameMain.cpp @@ -597,29 +597,29 @@ set(GAMEENGINE_SRC Source/Common/INI/INIWater.cpp Source/Common/INI/INIWeapon.cpp Source/Common/INI/INIWebpageURL.cpp - Source/Common/Language.cpp +# Source/Common/Language.cpp Source/Common/MessageStream.cpp - Source/Common/MiniLog.cpp +# Source/Common/MiniLog.cpp Source/Common/MultiplayerSettings.cpp Source/Common/NameKeyGenerator.cpp Source/Common/PartitionSolver.cpp - Source/Common/PerfTimer.cpp +# Source/Common/PerfTimer.cpp # Source/Common/RandomValue.cpp Source/Common/Recorder.cpp # Source/Common/ReplaySimulation.cpp # Source/Common/RTS/AcademyStats.cpp Source/Common/RTS/ActionManager.cpp Source/Common/RTS/Energy.cpp - Source/Common/RTS/Handicap.cpp - Source/Common/RTS/MissionStats.cpp +# Source/Common/RTS/Handicap.cpp +# Source/Common/RTS/MissionStats.cpp Source/Common/RTS/Money.cpp Source/Common/RTS/Player.cpp - Source/Common/RTS/PlayerList.cpp +# Source/Common/RTS/PlayerList.cpp Source/Common/RTS/PlayerTemplate.cpp Source/Common/RTS/ProductionPrerequisite.cpp Source/Common/RTS/ResourceGatheringManager.cpp - Source/Common/RTS/Science.cpp - Source/Common/RTS/ScoreKeeper.cpp +# Source/Common/RTS/Science.cpp +# Source/Common/RTS/ScoreKeeper.cpp Source/Common/RTS/SpecialPower.cpp Source/Common/RTS/Team.cpp Source/Common/RTS/TunnelTracker.cpp @@ -630,43 +630,43 @@ set(GAMEENGINE_SRC # Source/Common/System/ArchiveFileSystem.cpp # Source/Common/System/AsciiString.cpp Source/Common/System/BuildAssistant.cpp - Source/Common/System/CriticalSection.cpp - Source/Common/System/DataChunk.cpp +# Source/Common/System/CriticalSection.cpp +# Source/Common/System/DataChunk.cpp # Source/Common/System/Debug.cpp - Source/Common/System/Directory.cpp - Source/Common/System/DisabledTypes.cpp - Source/Common/System/encrypt.cpp +# Source/Common/System/Directory.cpp +# Source/Common/System/DisabledTypes.cpp +# Source/Common/System/encrypt.cpp # Source/Common/System/File.cpp # Source/Common/System/FileSystem.cpp Source/Common/System/FunctionLexicon.cpp # Source/Common/System/GameCommon.cpp #Source/Common/System/GameMemory.cpp # Source/Common/System/GameType.cpp - Source/Common/System/Geometry.cpp - Source/Common/System/KindOf.cpp - Source/Common/System/List.cpp +# Source/Common/System/Geometry.cpp +# Source/Common/System/KindOf.cpp +# Source/Common/System/List.cpp # Source/Common/System/LocalFile.cpp # Source/Common/System/LocalFileSystem.cpp #Source/Common/System/MemoryInit.cpp # Source/Common/System/ObjectStatusTypes.cpp - Source/Common/System/QuotedPrintable.cpp +# Source/Common/System/QuotedPrintable.cpp # Source/Common/System/Radar.cpp # Source/Common/System/RAMFile.cpp Source/Common/System/registry.cpp Source/Common/System/SaveGame/GameState.cpp Source/Common/System/SaveGame/GameStateMap.cpp # Source/Common/System/Snapshot.cpp - Source/Common/System/StackDump.cpp +# Source/Common/System/StackDump.cpp # Source/Common/System/StreamingArchiveFile.cpp # Source/Common/System/SubsystemInterface.cpp Source/Common/System/Trig.cpp # Source/Common/System/UnicodeString.cpp - Source/Common/System/Upgrade.cpp +# Source/Common/System/Upgrade.cpp # Source/Common/System/Xfer.cpp # Source/Common/System/XferCRC.cpp # Source/Common/System/XferLoad.cpp # Source/Common/System/XferSave.cpp - Source/Common/TerrainTypes.cpp +# Source/Common/TerrainTypes.cpp Source/Common/Thing/DrawModule.cpp Source/Common/Thing/Module.cpp Source/Common/Thing/ModuleFactory.cpp @@ -674,7 +674,7 @@ set(GAMEENGINE_SRC Source/Common/Thing/ThingFactory.cpp Source/Common/Thing/ThingTemplate.cpp # Source/Common/UserPreferences.cpp - Source/Common/version.cpp +# Source/Common/version.cpp # Source/Common/WorkerProcess.cpp # Source/GameClient/ClientInstance.cpp # Source/GameClient/Color.cpp @@ -709,7 +709,7 @@ set(GAMEENGINE_SRC # Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp # Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp - Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp +# Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp # Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp # Source/GameClient/GUI/Gadget/GadgetComboBox.cpp # Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp @@ -730,8 +730,8 @@ set(GAMEENGINE_SRC Source/GameClient/GUI/GameWindowTransitionsStyles.cpp # Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp # Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp - Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp - Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp +# Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp +# Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp Source/GameClient/GUI/GUICallbacks/GeneralsExpPoints.cpp Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp Source/GameClient/GUI/GUICallbacks/InGameChat.cpp @@ -742,7 +742,7 @@ set(GAMEENGINE_SRC Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp - Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp +# Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp @@ -777,14 +777,14 @@ set(GAMEENGINE_SRC Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp - Source/GameClient/GUI/GUICallbacks/MessageBox.cpp +# Source/GameClient/GUI/GUICallbacks/MessageBox.cpp Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp # Source/GameClient/GUI/HeaderTemplate.cpp # Source/GameClient/GUI/IMEManager.cpp # Source/GameClient/GUI/LoadScreen.cpp # Source/GameClient/GUI/ProcessAnimateWindow.cpp Source/GameClient/GUI/Shell/Shell.cpp - Source/GameClient/GUI/Shell/ShellMenuScheme.cpp +# Source/GameClient/GUI/Shell/ShellMenuScheme.cpp # Source/GameClient/GUI/WindowLayout.cpp # Source/GameClient/GUI/WindowVideoManager.cpp # Source/GameClient/GUI/WinInstanceData.cpp @@ -823,7 +823,7 @@ set(GAMEENGINE_SRC # Source/GameClient/View.cpp # Source/GameClient/Water.cpp Source/GameLogic/AI/AI.cpp - Source/GameLogic/AI/AIDock.cpp +# Source/GameLogic/AI/AIDock.cpp Source/GameLogic/AI/AIGroup.cpp Source/GameLogic/AI/AIGuard.cpp Source/GameLogic/AI/AIGuardRetaliate.cpp @@ -832,7 +832,7 @@ set(GAMEENGINE_SRC Source/GameLogic/AI/AISkirmishPlayer.cpp Source/GameLogic/AI/AIStates.cpp Source/GameLogic/AI/AITNGuard.cpp - Source/GameLogic/AI/Squad.cpp +# Source/GameLogic/AI/Squad.cpp Source/GameLogic/AI/TurretAI.cpp Source/GameLogic/Map/PolygonTrigger.cpp Source/GameLogic/Map/SidesList.cpp @@ -842,8 +842,8 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/Behavior/BattleBusSlowDeathBehavior.cpp Source/GameLogic/Object/Behavior/BehaviorModule.cpp Source/GameLogic/Object/Behavior/BridgeBehavior.cpp - Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp - Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp +# Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp +# Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp Source/GameLogic/Object/Behavior/BunkerBusterBehavior.cpp Source/GameLogic/Object/Behavior/CountermeasuresBehavior.cpp Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp @@ -852,35 +852,35 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp Source/GameLogic/Object/Behavior/GenerateMinefieldBehavior.cpp Source/GameLogic/Object/Behavior/GrantStealthBehavior.cpp - Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp +# Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp Source/GameLogic/Object/Behavior/JetSlowDeathBehavior.cpp Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp Source/GameLogic/Object/Behavior/NeutonBlastBehavior.cpp - Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp +# Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp - Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp +# Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp Source/GameLogic/Object/Behavior/PrisonBehavior.cpp - Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp +# Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp Source/GameLogic/Object/Behavior/SpawnBehavior.cpp - Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp +# Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp Source/GameLogic/Object/Behavior/TechBuildingBehavior.cpp Source/GameLogic/Object/Body/ActiveBody.cpp Source/GameLogic/Object/Body/BodyModule.cpp - Source/GameLogic/Object/Body/HighlanderBody.cpp +# Source/GameLogic/Object/Body/HighlanderBody.cpp Source/GameLogic/Object/Body/HiveStructureBody.cpp - Source/GameLogic/Object/Body/ImmortalBody.cpp +# Source/GameLogic/Object/Body/ImmortalBody.cpp Source/GameLogic/Object/Body/InactiveBody.cpp - Source/GameLogic/Object/Body/StructureBody.cpp +# Source/GameLogic/Object/Body/StructureBody.cpp Source/GameLogic/Object/Body/UndeadBody.cpp Source/GameLogic/Object/Collide/CollideModule.cpp Source/GameLogic/Object/Collide/CrateCollide/ConvertToCarBombCrateCollide.cpp Source/GameLogic/Object/Collide/CrateCollide/ConvertToHijackedVehicleCrateCollide.cpp Source/GameLogic/Object/Collide/CrateCollide/CrateCollide.cpp - Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp +# Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp Source/GameLogic/Object/Collide/CrateCollide/MoneyCrateCollide.cpp Source/GameLogic/Object/Collide/CrateCollide/SabotageCommandCenterCrateCollide.cpp Source/GameLogic/Object/Collide/CrateCollide/SabotageFakeBuilding.cpp @@ -891,56 +891,56 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/Collide/CrateCollide/SabotageSupplyCenterCrateCollide.cpp Source/GameLogic/Object/Collide/CrateCollide/SabotageSupplyDropzoneCrateCollide.cpp Source/GameLogic/Object/Collide/CrateCollide/SalvageCrateCollide.cpp - Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp - Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp - Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp - Source/GameLogic/Object/Collide/FireWeaponCollide.cpp - Source/GameLogic/Object/Collide/SquishCollide.cpp +# Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp +# Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp +# Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp +# Source/GameLogic/Object/Collide/FireWeaponCollide.cpp +# Source/GameLogic/Object/Collide/SquishCollide.cpp Source/GameLogic/Object/Contain/CaveContain.cpp Source/GameLogic/Object/Contain/GarrisonContain.cpp - Source/GameLogic/Object/Contain/HealContain.cpp +# Source/GameLogic/Object/Contain/HealContain.cpp Source/GameLogic/Object/Contain/HelixContain.cpp Source/GameLogic/Object/Contain/InternetHackContain.cpp Source/GameLogic/Object/Contain/MobNexusContain.cpp Source/GameLogic/Object/Contain/OpenContain.cpp Source/GameLogic/Object/Contain/OverlordContain.cpp Source/GameLogic/Object/Contain/ParachuteContain.cpp - Source/GameLogic/Object/Contain/RailedTransportContain.cpp +# Source/GameLogic/Object/Contain/RailedTransportContain.cpp Source/GameLogic/Object/Contain/RiderChangeContain.cpp Source/GameLogic/Object/Contain/TransportContain.cpp Source/GameLogic/Object/Contain/TunnelContain.cpp - Source/GameLogic/Object/Create/CreateModule.cpp +# Source/GameLogic/Object/Create/CreateModule.cpp Source/GameLogic/Object/Create/GrantUpgradeCreate.cpp Source/GameLogic/Object/Create/LockWeaponCreate.cpp - Source/GameLogic/Object/Create/PreorderCreate.cpp - Source/GameLogic/Object/Create/SpecialPowerCreate.cpp - Source/GameLogic/Object/Create/SupplyCenterCreate.cpp - Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp - Source/GameLogic/Object/Create/VeterancyGainCreate.cpp - Source/GameLogic/Object/Damage/BoneFXDamage.cpp - Source/GameLogic/Object/Damage/DamageModule.cpp +# Source/GameLogic/Object/Create/PreorderCreate.cpp +# Source/GameLogic/Object/Create/SpecialPowerCreate.cpp +# Source/GameLogic/Object/Create/SupplyCenterCreate.cpp +# Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp +# Source/GameLogic/Object/Create/VeterancyGainCreate.cpp +# Source/GameLogic/Object/Damage/BoneFXDamage.cpp +# Source/GameLogic/Object/Damage/DamageModule.cpp Source/GameLogic/Object/Damage/TransitionDamageFX.cpp - Source/GameLogic/Object/Destroy/DestroyModule.cpp - Source/GameLogic/Object/Die/CreateCrateDie.cpp +# Source/GameLogic/Object/Destroy/DestroyModule.cpp +# Source/GameLogic/Object/Die/CreateCrateDie.cpp Source/GameLogic/Object/Die/CreateObjectDie.cpp - Source/GameLogic/Object/Die/CrushDie.cpp - Source/GameLogic/Object/Die/DamDie.cpp +# Source/GameLogic/Object/Die/CrushDie.cpp +# Source/GameLogic/Object/Die/DamDie.cpp Source/GameLogic/Object/Die/DestroyDie.cpp - Source/GameLogic/Object/Die/DieModule.cpp - Source/GameLogic/Object/Die/EjectPilotDie.cpp +# Source/GameLogic/Object/Die/DieModule.cpp +# Source/GameLogic/Object/Die/EjectPilotDie.cpp Source/GameLogic/Object/Die/FXListDie.cpp - Source/GameLogic/Object/Die/KeepObjectDie.cpp +# Source/GameLogic/Object/Die/KeepObjectDie.cpp Source/GameLogic/Object/Die/RebuildHoleExposeDie.cpp - Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp - Source/GameLogic/Object/Die/UpgradeDie.cpp +# Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp +# Source/GameLogic/Object/Die/UpgradeDie.cpp Source/GameLogic/Object/ExperienceTracker.cpp Source/GameLogic/Object/FiringTracker.cpp Source/GameLogic/Object/GhostObject.cpp - Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp - Source/GameLogic/Object/Helper/ObjectHelper.cpp - Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp - Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp - Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp +# Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp +# Source/GameLogic/Object/Helper/ObjectHelper.cpp +# Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp +# Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp +# Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp Source/GameLogic/Object/Helper/StatusDamageHelper.cpp Source/GameLogic/Object/Helper/SubdualDamageHelper.cpp Source/GameLogic/Object/Helper/TempWeaponBonusHelper.cpp @@ -958,9 +958,9 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/SpecialPower/DemoralizeSpecialPower.cpp Source/GameLogic/Object/SpecialPower/FireWeaponPower.cpp Source/GameLogic/Object/SpecialPower/OCLSpecialPower.cpp - Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp +# Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp - Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp +# Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp Source/GameLogic/Object/Update/AIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/AssaultTransportAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -970,12 +970,12 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp - Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp - Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp +# Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp +# Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/TransportAIUpdate.cpp - Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp +# Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp Source/GameLogic/Object/Update/AnimationSteeringUpdate.cpp Source/GameLogic/Object/Update/AssistedTargetingUpdate.cpp @@ -984,52 +984,52 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/Update/BaseRenerateUpdate.cpp Source/GameLogic/Object/Update/BattlePlanUpdate.cpp Source/GameLogic/Object/Update/BoneFXUpdate.cpp - Source/GameLogic/Object/Update/CheckpointUpdate.cpp - Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp +# Source/GameLogic/Object/Update/CheckpointUpdate.cpp +# Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp Source/GameLogic/Object/Update/CommandButtonHuntUpdate.cpp - Source/GameLogic/Object/Update/DeletionUpdate.cpp +# Source/GameLogic/Object/Update/DeletionUpdate.cpp Source/GameLogic/Object/Update/DemoTrapUpdate.cpp Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp - Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp +# Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp Source/GameLogic/Object/Update/DockUpdate/RailedTransportDockUpdate.cpp - Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp +# Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp Source/GameLogic/Object/Update/DockUpdate/SupplyCenterDockUpdate.cpp - Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp - Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp +# Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp +# Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp Source/GameLogic/Object/Update/DynamicShroudClearingRangeUpdate.cpp Source/GameLogic/Object/Update/EMPUpdate.cpp - Source/GameLogic/Object/Update/EnemyNearUpdate.cpp +# Source/GameLogic/Object/Update/EnemyNearUpdate.cpp Source/GameLogic/Object/Update/FireOCLAfterWeaponCooldownUpdate.cpp - Source/GameLogic/Object/Update/FireSpreadUpdate.cpp +# Source/GameLogic/Object/Update/FireSpreadUpdate.cpp Source/GameLogic/Object/Update/FirestormDynamicGeometryInfoUpdate.cpp Source/GameLogic/Object/Update/FireWeaponUpdate.cpp - Source/GameLogic/Object/Update/FlammableUpdate.cpp - Source/GameLogic/Object/Update/FloatUpdate.cpp - Source/GameLogic/Object/Update/HeightDieUpdate.cpp +# Source/GameLogic/Object/Update/FlammableUpdate.cpp +# Source/GameLogic/Object/Update/FloatUpdate.cpp +# Source/GameLogic/Object/Update/HeightDieUpdate.cpp Source/GameLogic/Object/Update/HelicopterSlowDeathUpdate.cpp - Source/GameLogic/Object/Update/HijackerUpdate.cpp +# Source/GameLogic/Object/Update/HijackerUpdate.cpp Source/GameLogic/Object/Update/HordeUpdate.cpp Source/GameLogic/Object/Update/LaserUpdate.cpp - Source/GameLogic/Object/Update/LifetimeUpdate.cpp +# Source/GameLogic/Object/Update/LifetimeUpdate.cpp Source/GameLogic/Object/Update/MissileLauncherBuildingUpdate.cpp - Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp - Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp +# Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp +# Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp Source/GameLogic/Object/Update/OCLUpdate.cpp Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp Source/GameLogic/Object/Update/PhysicsUpdate.cpp - Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp +# Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp Source/GameLogic/Object/Update/PointDefenseLaserUpdate.cpp - Source/GameLogic/Object/Update/PowerPlantUpdate.cpp +# Source/GameLogic/Object/Update/PowerPlantUpdate.cpp Source/GameLogic/Object/Update/ProductionExitUpdate/DefaultProductionExitUpdate.cpp - Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp - Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp +# Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp +# Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp Source/GameLogic/Object/Update/ProductionExitUpdate/SupplyCenterProductionExitUpdate.cpp Source/GameLogic/Object/Update/ProductionUpdate.cpp Source/GameLogic/Object/Update/ProjectileStreamUpdate.cpp - Source/GameLogic/Object/Update/ProneUpdate.cpp - Source/GameLogic/Object/Update/RadarUpdate.cpp - Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp +# Source/GameLogic/Object/Update/ProneUpdate.cpp +# Source/GameLogic/Object/Update/RadarUpdate.cpp +# Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp Source/GameLogic/Object/Update/SlavedUpdate.cpp Source/GameLogic/Object/Update/SmartBombTargetHomingUpdate.cpp Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp @@ -1042,32 +1042,32 @@ set(GAMEENGINE_SRC Source/GameLogic/Object/Update/StickyBombUpdate.cpp Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp Source/GameLogic/Object/Update/StructureToppleUpdate.cpp - Source/GameLogic/Object/Update/TensileFormationUpdate.cpp +# Source/GameLogic/Object/Update/TensileFormationUpdate.cpp Source/GameLogic/Object/Update/ToppleUpdate.cpp Source/GameLogic/Object/Update/UpdateModule.cpp Source/GameLogic/Object/Update/WaveGuideUpdate.cpp Source/GameLogic/Object/Update/WeaponBonusUpdate.cpp - Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp +# Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp Source/GameLogic/Object/Upgrade/ArmorUpgrade.cpp Source/GameLogic/Object/Upgrade/CommandSetUpgrade.cpp - Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp - Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp +# Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp +# Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp Source/GameLogic/Object/Upgrade/GrantScienceUpgrade.cpp - Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp - Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp +# Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp +# Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp Source/GameLogic/Object/Upgrade/ModelConditionUpgrade.cpp - Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp +# Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp Source/GameLogic/Object/Upgrade/PassengersFireUpgrade.cpp - Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp - Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp +# Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp +# Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp Source/GameLogic/Object/Upgrade/ReplaceObjectUpgrade.cpp - Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp +# Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp Source/GameLogic/Object/Upgrade/StealthUpgrade.cpp - Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp - Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp +# Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp +# Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp Source/GameLogic/Object/Upgrade/UpgradeModule.cpp - Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp - Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp +# Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp +# Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp Source/GameLogic/Object/Weapon.cpp Source/GameLogic/Object/WeaponSet.cpp Source/GameLogic/ScriptEngine/ScriptActions.cpp diff --git a/scripts/cpp/unify_move_files.py b/scripts/cpp/unify_move_files.py index f691b45c96c..443666ac511 100644 --- a/scripts/cpp/unify_move_files.py +++ b/scripts/cpp/unify_move_files.py @@ -591,8 +591,241 @@ def main(): #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp") #unify_file(Game.ZEROHOUR, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp", Game.CORE, "GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/BezFwdIterator.h", Game.CORE, "GameEngine/Include/Common/BezFwdIterator.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/BezierSegment.h", Game.CORE, "GameEngine/Include/Common/BezierSegment.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/CriticalSection.h", Game.CORE, "GameEngine/Include/Common/CriticalSection.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/DamageFX.h", Game.CORE, "GameEngine/Include/Common/DamageFX.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/DataChunk.h", Game.CORE, "GameEngine/Include/Common/DataChunk.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/Dict.h", Game.CORE, "GameEngine/Include/Common/Dict.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/Directory.h", Game.CORE, "GameEngine/Include/Common/Directory.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/DisabledTypes.h", Game.CORE, "GameEngine/Include/Common/DisabledTypes.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/DiscreteCircle.h", Game.CORE, "GameEngine/Include/Common/DiscreteCircle.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/Geometry.h", Game.CORE, "GameEngine/Include/Common/Geometry.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/KindOf.h", Game.CORE, "GameEngine/Include/Common/KindOf.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/Language.h", Game.CORE, "GameEngine/Include/Common/Language.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/List.h", Game.CORE, "GameEngine/Include/Common/List.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/MiniLog.h", Game.CORE, "GameEngine/Include/Common/MiniLog.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/PerfTimer.h", Game.CORE, "GameEngine/Include/Common/PerfTimer.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/PlayerList.h", Game.CORE, "GameEngine/Include/Common/PlayerList.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/QuotedPrintable.h", Game.CORE, "GameEngine/Include/Common/QuotedPrintable.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/Handicap.h", Game.CORE, "GameEngine/Include/Common/Handicap.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/MissionStats.h", Game.CORE, "GameEngine/Include/Common/MissionStats.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/Science.h", Game.CORE, "GameEngine/Include/Common/Science.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/ScoreKeeper.h", Game.CORE, "GameEngine/Include/Common/ScoreKeeper.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/StackDump.h", Game.CORE, "GameEngine/Include/Common/StackDump.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/TerrainTypes.h", Game.CORE, "GameEngine/Include/Common/TerrainTypes.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/Upgrade.h", Game.CORE, "GameEngine/Include/Common/Upgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/encrypt.h", Game.CORE, "GameEngine/Include/Common/encrypt.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/version.h", Game.CORE, "GameEngine/Include/Common/version.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/Diplomacy.h", Game.CORE, "GameEngine/Include/GameClient/Diplomacy.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/EstablishConnectionsMenu.h", Game.CORE, "GameEngine/Include/GameClient/EstablishConnectionsMenu.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/ExtendedMessageBox.h", Game.CORE, "GameEngine/Include/GameClient/ExtendedMessageBox.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GameInfoWindow.h", Game.CORE, "GameEngine/Include/GameClient/GameInfoWindow.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/MessageBox.h", Game.CORE, "GameEngine/Include/GameClient/MessageBox.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/ShellMenuScheme.h", Game.CORE, "GameEngine/Include/GameClient/ShellMenuScheme.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/AIDock.h", Game.CORE, "GameEngine/Include/GameLogic/AIDock.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/BoneFXDamage.h", Game.CORE, "GameEngine/Include/GameLogic/Module/BoneFXDamage.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/BridgeScaffoldBehavior.h", Game.CORE, "GameEngine/Include/GameLogic/Module/BridgeScaffoldBehavior.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h", Game.CORE, "GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/CheckpointUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/CheckpointUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/CleanupHazardUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/CleanupHazardUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/CreateCrateDie.h", Game.CORE, "GameEngine/Include/GameLogic/Module/CreateCrateDie.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/CreateModule.h", Game.CORE, "GameEngine/Include/GameLogic/Module/CreateModule.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/CrushDie.h", Game.CORE, "GameEngine/Include/GameLogic/Module/CrushDie.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/DamDie.h", Game.CORE, "GameEngine/Include/GameLogic/Module/DamDie.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/DamageModule.h", Game.CORE, "GameEngine/Include/GameLogic/Module/DamageModule.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/DeletionUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/DeletionUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/DestroyModule.h", Game.CORE, "GameEngine/Include/GameLogic/Module/DestroyModule.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/DieModule.h", Game.CORE, "GameEngine/Include/GameLogic/Module/DieModule.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/DynamicGeometryInfoUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/DynamicGeometryInfoUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/EjectPilotDie.h", Game.CORE, "GameEngine/Include/GameLogic/Module/EjectPilotDie.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/EnemyNearUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/EnemyNearUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/FireSpreadUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/FireWeaponCollide.h", Game.CORE, "GameEngine/Include/GameLogic/Module/FireWeaponCollide.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/FlammableUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/FlammableUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/FloatUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/FloatUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/HealContain.h", Game.CORE, "GameEngine/Include/GameLogic/Module/HealContain.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/HealCrateCollide.h", Game.CORE, "GameEngine/Include/GameLogic/Module/HealCrateCollide.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/HeightDieUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/HeightDieUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/HighlanderBody.h", Game.CORE, "GameEngine/Include/GameLogic/Module/HighlanderBody.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/HijackerUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/HijackerUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/ImmortalBody.h", Game.CORE, "GameEngine/Include/GameLogic/Module/ImmortalBody.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/InstantDeathBehavior.h", Game.CORE, "GameEngine/Include/GameLogic/Module/InstantDeathBehavior.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/KeepObjectDie.h", Game.CORE, "GameEngine/Include/GameLogic/Module/KeepObjectDie.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/LifetimeUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/LifetimeUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/MobMemberSlavedUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/MobMemberSlavedUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/NeutronMissileSlowDeathUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/ObjectDefectionHelper.h", Game.CORE, "GameEngine/Include/GameLogic/Module/ObjectDefectionHelper.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/ObjectHelper.h", Game.CORE, "GameEngine/Include/GameLogic/Module/ObjectHelper.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/ObjectRepulsorHelper.h", Game.CORE, "GameEngine/Include/GameLogic/Module/ObjectRepulsorHelper.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/ObjectSMCHelper.h", Game.CORE, "GameEngine/Include/GameLogic/Module/ObjectSMCHelper.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/ObjectWeaponStatusHelper.h", Game.CORE, "GameEngine/Include/GameLogic/Module/ObjectWeaponStatusHelper.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/OverchargeBehavior.h", Game.CORE, "GameEngine/Include/GameLogic/Module/OverchargeBehavior.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/POWTruckAIUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/POWTruckAIUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/POWTruckBehavior.h", Game.CORE, "GameEngine/Include/GameLogic/Module/POWTruckBehavior.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/PilotFindVehicleUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/PilotFindVehicleUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/PowerPlantUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/PreorderCreate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/PreorderCreate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/PrisonDockUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/PrisonDockUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/ProneUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/ProneUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h", Game.CORE, "GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/RadarUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/RadarUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/RadarUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/RadarUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/RadiusDecalUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/RadiusDecalUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/RailedTransportAIUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/RailedTransportAIUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/RailedTransportContain.h", Game.CORE, "GameEngine/Include/GameLogic/Module/RailedTransportContain.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/RepairDockUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/RepairDockUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/ShroudCrateCollide.h", Game.CORE, "GameEngine/Include/GameLogic/Module/ShroudCrateCollide.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/SpawnPointProductionExitUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/SpawnPointProductionExitUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/SpecialAbility.h", Game.CORE, "GameEngine/Include/GameLogic/Module/SpecialAbility.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/SpecialPowerCompletionDie.h", Game.CORE, "GameEngine/Include/GameLogic/Module/SpecialPowerCompletionDie.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/SpecialPowerCreate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/SpecialPowerCreate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/SpyVisionSpecialPower.h", Game.CORE, "GameEngine/Include/GameLogic/Module/SpyVisionSpecialPower.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/SquishCollide.h", Game.CORE, "GameEngine/Include/GameLogic/Module/SquishCollide.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/StructureBody.h", Game.CORE, "GameEngine/Include/GameLogic/Module/StructureBody.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/SupplyCenterCreate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/SupplyWarehouseCreate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/SupplyWarehouseCreate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h", Game.CORE, "GameEngine/Include/GameLogic/Module/SupplyWarehouseCripplingBehavior.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/SupplyWarehouseDockUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/TensileFormationUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/TensileFormationUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/UnitCrateCollide.h", Game.CORE, "GameEngine/Include/GameLogic/Module/UnitCrateCollide.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/UpgradeDie.h", Game.CORE, "GameEngine/Include/GameLogic/Module/UpgradeDie.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/VeterancyCrateCollide.h", Game.CORE, "GameEngine/Include/GameLogic/Module/VeterancyCrateCollide.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/VeterancyGainCreate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/VeterancyGainCreate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/WanderAIUpdate.h", Game.CORE, "GameEngine/Include/GameLogic/Module/WanderAIUpdate.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h", Game.CORE, "GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameLogic/Squad.h", Game.CORE, "GameEngine/Include/GameLogic/Squad.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/Bezier/BezFwdIterator.cpp", Game.CORE, "GameEngine/Source/Common/Bezier/BezFwdIterator.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/Bezier/BezierSegment.cpp", Game.CORE, "GameEngine/Source/Common/Bezier/BezierSegment.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/DamageFX.cpp", Game.CORE, "GameEngine/Source/Common/DamageFX.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/Dict.cpp", Game.CORE, "GameEngine/Source/Common/Dict.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/DiscreteCircle.cpp", Game.CORE, "GameEngine/Source/Common/DiscreteCircle.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/Language.cpp", Game.CORE, "GameEngine/Source/Common/Language.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/MiniLog.cpp", Game.CORE, "GameEngine/Source/Common/MiniLog.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/PerfTimer.cpp", Game.CORE, "GameEngine/Source/Common/PerfTimer.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/RTS/Handicap.cpp", Game.CORE, "GameEngine/Source/Common/RTS/Handicap.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/RTS/MissionStats.cpp", Game.CORE, "GameEngine/Source/Common/RTS/MissionStats.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/RTS/PlayerList.cpp", Game.CORE, "GameEngine/Source/Common/RTS/PlayerList.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/RTS/Science.cpp", Game.CORE, "GameEngine/Source/Common/RTS/Science.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/RTS/ScoreKeeper.cpp", Game.CORE, "GameEngine/Source/Common/RTS/ScoreKeeper.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/CriticalSection.cpp", Game.CORE, "GameEngine/Source/Common/System/CriticalSection.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/DataChunk.cpp", Game.CORE, "GameEngine/Source/Common/System/DataChunk.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/Directory.cpp", Game.CORE, "GameEngine/Source/Common/System/Directory.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/DisabledTypes.cpp", Game.CORE, "GameEngine/Source/Common/System/DisabledTypes.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/Geometry.cpp", Game.CORE, "GameEngine/Source/Common/System/Geometry.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/KindOf.cpp", Game.CORE, "GameEngine/Source/Common/System/KindOf.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/List.cpp", Game.CORE, "GameEngine/Source/Common/System/List.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/QuotedPrintable.cpp", Game.CORE, "GameEngine/Source/Common/System/QuotedPrintable.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/StackDump.cpp", Game.CORE, "GameEngine/Source/Common/System/StackDump.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/Upgrade.cpp", Game.CORE, "GameEngine/Source/Common/System/Upgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/encrypt.cpp", Game.CORE, "GameEngine/Source/Common/System/encrypt.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/TerrainTypes.cpp", Game.CORE, "GameEngine/Source/Common/TerrainTypes.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/Common/version.cpp", Game.CORE, "GameEngine/Source/Common/version.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/AI/AIDock.cpp", Game.CORE, "GameEngine/Source/GameLogic/AI/AIDock.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/AI/Squad.cpp", Game.CORE, "GameEngine/Source/GameLogic/AI/Squad.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Behavior/BridgeScaffoldBehavior.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Behavior/OverchargeBehavior.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Behavior/SupplyWarehouseCripplingBehavior.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Body/HighlanderBody.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Body/HighlanderBody.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Body/ImmortalBody.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Body/ImmortalBody.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Body/StructureBody.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Body/StructureBody.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Collide/CrateCollide/HealCrateCollide.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ShroudCrateCollide.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Collide/CrateCollide/UnitCrateCollide.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Collide/SquishCollide.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Collide/SquishCollide.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Contain/HealContain.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Contain/HealContain.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Contain/RailedTransportContain.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Contain/RailedTransportContain.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Damage/BoneFXDamage.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Damage/BoneFXDamage.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Damage/DamageModule.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Damage/DamageModule.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Destroy/DestroyModule.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Destroy/DestroyModule.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Die/DamDie.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Die/DamDie.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Die/DieModule.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Die/DieModule.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Die/EjectPilotDie.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Die/EjectPilotDie.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Die/KeepObjectDie.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Die/KeepObjectDie.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Die/SpecialPowerCompletionDie.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Die/UpgradeDie.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Die/UpgradeDie.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Helper/ObjectDefectionHelper.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Helper/ObjectHelper.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Helper/ObjectHelper.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Helper/ObjectRepulsorHelper.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Helper/ObjectSMCHelper.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Helper/ObjectWeaponStatusHelper.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/SpecialPower/SpecialAbility.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/SpecialPower/SpyVisionSpecialPower.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/AIUpdate/WanderAIUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/CheckpointUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/CheckpointUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/CleanupHazardUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/DeletionUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/DeletionUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/DockUpdate/RepairDockUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/DynamicGeometryInfoUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/EnemyNearUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/EnemyNearUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/FloatUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/FloatUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/HijackerUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/HijackerUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/LifetimeUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/LifetimeUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/MobMemberSlavedUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/PilotFindVehicleUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/PowerPlantUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/PowerPlantUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/QueueProductionExitUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/ProductionExitUpdate/SpawnPointProductionExitUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/ProneUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/ProneUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/RadarUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/RadarUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/RadiusDecalUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp", Game.CORE, "GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp") + return if __name__ == "__main__": - main() + main() \ No newline at end of file