mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Library/Yaml: Implement ParameterBase (#835)
This commit is contained in:
parent
06c8d29492
commit
875e4ec961
|
|
@ -78309,7 +78309,7 @@ MapObj/OceanWaveActor.o:
|
|||
- offset: 0x2d5b24
|
||||
size: 4
|
||||
label: _ZN2al13ParameterBase13afterGetParamEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
lazy: true
|
||||
- offset: 0x2d5b28
|
||||
size: 8
|
||||
|
|
@ -288010,27 +288010,27 @@ Library/Yaml/ParameterBase.o:
|
|||
- offset: 0xa3321c
|
||||
size: 192
|
||||
label: _ZN2al13ParameterBaseC2ERKN4sead14SafeStringBaseIcEES5_S5_PNS_12ParameterObjEb
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa332dc
|
||||
size: 428
|
||||
label: _ZN2al13ParameterBase18initializeListNodeERKN4sead14SafeStringBaseIcEES5_S5_PNS_12ParameterObjEb
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa33488
|
||||
size: 192
|
||||
label: _ZN2al13ParameterBaseC2ERKN4sead14SafeStringBaseIcEES5_S5_PNS_13ParameterListEb
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa33548
|
||||
size: 436
|
||||
label: _ZN2al13ParameterBase18initializeListNodeERKN4sead14SafeStringBaseIcEES5_S5_PNS_13ParameterListEb
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa336fc
|
||||
size: 388
|
||||
label: _ZN2al13ParameterBase10initializeERKN4sead14SafeStringBaseIcEES5_S5_b
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa33880
|
||||
size: 160
|
||||
label: _ZN2al13ParameterBase8calcHashERKN4sead14SafeStringBaseIcEE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa33920
|
||||
size: 28
|
||||
label: _ZN2al12ParameterObj16pushBackListNodeEPNS_13ParameterBaseE
|
||||
|
|
@ -288042,33 +288042,31 @@ Library/Yaml/ParameterBase.o:
|
|||
- offset: 0xa33960
|
||||
size: 920
|
||||
label: _ZN2al13ParameterBase11tryGetParamERKNS_9ByamlIterE
|
||||
status: NotDecompiled
|
||||
status: NonMatchingMajor
|
||||
- offset: 0xa33cf8
|
||||
size: 68
|
||||
label: _ZNK2al13ParameterBase8isEqual_IPKcEEbRKS0_
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa33d3c
|
||||
size: 116
|
||||
label: _ZN2al13ParameterBase9copyLerp_IfEEvRKS0_S3_f
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa33db0
|
||||
size: 120
|
||||
label: _ZN2al13ParameterBase9copyLerp_IN4sead4QuatIfEEEEvRKS0_S6_f
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa33e28
|
||||
size: 964
|
||||
label: _ZN2al13ParameterBase7isEqualERKS0_
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa341ec
|
||||
size: 352
|
||||
label: _ZN2al13ParameterBase4copyERKS0_
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa3434c
|
||||
size: 936
|
||||
label: _ZN2al13ParameterBase8copyLerpERKS0_S2_f
|
||||
status: NotDecompiled
|
||||
Library/Yaml/ParameterObj.o:
|
||||
'.text':
|
||||
status: Matching
|
||||
- offset: 0xa346f4
|
||||
size: 116
|
||||
label:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#include "Library/Math/MathUtil.h"
|
||||
#include "Library/Placement/PlacementFunction.h"
|
||||
#include "Library/Yaml/ParameterBase.h"
|
||||
#include "Library/Yaml/ParameterObj.h"
|
||||
|
||||
namespace al {
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "Library/Resource/Resource.h"
|
||||
#include "Library/Resource/ResourceFunction.h"
|
||||
#include "Library/Yaml/ByamlIter.h"
|
||||
#include "Library/Yaml/ParameterObj.h"
|
||||
#include "Library/Yaml/ParameterBase.h"
|
||||
|
||||
namespace al {
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include "Library/Screen/ScreenPointTarget.h"
|
||||
#include "Library/Yaml/ByamlIter.h"
|
||||
#include "Library/Yaml/ParameterBase.h"
|
||||
#include "Library/Yaml/ParameterObj.h"
|
||||
|
||||
namespace al {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,343 @@
|
|||
#include "Library/Yaml/ParameterObj.h"
|
||||
#include "Library/Yaml/ParameterBase.h"
|
||||
|
||||
#include <codec/seadHashCRC32.h>
|
||||
#include <math/seadQuat.h>
|
||||
|
||||
#include "Library/Base/StringUtil.h"
|
||||
#include "Library/Yaml/ByamlIter.h"
|
||||
#include "Library/Yaml/ParameterBase.h"
|
||||
#include "Library/Yaml/ByamlUtil.h"
|
||||
|
||||
namespace al {
|
||||
|
||||
ParameterBase::ParameterBase(const sead::SafeString& name, const sead::SafeString& label,
|
||||
const sead::SafeString& meta, ParameterObj* obj, bool e) {
|
||||
initializeListNode(name, label, meta, obj, e);
|
||||
}
|
||||
|
||||
ParameterBase::ParameterBase(const sead::SafeString& name, const sead::SafeString& label,
|
||||
const sead::SafeString& meta, ParameterList* list, bool e) {
|
||||
initializeListNode(name, label, meta, list, e);
|
||||
}
|
||||
|
||||
void ParameterBase::afterGetParam() {}
|
||||
|
||||
template <>
|
||||
bool ParameterBase::isEqual_<const char*>(const ParameterBase& parameter) const {
|
||||
return isEqualString(getValuePtr<const char>(), parameter.getValuePtr<const char>());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool ParameterBase::isEqual_(const ParameterBase& parameter) const {
|
||||
return *getValuePtr<T>() == *parameter.getValuePtr<T>();
|
||||
}
|
||||
|
||||
bool ParameterBase::isEqual(const ParameterBase& parameter) {
|
||||
if ((s32)getParamType() != (s32)parameter.getParamType())
|
||||
return false;
|
||||
|
||||
if (mHash != parameter.getHash())
|
||||
return false;
|
||||
|
||||
switch (getParamType()) {
|
||||
case YamlParamType::Bool:
|
||||
return isEqual_<bool>(parameter);
|
||||
|
||||
case YamlParamType::F32:
|
||||
return isEqual_<f32>(parameter);
|
||||
|
||||
case YamlParamType::S32:
|
||||
return isEqual_<s32>(parameter);
|
||||
|
||||
case YamlParamType::U32:
|
||||
return isEqual_<u32>(parameter);
|
||||
|
||||
case YamlParamType::V2f:
|
||||
return isEqual_<sead::Vector2f>(parameter);
|
||||
|
||||
case YamlParamType::V2s32:
|
||||
return isEqual_<sead::Vector2i>(parameter);
|
||||
|
||||
case YamlParamType::V3f:
|
||||
return isEqual_<sead::Vector3f>(parameter);
|
||||
|
||||
case YamlParamType::V4f:
|
||||
return isEqual_<sead::Vector4f>(parameter);
|
||||
|
||||
case YamlParamType::Q4f:
|
||||
return isEqual_<sead::Quatf>(parameter);
|
||||
|
||||
case YamlParamType::C4f:
|
||||
return isEqual_<sead::Color4f>(parameter);
|
||||
|
||||
case YamlParamType::StringRef:
|
||||
return isEqual_<const char*>(parameter);
|
||||
|
||||
case YamlParamType::String32:
|
||||
case YamlParamType::String64:
|
||||
case YamlParamType::String128:
|
||||
case YamlParamType::String256:
|
||||
case YamlParamType::String512:
|
||||
case YamlParamType::String1024:
|
||||
case YamlParamType::String2048:
|
||||
case YamlParamType::String4096:
|
||||
// TODO: Find isEqual_ equivalent
|
||||
return isEqualString(getValuePtr<sead::SafeString>()->cstr(),
|
||||
parameter.getValuePtr<sead::SafeString>()->cstr());
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool ParameterBase::copy(const ParameterBase& parameter) {
|
||||
if ((s32)getParamType() != (s32)parameter.getParamType())
|
||||
return false;
|
||||
|
||||
if (mHash != parameter.getHash())
|
||||
return false;
|
||||
|
||||
switch (parameter.getParamType()) {
|
||||
case YamlParamType::StringRef:
|
||||
*getMutableValuePtr<sead::SafeString>() = *parameter.getValuePtr<sead::SafeString>();
|
||||
return true;
|
||||
default: {
|
||||
u8* dest = getMutableValuePtr<u8>();
|
||||
const u8* source = parameter.getValuePtr<u8>();
|
||||
s32 n = size();
|
||||
for (s32 i = 0; i < n; i++) {
|
||||
*dest = *source;
|
||||
dest++;
|
||||
source++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void ParameterBase::copyLerp_<f32>(const ParameterBase& parameterA, const ParameterBase& parameterB,
|
||||
f32 rate) {
|
||||
f32 valueA = *parameterA.getValuePtr<f32>();
|
||||
f32 valueB = *parameterB.getValuePtr<f32>();
|
||||
setPtrValue(valueA + (valueB - valueA) * rate);
|
||||
}
|
||||
|
||||
template <>
|
||||
void ParameterBase::copyLerp_<sead::Quatf>(const ParameterBase& parameterA,
|
||||
const ParameterBase& parameterB, f32 rate) {
|
||||
sead::QuatCalcCommon<f32>::slerpTo(*(sead::Quatf*)ptr(), *parameterA.getValuePtr<sead::Quatf>(),
|
||||
*parameterB.getValuePtr<sead::Quatf>(), rate);
|
||||
}
|
||||
|
||||
// BUG: N's mistake here. This function never returns true
|
||||
bool ParameterBase::copyLerp(const ParameterBase& parameterA, const ParameterBase& parameterB,
|
||||
f32 rate) {
|
||||
if ((s32)getParamType() != (s32)parameterA.getParamType())
|
||||
return false;
|
||||
|
||||
if (mHash != parameterA.getHash())
|
||||
return false;
|
||||
|
||||
if ((s32)getParamType() != (s32)parameterB.getParamType())
|
||||
return false;
|
||||
|
||||
if (mHash != parameterB.getHash())
|
||||
return false;
|
||||
|
||||
switch (getParamType()) {
|
||||
case YamlParamType::Bool:
|
||||
case YamlParamType::S32:
|
||||
case YamlParamType::U32:
|
||||
case YamlParamType::StringRef:
|
||||
case YamlParamType::String32:
|
||||
case YamlParamType::String64:
|
||||
case YamlParamType::String128:
|
||||
case YamlParamType::String256:
|
||||
case YamlParamType::String512:
|
||||
case YamlParamType::String1024:
|
||||
case YamlParamType::String2048:
|
||||
case YamlParamType::String4096:
|
||||
if (rate >= 0.5f && !(rate == 0.5f))
|
||||
copy(parameterB);
|
||||
else
|
||||
copy(parameterA);
|
||||
return false;
|
||||
|
||||
case YamlParamType::F32:
|
||||
copyLerp_<f32>(parameterA, parameterB, rate);
|
||||
return false;
|
||||
|
||||
// BUG: N's mistake here. This is YamlParamType::V2f
|
||||
case YamlParamType::V3f: {
|
||||
sead::Vector2f* val = getMutableValuePtr<sead::Vector2f>();
|
||||
const sead::Vector2f* valueA = parameterA.getValuePtr<sead::Vector2f>();
|
||||
const sead::Vector2f* valueB = parameterB.getValuePtr<sead::Vector2f>();
|
||||
val->x = valueA->x + (valueB->x - valueA->x) * rate;
|
||||
val->y = valueA->y + (valueB->y - valueA->y) * rate;
|
||||
return false;
|
||||
}
|
||||
// BUG: N's mistake here. This is YamlParamType::V3f
|
||||
case YamlParamType::V2f: {
|
||||
sead::Vector3f* val = getMutableValuePtr<sead::Vector3f>();
|
||||
const sead::Vector3f* valueA = parameterA.getValuePtr<sead::Vector3f>();
|
||||
const sead::Vector3f* valueB = parameterB.getValuePtr<sead::Vector3f>();
|
||||
val->x = valueA->x + (valueB->x - valueA->x) * rate;
|
||||
val->y = valueA->y + (valueB->y - valueA->y) * rate;
|
||||
val->z = valueA->z + (valueB->z - valueA->z) * rate;
|
||||
return false;
|
||||
}
|
||||
case YamlParamType::V4f: {
|
||||
sead::Vector4f* val = getMutableValuePtr<sead::Vector4f>();
|
||||
const sead::Vector4f* valueA = parameterA.getValuePtr<sead::Vector4f>();
|
||||
const sead::Vector4f* valueB = parameterB.getValuePtr<sead::Vector4f>();
|
||||
val->x = valueA->x + (valueB->x - valueA->x) * rate;
|
||||
val->y = valueA->y + (valueB->y - valueA->y) * rate;
|
||||
val->z = valueA->z + (valueB->z - valueA->z) * rate;
|
||||
val->w = valueA->w + (valueB->w - valueA->w) * rate;
|
||||
return false;
|
||||
}
|
||||
case YamlParamType::Q4f:
|
||||
copyLerp_<sead::Quatf>(parameterA, parameterB, rate);
|
||||
return false;
|
||||
|
||||
case YamlParamType::C4f:
|
||||
getMutableValuePtr<sead::Color4f>()->setLerp(*parameterA.getValuePtr<sead::Color4f>(),
|
||||
*parameterB.getValuePtr<sead::Color4f>(),
|
||||
rate);
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void ParameterBase::initializeListNode(const sead::SafeString& name, const sead::SafeString& label,
|
||||
const sead::SafeString& meta, ParameterObj* obj, bool e) {
|
||||
initialize(name, label, meta, e);
|
||||
|
||||
if (obj)
|
||||
obj->pushBackListNode(this);
|
||||
}
|
||||
|
||||
void ParameterBase::initializeListNode(const sead::SafeString& name, const sead::SafeString& label,
|
||||
const sead::SafeString& meta, ParameterList* list, bool e) {
|
||||
initialize(name, label, meta, e);
|
||||
|
||||
if (list)
|
||||
list->addParam(this);
|
||||
}
|
||||
|
||||
void ParameterBase::initialize(const sead::SafeString& name, const sead::SafeString& label,
|
||||
const sead::SafeString& meta, bool e) {
|
||||
mNext = nullptr;
|
||||
mName = name;
|
||||
mHash = calcHash(name);
|
||||
}
|
||||
|
||||
u32 ParameterBase::calcHash(const sead::SafeString& key) {
|
||||
return sead::HashCRC32::calcHash(key.cstr(), key.calcLength());
|
||||
}
|
||||
|
||||
// NON-MATCHING: https://decomp.me/scratch/yc1tk
|
||||
void ParameterBase::tryGetParam(const ByamlIter& iter) {
|
||||
getParamTypeStr();
|
||||
switch (getParamType().value()) {
|
||||
case YamlParamType::Bool: {
|
||||
bool value;
|
||||
if (tryGetByamlBool(&value, iter, mName.cstr()))
|
||||
setPtrValue(value);
|
||||
afterGetParam();
|
||||
return;
|
||||
}
|
||||
case YamlParamType::F32: {
|
||||
f32 value;
|
||||
if (tryGetByamlF32(&value, iter, mName.cstr()))
|
||||
setPtrValue(value);
|
||||
afterGetParam();
|
||||
return;
|
||||
}
|
||||
case YamlParamType::S32: {
|
||||
s32 value;
|
||||
if (tryGetByamlS32(&value, iter, mName.cstr()))
|
||||
setPtrValue(value);
|
||||
afterGetParam();
|
||||
return;
|
||||
}
|
||||
case YamlParamType::U32: {
|
||||
u32 value;
|
||||
if (tryGetByamlU32(&value, iter, mName.cstr()))
|
||||
setPtrValue(value);
|
||||
afterGetParam();
|
||||
return;
|
||||
}
|
||||
|
||||
case YamlParamType::V2f: {
|
||||
sead::Vector2f value;
|
||||
if (tryGetByamlV2f(&value, iter, mName.cstr()))
|
||||
setPtrValue(value);
|
||||
afterGetParam();
|
||||
return;
|
||||
}
|
||||
|
||||
case YamlParamType::V2s32: {
|
||||
sead::Vector2i value;
|
||||
if (tryGetByamlV2s32(&value, iter, mName.cstr()))
|
||||
setPtrValue(value);
|
||||
afterGetParam();
|
||||
return;
|
||||
}
|
||||
|
||||
case YamlParamType::V3f: {
|
||||
sead::Vector3f value;
|
||||
if (tryGetByamlV3f(&value, iter, mName.cstr()))
|
||||
setPtrValue(value);
|
||||
afterGetParam();
|
||||
return;
|
||||
}
|
||||
|
||||
case YamlParamType::V4f:
|
||||
case YamlParamType::Q4f: {
|
||||
sead::Vector4f value;
|
||||
if (tryGetByamlV4f(&value, iter, mName.cstr()))
|
||||
setPtrValue(value);
|
||||
afterGetParam();
|
||||
return;
|
||||
}
|
||||
|
||||
case YamlParamType::C4f: {
|
||||
sead::Color4f value;
|
||||
if (tryGetByamlColor(&value, iter, mName.cstr()))
|
||||
setPtrValue(value);
|
||||
afterGetParam();
|
||||
return;
|
||||
}
|
||||
|
||||
case YamlParamType::StringRef: {
|
||||
const char* value = tryGetByamlKeyStringOrNULL(iter, mName.cstr());
|
||||
if (value)
|
||||
setPtrValue(value);
|
||||
afterGetParam();
|
||||
return;
|
||||
}
|
||||
|
||||
case YamlParamType::String32:
|
||||
case YamlParamType::String64:
|
||||
case YamlParamType::String128:
|
||||
case YamlParamType::String256:
|
||||
case YamlParamType::String512:
|
||||
case YamlParamType::String1024:
|
||||
case YamlParamType::String2048:
|
||||
case YamlParamType::String4096: {
|
||||
const char* value = tryGetByamlKeyStringOrNULL(iter, mName.cstr());
|
||||
if (value)
|
||||
getMutableValuePtr<sead::BufferedSafeString>()->format("%s", value);
|
||||
|
||||
afterGetParam();
|
||||
return;
|
||||
}
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ParameterObj::ParameterObj() = default;
|
||||
|
||||
void ParameterObj::pushBackListNode(ParameterBase* param) {
|
||||
|
|
@ -1,14 +1,16 @@
|
|||
#pragma once
|
||||
|
||||
#include <gfx/seadColor.h>
|
||||
#include <math/seadQuat.h>
|
||||
#include <math/seadVector.h>
|
||||
#include <prim/seadEnum.h>
|
||||
#include <prim/seadSafeString.h>
|
||||
|
||||
namespace al {
|
||||
class ByamlIter;
|
||||
class ParameterObj;
|
||||
class ParameterArray;
|
||||
class ParameterList;
|
||||
class ParameterObj;
|
||||
|
||||
// Enum formatted for match purposes
|
||||
SEAD_ENUM(YamlParamType,
|
||||
|
|
@ -106,10 +108,27 @@ public:
|
|||
u32 getHash() const { return mHash; }
|
||||
|
||||
template <typename T>
|
||||
T* getValuePtr() {
|
||||
return (T*)ptr();
|
||||
T* getMutableValuePtr() {
|
||||
return reinterpret_cast<T*>(ptr());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
const T* getValuePtr() const {
|
||||
return reinterpret_cast<const T*>(ptr());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void setPtrValue(T value) {
|
||||
*getMutableValuePtr<T>() = value;
|
||||
}
|
||||
|
||||
protected:
|
||||
template <typename T>
|
||||
bool isEqual_(const ParameterBase& parameter) const;
|
||||
|
||||
template <typename T>
|
||||
void copyLerp_(const ParameterBase& parameterA, const ParameterBase& parameterB, f32 rate);
|
||||
|
||||
private:
|
||||
ParameterBase* mNext;
|
||||
sead::FixedSafeString<0x40> mName;
|
||||
|
|
@ -179,6 +198,7 @@ PARAM_TYPE_DEF(U32, u32)
|
|||
PARAM_TYPE_DEF(V2f, sead::Vector2f)
|
||||
PARAM_TYPE_DEF(V3f, sead::Vector3f)
|
||||
PARAM_TYPE_DEF(V4f, sead::Vector4f)
|
||||
PARAM_TYPE_DEF(Q4f, sead::Quatf)
|
||||
PARAM_TYPE_DEF(C4f, sead::Color4f)
|
||||
PARAM_TYPE_DEF(StringRef, const char*)
|
||||
PARAM_TYPE_DEF(String32, sead::FixedSafeString<32>)
|
||||
|
|
@ -190,4 +210,98 @@ PARAM_TYPE_DEF(String1024, sead::FixedSafeString<1024>)
|
|||
PARAM_TYPE_DEF(String2048, sead::FixedSafeString<2048>)
|
||||
PARAM_TYPE_DEF(String4096, sead::FixedSafeString<4096>)
|
||||
|
||||
class ParameterObj {
|
||||
public:
|
||||
ParameterObj();
|
||||
|
||||
void pushBackListNode(ParameterBase* param);
|
||||
void tryGetParam(const ByamlIter& iter);
|
||||
void addArray(ParameterArray* array, const sead::SafeString& key);
|
||||
bool isEqual(const ParameterObj& obj) const;
|
||||
void copy(const ParameterObj& obj);
|
||||
void copyLerp(const ParameterObj& objA, const ParameterObj& objB, f32 rate);
|
||||
ParameterBase* findParameter(const char* name) const;
|
||||
|
||||
ParameterBase* getRootParam() const { return mRootParam; }
|
||||
|
||||
ParameterObj* getNext() const { return mNext; }
|
||||
|
||||
ParameterArray* getParamArray() const { return mParamArray; }
|
||||
|
||||
void setNext(ParameterObj* obj) { mNext = obj; }
|
||||
|
||||
void setKey(const sead::SafeString& key) { mKey = key; }
|
||||
|
||||
private:
|
||||
ParameterBase* mRootParam = nullptr;
|
||||
ParameterBase* mTailParam = nullptr;
|
||||
ParameterObj* mNext = nullptr;
|
||||
ParameterArray* mParamArray = nullptr;
|
||||
sead::FixedSafeString<0x40> mKey;
|
||||
};
|
||||
|
||||
class ParameterArray {
|
||||
public:
|
||||
ParameterArray();
|
||||
void tryGetParam(const ByamlIter& iter);
|
||||
bool isEqual(const ParameterArray& array) const;
|
||||
void copy(const ParameterArray& array);
|
||||
void copyLerp(const ParameterArray& arrayA, const ParameterArray& arrayB, f32 rate);
|
||||
void addObj(ParameterObj* obj);
|
||||
void clearObj();
|
||||
void removeObj(ParameterObj* obj);
|
||||
bool isExistObj(ParameterObj* obj);
|
||||
|
||||
ParameterObj* getRootObjNode() const { return mRootObjNode; }
|
||||
|
||||
ParameterArray* getNext() const { return mNext; }
|
||||
|
||||
void setNext(ParameterArray* array) { mNext = array; }
|
||||
|
||||
void setKey(const sead::SafeString& key) { mKey = key; }
|
||||
|
||||
s32 getSize() const { return mSize; }
|
||||
|
||||
private:
|
||||
ParameterObj* mRootObjNode = nullptr;
|
||||
ParameterArray* mNext = nullptr;
|
||||
sead::FixedSafeString<0x40> mKey;
|
||||
s32 mSize = 0;
|
||||
};
|
||||
|
||||
class ParameterList {
|
||||
public:
|
||||
ParameterList();
|
||||
|
||||
void addParam(ParameterBase* param);
|
||||
void addList(ParameterList* list, const sead::SafeString& key);
|
||||
void addObj(ParameterObj* obj, const sead::SafeString& key);
|
||||
void addArray(ParameterArray* array, const sead::SafeString& key);
|
||||
void clearList();
|
||||
void clearObj();
|
||||
void removeList(ParameterList* list);
|
||||
void removeObj(ParameterObj* obj);
|
||||
bool isExistObj(ParameterObj* obj);
|
||||
void tryGetParam(const ByamlIter& iter);
|
||||
|
||||
ParameterList* getNext() const { return mNext; }
|
||||
|
||||
void setNext(ParameterList* list) { mNext = list; }
|
||||
|
||||
void setKey(const sead::SafeString& key) { mKey = key; }
|
||||
|
||||
private:
|
||||
ParameterBase* mRootParamNode = nullptr;
|
||||
ParameterObj* mRootObjNode = nullptr;
|
||||
ParameterList* mRootListNode = nullptr;
|
||||
ParameterArray* mRootArrayNode = nullptr;
|
||||
ParameterList* mNext = nullptr;
|
||||
sead::FixedSafeString<0x40> mKey;
|
||||
};
|
||||
|
||||
class ParameterIo : public ParameterList {
|
||||
public:
|
||||
ParameterIo();
|
||||
};
|
||||
|
||||
} // namespace al
|
||||
|
|
|
|||
|
|
@ -1,105 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <basis/seadTypes.h>
|
||||
#include <prim/seadSafeString.h>
|
||||
|
||||
namespace al {
|
||||
class ParameterBase;
|
||||
class ByamlIter;
|
||||
class ParameterArray;
|
||||
|
||||
class ParameterObj {
|
||||
public:
|
||||
ParameterObj();
|
||||
|
||||
void pushBackListNode(ParameterBase* param);
|
||||
void tryGetParam(const ByamlIter& iter);
|
||||
void addArray(ParameterArray* array, const sead::SafeString& key);
|
||||
bool isEqual(const ParameterObj& obj) const;
|
||||
void copy(const ParameterObj& obj);
|
||||
void copyLerp(const ParameterObj& objA, const ParameterObj& objB, f32 rate);
|
||||
ParameterBase* findParameter(const char* name) const;
|
||||
|
||||
ParameterBase* getRootParam() const { return mRootParam; }
|
||||
|
||||
ParameterObj* getNext() const { return mNext; }
|
||||
|
||||
ParameterArray* getParamArray() const { return mParamArray; }
|
||||
|
||||
void setNext(ParameterObj* obj) { mNext = obj; }
|
||||
|
||||
void setKey(const sead::SafeString& key) { mKey = key; }
|
||||
|
||||
private:
|
||||
ParameterBase* mRootParam = nullptr;
|
||||
ParameterBase* mTailParam = nullptr;
|
||||
ParameterObj* mNext = nullptr;
|
||||
ParameterArray* mParamArray = nullptr;
|
||||
sead::FixedSafeString<0x40> mKey;
|
||||
};
|
||||
|
||||
class ParameterArray {
|
||||
public:
|
||||
ParameterArray();
|
||||
void tryGetParam(const ByamlIter& iter);
|
||||
bool isEqual(const ParameterArray& array) const;
|
||||
void copy(const ParameterArray& array);
|
||||
void copyLerp(const ParameterArray& arrayA, const ParameterArray& arrayB, f32 rate);
|
||||
void addObj(ParameterObj* obj);
|
||||
void clearObj();
|
||||
void removeObj(ParameterObj* obj);
|
||||
bool isExistObj(ParameterObj* obj);
|
||||
|
||||
ParameterObj* getRootObjNode() const { return mRootObjNode; }
|
||||
|
||||
ParameterArray* getNext() const { return mNext; }
|
||||
|
||||
void setNext(ParameterArray* array) { mNext = array; }
|
||||
|
||||
void setKey(const sead::SafeString& key) { mKey = key; }
|
||||
|
||||
s32 getSize() const { return mSize; }
|
||||
|
||||
private:
|
||||
ParameterObj* mRootObjNode = nullptr;
|
||||
ParameterArray* mNext = nullptr;
|
||||
sead::FixedSafeString<0x40> mKey;
|
||||
s32 mSize = 0;
|
||||
};
|
||||
|
||||
class ParameterList {
|
||||
public:
|
||||
ParameterList();
|
||||
|
||||
void addParam(ParameterBase* param);
|
||||
void addList(ParameterList* list, const sead::SafeString& key);
|
||||
void addObj(ParameterObj* obj, const sead::SafeString& key);
|
||||
void addArray(ParameterArray* array, const sead::SafeString& key);
|
||||
void clearList();
|
||||
void clearObj();
|
||||
void removeList(ParameterList* list);
|
||||
void removeObj(ParameterObj* obj);
|
||||
bool isExistObj(ParameterObj* obj);
|
||||
void tryGetParam(const ByamlIter& iter);
|
||||
|
||||
ParameterList* getNext() const { return mNext; }
|
||||
|
||||
void setNext(ParameterList* list) { mNext = list; }
|
||||
|
||||
void setKey(const sead::SafeString& key) { mKey = key; }
|
||||
|
||||
private:
|
||||
ParameterBase* mRootParamNode = nullptr;
|
||||
ParameterObj* mRootObjNode = nullptr;
|
||||
ParameterList* mRootListNode = nullptr;
|
||||
ParameterArray* mRootArrayNode = nullptr;
|
||||
ParameterList* mNext = nullptr;
|
||||
sead::FixedSafeString<0x40> mKey;
|
||||
};
|
||||
|
||||
class ParameterIo : public ParameterList {
|
||||
public:
|
||||
ParameterIo();
|
||||
};
|
||||
|
||||
} // namespace al
|
||||
Loading…
Reference in a new issue