From d486e1af083be71e0d1fdcc0321b855718f0dbde Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Wed, 27 Apr 2016 18:44:41 -1000 Subject: [PATCH] Add CScriptCameraHint --- Runtime/World/CMakeLists.txt | 1 + Runtime/World/CScriptCameraHint.cpp | 17 ++++++++++++ Runtime/World/CScriptCameraHint.hpp | 20 ++++++++++++++ Runtime/World/ScriptLoader.cpp | 42 +++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 Runtime/World/CScriptCameraHint.cpp create mode 100644 Runtime/World/CScriptCameraHint.hpp diff --git a/Runtime/World/CMakeLists.txt b/Runtime/World/CMakeLists.txt index 4f158141a..4206e58fc 100644 --- a/Runtime/World/CMakeLists.txt +++ b/Runtime/World/CMakeLists.txt @@ -35,6 +35,7 @@ set(WORLD_SOURCES CScriptCameraWaypoint.hpp CScriptCameraWaypoint.cpp CScriptCoverPoint.hpp CScriptCoverPoint.cpp CScriptSpawnPoint.hpp CScriptSpawnPoint.cpp + CScriptCameraHint.hpp CScriptCameraHint.cpp CGrappleParameters.hpp CActorParameters.hpp CLightParameters.hpp diff --git a/Runtime/World/CScriptCameraHint.cpp b/Runtime/World/CScriptCameraHint.cpp new file mode 100644 index 000000000..8f543d925 --- /dev/null +++ b/Runtime/World/CScriptCameraHint.cpp @@ -0,0 +1,17 @@ +#include "CScriptCameraHint.hpp" +#include "Character/CModelData.hpp" +#include "CActorParameters.hpp" + +namespace urde +{ + +CScriptCameraHint::CScriptCameraHint(TUniqueId uid, const std::string& name, const CEntityInfo& info, + const zeus::CTransform& xf, bool active, u32, u32, u32, float, float, float, + const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, + float, float, float, float, float, float, float, float, float, float) +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero), + CActorParameters::None(), kInvalidUniqueId) +{ +} + +} diff --git a/Runtime/World/CScriptCameraHint.hpp b/Runtime/World/CScriptCameraHint.hpp new file mode 100644 index 000000000..7b3608710 --- /dev/null +++ b/Runtime/World/CScriptCameraHint.hpp @@ -0,0 +1,20 @@ +#ifndef __URDE_CSCRIPTCAMERAHINT_HPP__ +#define __URDE_CSCRIPTCAMERAHINT_HPP__ + +#include "CActor.hpp" + +namespace urde +{ + +class CScriptCameraHint : public CActor +{ +public: + CScriptCameraHint(TUniqueId, const std::string& name, const CEntityInfo& info, + const zeus::CTransform& xf, bool, u32, u32, u32, float, float, float, + const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, + float, float, float, float, float, float, float, float, float, float); +}; + +} + +#endif // __URDE_CSCRIPTCAMERAHINT_HPP__ diff --git a/Runtime/World/ScriptLoader.cpp b/Runtime/World/ScriptLoader.cpp index 7f332e9a2..644649679 100644 --- a/Runtime/World/ScriptLoader.cpp +++ b/Runtime/World/ScriptLoader.cpp @@ -29,6 +29,7 @@ #include "CScriptCameraWaypoint.hpp" #include "CScriptCoverPoint.hpp" #include "CScriptSpawnPoint.hpp" +#include "CScriptCameraHint.hpp" #include "Camera/CCinematicCamera.hpp" #include "MP1/CNewIntroBoss.hpp" #include "MP1/CWarWasp.hpp" @@ -858,6 +859,47 @@ CEntity* ScriptLoader::LoadSpawnPoint(CStateManager& mgr, CInputStream& in, CEntity* ScriptLoader::LoadCameraHint(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) { + if (!EnsurePropertyCount(propCount, 25, "CamerHint")) + return nullptr; + + SActorHead head = LoadActorHead(in, mgr); + + bool active = in.readBool(); + u32 w1 = in.readUint32Big(); + u32 w2 = in.readUint32Big(); + u32 pf = LoadParameterFlags(in); + pf |= in.readBool() << 6; + float f1 = in.readFloatBig(); + pf |= in.readBool() << 7; + float f2 = in.readFloatBig(); + pf |= in.readBool() << 8; + float f3 = in.readFloatBig(); + zeus::CVector3f vec1; + vec1.readBig(in); + pf |= in.readBool() << 9; + zeus::CVector3f vec2; + vec2.readBig(in); + zeus::CVector3f vec3; + vec3.readBig(in); + pf |= in.readBool() << 10; + float f4 = in.readFloatBig(); + pf |= in.readBool() << 11; + float f5 = in.readFloatBig(); + pf |= in.readBool() << 12; + float f6 = in.readFloatBig(); + pf |= in.readBool() << 13; + float f7 = in.readFloatBig(); + float f8 = in.readFloatBig(); + float f9 = in.readFloatBig(); + pf |= in.readBool() << 14; + float f10 = in.readFloatBig(); + float f11 = in.readFloatBig(); + float f12 = in.readFloatBig(); + float f13 = in.readFloatBig(); + + return new CScriptCameraHint(mgr.AllocateUniqueId(), head.x0_name, info, + head.x10_transform, active, w1, w2, pf, f1, f2, f3, + vec1, vec2, vec3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13); } CEntity* ScriptLoader::LoadPickup(CStateManager& mgr, CInputStream& in,