summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers/touchscreen.h
diff options
context:
space:
mode:
authorgerman <german@thesoftwareartisans.com>2021-01-01 19:32:29 +0100
committergerman <german@thesoftwareartisans.com>2021-01-15 16:05:17 +0100
commitd8df9a16bd4f4517b024c17446a94915493d7f3d (patch)
treeaed2de583aa94dd11259bece37e55f4263f07336 /src/core/hle/service/hid/controllers/touchscreen.h
parentAllow all touch inputs at the same time and remove config options that are not longer necesary (diff)
downloadyuzu-d8df9a16bd4f4517b024c17446a94915493d7f3d.tar
yuzu-d8df9a16bd4f4517b024c17446a94915493d7f3d.tar.gz
yuzu-d8df9a16bd4f4517b024c17446a94915493d7f3d.tar.bz2
yuzu-d8df9a16bd4f4517b024c17446a94915493d7f3d.tar.lz
yuzu-d8df9a16bd4f4517b024c17446a94915493d7f3d.tar.xz
yuzu-d8df9a16bd4f4517b024c17446a94915493d7f3d.tar.zst
yuzu-d8df9a16bd4f4517b024c17446a94915493d7f3d.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/hid/controllers/touchscreen.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/hle/service/hid/controllers/touchscreen.h b/src/core/hle/service/hid/controllers/touchscreen.h
index 03f399344..e39ab89ee 100644
--- a/src/core/hle/service/hid/controllers/touchscreen.h
+++ b/src/core/hle/service/hid/controllers/touchscreen.h
@@ -30,13 +30,17 @@ public:
void OnLoadInputDevices() override;
private:
+ static constexpr size_t MAX_FINGERS = 16;
+
+ // Returns an unused finger id, if there is no fingers available std::nullopt will be 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
// 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
- void updateTouchInputEvent(const std::tuple<float, float, bool>& touch_input,
- size_t& finger_id);
- static const size_t MAX_FINGERS = 16;
+ size_t UpdateTouchInputEvent(const std::tuple<float, float, bool>& touch_input,
+ size_t finger_id);
struct Attributes {
union {
@@ -88,9 +92,9 @@ private:
std::unique_ptr<Input::TouchDevice> touch_mouse_device;
std::unique_ptr<Input::TouchDevice> touch_udp_device;
std::unique_ptr<Input::TouchDevice> touch_btn_device;
- size_t mouse_finger_id{-1};
- size_t keyboard_finger_id{-1};
- size_t udp_finger_id{-1};
+ std::array<size_t, MAX_FINGERS> mouse_finger_id;
+ std::array<size_t, MAX_FINGERS> keyboard_finger_id;
+ std::array<size_t, MAX_FINGERS> udp_finger_id;
std::array<Finger, MAX_FINGERS> fingers;
};
} // namespace Service::HID