REVIEWED: Formatting, follow raylib coding conventions

This commit is contained in:
Ray
2024-06-30 11:37:58 +02:00
parent 13e3092511
commit 1e1061d5c7
11 changed files with 77 additions and 78 deletions

View File

@ -1097,16 +1097,16 @@ void PollInputEvents(void)
}
#ifdef __linux__
float value = (event->axis[i].x + event->axis[i].y) / (float) 32767;
float value = (event->axis[i].x + event->axis[i].y)/(float)32767;
#else
float value = (event->axis[i].x + -event->axis[i].y) / (float) 32767;
float value = (event->axis[i].x + -event->axis[i].y)/(float)32767;
#endif
CORE.Input.Gamepad.axisState[event->joystick][axis] = value;
// Register button state for triggers in addition to their axes
if ((axis == GAMEPAD_AXIS_LEFT_TRIGGER) || (axis == GAMEPAD_AXIS_RIGHT_TRIGGER))
{
int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER) ? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2;
int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER)? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2;
int pressed = (value > 0.1f);
CORE.Input.Gamepad.currentButtonState[event->joystick][button] = pressed;
if (pressed) CORE.Input.Gamepad.lastButtonPressed = button;