Implementado cambio de paleta en el game over

This commit is contained in:
2022-11-08 10:19:27 +01:00
parent 2f3c8cada9
commit 3ef2ce3c0d
3 changed files with 11 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ Director::Director(int argc, char *argv[])
section.name = SECTION_PROG_LOGO; section.name = SECTION_PROG_LOGO;
section.subsection = SUBSECTION_LOGO_TO_INTRO; section.subsection = SUBSECTION_LOGO_TO_INTRO;
section.name = SECTION_PROG_ENDING2; section.name = SECTION_PROG_LOGO;
// Crea e inicializa las opciones del programa // Crea e inicializa las opciones del programa
iniOptions(); iniOptions();

View File

@@ -151,12 +151,10 @@ void GameOver::checkEventHandler()
break; break;
case SDL_SCANCODE_F5: case SDL_SCANCODE_F5:
// switchPalette(); switchPalette();
break; break;
default: default:
// section.name = SECTION_PROG_TITLE;
// section.subsection = 0;
break; break;
} }
} }
@@ -231,3 +229,9 @@ void GameOver::updateCounters()
section.subsection = SUBSECTION_LOGO_TO_TITLE; section.subsection = SUBSECTION_LOGO_TO_TITLE;
} }
} }
// Cambia la paleta
void GameOver::switchPalette()
{
options->palette = (options->palette == p_zxspectrum) ? p_zxarne : p_zxspectrum;
}

View File

@@ -60,6 +60,9 @@ private:
// Actualiza los contadores // Actualiza los contadores
void updateCounters(); void updateCounters();
// Cambia la paleta
void switchPalette();
public: public:
// Constructor // Constructor
GameOver(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options); GameOver(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options);