Add ksysDebugInput Singleton

This commit is contained in:
Brian Savage
2021-12-31 09:39:42 -05:00
committed by Léo Lam
parent 0e1500b6f8
commit 0542fa53b5
4 changed files with 44 additions and 4 deletions
+2
View File
@@ -24,4 +24,6 @@ add_subdirectory(XLink)
target_sources(uking PRIVATE
ksys.cpp
ksys.h
ksysDebugInput.cpp
ksysDebugInput.h
)
+17
View File
@@ -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
+21
View File
@@ -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