Skip to content

Commit 1b65f25

Browse files
committed
testcontroller: use the correct label for face buttons
1 parent 08e3758 commit 1b65f25

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/gamepadutils.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ struct GamepadImage
369369
bool showing_front;
370370
bool showing_touchpad;
371371
SDL_GamepadType type;
372+
SDL_GamepadButtonLabel east_label;
372373
ControllerDisplayMode display_mode;
373374

374375
bool elements[SDL_GAMEPAD_ELEMENT_MAX];
@@ -674,6 +675,7 @@ void UpdateGamepadImageFromGamepad(GamepadImage *ctx, SDL_Gamepad *gamepad)
674675
}
675676

676677
ctx->type = SDL_GetGamepadType(gamepad);
678+
ctx->east_label = SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_EAST);
677679
char *mapping = SDL_GetGamepadMapping(gamepad);
678680
if (mapping) {
679681
if (SDL_strstr(mapping, "SDL_GAMECONTROLLER_USE_BUTTON_LABELS")) {
@@ -795,7 +797,7 @@ void RenderGamepadImage(GamepadImage *ctx)
795797
dst.w = ctx->face_width;
796798
dst.h = ctx->face_height;
797799

798-
switch (SDL_GetGamepadButtonLabelForType(ctx->type, SDL_GAMEPAD_BUTTON_EAST)) {
800+
switch (ctx->east_label) {
799801
case SDL_GAMEPAD_BUTTON_LABEL_B:
800802
SDL_RenderTexture(ctx->renderer, ctx->face_abxy_texture, NULL, &dst);
801803
break;

0 commit comments

Comments
 (0)