From 7b750bf5bb6f8bdd1991c45ea509f93a9c151e04 Mon Sep 17 00:00:00 2001 From: lizzie Date: Tue, 7 Jul 2026 20:13:33 +0200 Subject: [hid_core, input_common] use std::numbers::pi{_v} instead of re-defining (#4160) don't reinvent the wheel, simple as that. Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4160 Reviewed-by: MaranBr Reviewed-by: CamilleLaVey --- src/input_common/drivers/sdl_driver.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/input_common/drivers/sdl_driver.cpp') diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index 9ba9010dc1..a656dcf077 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp @@ -3,6 +3,8 @@ // SPDX-FileCopyrightText: 2018 Citra Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include +#include #include "common/logging.h" #include "common/math_util.h" #include "common/param_package.h" @@ -146,9 +148,9 @@ public: break; } case SDL_SENSOR_GYRO: { - motion.gyro_x = event.data[0] / (Common::PI * 2); - motion.gyro_y = -event.data[2] / (Common::PI * 2); - motion.gyro_z = event.data[1] / (Common::PI * 2); + motion.gyro_x = event.data[0] / (f32(std::numbers::pi_v) * 2); + motion.gyro_y = -event.data[2] / (f32(std::numbers::pi_v) * 2); + motion.gyro_z = event.data[1] / (f32(std::numbers::pi_v) * 2); break; } } -- cgit v1.2.3