mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-09-21 02:24:21 +08:00
testgamepad works for joysticks as well as gamepads
This commit is contained in:
+7
-1
@@ -408,6 +408,12 @@ void UpdateGamepadImageFromGamepad(GamepadImage *ctx, SDL_Gamepad *gamepad)
|
||||
|
||||
SDL_GetGamepadTouchpadFinger(gamepad, 0, i, &finger->state, &finger->x, &finger->y, &finger->pressure);
|
||||
}
|
||||
} else {
|
||||
if (ctx->fingers) {
|
||||
SDL_free(ctx->fingers);
|
||||
ctx->fingers = NULL;
|
||||
ctx->num_fingers = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -613,7 +619,7 @@ void RenderGamepadDisplay(GamepadDisplay *ctx, SDL_Gamepad *gamepad)
|
||||
SDL_bool has_accel;
|
||||
SDL_bool has_gyro;
|
||||
|
||||
if (!ctx) {
|
||||
if (!ctx || !gamepad) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+283
-282
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user