From 134f5a68a23f783fbe2222d3d2cd135f086d1034 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 30 Oct 2018 15:21:29 -0700 Subject: [PATCH] Implement CScriptDebugCameraWaypoint loader --- Runtime/World/CScriptDebugCameraWaypoint.cpp | 6 ++++++ Runtime/World/CScriptDebugCameraWaypoint.hpp | 2 ++ Runtime/World/ScriptLoader.cpp | 8 +++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Runtime/World/CScriptDebugCameraWaypoint.cpp b/Runtime/World/CScriptDebugCameraWaypoint.cpp index 16d75a4ef..adf29cd5e 100644 --- a/Runtime/World/CScriptDebugCameraWaypoint.cpp +++ b/Runtime/World/CScriptDebugCameraWaypoint.cpp @@ -1,5 +1,6 @@ #include "CScriptDebugCameraWaypoint.hpp" #include "CActorParameters.hpp" +#include "TCastTo.hpp" namespace urde { @@ -11,4 +12,9 @@ CScriptDebugCameraWaypoint::CScriptDebugCameraWaypoint(TUniqueId uid, std::strin { } +void CScriptDebugCameraWaypoint::Accept(IVisitor& visitor) +{ + visitor.Visit(this); +} + } diff --git a/Runtime/World/CScriptDebugCameraWaypoint.hpp b/Runtime/World/CScriptDebugCameraWaypoint.hpp index 9168855f1..8fb97e6ba 100644 --- a/Runtime/World/CScriptDebugCameraWaypoint.hpp +++ b/Runtime/World/CScriptDebugCameraWaypoint.hpp @@ -11,6 +11,8 @@ class CScriptDebugCameraWaypoint : public CActor public: CScriptDebugCameraWaypoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, u32 w1); + + void Accept(IVisitor&); }; } diff --git a/Runtime/World/ScriptLoader.cpp b/Runtime/World/ScriptLoader.cpp index 3e458ab27..0212317ae 100644 --- a/Runtime/World/ScriptLoader.cpp +++ b/Runtime/World/ScriptLoader.cpp @@ -84,6 +84,7 @@ #include "CScriptWater.hpp" #include "CScriptWaypoint.hpp" #include "CScriptWorldTeleporter.hpp" +#include "CScriptDebugCameraWaypoint.hpp" #include "CScriptSpiderBallAttractionSurface.hpp" #include "CScriptSpindleCamera.hpp" #include "MP1/World/CAtomicAlpha.hpp" @@ -1699,7 +1700,12 @@ CEntity* ScriptLoader::LoadPuddleSpore(CStateManager& mgr, CInputStream& in, int CEntity* ScriptLoader::LoadDebugCameraWaypoint(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) { - return nullptr; + if (!EnsurePropertyCount(propCount, 4, "DebugCameraWaypoint")) + return nullptr; + + SActorHead actHead = LoadActorHead(in, mgr); + u32 w1 = in.readUint32Big(); + return new CScriptDebugCameraWaypoint(mgr.AllocateUniqueId(), actHead.x0_name, info, actHead.x10_transform, w1); } CEntity* ScriptLoader::LoadSpiderBallAttractionSurface(CStateManager& mgr, CInputStream& in, int propCount,