More script object imps

This commit is contained in:
Phillip Stephens 2016-04-20 14:07:18 -07:00
parent 8807fe4e4d
commit 4ce505989b
10 changed files with 148 additions and 4 deletions

View File

@ -11,7 +11,7 @@ class CMaterialList
public: public:
u64 x0_ = 0; u64 x0_ = 0;
CMaterialList() = default; CMaterialList() = default;
CMaterialList(int idx) : x0_(1 << idx) {} CMaterialList(int idx) : x0_(1ull << idx) {}
}; };
} }

View File

@ -14,13 +14,15 @@ add_library(RuntimeCommonWorld
CTeamAiTypes.hpp CTeamAiTypes.cpp CTeamAiTypes.hpp CTeamAiTypes.cpp
ScriptObjectSupport.hpp ScriptObjectSupport.cpp ScriptObjectSupport.hpp ScriptObjectSupport.cpp
ScriptLoader.hpp ScriptLoader.cpp ScriptLoader.hpp ScriptLoader.cpp
CScriptWater.hpp CScriptWater.cpp
CScriptActor.hpp CScriptActor.cpp CScriptActor.hpp CScriptActor.cpp
CScriptWaypoint.hpp CScriptWaypoint.cpp CScriptWaypoint.hpp CScriptWaypoint.cpp
CScriptDoor.hpp CScriptDoor.cpp CScriptDoor.hpp CScriptDoor.cpp
CScriptTrigger.hpp CScriptTrigger.cpp CScriptTrigger.hpp CScriptTrigger.cpp
CScriptTimer.hpp CScriptTimer.cpp CScriptTimer.hpp CScriptTimer.cpp
CScriptCounter.hpp CScriptCounter.cpp CScriptCounter.hpp CScriptCounter.cpp
CScriptDock.hpp CScriptDock.cpp
CScriptWater.hpp CScriptWater.cpp
CScriptGrapplePoint.hpp CScriptGrapplePoint.cpp
CGrappleParameters.hpp CGrappleParameters.hpp
CActorParameters.hpp CActorParameters.hpp
CLightParameters.hpp CLightParameters.hpp

View File

@ -0,0 +1,30 @@
#include "CScriptDock.hpp"
#include "CActorParameters.hpp"
#include "Character/CModelData.hpp"
#include "Collision/CMaterialList.hpp"
namespace urde
{
CMaterialList MakeDockMaterialList()
{
CMaterialList list;
list.x0_ |= (1ull << 34);
list.x0_ |= (1ull << 43);
list.x0_ |= (1ull << 48);
return list;
}
CScriptDock::CScriptDock(TUniqueId uid, const std::string &name, const CEntityInfo &info, const zeus::CVector3f position,
const zeus::CVector3f& extents, s32 dock, TAreaId area, bool active, s32 w1, bool b1)
: CPhysicsActor(uid, active, name, info, zeus::CTransform(zeus::CMatrix3f::skIdentityMatrix3f, position),
CModelData::CModelDataNull(), MakeDockMaterialList(), zeus::CAABox(-extents * 0.5f, extents * 0.5f), SMoverData(1.f), CActorParameters::None(), 0.3f, 0.1f),
x258_(w1),
x25c_dock(dock),
x260_area(area),
x264_(3)
{
x268_24_ = false;
x268_25_ = b1;
x268_26_ = false;
}
}

View File

@ -0,0 +1,30 @@
#ifndef __URDE_CSCRIPTDOCK_HPP__
#define __URDE_CSCRIPTDOCK_HPP__
#include "CPhysicsActor.hpp"
namespace urde
{
class CScriptDock : public CPhysicsActor
{
s32 x258_;
s32 x25c_dock;
TAreaId x260_area;
u32 x264_;
union
{
struct
{
bool x268_24_ : 1;
bool x268_25_ : 1;
bool x268_26_ : 1;
};
u8 dummy = 0;
};
public:
CScriptDock(TUniqueId uid, const std::string& name, const CEntityInfo& info, const zeus::CVector3f position,
const zeus::CVector3f& extent, s32, TAreaId, bool active, s32 w1, bool b1);
};
}
#endif // __URDE_CSCRIPTDOCK_HPP__

View File

@ -0,0 +1,18 @@
#include "CScriptGrapplePoint.hpp"
#include "Character/CModelData.hpp"
#include "Collision/CMaterialList.hpp"
#include "CActorParameters.hpp"
namespace urde
{
CScriptGrapplePoint::CScriptGrapplePoint(TUniqueId uid, const std::string &name, const CEntityInfo& info,
const zeus::CTransform &transform, bool active, const CGrappleParameters &params)
: CActor(uid, active, name, info, transform, CModelData::CModelDataNull(), CMaterialList(41), CActorParameters::None(),
kInvalidUniqueId),
xe8_({x40_unknown - 0.5f, x50_unknown - 0.5f, x60_unknown - 0.5f},
{x40_unknown + 0.5f, x50_unknown + 0.5f, x60_unknown + 0.5f}),
x100_parameters(params)
{
}
}

View File

@ -0,0 +1,19 @@
#ifndef __URDE_CSCRIPTGRAPPLEPOINT_HPP__
#define __URDE_CSCRIPTGRAPPLEPOINT_HPP__
#include "CActor.hpp"
#include "CGrappleParameters.hpp"
namespace urde
{
class CScriptGrapplePoint : public CActor
{
zeus::CAABox xe8_;
CGrappleParameters x100_parameters;
public:
CScriptGrapplePoint(TUniqueId uid, const std::string& name, const CEntityInfo& info, const zeus::CTransform& transform,
bool active, const CGrappleParameters& params);
};
}
#endif // __URDE_CSCRIPTGRAPPLEPOINT_HPP__

View File

@ -13,7 +13,6 @@ public:
const zeus::CTransform&, bool, float, float, const zeus::CTransform&, bool, float, float,
u32, u32, u32, u32, u32, u32, u32); u32, u32, u32, u32, u32, u32, u32);
}; };
} }
#endif // __URDE_CSCRIPTWAYPOINT_HPP__ #endif // __URDE_CSCRIPTWAYPOINT_HPP__

View File

@ -0,0 +1,6 @@
#include "CScriptWorldTeleporter.hpp"
namespace urde
{
}

View File

@ -0,0 +1,17 @@
#ifndef __CSCRIPTWORLDTELEPORTER_HPP__
#define __CSCRIPTWORLDTELEPORTER_HPP__
#include "CEntity.hpp"
namespace urde
{
class CScriptWorldTeleporter
{
public:
};
}
#endif // __CSCRIPTWORLDTELEPORTER_HPP__

View File

@ -18,7 +18,9 @@
#include "CScriptTrigger.hpp" #include "CScriptTrigger.hpp"
#include "CScriptTimer.hpp" #include "CScriptTimer.hpp"
#include "CScriptCounter.hpp" #include "CScriptCounter.hpp"
#include "CScriptDock.hpp"
#include "CScriptWater.hpp" #include "CScriptWater.hpp"
#include "CScriptGrapplePoint.hpp"
#include "CSimplePool.hpp" #include "CSimplePool.hpp"
#include "Editor/ProjectResourceFactoryMP1.hpp" #include "Editor/ProjectResourceFactoryMP1.hpp"
#include "logvisor/logvisor.hpp" #include "logvisor/logvisor.hpp"
@ -553,7 +555,20 @@ CEntity* ScriptLoader::LoadGenerator(CStateManager& mgr, CInputStream& in,
CEntity* ScriptLoader::LoadDock(CStateManager& mgr, CInputStream& in, CEntity* ScriptLoader::LoadDock(CStateManager& mgr, CInputStream& in,
int propCount, const CEntityInfo& info) int propCount, const CEntityInfo& info)
{ {
if (!EnsurePropertyCount(propCount, 7, "Dock"))
return nullptr;
std::string name = *mgr.HashInstanceName(in);
bool active = in.readBool();
zeus::CVector3f position;
position.readBig(in);
zeus::CVector3f scale;
scale.readBig(in);
u32 dock = in.readUint32Big();
TAreaId area = in.readUint32Big();
bool b1 = in.readBool();
return new CScriptDock(mgr.AllocateUniqueId(), name, info, position, scale, dock, area, active, 0, b1);
} }
CEntity* ScriptLoader::LoadCamera(CStateManager& mgr, CInputStream& in, CEntity* ScriptLoader::LoadCamera(CStateManager& mgr, CInputStream& in,
@ -811,6 +826,14 @@ CEntity* ScriptLoader::LoadPathCamera(CStateManager& mgr, CInputStream& in,
CEntity* ScriptLoader::LoadGrapplePoint(CStateManager& mgr, CInputStream& in, CEntity* ScriptLoader::LoadGrapplePoint(CStateManager& mgr, CInputStream& in,
int propCount, const CEntityInfo& info) int propCount, const CEntityInfo& info)
{ {
if (!EnsurePropertyCount(propCount, 5, "GrapplePoint"))
return nullptr;
std::string name = *mgr.HashInstanceName(in);
zeus::CTransform grappleXf = LoadEditorTransform(in);
bool active = in.readBool();
CGrappleParameters parameters = LoadGrappleParameters(in);
return new CScriptGrapplePoint(mgr.AllocateUniqueId(), name, info, grappleXf, active, parameters);
} }
CEntity* ScriptLoader::LoadPuddleSpore(CStateManager& mgr, CInputStream& in, CEntity* ScriptLoader::LoadPuddleSpore(CStateManager& mgr, CInputStream& in,