Transició a surface: barallantme amb tots els Color que hi ha pel codi

This commit is contained in:
2025-03-03 22:58:12 +01:00
parent b940d627d6
commit c4033e3663
20 changed files with 219 additions and 224 deletions

View File

@@ -28,7 +28,7 @@
// Constructor
Game::Game(GameMode mode)
: board_(std::make_shared<ScoreboardData>(0, 9, 0, true, Color(0, 0, 0), SDL_GetTicks(), options.cheats.jail_is_open == Cheat::CheatState::ENABLED)),
: board_(std::make_shared<ScoreboardData>(0, 9, 0, true, 0, SDL_GetTicks(), options.cheats.jail_is_open == Cheat::CheatState::ENABLED)),
scoreboard_(std::make_shared<Scoreboard>(board_)),
room_tracker_(std::make_shared<RoomTracker>()),
stats_(std::make_shared<Stats>(Asset::get()->get("stats.csv"), Asset::get()->get("stats_buffer.csv"))),
@@ -447,7 +447,7 @@ void Game::renderBlackScreen()
if (black_screen_)
{
Screen::get()->clean();
Screen::get()->setBorderColor(stringToColor(options.video.palette, "black"));
Screen::get()->setBorderColor(stringToColor("black"));
}
}
@@ -455,13 +455,13 @@ void Game::renderBlackScreen()
void Game::setScoreBoardColor()
{
// Obtiene el color del borde
const Color colorBorder = room_->getBorderColor();
const Uint8 colorBorder = room_->getBorderColor();
const bool isBlack = colorAreEqual(colorBorder, stringToColor(options.video.palette, "black"));
const bool isBrightBlack = colorAreEqual(colorBorder, stringToColor(options.video.palette, "bright_black"));
const bool isBlack = colorBorder, stringToColor("black");
const bool isBrightBlack = colorBorder, stringToColor("bright_black");
// Si el color del borde es negro o negro brillante cambia el texto del marcador a blanco
board_->color = isBlack || isBrightBlack ? stringToColor(options.video.palette, "white") : colorBorder;
board_->color = isBlack || isBrightBlack ? stringToColor("white") : colorBorder;
}
// Comprueba si ha finalizado el juego