From 188194908c2785bd1e03485941b9148777cdddd7 Mon Sep 17 00:00:00 2001 From: wwylele Date: Mon, 7 Aug 2017 00:04:06 +0300 Subject: move MotionEmu from core/frontend to input_common as a InputDevice --- src/core/frontend/emu_window.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src/core/frontend/emu_window.cpp') 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 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(x * coef); - accel_y = static_cast(y * coef); - accel_z = static_cast(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 lock(gyro_mutex); - gyro_x = static_cast(x * coef * stretch); - gyro_y = static_cast(y * coef * stretch); - gyro_z = static_cast(z * coef * stretch); -} - void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) { Layout::FramebufferLayout layout; if (Settings::values.custom_layout == true) { -- cgit v1.2.3