More loader imps

This commit is contained in:
Phillip Stephens 2016-05-22 22:36:20 -07:00
parent 60e514f57f
commit aca8b48674
7 changed files with 133 additions and 4 deletions

View File

@ -27,6 +27,7 @@ enum class EMaterialTypes
FourtyOne = 41, FourtyOne = 41,
FourtyTwo = 42, FourtyTwo = 42,
FourtyThree = 43, FourtyThree = 43,
FourtyFour = 44,
FourtyEight = 48, FourtyEight = 48,
FourtyNine = 49, FourtyNine = 49,
Fifty = 50, Fifty = 50,

View File

@ -42,7 +42,9 @@ set(WORLD_SOURCES
CScriptRelay.hpp CScriptRelay.cpp CScriptRelay.hpp CScriptRelay.cpp
CScriptHUDMemo.hpp CScriptHUDMemo.cpp CScriptHUDMemo.hpp CScriptHUDMemo.cpp
CScriptCameraFilterKeyframe.hpp CScriptCameraFilterKeyframe.cpp CScriptCameraFilterKeyframe.hpp CScriptCameraFilterKeyframe.cpp
CScriptCameraBlurKeyframe.hpp CScriptCameraBlurKeyframe.cpp
CScriptDamageableTrigger.hpp CScriptDamageableTrigger.cpp CScriptDamageableTrigger.hpp CScriptDamageableTrigger.cpp
CScriptDebris.hpp CScriptDebris.cpp
CScriptActorRotate.hpp CScriptActorRotate.cpp CScriptActorRotate.hpp CScriptActorRotate.cpp
CScriptSpecialFunction.hpp CScriptSpecialFunction.cpp CScriptSpecialFunction.hpp CScriptSpecialFunction.cpp
CGrappleParameters.hpp CGrappleParameters.hpp

View File

@ -0,0 +1,10 @@
#include "CScriptCameraBlurKeyframe.hpp"
namespace urde
{
CScriptCameraBlurKeyframe::CScriptCameraBlurKeyframe(TUniqueId uid, const std::string& name, const CEntityInfo& info,
u32, float, u32, float, float, bool active)
: CEntity(uid, info, active, name)
{
}
}

View File

@ -0,0 +1,15 @@
#ifndef __URDE_CSCRIPTCAMERABLURKEYFRAME__
#define __URDE_CSCRIPTCAMERABLURKEYFRAME__
#include "CEntity.hpp"
namespace urde
{
class CScriptCameraBlurKeyframe : public CEntity
{
public:
CScriptCameraBlurKeyframe(TUniqueId, const std::string&, const CEntityInfo&, u32, float, u32, float, float, bool);
};
}
#endif // __URDE_CSCRIPTCAMERABLURKEYFRAME__

View File

@ -0,0 +1,29 @@
#include "CScriptDebris.hpp"
namespace urde
{
CScriptDebris::CScriptDebris(TUniqueId uid, const std::string& name, const CEntityInfo& info, const zeus::CTransform& xf,
CModelData&& mData, const CActorParameters& aParams, ResId, const zeus::CVector3f&, float,
const zeus::CVector3f&, const zeus::CColor&, float f1, float f2, float f3,
CScriptDebris::EScaleType, bool, bool, bool active)
: CPhysicsActor(uid, active, name, info, xf, std::move(mData),
CMaterialList(EMaterialTypes::Nineteen, EMaterialTypes::FourtyFour),
mData.GetBounds(xf.getRotation()), SMoverData(f2), aParams, 0.3, 0.1)
{
}
#if 0
CScriptDebris::CScriptDebris(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
const CActorParameters&, float, float, float, float, float, float, float, float, float,
const zeus::CColor&, const zeus::CColor&, float, const zeus::CVector3f&, const zeus::CVector3f&,
float, float, const zeus::CVector3f&, u32, const zeus::CVector3f&, bool, bool,
CScriptDebris::EOrientationType, u32, const zeus::CVector3f&, bool, bool,
CScriptDebris::EOrientationType, u32, const zeus::CVector3f&, CScriptDebris::EOrientationType,
bool, bool, bool)
{
}
#endif
}

View File

@ -0,0 +1,36 @@
#ifndef __URDE_CSCRIPTDEBRIS_HPP__
#define __URDE_CSCRIPTDEBRIS_HPP__
#include "CPhysicsActor.hpp"
namespace urde
{
class CScriptDebris : public CPhysicsActor
{
public:
enum class EScaleType
{
};
enum class EOrientationType
{
};
private:
//TReservedAverage<float, 8> x2e0_;
public:
CScriptDebris(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
const CActorParameters&, ResId, const zeus::CVector3f&, float, const zeus::CVector3f&,
const zeus::CColor&, float, float, float, EScaleType, bool, bool, bool);
#if 0
CScriptDebris(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
const CActorParameters&, float, float, float, float, float, float, float, float, float,
const zeus::CColor&, const zeus::CColor&, float, const zeus::CVector3f&, const zeus::CVector3f&,
float, float, const zeus::CVector3f&, u32, const zeus::CVector3f&, bool, bool, EOrientationType, u32,
const zeus::CVector3f&, bool, bool, EOrientationType, u32, const zeus::CVector3f&, EOrientationType,
bool, bool, bool);
#endif
};
}
#endif // __URDE_CSCRIPTDEBRIS_HPP__

View File

@ -36,7 +36,9 @@
#include "CScriptRelay.hpp" #include "CScriptRelay.hpp"
#include "CScriptHUDMemo.hpp" #include "CScriptHUDMemo.hpp"
#include "CScriptCameraFilterKeyframe.hpp" #include "CScriptCameraFilterKeyframe.hpp"
#include "CScriptCameraBlurKeyframe.hpp"
#include "CScriptDamageableTrigger.hpp" #include "CScriptDamageableTrigger.hpp"
#include "CScriptDebris.hpp"
#include "CScriptActorRotate.hpp" #include "CScriptActorRotate.hpp"
#include "CScriptSpecialFunction.hpp" #include "CScriptSpecialFunction.hpp"
#include "Camera/CCinematicCamera.hpp" #include "Camera/CCinematicCamera.hpp"
@ -1050,7 +1052,18 @@ CEntity* ScriptLoader::LoadCameraFilterKeyframe(CStateManager& mgr, CInputStream
CEntity* ScriptLoader::LoadCameraBlurKeyframe(CStateManager& mgr, CInputStream& in, CEntity* ScriptLoader::LoadCameraBlurKeyframe(CStateManager& mgr, CInputStream& in,
int propCount, const CEntityInfo& info) int propCount, const CEntityInfo& info)
{ {
return nullptr; if (!EnsurePropertyCount(propCount, 7, "CameraBlurKeyframe"))
return nullptr;
const std::string* name = mgr.HashInstanceName(in);
bool active = in.readBool();
u32 w1 = in.readUint32Big();
float f1 = in.readFloatBig();
u32 w2 = in.readUint32Big();
float f2 = in.readFloatBig();
float f3 = in.readFloatBig();
return new CScriptCameraBlurKeyframe(mgr.AllocateUniqueId(), *name, info, w1, f1, w2, f2, f3, active);
} }
u32 ClassifyVector(const zeus::CVector3f& dir) u32 ClassifyVector(const zeus::CVector3f& dir)
@ -1073,7 +1086,7 @@ u32 ClassifyVector(const zeus::CVector3f& dir)
u32 TransformDamagableTriggerFlags(CStateManager& mgr, TAreaId aId, u32 flags) u32 TransformDamagableTriggerFlags(CStateManager& mgr, TAreaId aId, u32 flags)
{ {
CGameArea* area = mgr.GetWorld()->GetGameAreas().at(aId).get(); CGameArea* area = mgr.GetWorld()->GetGameAreas().at(u32(aId)).get();
zeus::CTransform rotation = area->GetTransform().getRotation(); zeus::CTransform rotation = area->GetTransform().getRotation();
u32 ret = 0; u32 ret = 0;
@ -1119,7 +1132,30 @@ CEntity* ScriptLoader::LoadDamageableTrigger(CStateManager& mgr, CInputStream& i
CEntity* ScriptLoader::LoadDebris(CStateManager& mgr, CInputStream& in, CEntity* ScriptLoader::LoadDebris(CStateManager& mgr, CInputStream& in,
int propCount, const CEntityInfo& info) int propCount, const CEntityInfo& info)
{ {
return nullptr; if (!EnsurePropertyCount(propCount, 18, "Debris"))
return nullptr;
SScaledActorHead head = LoadScaledActorHead(in, mgr);
float f1 = in.readFloatBig();
zeus::CVector3f v1 = zeus::CVector3f::ReadBig(in);
zeus::CColor color;
color.readRGBABig(in);
float f2 = in.readFloatBig();
float f3 = in.readFloatBig();
float f4 = in.readFloatBig();
CScriptDebris::EScaleType scaleType = CScriptDebris::EScaleType(in.readUint32Big());
bool b1 = in.readBool();
ResId model = in.readUint32Big();
CActorParameters aParams = LoadActorParameters(in);
ResId w3 = in.readUint32Big();
zeus::CVector3f v2 = zeus::CVector3f::ReadBig(in);
bool b2 = in.readBool();
bool b3 = in.readBool();
if (!g_ResFactory->GetResourceTypeById(model))
return nullptr;
return new CScriptDebris(mgr.AllocateUniqueId(), head.x0_name, info, head.x10_transform, CStaticRes(model, head.x40_scale),
aParams, w3, v2, f1, v1, color, f2, f3, f4, scaleType, b2, b1, b3);
} }
CEntity* ScriptLoader::LoadCameraShaker(CStateManager& mgr, CInputStream& in, CEntity* ScriptLoader::LoadCameraShaker(CStateManager& mgr, CInputStream& in,
@ -1243,7 +1279,7 @@ CEntity* ScriptLoader::LoadWater(CStateManager& mgr, CInputStream& in,
f3, active, fluidType, b4, f4, fluidMotion, f5, f6, f7, f8, f9, f10, f11, f12, c1, c2, enterParticle, f3, active, fluidType, b4, f4, fluidMotion, f5, f6, f7, f8, f9, f10, f11, f12, c1, c2, enterParticle,
partId2, partId3, partId4, partId5, soundId1, soundId2, soundId3, soundId4, soundId5, partId2, partId3, partId4, partId5, soundId1, soundId2, soundId3, soundId4, soundId5,
f13, w19, f14, f15, f16, f17, f18, f19, heatWaveHeight, heatWaveSpeed, heatWaveColor, lightmap, f22, f23, f24, f13, w19, f14, f15, f16, f17, f18, f19, heatWaveHeight, heatWaveSpeed, heatWaveColor, lightmap, f22, f23, f24,
w21, w22, b5, bitVal0, bitVal0, bitset); w21, w22, b5, bitVal0, bitVal1, bitset);
} }
CEntity* ScriptLoader::LoadWarWasp(CStateManager& mgr, CInputStream& in, CEntity* ScriptLoader::LoadWarWasp(CStateManager& mgr, CInputStream& in,