summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Savage <savage13@gmail.com>2021-12-31 09:39:42 -0500
committerLéo Lam <leo@leolam.fr>2021-12-31 19:16:24 +0100
commit0542fa53b51af9359cbdf7c58df031edf4a17b31 (patch)
tree71509285597b61b6d86c2663ebc479008cf9540e /src
parent0e1500b6f849e1a808d1a6d5923439907a120c38 (diff)
Add ksysDebugInput Singleton
Diffstat (limited to 'src')
-rw-r--r--src/KingSystem/CMakeLists.txt2
-rw-r--r--src/KingSystem/ksysDebugInput.cpp17
-rw-r--r--src/KingSystem/ksysDebugInput.h21
3 files changed, 40 insertions, 0 deletions
diff --git a/src/KingSystem/CMakeLists.txt b/src/KingSystem/CMakeLists.txt
index 9c40f3ff..550bad89 100644
--- a/src/KingSystem/CMakeLists.txt
+++ b/src/KingSystem/CMakeLists.txt
@@ -24,4 +24,6 @@ add_subdirectory(XLink)
target_sources(uking PRIVATE
ksys.cpp
ksys.h
+ ksysDebugInput.cpp
+ ksysDebugInput.h
)
diff --git a/src/KingSystem/ksysDebugInput.cpp b/src/KingSystem/ksysDebugInput.cpp
new file mode 100644
index 00000000..b1af1435
--- /dev/null
+++ b/src/KingSystem/ksysDebugInput.cpp
@@ -0,0 +1,17 @@
+#include "KingSystem/ksysDebugInput.h"
+#include "KingSystem/System/VFR.h"
+
+namespace ksys {
+
+SEAD_SINGLETON_DISPOSER_IMPL(DebugInput)
+
+void DebugInput::update() {
+ if (mFlags.isOnBit(0)) {
+ mLastDelta += VFR::instance()->getDeltaTime();
+ while (mLastDelta > 30.0) {
+ mLastDelta -= 30.0;
+ }
+ }
+}
+
+} // namespace ksys
diff --git a/src/KingSystem/ksysDebugInput.h b/src/KingSystem/ksysDebugInput.h
new file mode 100644
index 00000000..bdf67465
--- /dev/null
+++ b/src/KingSystem/ksysDebugInput.h
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <heap/seadDisposer.h>
+#include <prim/seadTypedBitFlag.h>
+
+namespace ksys {
+
+class DebugInput {
+ SEAD_SINGLETON_DISPOSER(DebugInput)
+
+public:
+ DebugInput() = default;
+ virtual ~DebugInput() = default;
+ void update();
+
+private:
+ sead::BitFlag8 mFlags;
+ float mLastDelta = 0;
+};
+
+} // namespace ksys