PER FI JA MAPEJA BE ELS BOTONS AL REDEFINIRLOS!

This commit is contained in:
2024-07-07 14:53:26 +02:00
parent ceafe931f1
commit 38dc63ef02
2 changed files with 4 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ void DefineButtons::render()
} }
// Comprueba el botón que se ha pulsado // Comprueba el botón que se ha pulsado
void DefineButtons::doJoystickButtonDown(SDL_JoyButtonEvent *event) void DefineButtons::doControllerButtonDown(SDL_ControllerButtonEvent *event)
{ {
int i = input->getJoyIndex(event->which); int i = input->getJoyIndex(event->which);
@@ -111,8 +111,8 @@ void DefineButtons::checkInput()
// Comprueba los eventos que hay en la cola // Comprueba los eventos que hay en la cola
while (SDL_PollEvent(&event)) while (SDL_PollEvent(&event))
{ {
if (event.type == SDL_JOYBUTTONDOWN) if (event.type == SDL_CONTROLLERBUTTONDOWN)
doJoystickButtonDown(&event.jbutton); doControllerButtonDown(&event.cbutton);
} }
} }
} }

View File

@@ -38,7 +38,7 @@ private:
void incIndexButton(); void incIndexButton();
// Comprueba el botón que se ha pulsado // Comprueba el botón que se ha pulsado
void doJoystickButtonDown(SDL_JoyButtonEvent *event); void doControllerButtonDown(SDL_ControllerButtonEvent *event);
// Asigna los botones definidos al input // Asigna los botones definidos al input
void bindButtons(); void bindButtons();