From 44556dc21ac5609e5c60334347baa60701d056b3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 18 May 2021 03:59:41 -0400 Subject: hid/gesture: Factor out last gesture retrieval into its own function Deduplicates a commonly repeated expression. --- src/core/hle/service/hid/controllers/gesture.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/core/hle/service/hid/controllers/gesture.h') diff --git a/src/core/hle/service/hid/controllers/gesture.h b/src/core/hle/service/hid/controllers/gesture.h index c1578ec25..eecfeaad5 100644 --- a/src/core/hle/service/hid/controllers/gesture.h +++ b/src/core/hle/service/hid/controllers/gesture.h @@ -162,7 +162,11 @@ private: TouchType& type); // Returns an unused finger id, if there is no fingers available std::nullopt is returned. - std::optional GetUnusedFingerID() const; + [[nodiscard]] std::optional GetUnusedFingerID() const; + + // Retrieves the last gesture entry, as indicated by shared memory indices. + [[nodiscard]] GestureState& GetLastGestureEntry(); + [[nodiscard]] const GestureState& GetLastGestureEntry() const; /** * If the touch is new it tries to assign a new finger id, if there is no fingers available no -- cgit v1.2.3