diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2022-11-19 19:21:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-19 19:21:01 +0100 |
commit | bcbc25eeb3027445f55050baa9ecd09289141dad (patch) | |
tree | c3e93e0ca9dc41a492898520b5c8e7c28f1f7954 /src/core/hid/emulated_console.h | |
parent | Merge pull request #9260 from liamwhite/youre-in-big-trouble-now (diff) | |
parent | service: hid: Only overclock npad controllers (diff) | |
download | yuzu-bcbc25eeb3027445f55050baa9ecd09289141dad.tar yuzu-bcbc25eeb3027445f55050baa9ecd09289141dad.tar.gz yuzu-bcbc25eeb3027445f55050baa9ecd09289141dad.tar.bz2 yuzu-bcbc25eeb3027445f55050baa9ecd09289141dad.tar.lz yuzu-bcbc25eeb3027445f55050baa9ecd09289141dad.tar.xz yuzu-bcbc25eeb3027445f55050baa9ecd09289141dad.tar.zst yuzu-bcbc25eeb3027445f55050baa9ecd09289141dad.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hid/emulated_console.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/core/hid/emulated_console.h b/src/core/hid/emulated_console.h index 1c510cd19..697ecd2d6 100644 --- a/src/core/hid/emulated_console.h +++ b/src/core/hid/emulated_console.h @@ -7,6 +7,7 @@ #include <functional> #include <memory> #include <mutex> +#include <optional> #include <unordered_map> #include "common/common_funcs.h" @@ -20,6 +21,8 @@ #include "core/hid/motion_input.h" namespace Core::HID { +static constexpr std::size_t MaxTouchDevices = 32; +static constexpr std::size_t MaxActiveTouchInputs = 16; struct ConsoleMotionInfo { Common::Input::MotionStatus raw_status{}; @@ -27,13 +30,13 @@ struct ConsoleMotionInfo { }; using ConsoleMotionDevices = std::unique_ptr<Common::Input::InputDevice>; -using TouchDevices = std::array<std::unique_ptr<Common::Input::InputDevice>, 16>; +using TouchDevices = std::array<std::unique_ptr<Common::Input::InputDevice>, MaxTouchDevices>; using ConsoleMotionParams = Common::ParamPackage; -using TouchParams = std::array<Common::ParamPackage, 16>; +using TouchParams = std::array<Common::ParamPackage, MaxTouchDevices>; using ConsoleMotionValues = ConsoleMotionInfo; -using TouchValues = std::array<Common::Input::TouchStatus, 16>; +using TouchValues = std::array<Common::Input::TouchStatus, MaxTouchDevices>; struct TouchFinger { u64 last_touch{}; @@ -55,7 +58,7 @@ struct ConsoleMotion { bool is_at_rest{}; }; -using TouchFingerState = std::array<TouchFinger, 16>; +using TouchFingerState = std::array<TouchFinger, MaxActiveTouchInputs>; struct ConsoleStatus { // Data from input_common @@ -166,6 +169,10 @@ private: */ void SetTouch(const Common::Input::CallbackStatus& callback, std::size_t index); + std::optional<std::size_t> GetIndexFromFingerId(std::size_t finger_id) const; + + std::optional<std::size_t> GetNextFreeIndex() const; + /** * Triggers a callback that something has changed on the console status * @param type Input type of the event to trigger |