summaryrefslogtreecommitdiff
path: root/src/KingSystem/System/AutoDim.cpp
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2021-06-24 23:50:52 -0700
committertheo3 <arisstephenson2@gmail.com>2021-06-25 20:29:11 -0700
commitd12508cfce49ca4bf620c688aea7f14f1e161ca7 (patch)
tree252ad40be49298c67c5c1e2ba970d3191a7a3e09 /src/KingSystem/System/AutoDim.cpp
parent24cc84add75663b733efa704e3d20e3f31b462a0 (diff)
AutoDim decompiled
Diffstat (limited to 'src/KingSystem/System/AutoDim.cpp')
-rw-r--r--src/KingSystem/System/AutoDim.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/KingSystem/System/AutoDim.cpp b/src/KingSystem/System/AutoDim.cpp
new file mode 100644
index 00000000..c222f790
--- /dev/null
+++ b/src/KingSystem/System/AutoDim.cpp
@@ -0,0 +1,22 @@
+#include "KingSystem/System/AutoDim.h"
+#include <nn/oe.h>
+#include <prim/seadScopedLock.h>
+
+namespace ksys {
+
+SEAD_SINGLETON_DISPOSER_IMPL(AutoDim)
+
+void AutoDim::setEnabled(bool enable) {
+ const auto lock = sead::makeScopedLock(mCS);
+ mEnabled = enable;
+ if (enable)
+ nn::oe::SetUserInactivityDetectionTimeExtended(false);
+ else
+ nn::oe::SetUserInactivityDetectionTimeExtended(true);
+}
+
+bool AutoDim::isEnabled() const {
+ return mEnabled;
+}
+
+} // namespace ksys