Fixed mapping the paddle buttons with the virtual controller

This commit is contained in:
Sam Lantinga 2022-05-16 06:22:18 -07:00
parent e3fd8feae6
commit 7e005bd843
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *desc)
int i, axis; int i, axis;
if (hwdata->desc.button_mask == 0) { if (hwdata->desc.button_mask == 0) {
for (i = 0; i < hwdata->desc.nbuttons && i < sizeof(Uint16)*8; ++i) { for (i = 0; i < hwdata->desc.nbuttons && i < sizeof(hwdata->desc.button_mask)*8; ++i) {
hwdata->desc.button_mask |= (1 << i); hwdata->desc.button_mask |= (1 << i);
} }
} }