llevat soport per a colors amb nom
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
#include "game/ui/console.hpp" // Para Console
|
||||
#include "game/ui/notifier.hpp" // Para Notifier, NotificationText, CHEEVO_NO...
|
||||
#include "utils/defines.hpp" // Para Tile::SIZE, PlayArea::HEIGHT, RoomBorder::BOTTOM
|
||||
#include "utils/utils.hpp" // Para PaletteColor, stringToColor
|
||||
#include "utils/utils.hpp"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include "core/system/debug.hpp" // Para Debug
|
||||
@@ -489,7 +489,7 @@ void Game::renderPlaying() {
|
||||
// Renderiza el juego en estado BLACK_SCREEN (pantalla negra)
|
||||
void Game::renderBlackScreen() {
|
||||
Screen::get()->start();
|
||||
auto const COLOR = static_cast<Uint8>(PaletteColor::BLACK);
|
||||
auto const COLOR = 0;
|
||||
Screen::get()->clearSurface(COLOR);
|
||||
Screen::get()->setBorderColor(COLOR);
|
||||
Screen::get()->render();
|
||||
@@ -498,7 +498,7 @@ void Game::renderBlackScreen() {
|
||||
// Renderiza el juego en estado GAME_OVER (pantalla negra)
|
||||
void Game::renderGameOver() {
|
||||
Screen::get()->start();
|
||||
Screen::get()->clearSurface(static_cast<Uint8>(PaletteColor::BLACK));
|
||||
Screen::get()->clearSurface(0);
|
||||
Screen::get()->render();
|
||||
}
|
||||
|
||||
@@ -511,7 +511,7 @@ void Game::renderFadeToEnding() {
|
||||
Screen::get()->setRendererSurface(game_backbuffer_surface_);
|
||||
|
||||
// 3. Renderizar todo a backbuffer
|
||||
game_backbuffer_surface_->clear(static_cast<Uint8>(PaletteColor::BLACK));
|
||||
game_backbuffer_surface_->clear(0);
|
||||
room_->renderMap();
|
||||
room_->renderEnemies();
|
||||
room_->renderItems();
|
||||
@@ -530,7 +530,7 @@ void Game::renderFadeToEnding() {
|
||||
// Renderiza el juego en estado POST_FADE_ENDING (pantalla negra)
|
||||
void Game::renderPostFadeEnding() {
|
||||
Screen::get()->start();
|
||||
Screen::get()->clearSurface(static_cast<Uint8>(PaletteColor::BLACK));
|
||||
Screen::get()->clearSurface(0);
|
||||
Screen::get()->render();
|
||||
}
|
||||
|
||||
@@ -550,18 +550,18 @@ void Game::renderDebugInfo() {
|
||||
|
||||
// Borra el marcador
|
||||
SDL_FRect rect = {.x = 0, .y = 18 * Tile::SIZE, .w = PlayArea::WIDTH, .h = GameCanvas::HEIGHT - PlayArea::HEIGHT};
|
||||
surface->fillRect(&rect, static_cast<Uint8>(PaletteColor::BLACK));
|
||||
surface->fillRect(&rect, 0);
|
||||
|
||||
// Pinta la rejilla
|
||||
/*for (int i = 0; i < PlayArea::BOTTOM; i += 8)
|
||||
{
|
||||
// Lineas horizontales
|
||||
surface->drawLine(0, i, PlayArea::RIGHT, i, static_cast<Uint8>(PaletteColor::BRIGHT_BLACK));
|
||||
surface->drawLine(0, i, PlayArea::RIGHT, i, 1);
|
||||
}
|
||||
for (int i = 0; i < PlayArea::RIGHT; i += 8)
|
||||
{
|
||||
// Lineas verticales
|
||||
surface->drawLine(i, 0, i, PlayArea::BOTTOM - 1, static_cast<Uint8>(PaletteColor::BRIGHT_BLACK));
|
||||
surface->drawLine(i, 0, i, PlayArea::BOTTOM - 1, 1);
|
||||
}*/
|
||||
|
||||
// Pinta el texto
|
||||
@@ -815,11 +815,11 @@ void Game::setScoreBoardColor() { // NOLINT(readability-convert-member-function
|
||||
// Obtiene el color del borde
|
||||
const Uint8 BORDER_COLOR = room_->getBorderColor();
|
||||
|
||||
const bool IS_BLACK = BORDER_COLOR == static_cast<Uint8>(PaletteColor::BLACK);
|
||||
const bool IS_BRIGHT_BLACK = BORDER_COLOR == static_cast<Uint8>(PaletteColor::BRIGHT_BLACK);
|
||||
const bool IS_BLACK = BORDER_COLOR == 0;
|
||||
const bool IS_BRIGHT_BLACK = BORDER_COLOR == 1;
|
||||
|
||||
// Si el color del borde es negro o negro brillante cambia el texto del marcador a blanco
|
||||
scoreboard_data_->color = IS_BLACK || IS_BRIGHT_BLACK ? static_cast<Uint8>(PaletteColor::WHITE) : BORDER_COLOR;
|
||||
scoreboard_data_->color = IS_BLACK || IS_BRIGHT_BLACK ? 14 : BORDER_COLOR;
|
||||
}
|
||||
|
||||
// Comprueba si ha finalizado el juego
|
||||
|
||||
Reference in New Issue
Block a user