diff options
author | german77 <juangerman-13@hotmail.com> | 2021-10-23 06:04:06 +0200 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2021-11-25 03:30:25 +0100 |
commit | b564f024f0be5023cf13fb2fca953ea6c1feeeb6 (patch) | |
tree | bb2fb272058a239a345856d4b34389791ea0a783 /src/core/hle/service/hid/controllers/gesture.cpp | |
parent | service/hid: Match shared memory closer to HW (diff) | |
download | yuzu-b564f024f0be5023cf13fb2fca953ea6c1feeeb6.tar yuzu-b564f024f0be5023cf13fb2fca953ea6c1feeeb6.tar.gz yuzu-b564f024f0be5023cf13fb2fca953ea6c1feeeb6.tar.bz2 yuzu-b564f024f0be5023cf13fb2fca953ea6c1feeeb6.tar.lz yuzu-b564f024f0be5023cf13fb2fca953ea6c1feeeb6.tar.xz yuzu-b564f024f0be5023cf13fb2fca953ea6c1feeeb6.tar.zst yuzu-b564f024f0be5023cf13fb2fca953ea6c1feeeb6.zip |
Diffstat (limited to 'src/core/hle/service/hid/controllers/gesture.cpp')
-rw-r--r-- | src/core/hle/service/hid/controllers/gesture.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp index a82d04b3b..7a7bc68a2 100644 --- a/src/core/hle/service/hid/controllers/gesture.cpp +++ b/src/core/hle/service/hid/controllers/gesture.cpp @@ -65,10 +65,7 @@ void Controller_Gesture::OnUpdate(const Core::Timing::CoreTiming& core_timing, u void Controller_Gesture::ReadTouchInput() { const auto touch_status = console->GetTouch(); for (std::size_t id = 0; id < fingers.size(); ++id) { - const Core::HID::TouchFinger& status = touch_status[id]; - Finger& finger = fingers[id]; - finger.pos = status.position; - finger.pressed = status.pressed; + fingers[id] = touch_status[id]; } } @@ -315,14 +312,14 @@ const Controller_Gesture::GestureState& Controller_Gesture::GetLastGestureEntry( Controller_Gesture::GestureProperties Controller_Gesture::GetGestureProperties() { GestureProperties gesture; - std::array<Finger, MAX_POINTS> active_fingers; + std::array<Core::HID::TouchFinger, MAX_POINTS> active_fingers; const auto end_iter = std::copy_if(fingers.begin(), fingers.end(), active_fingers.begin(), [](const auto& finger) { return finger.pressed; }); gesture.active_points = static_cast<std::size_t>(std::distance(active_fingers.begin(), end_iter)); for (size_t id = 0; id < gesture.active_points; ++id) { - const auto& [active_x, active_y] = active_fingers[id].pos; + const auto& [active_x, active_y] = active_fingers[id].position; gesture.points[id] = { .x = static_cast<s32>(active_x * Layout::ScreenUndocked::Width), .y = static_cast<s32>(active_y * Layout::ScreenUndocked::Height), |