mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Merge pull request #2491 from Kloen/killing-warnings-2.5HDRemix
core: emu_window.cpp, fix conversion warnings from float to s16 on MSVC
This commit is contained in:
commit
129757b967
1 changed files with 6 additions and 6 deletions
|
@ -98,9 +98,9 @@ void EmuWindow::AccelerometerChanged(float x, float y, float z) {
|
||||||
// TODO(wwylele): do a time stretch as it in GyroscopeChanged
|
// TODO(wwylele): do a time stretch as it in GyroscopeChanged
|
||||||
// The time stretch formula should be like
|
// The time stretch formula should be like
|
||||||
// stretched_vector = (raw_vector - gravity) * stretch_ratio + gravity
|
// stretched_vector = (raw_vector - gravity) * stretch_ratio + gravity
|
||||||
accel_x = x * coef;
|
accel_x = static_cast<s16>(x * coef);
|
||||||
accel_y = y * coef;
|
accel_y = static_cast<s16>(y * coef);
|
||||||
accel_z = z * coef;
|
accel_z = static_cast<s16>(z * coef);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmuWindow::GyroscopeChanged(float x, float y, float z) {
|
void EmuWindow::GyroscopeChanged(float x, float y, float z) {
|
||||||
|
@ -109,9 +109,9 @@ void EmuWindow::GyroscopeChanged(float x, float y, float z) {
|
||||||
float stretch =
|
float stretch =
|
||||||
FULL_FPS / Common::Profiling::GetTimingResultsAggregator()->GetAggregatedResults().fps;
|
FULL_FPS / Common::Profiling::GetTimingResultsAggregator()->GetAggregatedResults().fps;
|
||||||
std::lock_guard<std::mutex> lock(gyro_mutex);
|
std::lock_guard<std::mutex> lock(gyro_mutex);
|
||||||
gyro_x = x * coef * stretch;
|
gyro_x = static_cast<s16>(x * coef * stretch);
|
||||||
gyro_y = y * coef * stretch;
|
gyro_y = static_cast<s16>(y * coef * stretch);
|
||||||
gyro_z = z * coef * stretch;
|
gyro_z = static_cast<s16>(z * coef * stretch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) {
|
void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) {
|
||||||
|
|
Loading…
Reference in a new issue