summaryrefslogtreecommitdiff
path: root/src/core/frontend/emu_window.cpp
diff options
context:
space:
mode:
authorGravatar Kloen2017-01-29 16:39:31 +0100
committerGravatar Kloen2017-01-29 16:39:31 +0100
commitff7d68d743c5af59557c80f5dbd7b57595b084a8 (patch)
treeef445ec7ae5e5878776cd17a543650a754e41fba /src/core/frontend/emu_window.cpp
parentMerge pull request #2485 from Kloen/killing-warnings-computehash64 (diff)
downloadyuzu-ff7d68d743c5af59557c80f5dbd7b57595b084a8.tar.gz
yuzu-ff7d68d743c5af59557c80f5dbd7b57595b084a8.tar.xz
yuzu-ff7d68d743c5af59557c80f5dbd7b57595b084a8.zip
core: emu_window.cpp, fix conversion warnings from float to s16 on MSVC
Diffstat (limited to 'src/core/frontend/emu_window.cpp')
-rw-r--r--src/core/frontend/emu_window.cpp12
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) {
98 // TODO(wwylele): do a time stretch as it in GyroscopeChanged 98 // TODO(wwylele): do a time stretch as it in GyroscopeChanged
99 // The time stretch formula should be like 99 // The time stretch formula should be like
100 // stretched_vector = (raw_vector - gravity) * stretch_ratio + gravity 100 // stretched_vector = (raw_vector - gravity) * stretch_ratio + gravity
101 accel_x = x * coef; 101 accel_x = static_cast<s16>(x * coef);
102 accel_y = y * coef; 102 accel_y = static_cast<s16>(y * coef);
103 accel_z = z * coef; 103 accel_z = static_cast<s16>(z * coef);
104} 104}
105 105
106void EmuWindow::GyroscopeChanged(float x, float y, float z) { 106void EmuWindow::GyroscopeChanged(float x, float y, float z) {
@@ -109,9 +109,9 @@ void EmuWindow::GyroscopeChanged(float x, float y, float z) {
109 float stretch = 109 float stretch =
110 FULL_FPS / Common::Profiling::GetTimingResultsAggregator()->GetAggregatedResults().fps; 110 FULL_FPS / Common::Profiling::GetTimingResultsAggregator()->GetAggregatedResults().fps;
111 std::lock_guard<std::mutex> lock(gyro_mutex); 111 std::lock_guard<std::mutex> lock(gyro_mutex);
112 gyro_x = x * coef * stretch; 112 gyro_x = static_cast<s16>(x * coef * stretch);
113 gyro_y = y * coef * stretch; 113 gyro_y = static_cast<s16>(y * coef * stretch);
114 gyro_z = z * coef * stretch; 114 gyro_z = static_cast<s16>(z * coef * stretch);
115} 115}
116 116
117void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) { 117void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) {