ksys/res: Implement GParamList Rope

This commit is contained in:
Léo Lam
2020-09-20 11:55:42 +02:00
parent 518586b352
commit ef1925df9f
4 changed files with 47 additions and 2 deletions
@@ -0,0 +1,42 @@
#pragma once
#include <agl/Utils/aglParameter.h>
#include "KingSystem/Resource/GeneralParamList/resGParamListObject.h"
#include "KingSystem/Utils/Types.h"
namespace ksys::res {
class GParamListObjectRope : public GParamListObject {
public:
GParamListObjectRope();
const char* getName() const override { return "Rope"; }
agl::utl::Parameter<bool> mIsAllowCutting;
agl::utl::Parameter<bool> mIsSetupKeyframed;
agl::utl::Parameter<f32> mBoneEffectiveLength;
agl::utl::Parameter<bool> mIsInterpolateEdge;
agl::utl::Parameter<bool> mIsDeformable;
agl::utl::Parameter<bool> mIsOneBoneOneShape;
agl::utl::Parameter<f32> mSplineOffsetRateA;
agl::utl::Parameter<f32> mSplineOffsetRateB;
agl::utl::Parameter<f32> mSplineOffsetRateC;
agl::utl::Parameter<f32> mMtxEndPosOffsetLength;
};
KSYS_CHECK_SIZE_NX150(GParamListObjectRope, 0x178);
inline GParamListObjectRope::GParamListObjectRope() {
auto* const obj = &mObj;
mIsAllowCutting.init(true, "IsAllowCutting", "", obj);
mIsSetupKeyframed.init(false, "IsSetupKeyframed", "", obj);
mBoneEffectiveLength.init(0.1, "BoneEffectiveLength", "", obj);
mIsInterpolateEdge.init(true, "IsInterpolateEdge", "", obj);
mIsDeformable.init(true, "IsDeformable", "", obj);
mIsOneBoneOneShape.init(false, "IsOneBoneOneShape", "", obj);
mSplineOffsetRateA.init(0.0, "SplineOffsetRateA", "", obj);
mSplineOffsetRateB.init(0.0, "SplineOffsetRateB", "", obj);
mSplineOffsetRateC.init(0.0, "SplineOffsetRateC", "", obj);
mMtxEndPosOffsetLength.init(0.0, "MtxEndPosOffsetLength", "", obj);
}
} // namespace ksys::res
@@ -40,6 +40,7 @@
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectPlayer.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectPrey.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectRod.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectRope.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectRupee.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectSandworm.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectSeriesArmor.h"
@@ -142,6 +143,7 @@ bool GParamList::parse_(u8* data, size_t, sead::Heap* heap) {
add<GParamListObjType::AnimalUnit>(archive.getRootList(), "AnimalUnit", heap, dummy_list);
add<GParamListObjType::Insect>(archive.getRootList(), "Insect", heap, dummy_list);
add<GParamListObjType::Fish>(archive.getRootList(), "Fish", heap, dummy_list);
add<GParamListObjType::Rope>(archive.getRootList(), "Rope", heap, dummy_list);
// TODO: the rest