diff options
| author | 2021-10-30 22:23:10 -0500 | |
|---|---|---|
| committer | 2021-11-24 20:30:26 -0600 | |
| commit | 2b1b0c2a30e242b08ec120e09803ec54d5445703 (patch) | |
| tree | 9a10400a7e4403b288eee3aae8a52f1d5be912de /src/core/hid/emulated_console.cpp | |
| parent | input_common: Revert deleted TAS functions (diff) | |
| download | yuzu-2b1b0c2a30e242b08ec120e09803ec54d5445703.tar.gz yuzu-2b1b0c2a30e242b08ec120e09803ec54d5445703.tar.xz yuzu-2b1b0c2a30e242b08ec120e09803ec54d5445703.zip | |
kraken: Address comments from review
start lion review
Diffstat (limited to 'src/core/hid/emulated_console.cpp')
| -rw-r--r-- | src/core/hid/emulated_console.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/hid/emulated_console.cpp b/src/core/hid/emulated_console.cpp index d1d4a5355..c259de0f1 100644 --- a/src/core/hid/emulated_console.cpp +++ b/src/core/hid/emulated_console.cpp | |||
| @@ -55,21 +55,21 @@ void EmulatedConsole::SetTouchParams() { | |||
| 55 | 55 | ||
| 56 | void EmulatedConsole::ReloadInput() { | 56 | void EmulatedConsole::ReloadInput() { |
| 57 | SetTouchParams(); | 57 | SetTouchParams(); |
| 58 | motion_devices = Input::CreateDevice<Input::InputDevice>(motion_params); | 58 | motion_devices = Common::Input::CreateDevice<Common::Input::InputDevice>(motion_params); |
| 59 | if (motion_devices) { | 59 | if (motion_devices) { |
| 60 | Input::InputCallback motion_callback{ | 60 | Common::Input::InputCallback motion_callback{ |
| 61 | [this](Input::CallbackStatus callback) { SetMotion(callback); }}; | 61 | [this](Common::Input::CallbackStatus callback) { SetMotion(callback); }}; |
| 62 | motion_devices->SetCallback(motion_callback); | 62 | motion_devices->SetCallback(motion_callback); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | std::size_t index = 0; | 65 | std::size_t index = 0; |
| 66 | for (auto& touch_device : touch_devices) { | 66 | for (auto& touch_device : touch_devices) { |
| 67 | touch_device = Input::CreateDevice<Input::InputDevice>(touch_params[index]); | 67 | touch_device = Common::Input::CreateDevice<Common::Input::InputDevice>(touch_params[index]); |
| 68 | if (!touch_device) { | 68 | if (!touch_device) { |
| 69 | continue; | 69 | continue; |
| 70 | } | 70 | } |
| 71 | Input::InputCallback touch_callback{ | 71 | Common::Input::InputCallback touch_callback{ |
| 72 | [this, index](Input::CallbackStatus callback) { SetTouch(callback, index); }}; | 72 | [this, index](Common::Input::CallbackStatus callback) { SetTouch(callback, index); }}; |
| 73 | touch_device->SetCallback(touch_callback); | 73 | touch_device->SetCallback(touch_callback); |
| 74 | index++; | 74 | index++; |
| 75 | } | 75 | } |
| @@ -117,7 +117,7 @@ void EmulatedConsole::SetMotionParam(Common::ParamPackage param) { | |||
| 117 | ReloadInput(); | 117 | ReloadInput(); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | void EmulatedConsole::SetMotion(Input::CallbackStatus callback) { | 120 | void EmulatedConsole::SetMotion(Common::Input::CallbackStatus callback) { |
| 121 | std::lock_guard lock{mutex}; | 121 | std::lock_guard lock{mutex}; |
| 122 | auto& raw_status = console.motion_values.raw_status; | 122 | auto& raw_status = console.motion_values.raw_status; |
| 123 | auto& emulated = console.motion_values.emulated; | 123 | auto& emulated = console.motion_values.emulated; |
| @@ -152,7 +152,8 @@ void EmulatedConsole::SetMotion(Input::CallbackStatus callback) { | |||
| 152 | TriggerOnChange(ConsoleTriggerType::Motion); | 152 | TriggerOnChange(ConsoleTriggerType::Motion); |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | void EmulatedConsole::SetTouch(Input::CallbackStatus callback, [[maybe_unused]] std::size_t index) { | 155 | void EmulatedConsole::SetTouch(Common::Input::CallbackStatus callback, |
| 156 | [[maybe_unused]] std::size_t index) { | ||
| 156 | if (index >= console.touch_values.size()) { | 157 | if (index >= console.touch_values.size()) { |
| 157 | return; | 158 | return; |
| 158 | } | 159 | } |