summaryrefslogtreecommitdiff
path: root/src/KingSystem
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2020-11-08 15:51:44 +0100
committerLéo Lam <leo@leolam.fr>2020-11-08 16:17:44 +0100
commita9ec880f2ef182947bb1bf037a3e388f1f466a86 (patch)
tree58453ce275df02bdd2b1168039ee49861a44be13 /src/KingSystem
parentaa92bf882c41b292a9ee11b6ec5ba8593b4b4fc2 (diff)
ksys/act: Fix ActorParamMgr struct and add ASSetting stub
Diffstat (limited to 'src/KingSystem')
-rw-r--r--src/KingSystem/ActorSystem/CMakeLists.txt1
-rw-r--r--src/KingSystem/ActorSystem/actASSetting.cpp1
-rw-r--r--src/KingSystem/ActorSystem/actASSetting.h12
-rw-r--r--src/KingSystem/ActorSystem/actActorParamMgr.cpp14
-rw-r--r--src/KingSystem/ActorSystem/actActorParamMgr.h33
-rw-r--r--src/KingSystem/GameData/gdtManager.h12
-rw-r--r--src/KingSystem/System/DebugMessage.h30
-rw-r--r--src/KingSystem/System/KingEditor.h5
8 files changed, 96 insertions, 12 deletions
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 <heap/seadDisposer.h>
+
+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 <container/seadSafeArray.h>
#include <heap/seadDisposer.h>
+#include <hostio/seadHostIONode.h>
+#include <thread/seadCriticalSection.h>
+#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<res::Handle, 28> 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 <basis/seadTypes.h>
+#include <gfx/seadColor.h>
+#include <prim/seadSafeString.h>
+#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