summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-07-18 16:33:11 -0400
committerGravatar Zach Hilman2018-07-18 16:33:11 -0400
commitc337272ca9a935d3b1bb99fac2182c8ff84a9597 (patch)
tree949bfdc854d7c8874af2e24bab5a0cfc042b9037
parentSingle touch support (diff)
downloadyuzu-c337272ca9a935d3b1bb99fac2182c8ff84a9597.tar.gz
yuzu-c337272ca9a935d3b1bb99fac2182c8ff84a9597.tar.xz
yuzu-c337272ca9a935d3b1bb99fac2182c8ff84a9597.zip
Fill in more fields in TouchScreenEntryTouch
-rw-r--r--src/core/hle/service/hid/hid.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 32c781cf3..4f18c0fd3 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -166,13 +166,18 @@ private:
166 touchscreen.entries[curr_entry].header.timestamp = sample_counter; 166 touchscreen.entries[curr_entry].header.timestamp = sample_counter;
167 167
168 TouchScreenEntryTouch touch_entry{}; 168 TouchScreenEntryTouch touch_entry{};
169 float x; 169 auto [x, y, pressed] = touch_device->GetStatus();
170 float y; 170 touch_entry.timestamp = timestamp;
171 bool pressed;
172 std::tie(x, y, pressed) = touch_device->GetStatus();
173 touch_entry.x = static_cast<u16>(x * Layout::ScreenUndocked::Width); 171 touch_entry.x = static_cast<u16>(x * Layout::ScreenUndocked::Width);
174 touch_entry.y = static_cast<u16>(y * Layout::ScreenUndocked::Height); 172 touch_entry.y = static_cast<u16>(y * Layout::ScreenUndocked::Height);
173 touch_entry.touch_index = 0;
175 174
175 // TODO(DarkLordZach): Maybe try to derive these from EmuWindow?
176 touch_entry.diameter_x = 15;
177 touch_entry.diameter_y = 15;
178 touch_entry.angle = 0;
179
180 // TODO(DarkLordZach): Implement multi-touch support
176 if (pressed) { 181 if (pressed) {
177 touchscreen.entries[curr_entry].header.num_touches = 1; 182 touchscreen.entries[curr_entry].header.num_touches = 1;
178 touchscreen.entries[curr_entry].touches[0] = touch_entry; 183 touchscreen.entries[curr_entry].touches[0] = touch_entry;