diff options
| author | 2020-10-08 10:18:39 -0700 | |
|---|---|---|
| committer | 2020-10-08 10:18:39 -0700 | |
| commit | 06e65de93cfa923b6fb1f12fa20193515249234d (patch) | |
| tree | 9771ca19a2686af1185f62ed7488d977d37a1703 /src/input_common/udp/client.cpp | |
| parent | Merge pull request #4765 from ReinUsesLisp/fix-sort-devices (diff) | |
| parent | Add random motion input to keyboard (diff) | |
| download | yuzu-06e65de93cfa923b6fb1f12fa20193515249234d.tar.gz yuzu-06e65de93cfa923b6fb1f12fa20193515249234d.tar.xz yuzu-06e65de93cfa923b6fb1f12fa20193515249234d.zip | |
Merge pull request #4677 from german77/ShakeFromButton
InputCommon: Add random motion input for buttons
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 cf72f6fef..9d0b9f31d 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 | } |