diff --git a/data/file_list.yml b/data/file_list.yml index 5c4091711b..77ce31baf2 100644 --- a/data/file_list.yml +++ b/data/file_list.yml @@ -241301,37 +241301,37 @@ Library/Fluid/RippleCtrl.o: - offset: 0x89e104 size: 8 label: _ZNK2al12ParameterV3f15getParamTypeStrEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e10c size: 8 label: _ZNK2al12ParameterV3f12getParamTypeEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e114 size: 8 label: _ZNK2al9ParameterIN4sead7Vector3IfEEE3ptrEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e11c size: 8 label: _ZN2al9ParameterIN4sead7Vector3IfEEE3ptrEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e124 size: 8 label: _ZNK2al9ParameterIN4sead7Vector3IfEEE4sizeEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e12c size: 8 label: _ZNK2al9ParameterIN4sead7Vector3IfEEE15getParamTypeStrEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e134 size: 8 label: _ZNK2al9ParameterIN4sead7Vector3IfEEE12getParamTypeEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e13c size: 8 @@ -241371,42 +241371,42 @@ Library/Fluid/RippleCtrl.o: - offset: 0x89e174 size: 516 label: _ZN2al9ParameterIN4sead15FixedSafeStringILi64EEEEC2ERKS3_RKNS1_14SafeStringBaseIcEESA_SA_PNS_12ParameterObjEb - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e378 size: 8 label: _ZNK2al17ParameterString6415getParamTypeStrEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e380 size: 8 label: _ZNK2al17ParameterString6412getParamTypeEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e388 size: 8 label: _ZNK2al9ParameterIN4sead15FixedSafeStringILi64EEEE3ptrEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e390 size: 8 label: _ZN2al9ParameterIN4sead15FixedSafeStringILi64EEEE3ptrEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e398 size: 8 label: _ZNK2al9ParameterIN4sead15FixedSafeStringILi64EEEE4sizeEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e3a0 size: 8 label: _ZNK2al9ParameterIN4sead15FixedSafeStringILi64EEEE15getParamTypeStrEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x89e3a8 size: 8 label: _ZNK2al9ParameterIN4sead15FixedSafeStringILi64EEEE12getParamTypeEv - status: NotDecompiled + status: Matching lazy: true Library/Fluid/RippleFixMapParts.o: '.text': @@ -265007,23 +265007,23 @@ Library/Model/SkyDirector.o: label: - _ZN2al8SkyParamC1Ev - _ZN2al8SkyParamC2Ev - status: NotDecompiled + status: NonMatchingMajor - offset: 0x950c3c size: 188 label: _ZNK2al8SkyParam7isEqualERKNS_16IUseRequestParamE - status: NotDecompiled + status: Matching - offset: 0x950cf8 size: 12 label: _ZNK2al8SkyParam9getRotateEv - status: NotDecompiled + status: Matching - offset: 0x950d04 size: 48 label: _ZNK2al8SkyParam10getSkyNameEv - status: NotDecompiled + status: Matching - offset: 0x950d34 size: 12 label: _ZNK2al8SkyParam16getStarIntensityEv - status: NotDecompiled + status: Matching - offset: 0x950d40 size: 320 label: @@ -265077,17 +265077,17 @@ Library/Model/SkyDirector.o: - offset: 0x951398 size: 12 label: _ZNK2al8SkyParam12getParamNameEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x9513a4 size: 8 label: _ZN2al8SkyParam11getParamObjEv - status: NotDecompiled + status: Matching lazy: true - offset: 0x9513ac size: 8 label: _ZNK2al8SkyParam11getParamObjEv - status: NotDecompiled + status: Matching lazy: true Library/Model/SubMeshRangeArray.o: '.text': @@ -291364,15 +291364,15 @@ Project/Base/ParamRequestInterp.o: - offset: 0xa45558 size: 104 label: _ZNK2al16IUseRequestParam7isEqualERKS0_ - status: NotDecompiled + status: Matching - offset: 0xa455c0 size: 104 label: _ZN2al16IUseRequestParam4copyERKS0_ - status: NotDecompiled + status: Matching - offset: 0xa45628 size: 164 label: _ZN2al16IUseRequestParam10copyInterpERKS0_S2_f - status: NotDecompiled + status: Matching - offset: 0xa456cc size: 44 label: diff --git a/lib/al/Library/Model/SkyDirector.cpp b/lib/al/Library/Model/SkyDirector.cpp new file mode 100644 index 0000000000..ca2e3b3da1 --- /dev/null +++ b/lib/al/Library/Model/SkyDirector.cpp @@ -0,0 +1,43 @@ +#include "Library/Model/SkyDirector.h" + +#include "Library/Base/StringUtil.h" +#include "Library/Math/MathUtil.h" +#include "Library/Yaml/ParameterBase.h" + +namespace al { + +// NON-MATCHING: Stack mismatch https://decomp.me/scratch/uG8AT +SkyParam::SkyParam() { + mParameterObj = new ParameterObj(); + + mSkyName = new ParameterString64(StringTmp<64>("RSGraphicTestSkyBlue"), mParameterObj, "Name", + "空のモデル名", "", true); + + mRotate = new ParameterV3f({0.0f, 0.0f, 0.0f}, mParameterObj, "Rotate", "回転", + "Min=-360.0f, Max=360.0f", true); + + mStarIntensity = new ParameterF32(0.0f, mParameterObj, "StarIntensity", "星の明るさ", + "Min=0.0f, Max=100.0f", true); +} + +bool SkyParam::isEqual(const IUseRequestParam& other) const { + const SkyParam* param = static_cast(&other); + + return isNear(getRotate(), param->getRotate()) && + isEqualString(getSkyName(), param->getSkyName()) && + isNear(getStarIntensity(), param->getStarIntensity()); +} + +const sead::Vector3f& SkyParam::getRotate() const { + return mRotate->getValue(); +} + +const char* SkyParam::getSkyName() const { + return mSkyName->getValue().cstr(); +} + +f32 SkyParam::getStarIntensity() const { + return mStarIntensity->getValue(); +} + +} // namespace al diff --git a/lib/al/Library/Model/SkyDirector.h b/lib/al/Library/Model/SkyDirector.h index 154bdcecf5..8f462325d0 100644 --- a/lib/al/Library/Model/SkyDirector.h +++ b/lib/al/Library/Model/SkyDirector.h @@ -2,13 +2,45 @@ #include #include +#include #include +#include "Project/Base/ParamRequestInterp.h" + namespace al { struct ActorInitInfo; class SkyParam; class Sky; class ParamRequestInterp; +class ParameterObj; +class ParameterString64; +class ParameterV3f; +class ParameterF32; + +class SkyParam : public IUseRequestParam { +public: + SkyParam(); + + const char* getParamName() const override { return "空"; } + + ParameterObj* getParamObj() override { return mParameterObj; } + + const ParameterObj* getParamObj() const override { return mParameterObj; } + + bool isEqual(const IUseRequestParam& other) const override; + + const sead::Vector3f& getRotate() const; + const char* getSkyName() const; + f32 getStarIntensity() const; + +private: + ParameterObj* mParameterObj; + ParameterString64* mSkyName; + ParameterV3f* mRotate; + ParameterF32* mStarIntensity; +}; + +static_assert(sizeof(SkyParam) == 0x28); class SkyDirector { public: diff --git a/lib/al/Library/Yaml/ParameterBase.h b/lib/al/Library/Yaml/ParameterBase.h index 904ec677dc..f7162a9cdf 100644 --- a/lib/al/Library/Yaml/ParameterBase.h +++ b/lib/al/Library/Yaml/ParameterBase.h @@ -45,6 +45,10 @@ SEAD_ENUM(YamlParamType, ParameterObj* obj, bool e) \ : Parameter(value, name, label, meta, obj, e) {} \ \ + Parameter##Name(Type const& value, ParameterObj* obj, const sead::SafeString& name, \ + const sead::SafeString& label, const sead::SafeString& meta, bool e) \ + : Parameter(value, name, label, meta, obj, e) {} \ + \ Parameter##Name(Type const& value, const sead::SafeString& name, \ const sead::SafeString& label, const sead::SafeString& meta, \ ParameterList* list, bool e) \ diff --git a/lib/al/Project/Base/ParamRequestInterp.cpp b/lib/al/Project/Base/ParamRequestInterp.cpp new file mode 100644 index 0000000000..6abb7fb8dc --- /dev/null +++ b/lib/al/Project/Base/ParamRequestInterp.cpp @@ -0,0 +1,29 @@ +#include "Project/Base/ParamRequestInterp.h" + +#include "Library/Yaml/ParameterBase.h" + +namespace al { + +bool IUseRequestParam::isEqual(const IUseRequestParam& requestParam) const { + if (!getParamObj()) + return false; + + return getParamObj()->isEqual(*requestParam.getParamObj()); +} + +void IUseRequestParam::copy(const IUseRequestParam& requestParam) { + if (!getParamObj()) + return; + + getParamObj()->copy(*requestParam.getParamObj()); +} + +void IUseRequestParam::copyInterp(const IUseRequestParam& requestParamStart, + const IUseRequestParam& requestParamEnd, f32 rate) { + if (!getParamObj()) + return; + + getParamObj()->copyLerp(*requestParamStart.getParamObj(), *requestParamEnd.getParamObj(), rate); +} + +} // namespace al diff --git a/lib/al/Project/Base/ParamRequestInterp.h b/lib/al/Project/Base/ParamRequestInterp.h new file mode 100644 index 0000000000..19996f1c93 --- /dev/null +++ b/lib/al/Project/Base/ParamRequestInterp.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +namespace al { +class ParameterObj; + +class IUseRequestParam { +public: + virtual const char* getParamName() const = 0; + virtual ParameterObj* getParamObj() = 0; + virtual const ParameterObj* getParamObj() const = 0; + virtual bool isEqual(const IUseRequestParam& requestParam) const; + virtual void copy(const IUseRequestParam& requestParam); + virtual void copyInterp(const IUseRequestParam& requestParamStart, + const IUseRequestParam& requestParamEnd, f32 rate); +}; + +static_assert(sizeof(IUseRequestParam) == 0x8); + +} // namespace al