aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/hid/controllers/gesture.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2021-05-16 01:46:30 -0400
committerLioncash <mathew1800@gmail.com>2021-05-16 03:43:16 -0400
commit9a07ed53ebe4e27ef1a14e0469037cab9fb7b1e7 (patch)
tree54d6c5a6b319a10522b068caf2b0600c8f27876a /src/core/hle/service/hid/controllers/gesture.h
parent06c410ee882885e67260b963c3b86f4cf3c7de98 (diff)
core: Make variable shadowing a compile-time error
Now that we have most of core free of shadowing, we can enable the warning as an error to catch anything that may be remaining and also eliminate this class of logic bug entirely.
Diffstat (limited to 'src/core/hle/service/hid/controllers/gesture.h')
-rw-r--r--src/core/hle/service/hid/controllers/gesture.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/core/hle/service/hid/controllers/gesture.h b/src/core/hle/service/hid/controllers/gesture.h
index 18110a6ad..f46e29411 100644
--- a/src/core/hle/service/hid/controllers/gesture.h
+++ b/src/core/hle/service/hid/controllers/gesture.h
@@ -128,32 +128,34 @@ private:
void UpdateExistingGesture(GestureProperties& gesture, TouchType& type, f32 time_difference);
// Terminates exiting gesture
- void EndGesture(GestureProperties& gesture, GestureProperties& last_gesture, TouchType& type,
- Attribute& attributes, f32 time_difference);
+ void EndGesture(GestureProperties& gesture, GestureProperties& last_gesture_props,
+ TouchType& type, Attribute& attributes, f32 time_difference);
// Set current event to a tap event
- void SetTapEvent(GestureProperties& gesture, GestureProperties& last_gesture, TouchType& type,
- Attribute& attributes);
+ void SetTapEvent(GestureProperties& gesture, GestureProperties& last_gesture_props,
+ TouchType& type, Attribute& attributes);
// Calculates and set the extra parameters related to a pan event
- void UpdatePanEvent(GestureProperties& gesture, GestureProperties& last_gesture,
+ void UpdatePanEvent(GestureProperties& gesture, GestureProperties& last_gesture_props,
TouchType& type, f32 time_difference);
// Terminates the pan event
- void EndPanEvent(GestureProperties& gesture, GestureProperties& last_gesture, TouchType& type,
- f32 time_difference);
+ void EndPanEvent(GestureProperties& gesture, GestureProperties& last_gesture_props,
+ TouchType& type, f32 time_difference);
// Set current event to a swipe event
- void SetSwipeEvent(GestureProperties& gesture, GestureProperties& last_gesture,
+ void SetSwipeEvent(GestureProperties& gesture, GestureProperties& last_gesture_props,
TouchType& type);
- // Returns an unused finger id, if there is no fingers avaliable MAX_FINGERS will be returned
+ // Returns an unused finger id, if there is no fingers available std::nullopt is returned.
std::optional<size_t> GetUnusedFingerID() const;
- /** If the touch is new it tries to assing a new finger id, if there is no fingers avaliable no
+ /**
+ * If the touch is new it tries to assign a new finger id, if there is no fingers available no
* changes will be made. Updates the coordinates if the finger id it's already set. If the touch
* ends delays the output by one frame to set the end_touch flag before finally freeing the
- * finger id */
+ * finger id
+ */
size_t UpdateTouchInputEvent(const std::tuple<float, float, bool>& touch_input,
size_t finger_id);