mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-04 19:15:52 +00:00
Implement CScriptCameraBlurKeyframe and CScriptCameraFilterKeyframe
This commit is contained in:
parent
94461ff41d
commit
4c41132168
@ -13,12 +13,12 @@ struct CameraBlurKeyframe : IScriptObject
|
|||||||
{
|
{
|
||||||
DECL_YAML
|
DECL_YAML
|
||||||
String<-1> name;
|
String<-1> name;
|
||||||
Value<bool> unknown1;
|
Value<bool> active;
|
||||||
Value<atUint32> unknown2;
|
Value<atUint32> type;
|
||||||
Value<float> unknown3;
|
Value<float> amount;
|
||||||
Value<atUint32> unknown4;
|
Value<atUint32> unk;
|
||||||
Value<float> unknown5;
|
Value<float> timeIn;
|
||||||
Value<float> unknown6;
|
Value<float> timeOut;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,14 +13,14 @@ struct CameraFilterKeyframe : IScriptObject
|
|||||||
{
|
{
|
||||||
DECL_YAML
|
DECL_YAML
|
||||||
String<-1> name;
|
String<-1> name;
|
||||||
Value<bool> unknown1;
|
Value<bool> active;
|
||||||
Value<atUint32> unkown2;
|
Value<atUint32> type;
|
||||||
Value<atUint32> unkown3;
|
Value<atUint32> shape;
|
||||||
Value<atUint32> unkown4;
|
Value<atUint32> filterIdx;
|
||||||
Value<atUint32> unkown5;
|
Value<atUint32> unk;
|
||||||
Value<atVec4f> unknown6; //CColor
|
DNAColor color;
|
||||||
Value<float> unknown7;
|
Value<float> timeIn;
|
||||||
Value<float> unknown8;
|
Value<float> timeOut;
|
||||||
UniqueID32 texture;
|
UniqueID32 texture;
|
||||||
|
|
||||||
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const
|
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const
|
||||||
|
@ -417,6 +417,7 @@ public:
|
|||||||
void ClearActiveRandom() { x900_activeRandom = nullptr; }
|
void ClearActiveRandom() { x900_activeRandom = nullptr; }
|
||||||
CRumbleManager& GetRumbleManager() {return *x88c_rumbleManager;}
|
CRumbleManager& GetRumbleManager() {return *x88c_rumbleManager;}
|
||||||
CCameraFilterPassPoly& GetCameraFilterPass(int idx) {return xb84_camFilterPasses[idx];}
|
CCameraFilterPassPoly& GetCameraFilterPass(int idx) {return xb84_camFilterPasses[idx];}
|
||||||
|
CCameraBlurPass& GetCameraBlurPass(int idx) {return xd14_camBlurPasses[idx];}
|
||||||
|
|
||||||
CEnvFxManager* GetEnvFxManager() { return x880_envFxManager; }
|
CEnvFxManager* GetEnvFxManager() { return x880_envFxManager; }
|
||||||
CWorld* WorldNC() {return x850_world.get();}
|
CWorld* WorldNC() {return x850_world.get();}
|
||||||
|
@ -1,14 +1,36 @@
|
|||||||
#include "CScriptCameraBlurKeyframe.hpp"
|
#include "CScriptCameraBlurKeyframe.hpp"
|
||||||
#include "TCastTo.hpp"
|
#include "TCastTo.hpp"
|
||||||
|
#include "CStateManager.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
CScriptCameraBlurKeyframe::CScriptCameraBlurKeyframe(TUniqueId uid, const std::string& name, const CEntityInfo& info,
|
CScriptCameraBlurKeyframe::CScriptCameraBlurKeyframe(TUniqueId uid, const std::string& name,
|
||||||
u32, float, u32, float, float, bool active)
|
const CEntityInfo& info, EBlurType type,
|
||||||
: CEntity(uid, info, active, name)
|
float amount, u32 unk, float timeIn,
|
||||||
|
float timeOut, bool active)
|
||||||
|
: CEntity(uid, info, active, name), x34_type(type), x38_amount(amount), x3c_(unk),
|
||||||
|
x40_timeIn(timeIn), x44_timeOut(timeOut)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CScriptCameraBlurKeyframe::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr)
|
||||||
|
{
|
||||||
|
CEntity::AcceptScriptMsg(msg, objId, stateMgr);
|
||||||
|
|
||||||
|
switch (msg)
|
||||||
|
{
|
||||||
|
case EScriptObjectMessage::Increment:
|
||||||
|
if (GetActive())
|
||||||
|
stateMgr.GetCameraBlurPass(3).SetBlur(x34_type, x38_amount, x40_timeIn);
|
||||||
|
break;
|
||||||
|
case EScriptObjectMessage::Decrement:
|
||||||
|
if (GetActive())
|
||||||
|
stateMgr.GetCameraBlurPass(3).DisableBlur(x44_timeOut);
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CScriptCameraBlurKeyframe::Accept(IVisitor& visitor)
|
void CScriptCameraBlurKeyframe::Accept(IVisitor& visitor)
|
||||||
{
|
{
|
||||||
visitor.Visit(this);
|
visitor.Visit(this);
|
||||||
|
@ -2,14 +2,24 @@
|
|||||||
#define __URDE_CSCRIPTCAMERABLURKEYFRAME__
|
#define __URDE_CSCRIPTCAMERABLURKEYFRAME__
|
||||||
|
|
||||||
#include "CEntity.hpp"
|
#include "CEntity.hpp"
|
||||||
|
#include "Camera/CCameraFilter.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CScriptCameraBlurKeyframe : public CEntity
|
class CScriptCameraBlurKeyframe : public CEntity
|
||||||
{
|
{
|
||||||
|
EBlurType x34_type;
|
||||||
|
float x38_amount;
|
||||||
|
u32 x3c_;
|
||||||
|
float x40_timeIn;
|
||||||
|
float x44_timeOut;
|
||||||
public:
|
public:
|
||||||
CScriptCameraBlurKeyframe(TUniqueId, const std::string&, const CEntityInfo&, u32, float, u32, float, float, bool);
|
CScriptCameraBlurKeyframe(TUniqueId uid, const std::string& name,
|
||||||
|
const CEntityInfo& info, EBlurType type,
|
||||||
|
float amount, u32 unk, float timeIn,
|
||||||
|
float timeOut, bool active);
|
||||||
|
|
||||||
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr);
|
||||||
void Accept(IVisitor& visitor);
|
void Accept(IVisitor& visitor);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,40 @@
|
|||||||
#include "CScriptCameraFilterKeyframe.hpp"
|
#include "CScriptCameraFilterKeyframe.hpp"
|
||||||
#include "TCastTo.hpp"
|
#include "TCastTo.hpp"
|
||||||
|
#include "CStateManager.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
CScriptCameraFilterKeyframe::CScriptCameraFilterKeyframe(TUniqueId uid, const std::string& name,
|
CScriptCameraFilterKeyframe::CScriptCameraFilterKeyframe(TUniqueId uid, const std::string& name,
|
||||||
const CEntityInfo& info, u32, u32, u32, u32,
|
const CEntityInfo& info, EFilterType type, EFilterShape shape,
|
||||||
const zeus::CColor&, float, float, u32, bool active)
|
u32 filterIdx, u32 unk, const zeus::CColor& color,
|
||||||
: CEntity(uid, info, active, name)
|
float timeIn, float timeOut, ResId txtr, bool active)
|
||||||
|
: CEntity(uid, info, active, name), x34_type(type), x38_shape(shape), x3c_filterIdx(filterIdx), x40_(unk),
|
||||||
|
x44_color(color), x48_timeIn(timeIn), x4c_timeOut(timeOut), x50_txtr(txtr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CScriptCameraFilterKeyframe::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr)
|
||||||
|
{
|
||||||
|
switch (msg)
|
||||||
|
{
|
||||||
|
case EScriptObjectMessage::Increment:
|
||||||
|
if (GetActive())
|
||||||
|
stateMgr.GetCameraFilterPass(x3c_filterIdx).SetFilter(x34_type, x38_shape, x48_timeIn, x44_color, x50_txtr);
|
||||||
|
break;
|
||||||
|
case EScriptObjectMessage::Decrement:
|
||||||
|
if (GetActive())
|
||||||
|
stateMgr.GetCameraFilterPass(x3c_filterIdx).DisableFilter(x4c_timeOut);
|
||||||
|
break;
|
||||||
|
case EScriptObjectMessage::Deactivate:
|
||||||
|
if (GetActive())
|
||||||
|
stateMgr.GetCameraFilterPass(x3c_filterIdx).DisableFilter(0.f);
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
CEntity::AcceptScriptMsg(msg, objId, stateMgr);
|
||||||
|
}
|
||||||
|
|
||||||
void CScriptCameraFilterKeyframe::Accept(IVisitor& visitor)
|
void CScriptCameraFilterKeyframe::Accept(IVisitor& visitor)
|
||||||
{
|
{
|
||||||
visitor.Visit(this);
|
visitor.Visit(this);
|
||||||
|
@ -3,24 +3,28 @@
|
|||||||
|
|
||||||
#include "CEntity.hpp"
|
#include "CEntity.hpp"
|
||||||
#include "zeus/CColor.hpp"
|
#include "zeus/CColor.hpp"
|
||||||
|
#include "Camera/CCameraFilter.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CScriptCameraFilterKeyframe : public CEntity
|
class CScriptCameraFilterKeyframe : public CEntity
|
||||||
{
|
{
|
||||||
u32 x34_;
|
EFilterType x34_type;
|
||||||
u32 x38_;
|
EFilterShape x38_shape;
|
||||||
u32 x3c_;
|
u32 x3c_filterIdx;
|
||||||
u32 x40_;
|
u32 x40_;
|
||||||
zeus::CColor x44_;
|
zeus::CColor x44_color;
|
||||||
float x48_;
|
float x48_timeIn;
|
||||||
float x4c_;
|
float x4c_timeOut;
|
||||||
u32 x50_;
|
ResId x50_txtr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CScriptCameraFilterKeyframe(TUniqueId, const std::string&, const CEntityInfo&, u32, u32, u32, u32,
|
CScriptCameraFilterKeyframe(TUniqueId uid, const std::string& name,
|
||||||
const zeus::CColor&, float, float, u32, bool);
|
const CEntityInfo& info, EFilterType type, EFilterShape shape,
|
||||||
|
u32 filterIdx, u32 unk, const zeus::CColor& color,
|
||||||
|
float timeIn, float timeOut, ResId txtr, bool active);
|
||||||
|
|
||||||
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr);
|
||||||
void Accept(IVisitor& visitor);
|
void Accept(IVisitor& visitor);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1032,18 +1032,18 @@ CEntity* ScriptLoader::LoadCameraFilterKeyframe(CStateManager& mgr, CInputStream
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
std::string name = mgr.HashInstanceName(in);
|
std::string name = mgr.HashInstanceName(in);
|
||||||
bool active = in.readBool();
|
bool active = in.readBool();
|
||||||
u32 w1 = in.readUint32Big();
|
EFilterType type = EFilterType(in.readUint32Big());
|
||||||
u32 w2 = in.readUint32Big();
|
EFilterShape shape = EFilterShape(in.readUint32Big());
|
||||||
u32 w3 = in.readUint32Big();
|
u32 filterIdx = in.readUint32Big();
|
||||||
u32 w4 = in.readUint32Big();
|
u32 unk = in.readUint32Big();
|
||||||
zeus::CColor color;
|
zeus::CColor color;
|
||||||
color.readRGBABig(in);
|
color.readRGBABig(in);
|
||||||
float f1 = in.readFloatBig();
|
float timeIn = in.readFloatBig();
|
||||||
float f2 = in.readFloatBig();
|
float timeOut = in.readFloatBig();
|
||||||
u32 w5 = in.readUint32Big();
|
ResId txtr = in.readUint32Big();
|
||||||
|
|
||||||
return new CScriptCameraFilterKeyframe(mgr.AllocateUniqueId(), name, info, w1, w2, w3, w4, color, f1, f2, w5,
|
return new CScriptCameraFilterKeyframe(mgr.AllocateUniqueId(), name, info, type, shape, filterIdx, unk,
|
||||||
active);
|
color, timeIn, timeOut, txtr, active);
|
||||||
}
|
}
|
||||||
|
|
||||||
CEntity* ScriptLoader::LoadCameraBlurKeyframe(CStateManager& mgr, CInputStream& in, int propCount,
|
CEntity* ScriptLoader::LoadCameraBlurKeyframe(CStateManager& mgr, CInputStream& in, int propCount,
|
||||||
@ -1054,13 +1054,14 @@ CEntity* ScriptLoader::LoadCameraBlurKeyframe(CStateManager& mgr, CInputStream&
|
|||||||
|
|
||||||
std::string name = mgr.HashInstanceName(in);
|
std::string name = mgr.HashInstanceName(in);
|
||||||
bool active = in.readBool();
|
bool active = in.readBool();
|
||||||
u32 w1 = in.readUint32Big();
|
EBlurType type = EBlurType(in.readUint32Big());
|
||||||
float f1 = in.readFloatBig();
|
float amount = in.readFloatBig();
|
||||||
u32 w2 = in.readUint32Big();
|
u32 unk = in.readUint32Big();
|
||||||
float f2 = in.readFloatBig();
|
float timeIn = in.readFloatBig();
|
||||||
float f3 = in.readFloatBig();
|
float timeOut = in.readFloatBig();
|
||||||
|
|
||||||
return new CScriptCameraBlurKeyframe(mgr.AllocateUniqueId(), name, info, w1, f1, w2, f2, f3, active);
|
return new CScriptCameraBlurKeyframe(mgr.AllocateUniqueId(), name, info, type, amount,
|
||||||
|
unk, timeIn, timeOut, active);
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 ClassifyVector(const zeus::CVector3f& dir)
|
u32 ClassifyVector(const zeus::CVector3f& dir)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user