From 5cc163dd144aaa5e34919b1eb4ce7a9c7fafdd0e Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Wed, 5 Mar 2025 21:57:10 +0100 Subject: [PATCH] Arreglats els endings --- source/ending.cpp | 9 +++++---- source/options.cpp | 2 +- source/text.cpp | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/source/ending.cpp b/source/ending.cpp index 1db3db1..276b485 100644 --- a/source/ending.cpp +++ b/source/ending.cpp @@ -84,7 +84,7 @@ void Ending::render() Screen::get()->start(); // Limpia la pantalla - Screen::get()->clearSurface(stringToColor("yellow")); + Screen::get()->clearSurface(stringToColor("black")); // Dibuja las imagenes de la escena sprite_pics_.at(current_scene_).image_sprite->render(); @@ -167,14 +167,15 @@ void Ending::iniTexts() const int WIDTH = text->lenght(txt.caption, 1) + 2 + 2; const int HEIGHT = text->getCharacterSize() + 2 + 2; - auto color = stringToColor("black"); + auto text_color = stringToColor("white"); + auto shadow_color = stringToColor("black"); EndingSurface st; // Crea la textura st.image_surface = std::make_shared(WIDTH, HEIGHT); Screen::get()->setRendererSurface(st.image_surface); - text->writeDX(TEXT_STROKE, 2, 2, txt.caption, 1, color, 2, color); + text->writeDX(TEXT_STROKE, 2, 2, txt.caption, 1, text_color, 2, shadow_color); // Crea el sprite st.image_sprite = std::make_shared(st.image_surface, 0, 0, st.image_surface->getWidth(), st.image_surface->getHeight()); @@ -189,7 +190,7 @@ void Ending::iniTexts() // Crea una malla de 8 pixels de alto auto surface = Screen::get()->getRendererSurface(); - color = stringToColor("black"); + auto color = stringToColor("black"); for (int i = 0; i < WIDTH; i += 2) { surface->putPixel(i, 0, color); diff --git a/source/options.cpp b/source/options.cpp index 468f69a..084a207 100644 --- a/source/options.cpp +++ b/source/options.cpp @@ -21,7 +21,7 @@ void initOptions() options = Options(); #ifdef DEBUG - options.section = SectionState(Section::LOGO, Subsection::LOGO_TO_INTRO); + options.section = SectionState(Section::ENDING2, Subsection::NONE); options.console = true; #else options.section = SectionState(Section::LOGO, Subsection::LOGO_TO_INTRO); diff --git a/source/text.cpp b/source/text.cpp index a8ca633..17065cf 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -136,7 +136,7 @@ void Text::write(int x, int y, const std::string &text, int kerning, int lenght) auto index = static_cast(text[i]); sprite_->setClip(offset_[index].x, offset_[index].y, box_width_, box_height_); sprite_->setX(x + shift); - sprite_->render(); + sprite_->render(1, 15); shift += offset_[static_cast(text[i])].w + kerning; } } @@ -242,7 +242,8 @@ void Text::writeDX(Uint8 flags, int x, int y, const std::string &text, int kerni } else { - write(x, y, text, kerning, lenght); + writeColored(x, y, text, textColor, kerning, lenght); + //write(x, y, text, kerning, lenght); } }