ksys/phys: Implement ParamSet and res::Physics

This commit is contained in:
Léo Lam
2021-04-22 19:03:46 +02:00
parent f6e4643808
commit 136f20427d
6 changed files with 214 additions and 27 deletions
@@ -1 +1,15 @@
#include "KingSystem/Resource/resResourcePhysics.h"
namespace ksys::res {
void Physics::doCreate_(u8* buffer, u32 buffer_size, sead::Heap* heap) {}
bool Physics::parse_(u8* data, size_t size, sead::Heap* heap) {
if (!data)
return true;
mParamSet.parse(this, agl::utl::ResParameterArchive{data}, heap);
return true;
}
} // namespace ksys::res
+12 -1
View File
@@ -1,13 +1,24 @@
#pragma once
#include "KingSystem/Physics/System/physParamSet.h"
#include "KingSystem/Resource/resResource.h"
#include "KingSystem/Utils/ParamIO.h"
namespace ksys::res {
// TODO
class Physics : public ParamIO, public Resource {
SEAD_RTTI_OVERRIDE(Physics, Resource)
public:
Physics() : ParamIO("physics", 0) {}
phys::ParamSet& getParamSet() { return mParamSet; }
void doCreate_(u8* buffer, u32 buffer_size, sead::Heap* heap) override;
bool parse_(u8* data, size_t size, sead::Heap* heap) override;
bool needsParse() const override { return true; }
private:
phys::ParamSet mParamSet;
};
} // namespace ksys::res