mirror of
https://github.com/zeldaret/botw
synced 2026-07-03 12:10:14 -04:00
ksys/res: Finish implementing ModelList
This commit is contained in:
@@ -70,6 +70,7 @@ target_sources(uking PRIVATE
|
||||
HeapUtil.cpp
|
||||
HeapUtil.h
|
||||
InitTimeInfo.h
|
||||
ParamIO.cpp
|
||||
ParamIO.h
|
||||
SafeDelete.h
|
||||
StrTreeMap.h
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "KingSystem/Utils/ParamIO.h"
|
||||
#include <agl/Utils/aglParameter.h>
|
||||
|
||||
namespace ksys {
|
||||
|
||||
const char* ParamIO::getString(const agl::utl::ResParameterObj& obj, const char* key,
|
||||
const char* default_value, void*) const {
|
||||
const auto param = agl::utl::getResParameter(obj, key);
|
||||
if (!param.ptr())
|
||||
return default_value;
|
||||
return param.getData<const char>();
|
||||
}
|
||||
|
||||
// NON_MATCHING: how the default_value Vec3f is stored on the stack
|
||||
sead::Vector3f ParamIO::getVec3(const agl::utl::ResParameterObj& obj, const char* key,
|
||||
sead::Vector3f default_value, void*) const {
|
||||
const auto param = agl::utl::getResParameter(obj, key);
|
||||
return param.ptr() ? *param.getData<sead::Vector3f>() : default_value;
|
||||
}
|
||||
|
||||
} // namespace ksys
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <agl/Utils/aglParameterIO.h>
|
||||
#include <hostio/seadHostIONode.h>
|
||||
#include <math/seadVector.h>
|
||||
#include <prim/seadSafeString.h>
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
|
||||
@@ -15,6 +16,11 @@ public:
|
||||
|
||||
bool applyResourceUpdate(const char* data, const char* data1);
|
||||
|
||||
const char* getString(const agl::utl::ResParameterObj& obj, const char* key,
|
||||
const char* default_value, void* = nullptr) const;
|
||||
sead::Vector3f getVec3(const agl::utl::ResParameterObj& obj, const char* key,
|
||||
sead::Vector3f default_value, void* = nullptr) const;
|
||||
|
||||
u32 getIdx() const { return mIdx; }
|
||||
sead::BufferedSafeString& getPath() { return mPath; }
|
||||
const sead::BufferedSafeString& getPath() const { return mPath; }
|
||||
|
||||
Reference in New Issue
Block a user