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

dreammaster dreammaster at scummvm.org
Tue Jun 29 02:12:58 UTC 2021


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:
f0e7771eba AGS: Handle displaying thumbnails other than 160x100 in GMM


Commit: f0e7771ebad0b0e74f7a55cc451d919e3eccdb60
    https://github.com/scummvm/scummvm/commit/f0e7771ebad0b0e74f7a55cc451d919e3eccdb60
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-06-28T19:12:42-07:00

Commit Message:
AGS: Handle displaying thumbnails other than 160x100 in GMM

Changed paths:
    engines/ags/metaengine.cpp


diff --git a/engines/ags/metaengine.cpp b/engines/ags/metaengine.cpp
index 8d4e5a0eb1..a5696a2229 100644
--- a/engines/ags/metaengine.cpp
+++ b/engines/ags/metaengine.cpp
@@ -139,8 +139,19 @@ SaveStateDescriptor AGSMetaEngine::querySaveMetaInfos(const char *target, int sl
 				Image::BitmapDecoder decoder;
 				if (decoder.loadStream(thumbStream)) {
 					const Graphics::Surface *src = decoder.getSurface();
-					Graphics::Surface *dest = new Graphics::Surface();
-					dest->copyFrom(*src);
+					Graphics::Surface *dest;
+
+					if (src->w == 160 && src->h == 100) {
+						dest = new Graphics::Surface();
+						dest->copyFrom(*src);
+					} else {
+						Graphics::ManagedSurface temp(160, 100, src->format);
+						temp.blitFrom(*src, Common::Rect(0, 0, src->w, src->h),
+							Common::Rect(0, 0, 160, 100));
+
+						dest = new Graphics::Surface();
+						dest->copyFrom(temp);
+					}
 
 					desc.setThumbnail(dest);
 				}




More information about the Scummvm-git-logs mailing list