No se pq el ultim commit ha deixat 4 fitxers per commitar

This commit is contained in:
2025-03-07 12:21:21 +01:00
parent 6c3e231d51
commit ce88596d35
4 changed files with 8 additions and 14 deletions

View File

@@ -46,9 +46,3 @@ constexpr int GAMECANVAS_THIRD_QUARTER_X = (GAMECANVAS_WIDTH / 4) * 3;
constexpr int GAMECANVAS_CENTER_Y = GAMECANVAS_HEIGHT / 2;
constexpr int GAMECANVAS_FIRST_QUARTER_Y = GAMECANVAS_HEIGHT / 4;
constexpr int GAMECANVAS_THIRD_QUARTER_Y = (GAMECANVAS_HEIGHT / 4) * 3;
// Colores
// const Color borderColor = {0x27, 0x27, 0x36};
const Uint8 border_color = 1;
// const Color black = {0xFF, 0xFF, 0xFF};
const Uint8 black_color = 1;

View File

@@ -76,7 +76,6 @@ Director::Director(int argc, const char *argv[])
// Crea los objetos
Screen::init(window_, renderer_);
Screen::get()->setBorderColor(border_color);
Resource::init();
Notifier::init("", "8bithud");
Screen::get()->setNotificationsEnabled(true);

View File

@@ -49,7 +49,7 @@ void Resource::load()
{
calculateTotal();
Screen::get()->show();
Screen::get()->setBorderColor(1);
Screen::get()->setBorderColor(static_cast<Uint8>(PaletteColor::BLACK));
std::cout << "** LOADING RESOURCES" << std::endl;
loadSounds();
loadMusics();
@@ -438,6 +438,8 @@ void Resource::renderProgress()
const int full_bar_width = wired_bar_width * count_.getPercentage();
SDL_Rect rect_full = {X_PADDING, bar_position, full_bar_width, X_PADDING};
surface->fillRect(&rect_full, static_cast<Uint8>(PaletteColor::WHITE));
Screen::get()->render();
}
// Comprueba los eventos de la pantalla de carga

View File

@@ -92,10 +92,12 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer)
// Crea la surface donde se dibujan los graficos del juego
game_surface_ = std::make_shared<Surface>(options.game.width, options.game.height);
game_surface_->setPalette(readPalFile(palettes_.at(current_palette_)));
game_surface_->clear(static_cast<Uint8>(PaletteColor::BLACK));
// Crea la surface donde se dibujan los graficos del juego
// Crea la surface para el borde de colores
border_surface_ = std::make_shared<Surface>(options.game.width + options.video.border.width * 2, options.game.height + options.video.border.height * 2);
border_surface_->setPalette(readPalFile(palettes_.at(current_palette_)));
border_surface_->clear(border_color_);
// Establece la surface que actuará como renderer para recibir las llamadas a render()
renderer_surface_ = std::make_shared<std::shared_ptr<Surface>>(game_surface_);
@@ -127,10 +129,7 @@ void Screen::clear(Color color)
}
// Limpia la pantalla
void Screen::clearSurface(Uint8 index)
{
game_surface_->clear(index);
}
void Screen::clearSurface(Uint8 index) { game_surface_->clear(index); }
// Prepara para empezar a dibujar en la textura de juego
void Screen::start()