Mapeados los jugadores a los dos mandos

This commit is contained in:
2024-06-30 14:07:07 +02:00
parent 097320cff7
commit 1754cfb93a
8 changed files with 47 additions and 163 deletions

View File

@@ -40,19 +40,19 @@ void Input::update()
}
// Asigna inputs a teclas
void Input::bindKey(Uint8 input, SDL_Scancode code)
void Input::bindKey(inputs_e input, SDL_Scancode code)
{
keyBindings[input].scancode = code;
}
// Asigna inputs a botones del mando
void Input::bindGameControllerButton(Uint8 input, SDL_GameControllerButton button)
void Input::bindGameControllerButton(inputs_e input, SDL_GameControllerButton button)
{
gameControllerBindings[input].button = button;
}
// Comprueba si un input esta activo
bool Input::checkInput(Uint8 input, bool repeat, int device, int index)
bool Input::checkInput(inputs_e input, bool repeat, int device, int index)
{
if (!enabled)
{
@@ -244,7 +244,7 @@ bool Input::discoverGameController()
connectedControllers.push_back(pad);
const std::string separator(" #");
std::string name = SDL_GameControllerNameForIndex(i);
name.resize(25);
//name.resize(25);
name = name + separator + std::to_string(i);
if (verbose)
{