From d1b55e23dbb1869f26002c1db4c1ea5bc7891f7e Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Wed, 18 Jan 2017 14:30:02 -0800 Subject: [PATCH] TCastToPtr adjustments --- DataSpec/DNAMP2/ScriptObjects/CMakeLists.txt | 0 Runtime/CStateManager.hpp | 12 +-- Runtime/Collision/CCollisionActor.cpp | 0 Runtime/Collision/CCollisionActor.hpp | 0 Runtime/Collision/CMakeLists.txt | 3 +- Runtime/GameObjectLists.cpp | 3 +- Runtime/MP1/CBeetle.cpp | 5 + Runtime/MP1/CBeetle.hpp | 2 + Runtime/MP1/CMakeLists.txt | 1 + Runtime/MP1/CMetroidPrimeRelay.cpp | 0 Runtime/MP1/CMetroidPrimeRelay.hpp | 0 Runtime/MP1/CNewIntroBoss.cpp | 5 + Runtime/MP1/CNewIntroBoss.hpp | 2 + Runtime/MP1/CSpacePirate.cpp | 5 + Runtime/MP1/CSpacePirate.hpp | 2 + Runtime/MP1/CWarWasp.cpp | 7 +- Runtime/MP1/CWarWasp.hpp | 2 + Runtime/MkCastTo.py | 100 ++++++++++-------- Runtime/Weapon/CBomb.cpp | 0 Runtime/Weapon/CBomb.hpp | 0 Runtime/Weapon/CEnergyProjectile.cpp | 0 Runtime/Weapon/CEnergyProjectile.hpp | 0 Runtime/Weapon/CExplosion.cpp | 0 Runtime/Weapon/CExplosion.hpp | 0 Runtime/Weapon/CMakeLists.txt | 6 +- Runtime/Weapon/CPowerBomb.cpp | 0 Runtime/Weapon/CPowerBomb.hpp | 0 Runtime/World/CAi.hpp | 2 +- Runtime/World/CDestroyableRock.cpp | 0 Runtime/World/CDestroyableRock.hpp | 0 Runtime/World/CFishCloud.cpp | 0 Runtime/World/CFishCloud.hpp | 0 Runtime/World/CHUDBillboardEffect.cpp | 0 Runtime/World/CHUDBillboardEffect.hpp | 0 Runtime/World/CMakeLists.txt | 14 ++- Runtime/World/CPatterned.cpp | 5 - Runtime/World/CPatterned.hpp | 1 - Runtime/World/CScriptDebugCameraWaypoint.cpp | 0 Runtime/World/CScriptDebugCameraWaypoint.hpp | 0 Runtime/World/CScriptGunTurret.cpp | 0 Runtime/World/CScriptGunTurret.hpp | 0 Runtime/World/CScriptPlayerHint.cpp | 0 Runtime/World/CScriptPlayerHint.hpp | 0 Runtime/World/CScriptRelay.cpp | 27 ++--- Runtime/World/CScriptRelay.hpp | 4 +- Runtime/World/CScriptRoomAcoustics.cpp | 0 Runtime/World/CScriptRoomAcoustics.hpp | 0 .../CScriptSpiderBallAttractionSurface.cpp | 0 .../CScriptSpiderBallAttractionSurface.hpp | 0 Runtime/World/CScriptSpiderBallWaypoint.cpp | 0 Runtime/World/CScriptSpiderBallWaypoint.hpp | 0 Runtime/World/CScriptSpindleCamera.cpp | 0 Runtime/World/CScriptSpindleCamera.hpp | 0 Runtime/World/CScriptTargetingPoint.cpp | 34 ++++++ Runtime/World/CScriptTargetingPoint.hpp | 34 ++++++ Runtime/World/CScriptTrigger.cpp | 8 +- Runtime/World/CScriptVisorFlare.cpp | 0 Runtime/World/CScriptVisorFlare.hpp | 0 Runtime/World/CSnakeWeedSwarm.cpp | 0 Runtime/World/CSnakeWeedSwarm.hpp | 0 Runtime/World/CTeamAiMgr.cpp | 0 Runtime/World/CTeamAiMgr.hpp | 0 Runtime/World/CWallCrawlerSwarm.cpp | 0 Runtime/World/CWallCrawlerSwarm.hpp | 0 Runtime/World/FishCloud.cpp | 0 Runtime/World/FishCloud.hpp | 0 66 files changed, 197 insertions(+), 87 deletions(-) create mode 100644 DataSpec/DNAMP2/ScriptObjects/CMakeLists.txt create mode 100644 Runtime/Collision/CCollisionActor.cpp create mode 100644 Runtime/Collision/CCollisionActor.hpp create mode 100644 Runtime/MP1/CMetroidPrimeRelay.cpp create mode 100644 Runtime/MP1/CMetroidPrimeRelay.hpp create mode 100644 Runtime/Weapon/CBomb.cpp create mode 100644 Runtime/Weapon/CBomb.hpp create mode 100644 Runtime/Weapon/CEnergyProjectile.cpp create mode 100644 Runtime/Weapon/CEnergyProjectile.hpp create mode 100644 Runtime/Weapon/CExplosion.cpp create mode 100644 Runtime/Weapon/CExplosion.hpp create mode 100644 Runtime/Weapon/CPowerBomb.cpp create mode 100644 Runtime/Weapon/CPowerBomb.hpp create mode 100644 Runtime/World/CDestroyableRock.cpp create mode 100644 Runtime/World/CDestroyableRock.hpp create mode 100644 Runtime/World/CFishCloud.cpp create mode 100644 Runtime/World/CFishCloud.hpp create mode 100644 Runtime/World/CHUDBillboardEffect.cpp create mode 100644 Runtime/World/CHUDBillboardEffect.hpp create mode 100644 Runtime/World/CScriptDebugCameraWaypoint.cpp create mode 100644 Runtime/World/CScriptDebugCameraWaypoint.hpp create mode 100644 Runtime/World/CScriptGunTurret.cpp create mode 100644 Runtime/World/CScriptGunTurret.hpp create mode 100644 Runtime/World/CScriptPlayerHint.cpp create mode 100644 Runtime/World/CScriptPlayerHint.hpp create mode 100644 Runtime/World/CScriptRoomAcoustics.cpp create mode 100644 Runtime/World/CScriptRoomAcoustics.hpp create mode 100644 Runtime/World/CScriptSpiderBallAttractionSurface.cpp create mode 100644 Runtime/World/CScriptSpiderBallAttractionSurface.hpp create mode 100644 Runtime/World/CScriptSpiderBallWaypoint.cpp create mode 100644 Runtime/World/CScriptSpiderBallWaypoint.hpp create mode 100644 Runtime/World/CScriptSpindleCamera.cpp create mode 100644 Runtime/World/CScriptSpindleCamera.hpp create mode 100644 Runtime/World/CScriptTargetingPoint.cpp create mode 100644 Runtime/World/CScriptTargetingPoint.hpp create mode 100644 Runtime/World/CScriptVisorFlare.cpp create mode 100644 Runtime/World/CScriptVisorFlare.hpp create mode 100644 Runtime/World/CSnakeWeedSwarm.cpp create mode 100644 Runtime/World/CSnakeWeedSwarm.hpp create mode 100644 Runtime/World/CTeamAiMgr.cpp create mode 100644 Runtime/World/CTeamAiMgr.hpp create mode 100644 Runtime/World/CWallCrawlerSwarm.cpp create mode 100644 Runtime/World/CWallCrawlerSwarm.hpp create mode 100644 Runtime/World/FishCloud.cpp create mode 100644 Runtime/World/FishCloud.hpp diff --git a/DataSpec/DNAMP2/ScriptObjects/CMakeLists.txt b/DataSpec/DNAMP2/ScriptObjects/CMakeLists.txt new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/CStateManager.hpp b/Runtime/CStateManager.hpp index 4ff84bb70..1f9f50e21 100644 --- a/Runtime/CStateManager.hpp +++ b/Runtime/CStateManager.hpp @@ -164,11 +164,8 @@ class CStateManager void UpdateThermalVisor(); TUniqueId xf74_lastTrigger = kInvalidUniqueId; + TUniqueId xf76_lastRelay = kInvalidUniqueId; public: - /* TODO: Figure out what these are - * Public for CScriptRelay - */ - TUniqueId xf76_ = kInvalidUniqueId; /* TODO: Public for CFirstPersonCamera */ u32 x904_; @@ -310,8 +307,11 @@ public: CAiWaypointList& GetAiWaypointObjectList() const { return *x83c_aiWaypointObjs; } CPlatformAndDoorList& GetPlatformAndDoorObjectList() const { return *x844_platformAndDoorObjs; } std::pair CalculateScanCompletionRate() const; - void SetLastTrigger(TUniqueId uid) { xf74_lastTrigger = uid; } - TUniqueId GetLastTrigger() const { return xf74_lastTrigger; } + void SetLastTriggerId(TUniqueId uid) { xf74_lastTrigger = uid; } + TUniqueId GetLastTriggerId() const { return xf74_lastTrigger; } + void SetLastRelayId(TUniqueId uid) { xf76_lastRelay = uid; } + TUniqueId* GetLastRelayIdPtr() { return &xf76_lastRelay; } + TUniqueId GetLastRelayId() const { return xf76_lastRelay; } }; } diff --git a/Runtime/Collision/CCollisionActor.cpp b/Runtime/Collision/CCollisionActor.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/Collision/CCollisionActor.hpp b/Runtime/Collision/CCollisionActor.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/Collision/CMakeLists.txt b/Runtime/Collision/CMakeLists.txt index a15fdf43d..c5dcbe64d 100644 --- a/Runtime/Collision/CMakeLists.txt +++ b/Runtime/Collision/CMakeLists.txt @@ -18,6 +18,7 @@ set(COLLISION_SOURCES CMaterialList.hpp CMaterialFilter.hpp CMaterialFilter.cpp CInternalRayCastStructure.hpp CInternalRayCastStructure.cpp - CRayCastResult.hpp CRayCastResult.cpp) + CRayCastResult.hpp CRayCastResult.cpp + CCollisionActor.hpp CCollisionActor.cpp) runtime_add_list(Collision COLLISION_SOURCES) diff --git a/Runtime/GameObjectLists.cpp b/Runtime/GameObjectLists.cpp index 514548a73..8242467b3 100644 --- a/Runtime/GameObjectLists.cpp +++ b/Runtime/GameObjectLists.cpp @@ -40,7 +40,8 @@ CListeningAiList::CListeningAiList() bool CListeningAiList::IsQualified(const CEntity& ent) { - return TCastToConstPtr(ent); + TCastToConstPtr ai(ent); + return ai && ai->IsListening(); } CAiWaypointList::CAiWaypointList() diff --git a/Runtime/MP1/CBeetle.cpp b/Runtime/MP1/CBeetle.cpp index d02543a9a..ee09ffa4f 100644 --- a/Runtime/MP1/CBeetle.cpp +++ b/Runtime/MP1/CBeetle.cpp @@ -18,5 +18,10 @@ CBeetle::CBeetle(TUniqueId uid, const std::string& name, const CEntityInfo& info } +void CBeetle::Accept(IVisitor &visitor) +{ + visitor.Visit(this); +} + } } diff --git a/Runtime/MP1/CBeetle.hpp b/Runtime/MP1/CBeetle.hpp index 3c61b434b..dc3bdcd6b 100644 --- a/Runtime/MP1/CBeetle.hpp +++ b/Runtime/MP1/CBeetle.hpp @@ -23,6 +23,8 @@ public: const CPatternedInfo&, CPatterned::EFlavorType,EEntranceType, const CDamageInfo &, const CDamageVulnerability&, const zeus::CVector3f&, float, float, float, const CDamageVulnerability&, const CActorParameters&, const rstl::optional_object); + + void Accept(IVisitor &visitor); }; } } diff --git a/Runtime/MP1/CMakeLists.txt b/Runtime/MP1/CMakeLists.txt index 31d508105..3f4738655 100644 --- a/Runtime/MP1/CMakeLists.txt +++ b/Runtime/MP1/CMakeLists.txt @@ -18,6 +18,7 @@ set(MP1_SOURCES CWarWasp.hpp CWarWasp.cpp CSpacePirate.hpp CSpacePirate.cpp CBabygoth.hpp CBabygoth.cpp + CMetroidPrimeRelay.hpp CMetroidPrimeRelay.cpp CSaveUI.hpp CSaveUI.cpp CMemoryCardDriver.hpp CMemoryCardDriver.cpp CQuitScreen.hpp CQuitScreen.cpp diff --git a/Runtime/MP1/CMetroidPrimeRelay.cpp b/Runtime/MP1/CMetroidPrimeRelay.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/MP1/CMetroidPrimeRelay.hpp b/Runtime/MP1/CMetroidPrimeRelay.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/MP1/CNewIntroBoss.cpp b/Runtime/MP1/CNewIntroBoss.cpp index ba4fa9741..15eb824dd 100644 --- a/Runtime/MP1/CNewIntroBoss.cpp +++ b/Runtime/MP1/CNewIntroBoss.cpp @@ -16,5 +16,10 @@ CNewIntroBoss::CNewIntroBoss(TUniqueId uid, const std::string& name, const CEnti { } +void CNewIntroBoss::Accept(IVisitor &visitor) +{ + visitor.Visit(this); +} + } } diff --git a/Runtime/MP1/CNewIntroBoss.hpp b/Runtime/MP1/CNewIntroBoss.hpp index 29d1f59ed..7cf3aa5f9 100644 --- a/Runtime/MP1/CNewIntroBoss.hpp +++ b/Runtime/MP1/CNewIntroBoss.hpp @@ -17,6 +17,8 @@ public: const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms, float, u32, const CDamageInfo& dInfo, u32, u32, u32, u32); + + void Accept(IVisitor &visitor); }; } diff --git a/Runtime/MP1/CSpacePirate.cpp b/Runtime/MP1/CSpacePirate.cpp index 1b593d9ad..45a34245e 100644 --- a/Runtime/MP1/CSpacePirate.cpp +++ b/Runtime/MP1/CSpacePirate.cpp @@ -14,5 +14,10 @@ CSpacePirate::CSpacePirate(TUniqueId uid, const std::string& name, const CEntity { } +void CSpacePirate::Accept(IVisitor &visitor) +{ + visitor.Visit(this); +} + } } diff --git a/Runtime/MP1/CSpacePirate.hpp b/Runtime/MP1/CSpacePirate.hpp index edba8f8eb..a6c717c6f 100644 --- a/Runtime/MP1/CSpacePirate.hpp +++ b/Runtime/MP1/CSpacePirate.hpp @@ -12,6 +12,8 @@ class CSpacePirate : public CPatterned public: CSpacePirate(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&, const CActorParameters&, const CPatternedInfo&, CInputStream&, u32); + + void Accept(IVisitor &visitor); }; } } diff --git a/Runtime/MP1/CWarWasp.cpp b/Runtime/MP1/CWarWasp.cpp index 2d9487969..16e103cdd 100644 --- a/Runtime/MP1/CWarWasp.cpp +++ b/Runtime/MP1/CWarWasp.cpp @@ -10,12 +10,11 @@ CWarWasp::CWarWasp(TUniqueId uid, const std::string& name, const CEntityInfo& in CModelData&& mData, const CPatternedInfo& pInfo, CPatterned::EFlavorType flavor, CPatterned::EColliderType collider, const CDamageInfo& dInfo1, const CActorParameters& actorParms, ResId weapon, const CDamageInfo& dInfo2, ResId particle, u32 w3) - : CPatterned(EUnknown::ThirtyNine, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer, - collider, EBodyType::Three, actorParms, false) +: CPatterned(EUnknown::ThirtyNine, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer, collider, + EBodyType::Three, actorParms, false) { - } +void CWarWasp::Accept(IVisitor& visitor) { visitor.Visit(this); } } - } diff --git a/Runtime/MP1/CWarWasp.hpp b/Runtime/MP1/CWarWasp.hpp index 6d90e04dd..8ed2a46be 100644 --- a/Runtime/MP1/CWarWasp.hpp +++ b/Runtime/MP1/CWarWasp.hpp @@ -15,6 +15,8 @@ public: const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo, CPatterned::EFlavorType flavor, CPatterned::EColliderType, const CDamageInfo& dInfo1, const CActorParameters&, ResId weapon, const CDamageInfo& dInfo2, ResId particle, u32 w3); + + void Accept(IVisitor &visitor); }; } } diff --git a/Runtime/MkCastTo.py b/Runtime/MkCastTo.py index 5115ac292..07475944d 100644 --- a/Runtime/MkCastTo.py +++ b/Runtime/MkCastTo.py @@ -8,60 +8,66 @@ class EndNamespace: pass CENTITY_TYPES = ( + # Class, Visit, Header ('CActor', 'World/CActor.hpp'), - ('CPhysicsActor', 'World/CPhysicsActor.hpp'), - ('CGameCamera', 'Camera/CGameCamera.hpp'), - ('CPatterned', 'World/CPatterned.hpp'), - ('CGameLight', 'World/CGameLight.hpp'), - ('CAi', 'World/CAi.hpp'), + ('CBallCamera', 'Camera/CBallCamera.hpp'), + ('CBomb', 'Weapon/CBomb.hpp'), ('CCinematicCamera', 'Camera/CCinematicCamera.hpp'), - ('CScriptHUDMemo', 'World/CScriptHUDMemo.hpp'), + ('CCollisionActor', 'Collision/CCollisionActor.hpp'), + ('CDestroyableRock', 'World/CDestroyableRock.hpp'), + ('CEnergyProjectile', 'Weapon/CEnergyProjectile.hpp'), + ('CEntity', 'World/CEntity.hpp'), + ('CExplosion', 'Weapon/CExplosion.hpp'), + ('CFirstPersonCamera', 'Camera/CFirstPersonCamera.hpp'), + ('CFishCloud', 'World/CFishCloud.hpp'), + ('CGameCamera', 'Camera/CGameCamera.hpp'), + ('CGameLight', 'World/CGameLight.hpp'), + ('CGameProjectile', 'Weapon/CGameProjectile.hpp'), + ('CHUDBillboardEffect', 'World/CHUDBillboardEffect.hpp'), + Namespace('MP1'), + ('CMetroidPrimeRelay', 'MP1/CMetroidPrimeRelay.hpp', 'MP1'), + EndNamespace(), + ('CPathCamera', 'Camera/CPathCamera.hpp'), + ('CAi', 'World/CAi.hpp'), + ('CPhysicsActor', 'World/CPhysicsActor.hpp'), + ('CPlayer', 'World/CPhysicsActor.hpp'), + ('CRepulsor', 'World/CRepulsor.hpp'), + ('CScriptActor', 'World/CScriptActor.hpp'), + ('CScriptActorKeyframe', 'World/CScriptActorKeyframe.hpp'), + ('CScriptAiJumpPoint', 'World/CScriptAiJumpPoint.hpp'), ('CScriptCameraHint', 'World/CScriptCameraHint.hpp'), - ('CScriptPickup', 'World/CScriptPickup.hpp'), - ('CScriptRandomRelay', 'World/CScriptRandomRelay.hpp'), - ('CScriptMemoryRelay', 'World/CScriptMemoryRelay.hpp'), - ('CScriptRelay', 'World/CScriptRelay.hpp'), + ('CScriptCameraPitchVolume', 'World/CScriptCameraPitchVolume.hpp'), ('CScriptCameraWaypoint', 'World/CScriptCameraWaypoint.hpp'), ('CScriptCoverPoint', 'World/CScriptCoverPoint.hpp'), - ('CScriptSpawnPoint', 'World/CScriptSpawnPoint.hpp'), - ('CRepulsor', 'World/CRepulsor.hpp'), - ('CScriptCameraHintTrigger', 'World/CScriptCameraHintTrigger.hpp'), - ('CScriptSwitch', 'World/CScriptSwitch.hpp'), - ('CScriptAiJumpPoint', 'World/CScriptAiJumpPoint.hpp'), - ('CScriptColorModulate', 'World/CScriptColorModulate.hpp'), - ('CScriptCameraPitchVolume', 'World/CScriptCameraPitchVolume.hpp'), - ('CPlayer', 'World/CPlayer.hpp'), - ('CScriptActor', 'World/CScriptActor.hpp'), - ('CScriptWaypoint', 'World/CScriptWaypoint.hpp'), - ('CScriptDoor', 'World/CScriptDoor.hpp'), - ('CScriptActorKeyframe', 'World/CScriptActorKeyframe.hpp'), - ('CScriptTrigger', 'World/CScriptTrigger.hpp'), - ('CScriptSound', 'World/CScriptSound.hpp'), - ('CWeapon', 'Weapon/CWeapon.hpp'), - ('CGameProjectile', 'Weapon/CGameProjectile.hpp'), - ('CBeamProjectile', 'Weapon/CBeamProjectile.hpp'), - ('CPlasmaProjectile', 'Weapon/CPlasmaProjectile.hpp'), - ('CScriptCounter', 'World/CScriptCounter.hpp'), - ('CScriptBeam', 'World/CScriptBeam.hpp'), - ('CScriptStreamedMusic', 'World/CScriptStreamedMusic.hpp'), - ('CScriptTimer', 'World/CScriptTimer.hpp'), - ('CScriptEffect', 'World/CScriptEffect.hpp'), - ('CScriptPlatform', 'World/CScriptPlatform.hpp'), - ('CScriptGrapplePoint', 'World/CScriptGrapplePoint.hpp'), - ('CScriptGenerator', 'World/CScriptGenerator.hpp'), - ('CScriptShadowProjector', 'World/CScriptShadowProjector.hpp'), - ('CScriptDock', 'World/CScriptDock.hpp'), - ('CScriptAreaAttributes', 'World/CScriptAreaAttributes.hpp'), - ('CScriptPickupGenerator', 'World/CScriptPickupGenerator.hpp'), - ('CScriptPointOfInterest', 'World/CScriptPointOfInterest.hpp'), - ('CScriptCameraFilterKeyframe', 'World/CScriptCameraFilterKeyframe.hpp'), - ('CScriptCameraBlurKeyframe', 'World/CScriptCameraBlurKeyframe.hpp'), - ('CScriptActorRotate', 'World/CScriptActorRotate.hpp'), + ('CScriptDebugCameraWaypoint', 'World/CScriptDebugCameraWaypoint.hpp'), ('CScriptDistanceFog', 'World/CScriptDistanceFog.hpp'), - ('CScriptDamageableTrigger', 'World/CScriptDamageableTrigger.hpp'), - ('CScriptDockAreaChange', 'World/CScriptDockAreaChange.hpp'), + ('CScriptDock', 'World/CScriptDock.hpp'), + ('CScriptDoor', 'World/CScriptDoor.hpp'), + ('CScriptEffect', 'World/CScriptEffect.hpp'), + ('CScriptGrapplePoint', 'World/CScriptGrapplePoint.hpp'), + ('CScriptGunTurret', 'World/CScriptGunTurret.hpp'), + ('CScriptMazeNode', 'World/CScriptMazeNode.hpp'), + ('CScriptPickup', 'World/CScriptPickup.hpp'), + ('CScriptPlatform', 'World/CScriptPlatform.hpp'), + ('CScriptPlayerHint', 'World/CScriptPlayerHint.hpp'), + ('CScriptPointOfInterest', 'World/CScriptPointOfInterest.hpp'), + ('CScriptRoomAcoustics', 'World/CScriptRoomAcoustics.hpp'), + ('CScriptSound', 'World/CScriptSound.hpp'), + ('CScriptSpawnPoint', 'World/CScriptSpawnPoint.hpp'), ('CScriptSpecialFunction', 'World/CScriptSpecialFunction.hpp'), - ('CScriptDebris', 'World/CScriptDebris.hpp'), + ('CScriptSpiderBallAttractionSurface', 'World/CScriptSpiderBallAttractionSurface.hpp'), + ('CScriptSpiderBallWaypoint', 'World/CScriptSpiderBallWaypoint.hpp'), + ('CScriptTargetingPoint', 'World/CScriptTargetingPoint.hpp'), + ('CTeamAiMgr', 'World/CTeamAiMgr.hpp'), + ('CScriptTimer', 'World/CScriptTimer.hpp'), + ('CScriptTrigger', 'World/CScriptTrigger.hpp'), + ('CScriptVisorFlare', 'World/CScriptVisorFlare.hpp'), + ('CScriptWater', 'World/CScriptWater.hpp'), + ('CScriptWaypoint', 'World/CScriptWaypoint.hpp'), + ('CSnakeWeedSwarm', 'World/CSnakeWeedSwarm.hpp'), + ('CScriptSpindleCamera', 'World/CScriptSpindleCamera.hpp'), + ('CWallCrawlerSwarm', 'World/CWallCrawlerSwarm.hpp'), + ('CWeapon', 'Weapon/CWeapon.hpp'), ) def getqualified(tp): diff --git a/Runtime/Weapon/CBomb.cpp b/Runtime/Weapon/CBomb.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/Weapon/CBomb.hpp b/Runtime/Weapon/CBomb.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/Weapon/CEnergyProjectile.cpp b/Runtime/Weapon/CEnergyProjectile.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/Weapon/CEnergyProjectile.hpp b/Runtime/Weapon/CEnergyProjectile.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/Weapon/CExplosion.cpp b/Runtime/Weapon/CExplosion.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/Weapon/CExplosion.hpp b/Runtime/Weapon/CExplosion.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/Weapon/CMakeLists.txt b/Runtime/Weapon/CMakeLists.txt index df6a4eb0c..7e3fb96b8 100644 --- a/Runtime/Weapon/CMakeLists.txt +++ b/Runtime/Weapon/CMakeLists.txt @@ -21,6 +21,10 @@ set(WEAPON_SOURCES CGameProjectile.hpp CGameProjectile.cpp CBeamProjectile.hpp CBeamProjectile.cpp CBeamInfo.hpp CBeamInfo.cpp - CPlasmaProjectile.hpp CPlasmaProjectile.cpp) + CPlasmaProjectile.hpp CPlasmaProjectile.cpp + CEnergyProjectile.cpp CEnergyProjectile.cpp + CExplosion.hpp CExplosion.cpp + CBomb.hpp CBomb.cpp + CPowerBomb.hpp CPowerBomb.cpp) runtime_add_list(Weapon WEAPON_SOURCES) diff --git a/Runtime/Weapon/CPowerBomb.cpp b/Runtime/Weapon/CPowerBomb.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/Weapon/CPowerBomb.hpp b/Runtime/Weapon/CPowerBomb.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CAi.hpp b/Runtime/World/CAi.hpp index d7ea20e26..193efdedb 100644 --- a/Runtime/World/CAi.hpp +++ b/Runtime/World/CAi.hpp @@ -46,7 +46,7 @@ public: virtual CDamageVulnerability GetDamageVulnerability() { return x260_damageVulnerability; } virtual void TakeDamage(const zeus::CVector3f&, float) {} virtual bool CanBeShot(const CStateManager&, int) { return true; } - virtual bool IsListening() { return false; } + virtual bool IsListening() const { return false; } virtual int Listen(const zeus::CVector3f&, EListenNoiseType) { return 0; } virtual void Patrol(CStateManager&, EStateMsg, float) {} diff --git a/Runtime/World/CDestroyableRock.cpp b/Runtime/World/CDestroyableRock.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CDestroyableRock.hpp b/Runtime/World/CDestroyableRock.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CFishCloud.cpp b/Runtime/World/CFishCloud.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CFishCloud.hpp b/Runtime/World/CFishCloud.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CHUDBillboardEffect.cpp b/Runtime/World/CHUDBillboardEffect.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CHUDBillboardEffect.hpp b/Runtime/World/CHUDBillboardEffect.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CMakeLists.txt b/Runtime/World/CMakeLists.txt index 0d140f4d4..58eea5fc7 100644 --- a/Runtime/World/CMakeLists.txt +++ b/Runtime/World/CMakeLists.txt @@ -45,6 +45,8 @@ set(WORLD_SOURCES CScriptPickupGenerator.hpp CScriptPickupGenerator.cpp CScriptPointOfInterest.hpp CScriptPointOfInterest.cpp CScriptAreaAttributes.hpp CScriptAreaAttributes.cpp + CFishCloud.hpp CFishCloud.cpp + CScriptVisorFlare.hpp CScriptVisorFlare.cpp CScriptCameraWaypoint.hpp CScriptCameraWaypoint.cpp CScriptCoverPoint.hpp CScriptCoverPoint.cpp CScriptSpawnPoint.hpp CScriptSpawnPoint.cpp @@ -58,17 +60,25 @@ set(WORLD_SOURCES CScriptCameraBlurKeyframe.hpp CScriptCameraBlurKeyframe.cpp CScriptDamageableTrigger.hpp CScriptDamageableTrigger.cpp CScriptDebris.hpp CScriptDebris.cpp + CScriptDebugCameraWaypoint.hpp CScriptDebugCameraWaypoint.cpp CScriptDistanceFog.hpp CScriptDistanceFog.cpp CScriptDockAreaChange.hpp CScriptDockAreaChange.cpp CScriptActorRotate.hpp CScriptActorRotate.cpp CScriptSpecialFunction.hpp CScriptSpecialFunction.cpp + CScriptPlayerHint.hpp CScriptPlayerHint.cpp + CScriptTargetingPoint.hpp CScriptTargetingPoint.cpp CScriptPlayerActor.hpp CScriptPlayerActor.cpp CScriptSwitch.hpp CScriptSwitch.cpp CScriptAiJumpPoint.hpp CScriptAiJumpPoint.cpp + CScriptRoomAcoustics.hpp CScriptRoomAcoustics.cpp CScriptColorModulate.hpp CScriptColorModulate.cpp CScriptStreamedMusic.hpp CScriptStreamedMusic.cpp CRepulsor.hpp CRepulsor.cpp + CScriptGunTurret.hpp CScriptGunTurret.cpp CScriptCameraPitchVolume.hpp CScriptCameraPitchVolume.cpp + CTeamAiMgr.hpp CTeamAiMgr.cpp + CSnakeWeedSwarm.hpp CSnakeWeedSwarm.cpp + CScriptSpindleCamera.hpp CScriptSpindleCamera.cpp CScriptCameraHintTrigger.hpp CScriptCameraHintTrigger.cpp CScriptBeam.hpp CScriptBeam.cpp CScriptMazeNode.hpp CScriptMazeNode.cpp @@ -94,6 +104,8 @@ set(WORLD_SOURCES CFluidPlaneCPU.hpp CFluidPlaneCPU.cpp CFluidPlaneDoor.hpp CFluidPlaneDoor.cpp CRippleManager.hpp CRippleManager.cpp - CRipple.hpp CRipple.cpp) + CRipple.hpp CRipple.cpp + CDestroyableRock.hpp CDestroyableRock.cpp + CHUDBillboardEffect.hpp CHUDBillboardEffect.cpp) runtime_add_list(World WORLD_SOURCES) diff --git a/Runtime/World/CPatterned.cpp b/Runtime/World/CPatterned.cpp index e91c922c2..25457b2b9 100644 --- a/Runtime/World/CPatterned.cpp +++ b/Runtime/World/CPatterned.cpp @@ -25,9 +25,4 @@ CPatterned::CPatterned(EUnknown, TUniqueId uid, const std::string& name, CPatter { } -void CPatterned::Accept(IVisitor& visitor) -{ - visitor.Visit(this); -} - } diff --git a/Runtime/World/CPatterned.hpp b/Runtime/World/CPatterned.hpp index 73c70e7ba..ab2e950b3 100644 --- a/Runtime/World/CPatterned.hpp +++ b/Runtime/World/CPatterned.hpp @@ -41,7 +41,6 @@ public: CPatterned::EMovementType movement, EColliderType collider, EBodyType body, const CActorParameters& params, bool b1); - void Accept(IVisitor& visitor); virtual void Death(const zeus::CVector3f&, CStateManager&) {} virtual void KnockBack(const zeus::CVector3f&, CStateManager&) {} }; diff --git a/Runtime/World/CScriptDebugCameraWaypoint.cpp b/Runtime/World/CScriptDebugCameraWaypoint.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptDebugCameraWaypoint.hpp b/Runtime/World/CScriptDebugCameraWaypoint.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptGunTurret.cpp b/Runtime/World/CScriptGunTurret.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptGunTurret.hpp b/Runtime/World/CScriptGunTurret.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptPlayerHint.cpp b/Runtime/World/CScriptPlayerHint.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptPlayerHint.hpp b/Runtime/World/CScriptPlayerHint.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptRelay.cpp b/Runtime/World/CScriptRelay.cpp index d63d459b4..e4fb5082b 100644 --- a/Runtime/World/CScriptRelay.cpp +++ b/Runtime/World/CScriptRelay.cpp @@ -27,14 +27,14 @@ void CScriptRelay::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CS if (x30_24_active) return; - x38_++; - TUniqueId tmp = stateMgr.xf76_; + x38_refCount++; + TUniqueId tmp = stateMgr.GetLastRelayId(); while (tmp != kInvalidUniqueId) { const CEntity* obj = stateMgr.GetObjectById(tmp); if (!obj) { - tmp = x34_; + tmp = x34_nextRelay; continue; } @@ -44,19 +44,19 @@ void CScriptRelay::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CS if (tmp == kInvalidUniqueId) return; - x34_ = stateMgr.xf76_; - stateMgr.xf76_ = GetUniqueId(); + x34_nextRelay = stateMgr.GetLastRelayId(); + stateMgr.SetLastRelayId(GetUniqueId()); } } void CScriptRelay::Think(float, CStateManager& stateMgr) { - if (x38_ == 0) + if (x38_refCount == 0) return; - while (x38_ != 0) + while (x38_refCount != 0) { - x38_--; + x38_refCount--; SendScriptMsgs(EScriptObjectState::Zero, stateMgr, EScriptObjectMessage::None); } UpdateObjectRef(stateMgr); @@ -64,17 +64,18 @@ void CScriptRelay::Think(float, CStateManager& stateMgr) void CScriptRelay::UpdateObjectRef(CStateManager& stateMgr) { - TUniqueId* tmp = &stateMgr.xf76_; + TUniqueId* tmp = stateMgr.GetLastRelayIdPtr(); while (*tmp != kInvalidUniqueId && tmp != nullptr) { if (*tmp == GetUniqueId()) { - *tmp = x34_; + *tmp = x34_nextRelay; return; } - const CScriptRelay* obj = TCastToConstPtr(stateMgr.GetObjectById(*tmp)); - if (obj) - tmp = (TUniqueId*)&obj->x34_; + CScriptRelay* obj = dynamic_cast(stateMgr.ObjectById(*tmp)); + if (obj == nullptr) + return; + tmp = &obj->x34_nextRelay; } } diff --git a/Runtime/World/CScriptRelay.hpp b/Runtime/World/CScriptRelay.hpp index 9a8c11bc9..18b2044db 100644 --- a/Runtime/World/CScriptRelay.hpp +++ b/Runtime/World/CScriptRelay.hpp @@ -7,8 +7,8 @@ namespace urde { class CScriptRelay : public CEntity { - TUniqueId x34_ = kInvalidUniqueId; - u32 x38_ = 0; + TUniqueId x34_nextRelay = kInvalidUniqueId; + u32 x38_refCount = 0; public: CScriptRelay(TUniqueId, const std::string&, const CEntityInfo&, bool); diff --git a/Runtime/World/CScriptRoomAcoustics.cpp b/Runtime/World/CScriptRoomAcoustics.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptRoomAcoustics.hpp b/Runtime/World/CScriptRoomAcoustics.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptSpiderBallAttractionSurface.cpp b/Runtime/World/CScriptSpiderBallAttractionSurface.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptSpiderBallAttractionSurface.hpp b/Runtime/World/CScriptSpiderBallAttractionSurface.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptSpiderBallWaypoint.cpp b/Runtime/World/CScriptSpiderBallWaypoint.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptSpiderBallWaypoint.hpp b/Runtime/World/CScriptSpiderBallWaypoint.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptSpindleCamera.cpp b/Runtime/World/CScriptSpindleCamera.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptSpindleCamera.hpp b/Runtime/World/CScriptSpindleCamera.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptTargetingPoint.cpp b/Runtime/World/CScriptTargetingPoint.cpp new file mode 100644 index 000000000..f0607c5a9 --- /dev/null +++ b/Runtime/World/CScriptTargetingPoint.cpp @@ -0,0 +1,34 @@ +#include "World/CScriptTargetingPoint.hpp" +#include "World/CActorParameters.hpp" +#include "TCastTo.hpp" + +namespace urde +{ + +CScriptTargetingPoint::CScriptTargetingPoint(TUniqueId uid, const std::string& name, const CEntityInfo& info, + const zeus::CTransform& xf, bool active) +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), + CActorParameters::None(), kInvalidUniqueId) +{ +} + +void CScriptTargetingPoint::Accept(IVisitor& visitor) { visitor.Visit(this); } + +void CScriptTargetingPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) +{ + CActor::AcceptScriptMsg(msg, uid, mgr); + + if (msg == EScriptObjectMessage::Deactivate || msg == EScriptObjectMessage::Activate) + CEntity::SendScriptMsgs(EScriptObjectState::Attack, mgr, EScriptObjectMessage::None); +} + +void CScriptTargetingPoint::Think(float dt, CStateManager&) +{ + if (xec_time <= 0.f) + return; + + xec_time -= dt; +} + +bool CScriptTargetingPoint::GetLocked() const { return !x20_conns.empty(); } +} diff --git a/Runtime/World/CScriptTargetingPoint.hpp b/Runtime/World/CScriptTargetingPoint.hpp new file mode 100644 index 000000000..8213f5b01 --- /dev/null +++ b/Runtime/World/CScriptTargetingPoint.hpp @@ -0,0 +1,34 @@ +#ifndef __URDE_CSCRIPTTARGETINGPOINT_HPP__ +#define __URDE_CSCRIPTTARGETINGPOINT_HPP__ + +#include "World/CActor.hpp" + +namespace urde +{ +class CScriptTargetingPoint : public CActor +{ +private: + union + { + struct + { + bool xe8_e4_ : 1; + }; + u8 xe8_dummy = 0; + }; + TUniqueId xea_; + float xec_time = 0.f; + +public: + CScriptTargetingPoint(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, bool); + + void Accept(IVisitor& visitor); + void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager &); + void Think(float, CStateManager &); + void Render(const CStateManager &) const {} + + bool GetLocked() const; +}; +} + +#endif // __URDE_CSCRIPTTARGETINGPOINT_HPP__ diff --git a/Runtime/World/CScriptTrigger.cpp b/Runtime/World/CScriptTrigger.cpp index f1cd8fb8b..b3fd1f696 100644 --- a/Runtime/World/CScriptTrigger.cpp +++ b/Runtime/World/CScriptTrigger.cpp @@ -58,8 +58,8 @@ void CScriptTrigger::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CS x148_29_didPhazonDamage = false; } - if (x8_uid == mgr.GetLastTrigger()) - mgr.SetLastTrigger(kInvalidUniqueId); + if (x8_uid == mgr.GetLastTriggerId()) + mgr.SetLastTriggerId(kInvalidUniqueId); } } @@ -229,8 +229,8 @@ void CScriptTrigger::Touch(CActor& act, CStateManager& mgr) { if (x128_forceMagnitude > 0.f && (x12c_flags & ETriggerFlags::DetectPlayer) != ETriggerFlags::None && - mgr.GetLastTrigger() == kInvalidUniqueId) - mgr.SetLastTrigger(x8_uid); + mgr.GetLastTriggerId() == kInvalidUniqueId) + mgr.SetLastTriggerId(x8_uid); testFlags |= ETriggerFlags::DetectPlayer; if (pl->GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Unmorphed) diff --git a/Runtime/World/CScriptVisorFlare.cpp b/Runtime/World/CScriptVisorFlare.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CScriptVisorFlare.hpp b/Runtime/World/CScriptVisorFlare.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CSnakeWeedSwarm.cpp b/Runtime/World/CSnakeWeedSwarm.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CSnakeWeedSwarm.hpp b/Runtime/World/CSnakeWeedSwarm.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CTeamAiMgr.cpp b/Runtime/World/CTeamAiMgr.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CTeamAiMgr.hpp b/Runtime/World/CTeamAiMgr.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CWallCrawlerSwarm.cpp b/Runtime/World/CWallCrawlerSwarm.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/CWallCrawlerSwarm.hpp b/Runtime/World/CWallCrawlerSwarm.hpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/FishCloud.cpp b/Runtime/World/FishCloud.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Runtime/World/FishCloud.hpp b/Runtime/World/FishCloud.hpp new file mode 100644 index 000000000..e69de29bb