ksys/res: Implement RagdollConfig

This commit is contained in:
Léo Lam
2021-04-14 19:59:01 +02:00
parent 3a7b4df04c
commit 3fc1957cc2
3 changed files with 52 additions and 19 deletions
@@ -1 +1,22 @@
#include "KingSystem/Resource/resResourceRagdollConfig.h"
namespace ksys::res {
RagdollConfig::RagdollConfig() : ParamIO("rgconfig", 0) {}
RagdollConfig::~RagdollConfig() = default;
void RagdollConfig::doCreate_(u8* buffer, u32 buffer_size, sead::Heap* heap) {}
bool RagdollConfig::parse_(u8* data, size_t size, sead::Heap* heap) {
if (!data)
return false;
addList(&mConfig, "ConfigRoot");
agl::utl::ResParameterArchive archive{data};
applyResParameterArchive(archive);
return true;
}
} // namespace ksys::res
@@ -1,13 +1,25 @@
#pragma once
#include "KingSystem/Physics/Ragdoll/physRagdollConfig.h"
#include "KingSystem/Resource/resResource.h"
#include "KingSystem/Utils/ParamIO.h"
namespace ksys::res {
// TODO
class RagdollConfig : public ParamIO, public Resource {
SEAD_RTTI_OVERRIDE(RagdollConfig, Resource)
public:
RagdollConfig();
~RagdollConfig() override;
void doCreate_(u8* buffer, u32 buffer_size, sead::Heap* heap) override;
bool needsParse() const override { return true; }
bool parse_(u8* data, size_t size, sead::Heap* heap) override;
const phys::RagdollConfig& getConfig() const { return mConfig; }
private:
phys::RagdollConfig mConfig;
};
} // namespace ksys::res