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

bluegr noreply at scummvm.org
Wed Jun 21 07:10:46 UTC 2023


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:
bf8655b35e AGS: When loading images convert to supported pixelformats


Commit: bf8655b35ee2a6455cf57e8f1a4272ce1db8ef8a
    https://github.com/scummvm/scummvm/commit/bf8655b35ee2a6455cf57e8f1a4272ce1db8ef8a
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2023-06-21T10:10:42+03:00

Commit Message:
AGS: When loading images convert to supported pixelformats

This ensures that the surfaces mantain a format supported by Allegro,
and is required after commit b458ced:
"IMAGE: Speed up 16/24/32bpp BMP decoding"
to support 24bpp

Changed paths:
    engines/ags/shared/gfx/image.cpp


diff --git a/engines/ags/shared/gfx/image.cpp b/engines/ags/shared/gfx/image.cpp
index b8ded0e3c3b..69f703f92c1 100644
--- a/engines/ags/shared/gfx/image.cpp
+++ b/engines/ags/shared/gfx/image.cpp
@@ -45,7 +45,10 @@ BITMAP *decodeImageStream(Common::SeekableReadStream &stream, color *pal) {
 		const Graphics::Surface *src = decoder.getSurface();
 
 		// Copy the decoded surface
-		Surface *dest = new Surface(src->w, src->h, src->format);
+		int bpp = 8 * src->format.bytesPerPixel;
+		if (bpp == 24)
+			bpp = 32;
+		Surface *dest = (Surface *)create_bitmap_ex(bpp, src->w, src->h);
 		dest->blitFrom(*src);
 
 		// Copy the palette




More information about the Scummvm-git-logs mailing list