diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-01-29 20:42:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-29 20:42:23 +0100 |
commit | 129757b96786738d0e2b08a25880f5c6bf923ae5 (patch) | |
tree | ef445ec7ae5e5878776cd17a543650a754e41fba /src/core | |
parent | Merge pull request #2485 from Kloen/killing-warnings-computehash64 (diff) | |
parent | core: emu_window.cpp, fix conversion warnings from float to s16 on MSVC (diff) | |
download | yuzu-129757b96786738d0e2b08a25880f5c6bf923ae5.tar yuzu-129757b96786738d0e2b08a25880f5c6bf923ae5.tar.gz yuzu-129757b96786738d0e2b08a25880f5c6bf923ae5.tar.bz2 yuzu-129757b96786738d0e2b08a25880f5c6bf923ae5.tar.lz yuzu-129757b96786738d0e2b08a25880f5c6bf923ae5.tar.xz yuzu-129757b96786738d0e2b08a25880f5c6bf923ae5.tar.zst yuzu-129757b96786738d0e2b08a25880f5c6bf923ae5.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/frontend/emu_window.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 1541cc39d..4f0f786ce 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<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) { @@ -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<std::mutex> lock(gyro_mutex); - gyro_x = x * coef * stretch; - gyro_y = y * coef * stretch; - gyro_z = z * coef * stretch; + 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) { |