diff options
| author | 2020-09-17 20:26:34 -0500 | |
|---|---|---|
| committer | 2020-09-25 17:59:52 -0500 | |
| commit | 03b574ae2272fc8465e7d38f21b198fcb1885186 (patch) | |
| tree | e6e70906677339fce1a7bedafab8d8fcb39026b4 /src/input_common/udp/client.cpp | |
| parent | Merge pull request #4717 from lioncash/debug (diff) | |
| download | yuzu-03b574ae2272fc8465e7d38f21b198fcb1885186.tar.gz yuzu-03b574ae2272fc8465e7d38f21b198fcb1885186.tar.xz yuzu-03b574ae2272fc8465e7d38f21b198fcb1885186.zip | |
Add random motion input to SDL
Diffstat (limited to 'src/input_common/udp/client.cpp')
| -rw-r--r-- | src/input_common/udp/client.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp index 2b6a68d4b..b6323d56f 100644 --- a/src/input_common/udp/client.cpp +++ b/src/input_common/udp/client.cpp | |||
| @@ -219,14 +219,10 @@ void Client::OnPadData(Response::PadData data) { | |||
| 219 | clients[client].motion.SetGyroscope(raw_gyroscope / 312.0f); | 219 | clients[client].motion.SetGyroscope(raw_gyroscope / 312.0f); |
| 220 | clients[client].motion.UpdateRotation(time_difference); | 220 | clients[client].motion.UpdateRotation(time_difference); |
| 221 | clients[client].motion.UpdateOrientation(time_difference); | 221 | clients[client].motion.UpdateOrientation(time_difference); |
| 222 | Common::Vec3f gyroscope = clients[client].motion.GetGyroscope(); | ||
| 223 | Common::Vec3f accelerometer = clients[client].motion.GetAcceleration(); | ||
| 224 | Common::Vec3f rotation = clients[client].motion.GetRotations(); | ||
| 225 | std::array<Common::Vec3f, 3> orientation = clients[client].motion.GetOrientation(); | ||
| 226 | 222 | ||
| 227 | { | 223 | { |
| 228 | std::lock_guard guard(clients[client].status.update_mutex); | 224 | std::lock_guard guard(clients[client].status.update_mutex); |
| 229 | clients[client].status.motion_status = {accelerometer, gyroscope, rotation, orientation}; | 225 | clients[client].status.motion_status = clients[client].motion.GetMotion(); |
| 230 | 226 | ||
| 231 | // TODO: add a setting for "click" touch. Click touch refers to a device that differentiates | 227 | // TODO: add a setting for "click" touch. Click touch refers to a device that differentiates |
| 232 | // between a simple "tap" and a hard press that causes the touch screen to click. | 228 | // between a simple "tap" and a hard press that causes the touch screen to click. |
| @@ -250,6 +246,8 @@ void Client::OnPadData(Response::PadData data) { | |||
| 250 | clients[client].status.touch_status = {x, y, is_active}; | 246 | clients[client].status.touch_status = {x, y, is_active}; |
| 251 | 247 | ||
| 252 | if (configuring) { | 248 | if (configuring) { |
| 249 | const Common::Vec3f gyroscope = clients[client].motion.GetGyroscope(); | ||
| 250 | const Common::Vec3f accelerometer = clients[client].motion.GetAcceleration(); | ||
| 253 | UpdateYuzuSettings(client, accelerometer, gyroscope, is_active); | 251 | UpdateYuzuSettings(client, accelerometer, gyroscope, is_active); |
| 254 | } | 252 | } |
| 255 | } | 253 | } |