Allow to return up to 16 touch inputs per engine

This commit is contained in:
german 2021-01-01 12:32:29 -06:00
parent 390ee10eef
commit d8df9a16bd
10 changed files with 203 additions and 155 deletions

View file

@ -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: