summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers/gesture.h
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-10-21 07:49:09 +0200
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-25 03:30:25 +0100
commit95cf66b6559c3e7a1eb40be919f16217566ffdbc (patch)
tree0219a3e9e5441bf696d38d693a5dba4bfa2e3672 /src/core/hle/service/hid/controllers/gesture.h
parentservice/hid: Fix gesture input (diff)
downloadyuzu-95cf66b6559c3e7a1eb40be919f16217566ffdbc.tar
yuzu-95cf66b6559c3e7a1eb40be919f16217566ffdbc.tar.gz
yuzu-95cf66b6559c3e7a1eb40be919f16217566ffdbc.tar.bz2
yuzu-95cf66b6559c3e7a1eb40be919f16217566ffdbc.tar.lz
yuzu-95cf66b6559c3e7a1eb40be919f16217566ffdbc.tar.xz
yuzu-95cf66b6559c3e7a1eb40be919f16217566ffdbc.tar.zst
yuzu-95cf66b6559c3e7a1eb40be919f16217566ffdbc.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/hid/controllers/gesture.h24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/core/hle/service/hid/controllers/gesture.h b/src/core/hle/service/hid/controllers/gesture.h
index 6128fb0ad..6f5abaa4f 100644
--- a/src/core/hle/service/hid/controllers/gesture.h
+++ b/src/core/hle/service/hid/controllers/gesture.h
@@ -71,7 +71,6 @@ private:
// This is nn::hid::GestureState
struct GestureState {
s64_le sampling_number;
- s64_le sampling_number2;
s64_le detection_count;
GestureType type;
GestureDirection direction;
@@ -85,21 +84,7 @@ private:
s32_le point_count;
std::array<Common::Point<s32_le>, 4> points;
};
- static_assert(sizeof(GestureState) == 0x68, "GestureState is an invalid size");
-
- struct CommonHeader {
- s64_le timestamp;
- s64_le total_entry_count;
- s64_le last_entry_index;
- s64_le entry_count;
- };
- static_assert(sizeof(CommonHeader) == 0x20, "CommonHeader is an invalid size");
-
- struct SharedMemory {
- CommonHeader header;
- std::array<GestureState, 17> gesture_states;
- };
- static_assert(sizeof(SharedMemory) == 0x708, "SharedMemory is an invalid size");
+ static_assert(sizeof(GestureState) == 0x60, "GestureState is an invalid size");
struct Finger {
Common::Point<f32> pos{};
@@ -153,13 +138,16 @@ private:
GestureType& type);
// Retrieves the last gesture entry, as indicated by shared memory indices.
- [[nodiscard]] GestureState& GetLastGestureEntry();
[[nodiscard]] const GestureState& GetLastGestureEntry() const;
// Returns the average distance, angle and middle point of the active fingers
GestureProperties GetGestureProperties();
- SharedMemory shared_memory{};
+ // This is nn::hid::detail::GestureLifo
+ Lifo<GestureState> gesture_lifo{};
+ static_assert(sizeof(gesture_lifo) == 0x708, "gesture_lifo is an invalid size");
+ GestureState next_state{};
+
Core::HID::EmulatedConsole* console;
std::array<Finger, MAX_POINTS> fingers{};