AutoDim decompiled

This commit is contained in:
theo3
2021-06-24 23:50:52 -07:00
parent 24cc84add7
commit d12508cfce
4 changed files with 48 additions and 5 deletions
+22
View File
@@ -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
+19
View File
@@ -0,0 +1,19 @@
#include <heap/seadDisposer.h>
#include <thread/seadCriticalSection.h>
namespace ksys {
class AutoDim {
SEAD_SINGLETON_DISPOSER(AutoDim)
AutoDim() = default;
public:
void setEnabled(bool enable);
bool isEnabled() const;
private:
bool mEnabled = true;
sead::CriticalSection mCS{};
};
} // namespace ksys
+2
View File
@@ -1,6 +1,8 @@
target_sources(uking PRIVATE
Account.cpp
Account.h
AutoDim.cpp
AutoDim.h
BasicProfiler.cpp
BasicProfiler.h
CameraEditor.cpp