Skip to content

Commit

Permalink
shuffle WeaponMemPool.h #includes around
Browse files Browse the repository at this point in the history
  • Loading branch information
rtri committed May 30, 2017
1 parent cb2360a commit 5f7bc5e
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 16 deletions.
1 change: 1 addition & 0 deletions rts/Sim/Weapons/BeamLaser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "BeamLaser.h"
#include "PlasmaRepulser.h"
#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Game/GameHelper.h"
#include "Game/TraceRay.h"
#include "Map/Ground.h"
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Weapons/BombDropper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "BombDropper.h"
#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Game/GameHelper.h"
#include "Sim/Misc/GlobalSynced.h"
#include "Sim/Misc/Team.h"
Expand Down
3 changes: 2 additions & 1 deletion rts/Sim/Weapons/Cannon.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */

#include "Cannon.h"
#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Game/TraceRay.h"
#include "Map/Ground.h"
#include "Map/MapInfo.h"
Expand All @@ -9,7 +11,6 @@
#include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h"
#include "Sim/Units/Unit.h"
#include "System/Sync/SyncTracer.h"
#include "WeaponDefHandler.h"
#include "System/myMath.h"
#include "System/FastMath.h"

Expand Down
8 changes: 1 addition & 7 deletions rts/Sim/Weapons/DGunWeapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "DGunWeapon.h"
#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Sim/Misc/GlobalSynced.h"
#include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h"
#include "Sim/Units/Unit.h"
Expand All @@ -10,13 +11,6 @@ CR_BIND_DERIVED_POOL(CDGunWeapon, CWeapon, , weaponMemPool.alloc, weaponMemPool.
CR_REG_METADATA(CDGunWeapon, )


float CDGunWeapon::GetPredictedImpactTime(float3 p) const
{
// user has to manually predict
return 0;
}


void CDGunWeapon::FireImpl(const bool scriptCall)
{
float3 dir = wantedDir;
Expand Down
2 changes: 1 addition & 1 deletion rts/Sim/Weapons/DGunWeapon.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CDGunWeapon: public CWeapon
CDGunWeapon(CUnit* owner = nullptr, const WeaponDef* def = nullptr): CWeapon(owner, def) {}

void Fire();
float GetPredictedImpactTime(float3 p) const override final;
float GetPredictedImpactTime(float3 p) const override final { return 0.0f; }
void Init() override final;

private:
Expand Down
8 changes: 4 additions & 4 deletions rts/Sim/Weapons/EmgCannon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
#include "EmgCannon.h"

#include "WeaponDef.h"
#include "Sim/Misc/Team.h"
#include "WeaponMemPool.h"
#include "Map/Ground.h"
#include "Sim/Misc/Team.h"
#include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h"
#include "Sim/Units/Unit.h"
#include "Sim/Units/UnitDef.h"
Expand All @@ -20,10 +21,9 @@ void CEmgCannon::FireImpl(const bool scriptCall)
float3 dir = currentTargetPos - weaponMuzzlePos;
const float dist = dir.LengthNormalize();

if (onlyForward && owner->unitDef->IsStrafingAirUnit()) {
// [?] StrafeAirMoveType cannot align itself properly, change back when that is fixed
// [?] StrafeAirMoveType cannot align itself properly, change back when that is fixed
if (onlyForward && owner->unitDef->IsStrafingAirUnit())
dir = owner->frontdir;
}

dir += (gsRNG.NextVector() * SprayAngleExperience() + SalvoErrorExperience());
dir.Normalize();
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Weapons/FlameThrower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "FlameThrower.h"

#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Map/Ground.h"
#include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h"
#include "Sim/Units/Unit.h"
Expand Down
4 changes: 2 additions & 2 deletions rts/Sim/Weapons/LaserCannon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "LaserCannon.h"
#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Map/Ground.h"
#include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h"
#include "Sim/Units/Unit.h"
Expand All @@ -13,8 +14,7 @@ CR_REG_METADATA(CLaserCannon,(
CR_MEMBER(color)
))

CLaserCannon::CLaserCannon(CUnit* owner, const WeaponDef* def)
: CWeapon(owner, def)
CLaserCannon::CLaserCannon(CUnit* owner, const WeaponDef* def): CWeapon(owner, def)
{
//happens when loading
if (def != nullptr)
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Weapons/LightningCannon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "LightningCannon.h"
#include "PlasmaRepulser.h"
#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Game/GameHelper.h"
#include "Game/TraceRay.h"
#include "Sim/Misc/CollisionHandler.h"
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Weapons/MeleeWeapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "MeleeWeapon.h"
#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Sim/Units/Unit.h"

CR_BIND_DERIVED_POOL(CMeleeWeapon, CWeapon, , weaponMemPool.alloc, weaponMemPool.free)
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Weapons/MissileLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "MissileLauncher.h"

#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Game/TraceRay.h"
#include "Map/Ground.h"
#include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h"
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Weapons/NoWeapon.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */

#include "NoWeapon.h"
#include "WeaponMemPool.h"

CR_BIND_DERIVED_POOL(CNoWeapon, CWeapon, , weaponMemPool.alloc, weaponMemPool.free)
CR_REG_METADATA(CNoWeapon, )
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Weapons/PlasmaRepulser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "System/creg/STL_List.h"
#include "System/creg/STL_Set.h"
#include "PlasmaRepulser.h"
#include "WeaponMemPool.h"
#include "Sim/Misc/GlobalSynced.h"
#include "Sim/Misc/QuadField.h"
#include "Sim/Misc/TeamHandler.h"
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Weapons/Rifle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "Rifle.h"
#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Game/TraceRay.h"
#include "Game/GameHelper.h"
#include "Map/Ground.h"
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Weapons/StarburstLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "StarburstLauncher.h"
#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Game/TraceRay.h"
#include "Map/Ground.h"
#include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h"
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Weapons/TorpedoLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "TorpedoLauncher.h"

#include "WeaponDef.h"
#include "WeaponMemPool.h"
#include "Map/Ground.h"
#include "Sim/Projectiles/WeaponProjectiles/WeaponProjectileFactory.h"
#include "Sim/Units/UnitDef.h"
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Weapons/Weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "Weapon.h"
#include "WeaponDefHandler.h"
#include "WeaponMemPool.h"
#include "Game/GameHelper.h"
#include "Game/TraceRay.h"
#include "Game/Players/Player.h"
Expand Down
1 change: 0 additions & 1 deletion rts/Sim/Weapons/Weapon.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "System/Object.h"
#include "Sim/Misc/DamageArray.h"
#include "Sim/Projectiles/ProjectileParams.h"
#include "Sim/Weapons/WeaponMemPool.h"
#include "Sim/Weapons/WeaponTarget.h"
#include "System/float3.h"

Expand Down

0 comments on commit 5f7bc5e

Please sign in to comment.