fix: el teclado había dejado de funcionar

This commit is contained in:
2024-07-11 17:53:22 +02:00
parent aef00b9d89
commit 4c44fc0e1a
2 changed files with 2 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ void Input::bindGameControllerButton(int index, inputs_e input, SDL_GameControll
// Comprueba si un input esta activo // Comprueba si un input esta activo
bool Input::checkInput(inputs_e input, bool repeat, int device, int index) bool Input::checkInput(inputs_e input, bool repeat, int device, int index)
{ {
if (!enabled || index >= numGamepads) if (!enabled)
{ {
return false; return false;
} }
@@ -132,7 +132,7 @@ bool Input::checkInput(inputs_e input, bool repeat, int device, int index)
} }
} }
if (gameControllerFound()) if (gameControllerFound() && index < numGamepads)
if ((device == INPUT_USE_GAMECONTROLLER) || (device == INPUT_USE_ANY)) if ((device == INPUT_USE_GAMECONTROLLER) || (device == INPUT_USE_ANY))
{ {
if (repeat) if (repeat)

View File

@@ -42,7 +42,6 @@ private:
int fadeRandomSquaresMult; // Cantidad de cuadrados que se pintaran cada vez int fadeRandomSquaresMult; // Cantidad de cuadrados que se pintaran cada vez
int postDuration; // Duración posterior del fade tras finalizar int postDuration; // Duración posterior del fade tras finalizar
int postCounter; // Contador para la duración posterior int postCounter; // Contador para la duración posterior
Uint32 *pixels; // Array donde pintar los pixeles para la textura backbuffer2 con SDL_TEXTUREACCESS_STREAMING
// Inicializa las variables // Inicializa las variables
void init(); void init();