From adf9610138ae56370bcb7067afda41d208341e71 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 22 Sep 2019 09:26:46 -0400 Subject: [PATCH] CBurstFire: Tidy up includes Includes all necessary headers and uses a forward declaration where applicable. Ensures inclusion changes in other headers don't break the compilation of these headers and source files. --- Runtime/Weapon/CBurstFire.cpp | 11 +++++++++-- Runtime/Weapon/CBurstFire.hpp | 6 +++++- Runtime/World/CScriptGunTurret.cpp | 31 +++++++++++++++++------------- Runtime/World/CScriptGunTurret.hpp | 22 +++++++++++++++------ 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/Runtime/Weapon/CBurstFire.cpp b/Runtime/Weapon/CBurstFire.cpp index c90105271..4c6ccd739 100644 --- a/Runtime/Weapon/CBurstFire.cpp +++ b/Runtime/Weapon/CBurstFire.cpp @@ -1,5 +1,12 @@ -#include "CBurstFire.hpp" -#include "GameGlobalObjects.hpp" +#include "Runtime/Weapon/CBurstFire.hpp" + +#include +#include + +#include "Runtime/GameGlobalObjects.hpp" +#include "Runtime/CStateManager.hpp" + +#include namespace urde { CBurstFire::CBurstFire(const SBurst** burstDefs, s32 firstBurstCount) : x10_firstBurstCounter(firstBurstCount) { diff --git a/Runtime/Weapon/CBurstFire.hpp b/Runtime/Weapon/CBurstFire.hpp index d2d986629..b0dee4c3d 100644 --- a/Runtime/Weapon/CBurstFire.hpp +++ b/Runtime/Weapon/CBurstFire.hpp @@ -1,8 +1,12 @@ #pragma once -#include "CStateManager.hpp" +#include "Runtime/GCNTypes.hpp" +#include "Runtime/rstl.hpp" +#include namespace urde { +class CStateManager; + struct SBurst { s32 x0_randomSelectionWeight; s32 x4_shotAngles[8]; diff --git a/Runtime/World/CScriptGunTurret.cpp b/Runtime/World/CScriptGunTurret.cpp index 7814c8013..084724948 100644 --- a/Runtime/World/CScriptGunTurret.cpp +++ b/Runtime/World/CScriptGunTurret.cpp @@ -1,17 +1,20 @@ -#include "CScriptGunTurret.hpp" -#include "GameGlobalObjects.hpp" -#include "CSimplePool.hpp" -#include "Particle/CGenDescription.hpp" -#include "Particle/CElementGen.hpp" -#include "Weapon/CGameProjectile.hpp" -#include "World/CGameLight.hpp" -#include "Collision/CCollisionActorManager.hpp" -#include "Collision/CCollisionActor.hpp" -#include "CPlayer.hpp" -#include "Character/CPASAnimParmData.hpp" -#include "Graphics/CBooRenderer.hpp" +#include "Runtime/World/CScriptGunTurret.hpp" + +#include "Runtime/CSimplePool.hpp" +#include "Runtime/GameGlobalObjects.hpp" +#include "Runtime/Character/CPASAnimParmData.hpp" +#include "Runtime/Collision/CCollisionActor.hpp" +#include "Runtime/Collision/CCollisionActorManager.hpp" +#include "Runtime/Graphics/CBooRenderer.hpp" +#include "Runtime/Particle/CElementGen.hpp" +#include "Runtime/Particle/CGenDescription.hpp" +#include "Runtime/Weapon/CEnergyProjectile.hpp" +#include "Runtime/Weapon/CGameProjectile.hpp" +#include "Runtime/World/CAiFuncMap.hpp" +#include "Runtime/World/CGameLight.hpp" +#include "Runtime/World/CPlayer.hpp" + #include "TCastTo.hpp" // Generated file, do not modify include path -#include "Weapon/CEnergyProjectile.hpp" namespace urde { @@ -150,6 +153,8 @@ CScriptGunTurret::CScriptGunTurret(TUniqueId uid, std::string_view name, ETurret x37c_projectileInfo.Token().Lock(); } +CScriptGunTurret::~CScriptGunTurret() = default; + void CScriptGunTurret::Accept(IVisitor& visitor) { visitor.Visit(this); } void CScriptGunTurret::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) { diff --git a/Runtime/World/CScriptGunTurret.hpp b/Runtime/World/CScriptGunTurret.hpp index 0753601f5..5c4a0044a 100644 --- a/Runtime/World/CScriptGunTurret.hpp +++ b/Runtime/World/CScriptGunTurret.hpp @@ -1,15 +1,24 @@ #pragma once -#include +#include +#include +#include -#include "CPhysicsActor.hpp" -#include "CDamageInfo.hpp" -#include "CDamageVulnerability.hpp" -#include "Weapon/CProjectileInfo.hpp" -#include "Weapon/CBurstFire.hpp" +#include "Runtime/Weapon/CBurstFire.hpp" +#include "Runtime/Weapon/CProjectileInfo.hpp" +#include "Runtime/World/CDamageInfo.hpp" +#include "Runtime/World/CDamageVulnerability.hpp" +#include "Runtime/World/CPhysicsActor.hpp" + +#include +#include namespace urde { class CCollisionActorManager; +class CElementGen; + +enum class EStateMsg; + class CScriptGunTurretData { float x0_intoDeactivateDelay; float x4_intoActivateDelay; @@ -220,6 +229,7 @@ public: const zeus::CTransform& xf, CModelData&& mData, const zeus::CAABox& aabb, const CHealthInfo& hInfo, const CDamageVulnerability& dVuln, const CActorParameters& aParms, const CScriptGunTurretData& turretData); + ~CScriptGunTurret() override; void Accept(IVisitor&) override; void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;