summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-03-12 16:22:42 +0100
committerLéo Lam <leo@leolam.fr>2021-03-12 16:33:56 +0100
commit8e868dc2c35fea57c0722bc8d500424f647bd515 (patch)
treee66948dcc315a1c433195a233ff08425b43a1a88 /src
parent107121ad450ca8a1aee241ee46d4a11a71dc94c0 (diff)
ksys: Add HavokWorkerMgr stub
Diffstat (limited to 'src')
-rw-r--r--src/KingSystem/System/CMakeLists.txt2
-rw-r--r--src/KingSystem/System/HavokWorkerMgr.cpp13
-rw-r--r--src/KingSystem/System/HavokWorkerMgr.h23
3 files changed, 38 insertions, 0 deletions
diff --git a/src/KingSystem/System/CMakeLists.txt b/src/KingSystem/System/CMakeLists.txt
index 0c883f05..acf93ce8 100644
--- a/src/KingSystem/System/CMakeLists.txt
+++ b/src/KingSystem/System/CMakeLists.txt
@@ -2,6 +2,8 @@ target_sources(uking PRIVATE
Account.cpp
Account.h
DebugMessage.h
+ HavokWorkerMgr.cpp
+ HavokWorkerMgr.h
KingEditor.h
OverlayArena.cpp
OverlayArena.h
diff --git a/src/KingSystem/System/HavokWorkerMgr.cpp b/src/KingSystem/System/HavokWorkerMgr.cpp
new file mode 100644
index 00000000..55fdba90
--- /dev/null
+++ b/src/KingSystem/System/HavokWorkerMgr.cpp
@@ -0,0 +1,13 @@
+#include "KingSystem/System/HavokWorkerMgr.h"
+
+namespace ksys {
+
+SEAD_SINGLETON_DISPOSER_IMPL(HavokWorkerMgr)
+
+HavokWorkerMgr::~HavokWorkerMgr() = default;
+
+u32 HavokWorkerMgr::getWorkerThreadId(int idx) const {
+ return mWorkers[idx]->getId();
+}
+
+} // namespace ksys
diff --git a/src/KingSystem/System/HavokWorkerMgr.h b/src/KingSystem/System/HavokWorkerMgr.h
new file mode 100644
index 00000000..332b0b5f
--- /dev/null
+++ b/src/KingSystem/System/HavokWorkerMgr.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <heap/seadDisposer.h>
+#include <mc/seadWorkerMgr.h>
+#include "KingSystem/Utils/Types.h"
+
+namespace ksys {
+
+class HavokWorkerMgr : public sead::WorkerMgr {
+ SEAD_SINGLETON_DISPOSER(HavokWorkerMgr)
+ HavokWorkerMgr() = default;
+ ~HavokWorkerMgr() override;
+
+public:
+ // TODO: implement. This is almost exactly the same as sead::WorkerMgr::initialize
+ // but with a custom Worker class that calls out to Havok.
+ void initialize(const InitializeArg& arg) override;
+
+ u32 getWorkerThreadId(int idx) const;
+};
+KSYS_CHECK_SIZE_NX150(HavokWorkerMgr, 0xd8);
+
+} // namespace ksys