marcador provisional

This commit is contained in:
2026-04-06 14:53:58 +02:00
parent 67bf6b2017
commit 4c5e1e5470
12 changed files with 180 additions and 181 deletions

View File

@@ -144,6 +144,13 @@ void Console::redrawText() {
SDL_FRect rect = {.x = 0, .y = 0, .w = WIDTH, .h = height_};
surface_->drawRectBorder(&rect, BORDER_COLOR);
// La surface de la fuente tiene transparent_color_=255 por defecto,
// pero sus píxeles de fondo son color 0. Cambiarlo temporalmente a 0
// para que no pinte el fondo negro de los glyphs sobre la consola.
auto* font_surface = text_->getSprite()->getSurface().get();
const Uint8 PREV_TRANSPARENT = font_surface->getTransparentColor();
font_surface->setTransparentColor(0);
// Líneas de mensaje con efecto typewriter (solo muestra los primeros typewriter_chars_)
int y_pos = PADDING_IN_V;
int remaining = typewriter_chars_;
@@ -160,6 +167,9 @@ void Console::redrawText() {
const std::string INPUT_STR = prompt_ + input_line_ + (SHOW_CURSOR ? "_" : "");
text_->writeColored(PADDING_IN_H, y_pos, INPUT_STR, BORDER_COLOR);
// Restaurar transparent_color_ original de la fuente
font_surface->setTransparentColor(PREV_TRANSPARENT);
Screen::get()->setRendererSurface(previous_renderer);
}

View File

@@ -51,7 +51,7 @@ class Console {
};
// Constantes visuales
static constexpr Uint8 BG_COLOR = 0; // PaletteColor::BLACK
static constexpr Uint8 BG_COLOR = 255; // Transparente (sin fondo)
static constexpr Uint8 BORDER_COLOR = 9; // PaletteColor::BRIGHT_GREEN
static constexpr Uint8 MSG_COLOR = 8; // PaletteColor::GREEN
static constexpr float SLIDE_SPEED = 180.0F;