From 1b65f254655ee2e97755b95e4d43bada72d1b3da Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 15 Jul 2025 15:52:40 -0700
Subject: [PATCH] testcontroller: use the correct label for face buttons
---
test/gamepadutils.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/test/gamepadutils.c b/test/gamepadutils.c
index c5295c4c54dd0..3b6834222368c 100644
--- a/test/gamepadutils.c
+++ b/test/gamepadutils.c
@@ -369,6 +369,7 @@ struct GamepadImage
bool showing_front;
bool showing_touchpad;
SDL_GamepadType type;
+ SDL_GamepadButtonLabel east_label;
ControllerDisplayMode display_mode;
bool elements[SDL_GAMEPAD_ELEMENT_MAX];
@@ -674,6 +675,7 @@ void UpdateGamepadImageFromGamepad(GamepadImage *ctx, SDL_Gamepad *gamepad)
}
ctx->type = SDL_GetGamepadType(gamepad);
+ ctx->east_label = SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_EAST);
char *mapping = SDL_GetGamepadMapping(gamepad);
if (mapping) {
if (SDL_strstr(mapping, "SDL_GAMECONTROLLER_USE_BUTTON_LABELS")) {
@@ -795,7 +797,7 @@ void RenderGamepadImage(GamepadImage *ctx)
dst.w = ctx->face_width;
dst.h = ctx->face_height;
- switch (SDL_GetGamepadButtonLabelForType(ctx->type, SDL_GAMEPAD_BUTTON_EAST)) {
+ switch (ctx->east_label) {
case SDL_GAMEPAD_BUTTON_LABEL_B:
SDL_RenderTexture(ctx->renderer, ctx->face_abxy_texture, NULL, &dst);
break;