diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 6c5f1e74..2e0bf207 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -88753,12 +88753,12 @@ 0x0000007101167dc0,sub_7101167DC0,76, 0x0000007101167e0c,sub_7101167E0C,124, 0x0000007101167e88,sub_7101167E88,140, -0x0000007101167f14,sub_7101167F14,152, -0x0000007101167fac,sub_7101167FAC,160, -0x000000710116804c,ActorParam::createInstance,136, -0x00000071011680d4,ActorParam::ctor,372, +0x0000007101167f14,sub_7101167F14,152,_ZN4ksys3act13ActorParamMgr18SingletonDisposer_D2Ev +0x0000007101167fac,sub_7101167FAC,160,_ZN4ksys3act13ActorParamMgr18SingletonDisposer_D0Ev +0x000000710116804c,ActorParam::createInstance,136,_ZN4ksys3act13ActorParamMgr14createInstanceEPN4sead4HeapE +0x00000071011680d4,ActorParam::ctor,372,_ZN4ksys3act13ActorParamMgrC1Ev 0x0000007101168248,ActorParam::init,6612, -0x0000007101169c1c,sub_7101169C1C,248, +0x0000007101169c1c,sub_7101169C1C,248,_ZN4sead9SafeArrayIN4ksys3res6HandleELi28EED2Ev 0x0000007101169d14,sub_7101169D14,8, 0x0000007101169d1c,sub_7101169D1C,316, 0x0000007101169e58,ActorParam::getLoad,620, diff --git a/src/KingSystem/ActorSystem/CMakeLists.txt b/src/KingSystem/ActorSystem/CMakeLists.txt index 3eb27a0f..f328738b 100644 --- a/src/KingSystem/ActorSystem/CMakeLists.txt +++ b/src/KingSystem/ActorSystem/CMakeLists.txt @@ -10,6 +10,7 @@ target_sources(uking PRIVATE actActorLinkConstDataAccess.h actActorParam.cpp actActorParam.h + actActorParamMgr.cpp actActorParamMgr.h actAiAction.cpp actAiAction.h diff --git a/src/KingSystem/ActorSystem/actASSetting.cpp b/src/KingSystem/ActorSystem/actASSetting.cpp new file mode 100644 index 00000000..1dff9658 --- /dev/null +++ b/src/KingSystem/ActorSystem/actASSetting.cpp @@ -0,0 +1 @@ +#include "KingSystem/ActorSystem/actASSetting.h" diff --git a/src/KingSystem/ActorSystem/actASSetting.h b/src/KingSystem/ActorSystem/actASSetting.h new file mode 100644 index 00000000..82d9873a --- /dev/null +++ b/src/KingSystem/ActorSystem/actASSetting.h @@ -0,0 +1,12 @@ +#pragma once + +#include + +namespace ksys::act { + +// FIXME: very incomplete +class ASSetting { + SEAD_SINGLETON_DISPOSER(ASSetting) +}; + +} // namespace ksys::act diff --git a/src/KingSystem/ActorSystem/actActorParamMgr.cpp b/src/KingSystem/ActorSystem/actActorParamMgr.cpp new file mode 100644 index 00000000..f4b3d5cb --- /dev/null +++ b/src/KingSystem/ActorSystem/actActorParamMgr.cpp @@ -0,0 +1,14 @@ +#include "KingSystem/ActorSystem/actActorParamMgr.h" +#include "KingSystem/ActorSystem/actASSetting.h" + +namespace ksys::act { + +SEAD_SINGLETON_DISPOSER_IMPL(ActorParamMgr) + +ActorParamMgr::ActorParamMgr() = default; + +ActorParamMgr::~ActorParamMgr() { + ASSetting::deleteInstance(); +} + +} // namespace ksys::act diff --git a/src/KingSystem/ActorSystem/actActorParamMgr.h b/src/KingSystem/ActorSystem/actActorParamMgr.h index df1e5cac..4ec7ee52 100644 --- a/src/KingSystem/ActorSystem/actActorParamMgr.h +++ b/src/KingSystem/ActorSystem/actActorParamMgr.h @@ -1,6 +1,13 @@ #pragma once +#include #include +#include +#include +#include "KingSystem/Resource/resHandle.h" +#include "KingSystem/System/DebugMessage.h" +#include "KingSystem/System/KingEditor.h" +#include "KingSystem/Utils/Types.h" namespace ksys { @@ -10,14 +17,38 @@ class GParamList; namespace act { +class ActorParam; + // FIXME: incomplete -class ActorParamMgr { +class ActorParamMgr final : public sead::hostio::Node, public KingEditorComponent { SEAD_SINGLETON_DISPOSER(ActorParamMgr) + ActorParamMgr(); + ~ActorParamMgr(); + public: + const char* getName() const override { return "AglXml"; } + void syncData(const char* data) override; + void init(sead::Heap* heap, sead::Heap* debug_heap); res::GParamList* getDummyGParamList() const; + + DebugMessage& getDebugMessage() { return mDebugMessage; } + sead::Heap* getDebugHeap() const { return mDebugHeap; } + sead::Heap* getTmpActorParamMgrHeap() const { return mTmpActorParamMgrHeap; } + +private: + u8 mFlags{}; + ActorParam* mParams = nullptr; + DebugMessage mDebugMessage{"アクタパラメータ"}; + void* _e0 = nullptr; + void* _e8 = nullptr; + sead::Heap* mDebugHeap = nullptr; + sead::Heap* mTmpActorParamMgrHeap = nullptr; + sead::SafeArray mResHandles; + sead::CriticalSection mCS; }; +KSYS_CHECK_SIZE_NX150(ActorParamMgr, 0xa00); } // namespace act diff --git a/src/KingSystem/GameData/gdtManager.h b/src/KingSystem/GameData/gdtManager.h index 4637c260..093f4f9c 100644 --- a/src/KingSystem/GameData/gdtManager.h +++ b/src/KingSystem/GameData/gdtManager.h @@ -153,20 +153,12 @@ public: inline IManager::~IManager() = default; -/// GameDataMgr communication. -class ManagerCom : public KingEditorComponent { -public: - void* _8 = nullptr; - void* _10 = nullptr; -}; -KSYS_CHECK_SIZE_NX150(ManagerCom, 0x18); - -class Manager : public IManager, public ManagerCom { +class Manager : public IManager, public KingEditorComponent { SEAD_SINGLETON_DISPOSER(Manager) Manager(); ~Manager() override; const char* getName() const override { return "GameData"; } - void syncData() override; + void syncData(const char* data) override; public: struct ResetEvent { diff --git a/src/KingSystem/System/DebugMessage.h b/src/KingSystem/System/DebugMessage.h new file mode 100644 index 00000000..96ab60da --- /dev/null +++ b/src/KingSystem/System/DebugMessage.h @@ -0,0 +1,30 @@ +#pragma once + +#include +#include +#include +#include "KingSystem/Utils/Types.h" + +namespace ksys { + +struct DebugMessage { + DebugMessage() = default; + explicit DebugMessage(const sead::SafeString& msg) : message(msg) {} + + virtual ~DebugMessage() { ; } + + void log(const char* format, ...); + + u64 _8 = 0; + sead::FixedSafeString<64> message; + sead::Color4f color = sead::Color4f::cWhite; + f32 _78 = 0.3; + f32 _7c = 0.3; + f32 _80 = 0.3; + f32 _84 = 0.8; + bool _88 = true; + bool _89 = true; +}; +KSYS_CHECK_SIZE_NX150(DebugMessage, 0x90); + +} // namespace ksys diff --git a/src/KingSystem/System/KingEditor.h b/src/KingSystem/System/KingEditor.h index 45404ca9..2b103d2f 100644 --- a/src/KingSystem/System/KingEditor.h +++ b/src/KingSystem/System/KingEditor.h @@ -7,7 +7,10 @@ namespace ksys { class KingEditorComponent { public: virtual const char* getName() const = 0; - virtual void syncData() = 0; + virtual void syncData(const char* data) = 0; + + void* _8 = nullptr; + void* _10 = nullptr; }; // FIXME