From 6a12294a36c3d305b27a2abfbbd8f5698e582d5d Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sat, 18 Apr 2026 11:58:46 +0200 Subject: [PATCH] =?UTF-8?q?surface:=20hallazgo=205=20=E2=80=94=20renderWit?= =?UTF-8?q?hColorReplace=20aplica=20sub=5Fpalette=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Coherencia con render() y renderWithVerticalFade(): el píxel no sustituido pasa por sub_palette_ en vez de copiarse crudo. Hoy es no-op (las surfaces que usan color replace no hacen fadeSubPalette) pero cierra la divergencia de API y previene regresiones futuras. Co-Authored-By: Claude Opus 4.7 (1M context) --- source/core/rendering/surface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/rendering/surface.cpp b/source/core/rendering/surface.cpp index ae85e1c73..cc16cb0af 100644 --- a/source/core/rendering/surface.cpp +++ b/source/core/rendering/surface.cpp @@ -415,11 +415,11 @@ void Surface::renderWithColorReplace(int x, int y, Uint8 source_color, Uint8 tar continue; // Saltar píxeles fuera del rango del destino } - // Copia el píxel si no es transparente + // Copia el píxel si no es transparente; aplica sub_palette_ como el resto de render* Uint8 color = surface_data_->data.get()[static_cast(src_x + (src_y * surface_data_->width))]; if (color != static_cast(transparent_color_)) { surface_data->data[dest_x + (dest_y * surface_data->width)] = - (color == source_color) ? target_color : color; + (color == source_color) ? target_color : sub_palette_[color]; } } }