GRAPHICS: Explicitly handle matching formats in ManagedSurface::simpleBlitFrom

This commit is contained in:
Cameron Cawley 2024-07-03 23:23:43 +01:00 committed by Filippos Karapetis
parent 04137b4d21
commit a8221621e6

View File

@ -396,9 +396,17 @@ void ManagedSurface::simpleBlitFromInner(const Surface &src, const Common::Rect
const byte *srcPtr = (const byte *)src.getBasePtr(srcRectC.left, srcRectC.top);
byte *dstPtr = (byte *)getBasePtr(dstRectC.left, dstRectC.top);
if (src.format.isCLUT8()) {
if (format == src.format) {
if (transparentColorSet) {
keyBlit(dstPtr, srcPtr, pitch, src.pitch, srcRectC.width(), srcRectC.height(),
format.bytesPerPixel, transparentColor);
} else {
copyBlit(dstPtr, srcPtr, pitch, src.pitch, srcRectC.width(), srcRectC.height(),
format.bytesPerPixel);
}
} else if (src.format.isCLUT8()) {
assert(srcPalette);
assert(format.isCLUT8());
assert(!format.isCLUT8());
uint32 map[256];
convertPaletteToMap(map, srcPalette->data(), srcPalette->size(), format);