Start to work on dual input for P1

This commit is contained in:
2021-08-29 19:54:18 +02:00
parent 4de3d69bb8
commit 02b528ea8c
12 changed files with 110 additions and 48 deletions

View File

@@ -141,7 +141,7 @@ bool Input::discoverGameController()
int nJoysticks = SDL_NumJoysticks();
mNumGamepads = 0;
// Count how many controllers there are
// Cuenta el numero de mandos
for (int i = 0; i < nJoysticks; i++)
if (SDL_IsGameController(i))
mNumGamepads++;
@@ -154,7 +154,7 @@ bool Input::discoverGameController()
for (int i = 0; i < mNumGamepads; i++)
{
// Open the controller and add it to our list
// Abre el mando y lo añade a la lista
SDL_GameController *pad = SDL_GameControllerOpen(i);
if (SDL_GameControllerGetAttached(pad) == 1)
mConnectedControllers.push_back(pad);
@@ -167,4 +167,10 @@ bool Input::discoverGameController()
}
return found;
}
// Establece el método de entrada
void Input::setSource(Uint8 value)
{
mSource = value;
}