surface: hallazgo 5 — renderWithColorReplace aplica sub_palette_
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
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<size_t>(src_x + (src_y * surface_data_->width))];
|
Uint8 color = surface_data_->data.get()[static_cast<size_t>(src_x + (src_y * surface_data_->width))];
|
||||||
if (color != static_cast<Uint8>(transparent_color_)) {
|
if (color != static_cast<Uint8>(transparent_color_)) {
|
||||||
surface_data->data[dest_x + (dest_y * surface_data->width)] =
|
surface_data->data[dest_x + (dest_y * surface_data->width)] =
|
||||||
(color == source_color) ? target_color : color;
|
(color == source_color) ? target_color : sub_palette_[color];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user