From 0eefeac3c6473e2c2ce7a69df255d30e6f384f77 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Tue, 13 Sep 2022 22:25:08 -0400 Subject: [PATCH] Match & link CScriptDebugCameraWaypoint --- include/Collision/CMaterialList.hpp | 12 ++++++++---- include/MetroidPrime/CActor.hpp | 9 ++++++--- include/MetroidPrime/CActorParameters.hpp | 2 ++ include/MetroidPrime/CModelData.hpp | 1 + .../CScriptDebugCameraWaypoint.hpp | 19 +++++++++++++++++++ obj_files.mk | 2 +- src/MetroidPrime/CActor.cpp | 2 +- .../CScriptDebugCameraWaypoint.cpp | 12 ++++++++++++ 8 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 include/MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint.hpp create mode 100644 src/MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint.cpp diff --git a/include/Collision/CMaterialList.hpp b/include/Collision/CMaterialList.hpp index e0db5203..2f92d652 100644 --- a/include/Collision/CMaterialList.hpp +++ b/include/Collision/CMaterialList.hpp @@ -72,12 +72,16 @@ static EMaterialTypes SolidMaterial = kMT_Solid; class CMaterialList { public: CMaterialList() : value(0) {} - CMaterialList(EMaterialTypes material) : value(u64(1) << material) {} + CMaterialList(const EMaterialTypes& material) : value(0) { value |= u64(1) << material; } + // TODO + CMaterialList(const EMaterialTypes& m1, const EMaterialTypes& m2); + CMaterialList(const EMaterialTypes& m1, const EMaterialTypes& m2, const EMaterialTypes& m3); + CMaterialList(const EMaterialTypes& m1, const EMaterialTypes& m2, const EMaterialTypes& m3, const EMaterialTypes& m4); + CMaterialList(const EMaterialTypes& m1, const EMaterialTypes& m2, const EMaterialTypes& m3, const EMaterialTypes& m4, + const EMaterialTypes& m5); CMaterialList(u64 value) : value(value) {} - void Add(EMaterialTypes material) { - value |= u64(1) << material; - } + void Add(EMaterialTypes material) { value |= u64(1) << material; } const CMaterialList& Union(const CMaterialList& other) { value |= other.value; return *this; diff --git a/include/MetroidPrime/CActor.hpp b/include/MetroidPrime/CActor.hpp index 59aa0dbd..959b7602 100644 --- a/include/MetroidPrime/CActor.hpp +++ b/include/MetroidPrime/CActor.hpp @@ -211,6 +211,9 @@ public: const CMaterialList& list, const CActorParameters& params, TUniqueId nextDrawNode); ~CActor(); + void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override; + void SetActive(bool active) override; + virtual void PreRender(CStateManager&, const CFrustumPlanes&); virtual void AddToRenderer(const CFrustumPlanes&, const CStateManager&) const; virtual void Render(const CStateManager&) const; @@ -226,10 +229,10 @@ public: virtual CVector3f GetHomingPosition(const CStateManager&, float) const; virtual CVector3f GetScanObjectIndicatorPosition(const CStateManager&) const; virtual EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&, const CWeaponMode&, - EProjectileAttrib) const; + int /*EProjectileAttrib?*/) const; virtual void FluidFXThink(EFluidState, CScriptWater&, CStateManager&); - virtual void OnScanStateChanged(EScanState, CStateManager&); - virtual CAABox GetSortingBounds(const CStateManager&) const; + virtual void OnScanStateChange(EScanState, CStateManager&); + virtual CAABox GetSortingBounds(const CTransform4f&) const; virtual void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt); SAdvancementDeltas UpdateAnimation(float dt, CStateManager& mgr, bool advTree); diff --git a/include/MetroidPrime/CActorParameters.hpp b/include/MetroidPrime/CActorParameters.hpp index 94fb8628..bc667f43 100644 --- a/include/MetroidPrime/CActorParameters.hpp +++ b/include/MetroidPrime/CActorParameters.hpp @@ -113,6 +113,8 @@ public: bool ForceRenderUnsorted() const { return x58_26_renderUnsorted; } bool NoSortThermal() const { return x58_27_noSortThermal; } + static CActorParameters None(); + private: CLightParameters x0_lightParams; CScannableParameters x40_scanParams; diff --git a/include/MetroidPrime/CModelData.hpp b/include/MetroidPrime/CModelData.hpp index 5bdb53ca..281cb215 100644 --- a/include/MetroidPrime/CModelData.hpp +++ b/include/MetroidPrime/CModelData.hpp @@ -70,6 +70,7 @@ public: bool GetSortThermal() const { return x14_25_sortThermal; } void SetSortThermal(bool b) { x14_25_sortThermal = b; } + static CModelData CModelDataNull(); static EWhichModel GetRenderingModel(const CStateManager& mgr); private: diff --git a/include/MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint.hpp b/include/MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint.hpp new file mode 100644 index 00000000..0efa88cb --- /dev/null +++ b/include/MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint.hpp @@ -0,0 +1,19 @@ +#ifndef _CSCRIPTDEBUGCAMERAWAYPOINT_HPP +#define _CSCRIPTDEBUGCAMERAWAYPOINT_HPP + +#include "types.h" + +#include "MetroidPrime/CActor.hpp" + +class CScriptDebugCameraWaypoint : public CActor { +public: + CScriptDebugCameraWaypoint(TUniqueId uid, const rstl::string& name, const CEntityInfo& info, const CTransform4f& xf, uint value); + ~CScriptDebugCameraWaypoint() override; + + void Accept(IVisitor& visitor) override; + +private: + uint xe8_value; +}; + +#endif \ No newline at end of file diff --git a/obj_files.mk b/obj_files.mk index a6b7c148..5446646f 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -172,7 +172,7 @@ METROIDPRIME :=\ $(BUILD_DIR)/asm/MetroidPrime/Enemies/CPuddleSpore.o\ $(BUILD_DIR)/asm/MetroidPrime/BodyState/CBSTaunt.o\ $(BUILD_DIR)/asm/MetroidPrime/CSortedLists.o\ - $(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint.o\ + $(BUILD_DIR)/src/MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint.o\ $(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CScriptSpiderBallAttractionSurface.o\ $(BUILD_DIR)/asm/MetroidPrime/BodyState/CBSScripted.o\ $(BUILD_DIR)/asm/MetroidPrime/Enemies/CPuddleToadGamma.o\ diff --git a/src/MetroidPrime/CActor.cpp b/src/MetroidPrime/CActor.cpp index 986566dc..54ec188c 100644 --- a/src/MetroidPrime/CActor.cpp +++ b/src/MetroidPrime/CActor.cpp @@ -40,7 +40,7 @@ CActor::CActor(TUniqueId uid, bool active, const rstl::string& name, const CEnti , x34_transform(xf) , x64_modelData(mData.IsNull() ? nullptr : new CModelData(mData)) , x68_material(MakeActorMaterialList(list, params)) -, x70_materialFilter(CMaterialFilter::MakeIncludeExclude(CMaterialList().Union(SolidMaterial), CMaterialList(0))) +, x70_materialFilter(CMaterialFilter::MakeIncludeExclude(CMaterialList(SolidMaterial), CMaterialList())) , x88_sfxId(InvalidSfxId) , x8c_loopingSfxHandle(0) , x90_actorLights(mData.IsNull() ? nullptr : params.GetLighting().MakeActorLights().release()) diff --git a/src/MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint.cpp b/src/MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint.cpp new file mode 100644 index 00000000..3ebe7ebe --- /dev/null +++ b/src/MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint.cpp @@ -0,0 +1,12 @@ +#include "MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint.hpp" +#include "MetroidPrime/CActorParameters.hpp" + +CScriptDebugCameraWaypoint::CScriptDebugCameraWaypoint(TUniqueId uid, const rstl::string& name, const CEntityInfo& info, + const CTransform4f& xf, uint value) +: CActor(uid, true, name, info, xf, CModelData::CModelDataNull(), CMaterialList(kMT_NoStepLogic), CActorParameters::None(), + kInvalidUniqueId) +, xe8_value(value) {} + +void CScriptDebugCameraWaypoint::Accept(IVisitor& visitor) { visitor.Visit(*this); } + +CScriptDebugCameraWaypoint::~CScriptDebugCameraWaypoint() {} \ No newline at end of file