diff options
author | wwylele <wwylele@gmail.com> | 2017-08-06 23:04:06 +0200 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2017-08-11 10:05:08 +0200 |
commit | 188194908c2785bd1e03485941b9148777cdddd7 (patch) | |
tree | ab6cd04195f5e18bd1e7dd21a7c2896066827a6f /src/core/frontend/emu_window.cpp | |
parent | HID: use MotionDevice for Accelerometer and Gyroscope (diff) | |
download | yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.gz yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.bz2 yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.lz yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.xz yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.zst yuzu-188194908c2785bd1e03485941b9148777cdddd7.zip |
Diffstat (limited to 'src/core/frontend/emu_window.cpp')
-rw-r--r-- | src/core/frontend/emu_window.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 4f7d54a33..60b20d4e2 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -62,29 +62,6 @@ void EmuWindow::TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y) { TouchPressed(framebuffer_x, framebuffer_y); } -void EmuWindow::AccelerometerChanged(float x, float y, float z) { - constexpr float coef = 512; - - std::lock_guard<std::mutex> lock(accel_mutex); - - // TODO(wwylele): do a time stretch as it in GyroscopeChanged - // The time stretch formula should be like - // stretched_vector = (raw_vector - gravity) * stretch_ratio + gravity - accel_x = static_cast<s16>(x * coef); - accel_y = static_cast<s16>(y * coef); - accel_z = static_cast<s16>(z * coef); -} - -void EmuWindow::GyroscopeChanged(float x, float y, float z) { - constexpr float FULL_FPS = 60; - float coef = GetGyroscopeRawToDpsCoefficient(); - float stretch = Core::System::GetInstance().perf_stats.GetLastFrameTimeScale(); - std::lock_guard<std::mutex> lock(gyro_mutex); - gyro_x = static_cast<s16>(x * coef * stretch); - gyro_y = static_cast<s16>(y * coef * stretch); - gyro_z = static_cast<s16>(z * coef * stretch); -} - void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) { Layout::FramebufferLayout layout; if (Settings::values.custom_layout == true) { |