[Scummvm-git-logs] scummvm master -> a8221621e6470d05eaf5cf1c01eedfc326e83d50

bluegr noreply at scummvm.org
Fri Jul 5 05:38:10 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a8221621e6 GRAPHICS: Explicitly handle matching formats in ManagedSurface::simpleBlitFrom


Commit: a8221621e6470d05eaf5cf1c01eedfc326e83d50
    https://github.com/scummvm/scummvm/commit/a8221621e6470d05eaf5cf1c01eedfc326e83d50
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2024-07-05T08:38:08+03:00

Commit Message:
GRAPHICS: Explicitly handle matching formats in ManagedSurface::simpleBlitFrom

Changed paths:
    graphics/managed_surface.cpp


diff --git a/graphics/managed_surface.cpp b/graphics/managed_surface.cpp
index bf342e806c4..9d8093f6cff 100644
--- a/graphics/managed_surface.cpp
+++ b/graphics/managed_surface.cpp
@@ -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);




More information about the Scummvm-git-logs mailing list