From ff7d68d743c5af59557c80f5dbd7b57595b084a8 Mon Sep 17 00:00:00 2001 From: Kloen Date: Sun, 29 Jan 2017 16:39:31 +0100 Subject: [PATCH] core: emu_window.cpp, fix conversion warnings from float to s16 on MSVC --- src/core/frontend/emu_window.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 1541cc39d3..4f0f786ce2 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -98,9 +98,9 @@ void EmuWindow::AccelerometerChanged(float x, float y, float z) { // 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 = x * coef; - accel_y = y * coef; - accel_z = z * coef; + 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) { @@ -109,9 +109,9 @@ void EmuWindow::GyroscopeChanged(float x, float y, float z) { float stretch = FULL_FPS / Common::Profiling::GetTimingResultsAggregator()->GetAggregatedResults().fps; std::lock_guard lock(gyro_mutex); - gyro_x = x * coef * stretch; - gyro_y = y * coef * stretch; - gyro_z = z * coef * stretch; + 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) {