input_common: Small fix
This commit is contained in:
@ -17,7 +17,6 @@
|
|||||||
#include <numbers>
|
#include <numbers>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/math_util.h"
|
|
||||||
#include "common/param_package.h"
|
#include "common/param_package.h"
|
||||||
#include "common/threadsafe_queue.h"
|
#include "common/threadsafe_queue.h"
|
||||||
#include "core/frontend/input.h"
|
#include "core/frontend/input.h"
|
||||||
@ -597,10 +596,9 @@ void SDLState::HandleGameControllerEvent(const SDL_Event& event) {
|
|||||||
event.csensor.data[2] / SDL_STANDARD_GRAVITY);
|
event.csensor.data[2] / SDL_STANDARD_GRAVITY);
|
||||||
break;
|
break;
|
||||||
case SDL_SENSOR_GYRO:
|
case SDL_SENSOR_GYRO:
|
||||||
using namespace std::numbers;
|
joystick->SetGyro(-event.csensor.data[0] * (180.0f / std::numbers::pi),
|
||||||
joystick->SetGyro(-event.csensor.data[0] * (180.0f / pi),
|
event.csensor.data[1] * (180.0f / std::numbers::pi),
|
||||||
event.csensor.data[1] * (180.0f / pi),
|
-event.csensor.data[2] * (180.0f / std::numbers::pi));
|
||||||
-event.csensor.data[2] * (180.0f / pi));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1054,7 +1052,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Common::ParamPackage GetNextInput() override {
|
Common::ParamPackage GetNextInput() override {
|
||||||
SDL_Event event;
|
SDL_Event event{};
|
||||||
while (state.event_queue.Pop(event)) {
|
while (state.event_queue.Pop(event)) {
|
||||||
if (event.type != SDL_JOYAXISMOTION || std::abs(event.jaxis.value / 32767.0) < 0.5) {
|
if (event.type != SDL_JOYAXISMOTION || std::abs(event.jaxis.value / 32767.0) < 0.5) {
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user