diff options
author | german <german@thesoftwareartisans.com> | 2021-01-01 19:32:29 +0100 |
---|---|---|
committer | german <german@thesoftwareartisans.com> | 2021-01-15 16:05:17 +0100 |
commit | d8df9a16bd4f4517b024c17446a94915493d7f3d (patch) | |
tree | aed2de583aa94dd11259bece37e55f4263f07336 /src/input_common/touch_from_button.cpp | |
parent | Allow all touch inputs at the same time and remove config options that are not longer necesary (diff) | |
download | yuzu-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/input_common/touch_from_button.cpp')
-rw-r--r-- | src/input_common/touch_from_button.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/input_common/touch_from_button.cpp b/src/input_common/touch_from_button.cpp index a07124a86..5226e70df 100644 --- a/src/input_common/touch_from_button.cpp +++ b/src/input_common/touch_from_button.cpp @@ -25,18 +25,19 @@ public: } } - std::tuple<float, float, bool> GetStatus() const override { - for (const auto& m : map) { - const bool state = std::get<0>(m)->GetStatus(); + Input::TouchStatus GetStatus() const override { + Input::TouchStatus touch_status = {}; + for (size_t id = 0; id < map.size() && id < touch_status.size(); id++) { + const bool state = std::get<0>(map[id])->GetStatus(); if (state) { - const float x = static_cast<float>(std::get<1>(m)) / + const float x = static_cast<float>(std::get<1>(map[id])) / static_cast<int>(Layout::ScreenUndocked::Width); - const float y = static_cast<float>(std::get<2>(m)) / + const float y = static_cast<float>(std::get<2>(map[id])) / static_cast<int>(Layout::ScreenUndocked::Height); - return {x, y, true}; + touch_status[id] = {x, y, true}; } } - return {}; + return touch_status; } private: |