Cambiada la lógica para el carrusel de secciones del modo demo

This commit is contained in:
2024-06-28 11:52:18 +02:00
parent 2650a64c80
commit 85a24e0100
13 changed files with 114 additions and 226 deletions

View File

@@ -73,25 +73,11 @@ void HiScoreTable::update()
// Actualiza el fondo
background->update();
if (mode == mhst_auto)
{ // Modo automático
counter++;
counter++;
if (counter == counterEnd)
{
section->name = SECTION_PROG_TITLE;
section->subsection = SUBSECTION_TITLE_1;
}
}
else
{ // Modo manual
++counter %= 60000;
if (manualQuit)
{
section->name = SECTION_PROG_TITLE;
section->subsection = SUBSECTION_TITLE_2;
}
if (counter == counterEnd)
{
section->name = SECTION_PROG_INSTRUCTIONS;
}
}
}
@@ -130,11 +116,6 @@ void HiScoreTable::fillTexture()
text->writeDX(TXT_CENTER | TXT_SHADOW, GAMECANVAS_CENTER_X, (i * spaceBetweenLines) + spaceBetweenHeader, line, 1, orangeColor, 1, shdwTxtColor);
}
if ((mode == mhst_manual) && (counter % 50 > 14))
{
text->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, GAMECANVAS_CENTER_X, param->gameHeight - 12, lang->getText(22), 1, orangeColor, 1, shdwTxtColor);
}
// Cambia el destino de renderizado
SDL_SetRenderTarget(renderer, temp);
}
@@ -152,7 +133,7 @@ void HiScoreTable::render()
background->render();
// Establece la ventana del backbuffer
viewArea.y = mode == mhst_auto ? std::max(8, param->gameHeight - counter + 100) : 0;
viewArea.y = std::max(8, param->gameHeight - counter + 100);
// Copia el backbuffer al renderizador
SDL_RenderCopy(renderer, backbuffer, nullptr, &viewArea);
@@ -201,27 +182,15 @@ void HiScoreTable::checkInput()
else if (input->checkInput(input_pause, REPEAT_FALSE) || input->checkInput(input_accept, REPEAT_FALSE) || input->checkInput(input_fire_left, REPEAT_FALSE) || input->checkInput(input_fire_center, REPEAT_FALSE) || input->checkInput(input_fire_right, REPEAT_FALSE))
{
if (mode == mhst_auto)
{
JA_StopMusic();
section->name = SECTION_PROG_TITLE;
section->subsection = SUBSECTION_TITLE_1;
}
else
{
if (counter > 30)
{
manualQuit = true;
}
}
JA_StopMusic();
section->name = SECTION_PROG_TITLE;
section->subsection = SUBSECTION_TITLE_1;
}
}
// Bucle para la pantalla de instrucciones
void HiScoreTable::run(mode_hiScoreTable_e mode)
void HiScoreTable::run()
{
this->mode = mode;
while (section->name == SECTION_PROG_HI_SCORE_TABLE)
{
update();