[Scummvm-git-logs] scummvm master -> 642d2f4b1e44d19e7ba5c14b54b57ffad94872ef

bluegr noreply at scummvm.org
Sun Apr 7 19:40:28 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:
642d2f4b1e TESTBED: Improve video player support on low resolution platforms


Commit: 642d2f4b1e44d19e7ba5c14b54b57ffad94872ef
    https://github.com/scummvm/scummvm/commit/642d2f4b1e44d19e7ba5c14b54b57ffad94872ef
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2024-04-07T22:40:25+03:00

Commit Message:
TESTBED: Improve video player support on low resolution platforms

Changed paths:
    engines/testbed/video.cpp


diff --git a/engines/testbed/video.cpp b/engines/testbed/video.cpp
index 8ada429af75..c9fd79ae714 100644
--- a/engines/testbed/video.cpp
+++ b/engines/testbed/video.cpp
@@ -82,7 +82,20 @@ Common::Error Videotests::videoTest(Common::SeekableReadStream *stream, const Co
 	}
 
 	warning("Actual pixel format: %s", pixelformat.toString().c_str());
-	initGraphics(640, 480, &pixelformat);
+
+#ifdef __DS__
+	int w = 256, h = 192;
+#elif defined(USE_HIGHRES)
+	int w = 640, h = 480;
+#else
+	int w = 320, h = 200;
+#endif
+	if (w < video->getWidth() || h < video->getHeight()) {
+		w = video->getWidth();
+		h = video->getHeight();
+	}
+
+	initGraphics(w, h, &pixelformat);
 
 	video->start();
 
@@ -106,11 +119,11 @@ Common::Error Videotests::videoTest(Common::SeekableReadStream *stream, const Co
 
 				int x = 0, y = 0;
 
-				if (surf->w < g_system->getWidth() && surf->h < g_system->getHeight()) {
-					x = (g_system->getWidth() - surf->w) >> 1;
-					y = (g_system->getHeight() - surf->h) >> 1;
+				if (surf->w < w && surf->h < h) {
+					x = (w - surf->w) >> 1;
+					y = (h - surf->h) >> 1;
 				}
-				g_system->copyRectToScreen(surf->getPixels(), surf->pitch, x, y, MIN<uint16>(surf->w, 640), MIN<uint16>(surf->h, 480));
+				g_system->copyRectToScreen(surf->getPixels(), surf->pitch, x, y, MIN<uint16>(surf->w, w), MIN<uint16>(surf->h, h));
 
 				if (conv) {
 					conv->free();




More information about the Scummvm-git-logs mailing list