PER FI JA MAPEJA BE ELS BOTONS AL REDEFINIRLOS!
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user