mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
testcontroller: use the correct label for face buttons
This commit is contained in:
parent
08e3758e3f
commit
1b65f25465
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue