diff options
author | Lioncash <mathew1800@gmail.com> | 2021-05-17 21:10:59 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2021-05-18 09:32:42 +0200 |
commit | 20699e90fac3195ab1b5d39793b48a5238a5ebc3 (patch) | |
tree | fdf819fa479c8f3c999b3058109acef850f0b3f4 /src/core | |
parent | hid/gesture: Add default comparators to Point (diff) | |
download | yuzu-20699e90fac3195ab1b5d39793b48a5238a5ebc3.tar yuzu-20699e90fac3195ab1b5d39793b48a5238a5ebc3.tar.gz yuzu-20699e90fac3195ab1b5d39793b48a5238a5ebc3.tar.bz2 yuzu-20699e90fac3195ab1b5d39793b48a5238a5ebc3.tar.lz yuzu-20699e90fac3195ab1b5d39793b48a5238a5ebc3.tar.xz yuzu-20699e90fac3195ab1b5d39793b48a5238a5ebc3.tar.zst yuzu-20699e90fac3195ab1b5d39793b48a5238a5ebc3.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/hid/controllers/gesture.cpp | 7 | ||||
-rw-r--r-- | src/core/hle/service/hid/controllers/gesture.h | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp index 07b3a6095..86e9f4ea8 100644 --- a/src/core/hle/service/hid/controllers/gesture.cpp +++ b/src/core/hle/service/hid/controllers/gesture.cpp @@ -145,8 +145,7 @@ void Controller_Gesture::UpdateGestureSharedMemory(u8* data, std::size_t size, cur_entry.detection_count = gesture.detection_count; cur_entry.type = type; cur_entry.attributes = attributes; - cur_entry.x = gesture.mid_point.x; - cur_entry.y = gesture.mid_point.y; + cur_entry.pos = gesture.mid_point; cur_entry.point_count = static_cast<s32>(gesture.active_points); for (size_t id = 0; id < MAX_POINTS; id++) { cur_entry.points[id].x = gesture.points[id].x; @@ -262,8 +261,8 @@ void Controller_Gesture::UpdatePanEvent(GestureProperties& gesture, auto& cur_entry = shared_memory.gesture_states[shared_memory.header.last_entry_index]; const auto& last_entry = shared_memory.gesture_states[(shared_memory.header.last_entry_index + 16) % 17]; - cur_entry.delta_x = gesture.mid_point.x - last_entry.x; - cur_entry.delta_y = gesture.mid_point.y - last_entry.y; + cur_entry.delta_x = gesture.mid_point.x - last_entry.pos.x; + cur_entry.delta_y = gesture.mid_point.y - last_entry.pos.y; cur_entry.vel_x = static_cast<f32>(cur_entry.delta_x) / time_difference; cur_entry.vel_y = static_cast<f32>(cur_entry.delta_y) / time_difference; diff --git a/src/core/hle/service/hid/controllers/gesture.h b/src/core/hle/service/hid/controllers/gesture.h index 619b6f3dc..809303131 100644 --- a/src/core/hle/service/hid/controllers/gesture.h +++ b/src/core/hle/service/hid/controllers/gesture.h @@ -77,8 +77,7 @@ private: s64_le detection_count; TouchType type; Direction direction; - s32_le x; - s32_le y; + Point pos; s32_le delta_x; s32_le delta_y; f32 vel_x; |