Eliminada paleta.cpp i mig adaptada la surface que la gastava

This commit is contained in:
2025-03-07 14:12:24 +01:00
parent ce88596d35
commit 529bfb5e3a
6 changed files with 22 additions and 289 deletions

View File

@@ -19,20 +19,15 @@
#include "text.h" // for Text, TEXT_CENTER, TEXT_COLOR
#include "surface.h" // for Surface
#include "utils.h" // for Color, stringToColor, Palette
#include "paleta.h"
// Constructor
Title::Title()
: title_logo_surface_(Resource::get()->getSurface("title_logo.gif")),
title_logo_sprite_(std::make_shared<SSprite>(title_logo_surface_, 0, 0, title_logo_surface_->getWidth(), title_logo_surface_->getHeight())),
loading_screen_surface_(Resource::get()->getSurface("title_loading.gif")),
loading_screen_sprite_(std::make_shared<SSprite>(loading_screen_surface_, 0, options.game.height - loading_screen_surface_->getHeight(), loading_screen_surface_->getWidth(), loading_screen_surface_->getHeight())),
bg_surface_(std::make_shared<Surface>(options.game.width, options.game.height))
{
// Carga la surface con los gráficos de la pantalla de carga
pInit(Screen::get()->getRenderer(), 256, 128);
loading_screen_ = pLoadSurface(Asset::get()->get("loading_screen_color.gif").c_str());
pLoadPal(Asset::get()->get("loading_screen_color.gif").c_str());
pSetSource(loading_screen_);
// Inicializa variables
state_ = options.section.subsection == Subsection::TITLE_WITH_LOADING_SCREEN ? TitleState::SHOW_LOADING_SCREEN : TitleState::SHOW_MENU;
options.section.section = Section::TITLE;
@@ -52,12 +47,6 @@ Title::Title()
playMusic("title.ogg");
}
// Destructor
Title::~Title()
{
pDeleteSurface(loading_screen_);
}
// Inicializa la marquesina
void Title::initMarquee()
{
@@ -164,7 +153,7 @@ void Title::updateMarquee()
// Comprueba si ha terminado la marquesina y la reinicia
if (letters_[letters_.size() - 1].x < -10)
{
{
// Inicializa la marquesina
initMarquee();
}
@@ -213,7 +202,7 @@ void Title::update()
case TitleState::FADE_LOADING_SCREEN:
if (counter_ % 4 == 0)
{
if (pFadePal())
if (true) // poner aqui la condicion de "fin de fade = true"
{
counter_ = 0;
state_ = TitleState::SHOW_MENU;
@@ -267,12 +256,7 @@ void Title::render()
case TitleState::SHOW_LOADING_SCREEN:
case TitleState::FADE_LOADING_SCREEN:
// Dibuja la pantalla de carga
pCls(4);
pBlit(0, 0, 0, 0, 256, 128);
pFlip(Screen::get()->getRenderer());
// Dibuja el logo del título
loading_screen_sprite_->render();
title_logo_sprite_->render();
break;