Añadido el cambio de borde, tamaño de ventana y paleta a todas las secciones del juego

This commit is contained in:
2022-10-27 11:49:47 +02:00
parent abbff605c0
commit 4133dfd7c9
11 changed files with 162 additions and 57 deletions

View File

@@ -87,7 +87,8 @@ void Game::checkEventHandler()
screen->setBorderColor(stringToColor(options->palette, "black"));
break;
}
else if ((eventHandler->type == SDL_KEYDOWN) and (eventHandler->key.repeat == 0))
if ((eventHandler->type == SDL_KEYDOWN) and (eventHandler->key.repeat == 0))
{
switch (eventHandler->key.keysym.scancode)
{
@@ -420,6 +421,10 @@ void Game::switchPalette()
room->reLoadPalette();
player->reLoadPalette();
scoreboard->reLoadPalette();
const color_t c = room->getBorderColor();
board.color = (c.r + c.g + c.b == 0) ? stringToColor(options->palette, "white") : c; // Si el color es negro lo cambia a blanco
}
// Establece la pantalla en negro