mirror of
https://github.com/zeldaret/botw
synced 2026-07-25 22:18:39 -04:00
ksys/res: Finish implementing Chemical
This commit is contained in:
@@ -1 +1,24 @@
|
||||
#include "KingSystem/Resource/resResourceChemical.h"
|
||||
|
||||
namespace ksys::res {
|
||||
|
||||
Chemical::Chemical() : ParamIO("chemical", 0) {
|
||||
addList(&mRoot, "chemical_root");
|
||||
}
|
||||
|
||||
void Chemical::doCreate_(u8* buffer, u32 buffer_size, sead::Heap* heap) {}
|
||||
|
||||
bool Chemical::parse_(u8* data, size_t size, sead::Heap* heap) {
|
||||
if (!data)
|
||||
return true;
|
||||
|
||||
agl::utl::ResParameterArchive archive{data};
|
||||
|
||||
const auto chemical_root_list =
|
||||
agl::utl::getResParameterList(archive.getRootList(), "chemical_root");
|
||||
mRoot.parse(chemical_root_list, heap);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace ksys::res
|
||||
|
||||
@@ -1,13 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Chemical/chmRoot.h"
|
||||
#include "KingSystem/Resource/resResource.h"
|
||||
#include "KingSystem/Utils/ParamIO.h"
|
||||
|
||||
namespace ksys::res {
|
||||
|
||||
// TODO
|
||||
class Chemical : public ParamIO, public Resource {
|
||||
SEAD_RTTI_OVERRIDE(Chemical, Resource)
|
||||
|
||||
public:
|
||||
Chemical();
|
||||
|
||||
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 chm::Root& getRoot() const { return mRoot; }
|
||||
|
||||
private:
|
||||
chm::Root mRoot;
|
||||
};
|
||||
|
||||
} // namespace ksys::res
|
||||
|
||||
Reference in New Issue
Block a user