|
|
@@ -2208,9 +2208,9 @@ SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, SDL_Event *event)
|
|
|
}
|
|
|
|
|
|
if (display_mode == CONTROLLER_MODE_TESTING) {
|
|
|
- if (GamepadButtonContains(GetGyroResetButton(gyro_elements), event->button.x, event->button.y)) {
|
|
|
+ if (controller && GamepadButtonContains(GetGyroResetButton(gyro_elements), event->button.x, event->button.y)) {
|
|
|
ResetGyroOrientation(controller->imu_state);
|
|
|
- } else if (GamepadButtonContains(GetGyroCalibrateButton(gyro_elements), event->button.x, event->button.y)) {
|
|
|
+ } else if (controller && GamepadButtonContains(GetGyroCalibrateButton(gyro_elements), event->button.x, event->button.y)) {
|
|
|
BeginNoiseCalibrationPhase(controller->imu_state);
|
|
|
} else if (GamepadButtonContains(setup_mapping_button, event->button.x, event->button.y)) {
|
|
|
SetDisplayMode(CONTROLLER_MODE_BINDING);
|