diff options
| author | 2022-02-06 18:20:12 -0600 | |
|---|---|---|
| committer | 2022-02-06 18:33:55 -0600 | |
| commit | 21742f00961308fedb35cf38261afba3c1682853 (patch) | |
| tree | a130ab5b3d1a214e546227edf448a14e0be01081 /src/input_common/input_engine.cpp | |
| parent | Merge pull request #7847 from tech-ticks/master (diff) | |
| download | yuzu-21742f00961308fedb35cf38261afba3c1682853.tar.gz yuzu-21742f00961308fedb35cf38261afba3c1682853.tar.xz yuzu-21742f00961308fedb35cf38261afba3c1682853.zip | |
input_common: Remove battery duplicated struct and update every button press
Diffstat (limited to 'src/input_common/input_engine.cpp')
| -rw-r--r-- | src/input_common/input_engine.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/input_common/input_engine.cpp b/src/input_common/input_engine.cpp index 0508b408d..0d6de9e6a 100644 --- a/src/input_common/input_engine.cpp +++ b/src/input_common/input_engine.cpp | |||
| @@ -70,7 +70,7 @@ void InputEngine::SetAxis(const PadIdentifier& identifier, int axis, f32 value) | |||
| 70 | TriggerOnAxisChange(identifier, axis, value); | 70 | TriggerOnAxisChange(identifier, axis, value); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | void InputEngine::SetBattery(const PadIdentifier& identifier, BatteryLevel value) { | 73 | void InputEngine::SetBattery(const PadIdentifier& identifier, Common::Input::BatteryLevel value) { |
| 74 | { | 74 | { |
| 75 | std::lock_guard lock{mutex}; | 75 | std::lock_guard lock{mutex}; |
| 76 | ControllerData& controller = controller_list.at(identifier); | 76 | ControllerData& controller = controller_list.at(identifier); |
| @@ -143,13 +143,13 @@ f32 InputEngine::GetAxis(const PadIdentifier& identifier, int axis) const { | |||
| 143 | return axis_iter->second; | 143 | return axis_iter->second; |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | BatteryLevel InputEngine::GetBattery(const PadIdentifier& identifier) const { | 146 | Common::Input::BatteryLevel InputEngine::GetBattery(const PadIdentifier& identifier) const { |
| 147 | std::lock_guard lock{mutex}; | 147 | std::lock_guard lock{mutex}; |
| 148 | const auto controller_iter = controller_list.find(identifier); | 148 | const auto controller_iter = controller_list.find(identifier); |
| 149 | if (controller_iter == controller_list.cend()) { | 149 | if (controller_iter == controller_list.cend()) { |
| 150 | LOG_ERROR(Input, "Invalid identifier guid={}, pad={}, port={}", identifier.guid.Format(), | 150 | LOG_ERROR(Input, "Invalid identifier guid={}, pad={}, port={}", identifier.guid.Format(), |
| 151 | identifier.pad, identifier.port); | 151 | identifier.pad, identifier.port); |
| 152 | return BatteryLevel::Charging; | 152 | return Common::Input::BatteryLevel::Charging; |
| 153 | } | 153 | } |
| 154 | const ControllerData& controller = controller_iter->second; | 154 | const ControllerData& controller = controller_iter->second; |
| 155 | return controller.battery; | 155 | return controller.battery; |
| @@ -270,7 +270,7 @@ void InputEngine::TriggerOnAxisChange(const PadIdentifier& identifier, int axis, | |||
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | void InputEngine::TriggerOnBatteryChange(const PadIdentifier& identifier, | 272 | void InputEngine::TriggerOnBatteryChange(const PadIdentifier& identifier, |
| 273 | [[maybe_unused]] BatteryLevel value) { | 273 | [[maybe_unused]] Common::Input::BatteryLevel value) { |
| 274 | std::lock_guard lock{mutex_callback}; | 274 | std::lock_guard lock{mutex_callback}; |
| 275 | for (const auto& poller_pair : callback_list) { | 275 | for (const auto& poller_pair : callback_list) { |
| 276 | const InputIdentifier& poller = poller_pair.second; | 276 | const InputIdentifier& poller = poller_pair.second; |