fix: al voler definir els botons dels mandos sense tindre cap mando conectat, petava tot
This commit is contained in:
@@ -111,11 +111,11 @@ void DefineButtons::checkInput()
|
||||
while (SDL_PollEvent(&event))
|
||||
{
|
||||
// Evento de salida de la aplicación
|
||||
if (event.type == SDL_QUIT)
|
||||
{
|
||||
section->name = SECTION_PROG_QUIT;
|
||||
break;
|
||||
}
|
||||
if (event.type == SDL_QUIT)
|
||||
{
|
||||
section->name = SECTION_PROG_QUIT;
|
||||
break;
|
||||
}
|
||||
|
||||
if (event.type == SDL_CONTROLLERBUTTONDOWN)
|
||||
doControllerButtonDown(&event.cbutton);
|
||||
@@ -126,9 +126,12 @@ void DefineButtons::checkInput()
|
||||
// Habilita el objeto
|
||||
void DefineButtons::enable(int index)
|
||||
{
|
||||
enabled = true;
|
||||
indexController = index;
|
||||
indexButton = 0;
|
||||
if (input->getNumControllers() > 0)
|
||||
{
|
||||
enabled = true;
|
||||
indexController = index;
|
||||
indexButton = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Comprueba si está habilitado
|
||||
|
||||
@@ -215,7 +215,7 @@ void Scoreboard::fillBackgroundTexture()
|
||||
|
||||
else if (mode[SCOREBOARD_LEFT_SIDE] == SCOREBOARD_MODE_DEMO)
|
||||
{
|
||||
if (counter % 2 == 0)
|
||||
if (counter % 10 < 8)
|
||||
{
|
||||
textScoreBoard->writeCentered(offsetScoreP1.x, offsetScoreP1.y, "Mode");
|
||||
textScoreBoard->writeCentered(offsetMultP1Label.x, offsetMultP1Label.y, "Demo");
|
||||
@@ -235,7 +235,7 @@ void Scoreboard::fillBackgroundTexture()
|
||||
|
||||
else if (mode[SCOREBOARD_RIGHT_SIDE] == SCOREBOARD_MODE_DEMO)
|
||||
{
|
||||
if (counter % 2 == 0)
|
||||
if (counter % 10 < 8)
|
||||
{
|
||||
textScoreBoard->writeCentered(offsetScoreP2.x, offsetScoreP2.y, "Mode");
|
||||
textScoreBoard->writeCentered(offsetMultP2Label.x, offsetMultP2Label.y, "Demo");
|
||||
|
||||
@@ -19,7 +19,7 @@ enum scoreboard_modes_e
|
||||
#define SCOREBOARD_LEFT_SIDE 0
|
||||
#define SCOREBOARD_RIGHT_SIDE 1
|
||||
|
||||
#define SCOREBOARD_TICK_SPEED 1000
|
||||
#define SCOREBOARD_TICK_SPEED 100
|
||||
|
||||
// Clase Scoreboard
|
||||
class Scoreboard
|
||||
|
||||
Reference in New Issue
Block a user