diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/hid/controllers/gesture.cpp | 11 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/gesture.h | 6 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp index d311f754b..07b3a6095 100644 --- a/src/core/hle/service/hid/controllers/gesture.cpp +++ b/src/core/hle/service/hid/controllers/gesture.cpp | |||
| @@ -91,8 +91,7 @@ bool Controller_Gesture::ShouldUpdateGesture(const GestureProperties& gesture, | |||
| 91 | 91 | ||
| 92 | // Update if coordinates change | 92 | // Update if coordinates change |
| 93 | for (size_t id = 0; id < MAX_POINTS; id++) { | 93 | for (size_t id = 0; id < MAX_POINTS; id++) { |
| 94 | if (gesture.points[id].x != last_gesture.points[id].x || | 94 | if (gesture.points[id] != last_gesture.points[id]) { |
| 95 | gesture.points[id].y != last_gesture.points[id].y) { | ||
| 96 | return true; | 95 | return true; |
| 97 | } | 96 | } |
| 98 | } | 97 | } |
| @@ -179,8 +178,7 @@ void Controller_Gesture::UpdateExistingGesture(GestureProperties& gesture, Touch | |||
| 179 | 178 | ||
| 180 | // Promote to pan type if touch moved | 179 | // Promote to pan type if touch moved |
| 181 | for (size_t id = 0; id < MAX_POINTS; id++) { | 180 | for (size_t id = 0; id < MAX_POINTS; id++) { |
| 182 | if (gesture.points[id].x != last_gesture.points[id].x || | 181 | if (gesture.points[id] != last_gesture.points[id]) { |
| 183 | gesture.points[id].y != last_gesture.points[id].y) { | ||
| 184 | type = TouchType::Pan; | 182 | type = TouchType::Pan; |
| 185 | break; | 183 | break; |
| 186 | } | 184 | } |
| @@ -192,10 +190,7 @@ void Controller_Gesture::UpdateExistingGesture(GestureProperties& gesture, Touch | |||
| 192 | enable_press_and_tap = false; | 190 | enable_press_and_tap = false; |
| 193 | gesture.active_points = 0; | 191 | gesture.active_points = 0; |
| 194 | gesture.mid_point = {}; | 192 | gesture.mid_point = {}; |
| 195 | for (size_t id = 0; id < MAX_POINTS; id++) { | 193 | gesture.points.fill({}); |
| 196 | gesture.points[id].x = 0; | ||
| 197 | gesture.points[id].y = 0; | ||
| 198 | } | ||
| 199 | return; | 194 | return; |
| 200 | } | 195 | } |
| 201 | 196 | ||
diff --git a/src/core/hle/service/hid/controllers/gesture.h b/src/core/hle/service/hid/controllers/gesture.h index 21123c46c..619b6f3dc 100644 --- a/src/core/hle/service/hid/controllers/gesture.h +++ b/src/core/hle/service/hid/controllers/gesture.h | |||
| @@ -64,8 +64,10 @@ private: | |||
| 64 | static_assert(sizeof(Attribute) == 4, "Attribute is an invalid size"); | 64 | static_assert(sizeof(Attribute) == 4, "Attribute is an invalid size"); |
| 65 | 65 | ||
| 66 | struct Point { | 66 | struct Point { |
| 67 | s32_le x; | 67 | s32_le x{}; |
| 68 | s32_le y; | 68 | s32_le y{}; |
| 69 | |||
| 70 | friend bool operator==(const Point&, const Point&) = default; | ||
| 69 | }; | 71 | }; |
| 70 | static_assert(sizeof(Point) == 8, "Point is an invalid size"); | 72 | static_assert(sizeof(Point) == 8, "Point is an invalid size"); |
| 71 | 73 | ||