summaryrefslogtreecommitdiff
path: root/src/KingSystem/System/AutoDim.cpp
blob: c222f7901bc96ffd6110f5c90169e5d99d43659b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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