summaryrefslogtreecommitdiffstats
path: root/src/core/frontend
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/frontend
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 'src/core/frontend')
-rw-r--r--src/core/frontend/emu_window.cpp8
-rw-r--r--src/core/frontend/input.h7
2 files changed, 9 insertions, 6 deletions
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp
index 8c1193894..589842917 100644
--- a/src/core/frontend/emu_window.cpp
+++ b/src/core/frontend/emu_window.cpp
@@ -30,12 +30,14 @@ private:
class Device : public Input::TouchDevice {
public:
explicit Device(std::weak_ptr<TouchState>&& touch_state) : touch_state(touch_state) {}
- std::tuple<float, float, bool> GetStatus() const override {
+ Input::TouchStatus GetStatus() const override {
+ Input::TouchStatus touch_status = {};
if (auto state = touch_state.lock()) {
std::lock_guard guard{state->mutex};
- return std::make_tuple(state->touch_x, state->touch_y, state->touch_pressed);
+ touch_status[0] =
+ std::make_tuple(state->touch_x, state->touch_y, state->touch_pressed);
}
- return std::make_tuple(0.0f, 0.0f, false);
+ return touch_status;
}
private:
diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h
index de51a754e..f014dfea3 100644
--- a/src/core/frontend/input.h
+++ b/src/core/frontend/input.h
@@ -163,10 +163,11 @@ using MotionStatus = std::tuple<Common::Vec3<float>, Common::Vec3<float>, Common
using MotionDevice = InputDevice<MotionStatus>;
/**
- * A touch status is an object that returns a tuple of two floats and a bool. The floats are
- * x and y coordinates in the range 0.0 - 1.0, and the bool indicates whether it is pressed.
+ * A touch status is an object that returns an array of 16 tuple elements of two floats and a bool.
+ * The floats are x and y coordinates in the range 0.0 - 1.0, and the bool indicates whether it is
+ * pressed.
*/
-using TouchStatus = std::tuple<float, float, bool>;
+using TouchStatus = std::array<std::tuple<float, float, bool>, 16>;
/**
* A touch device is an input device that returns a touch status object