[Scummvm-git-logs] scummvm master -> 2472ef30c302fee57ffb67132f25ebb3d5f4a47d

bluegr noreply at scummvm.org
Sat Sep 27 16:33:51 UTC 2025


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

Summary:
4204761f64 TESTBED: Add flag to draw a frame around screen when writing text
3ff491d229 TESTBED: Improve shaking test
2472ef30c3 GRAPHICS: Don't constrain too much the game screen


Commit: 4204761f647741aceb1b2eb9945b9cf58a92e6c1
    https://github.com/scummvm/scummvm/commit/4204761f647741aceb1b2eb9945b9cf58a92e6c1
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-09-27T19:33:46+03:00

Commit Message:
TESTBED: Add flag to draw a frame around screen when writing text

Changed paths:
    engines/testbed/graphics.cpp
    engines/testbed/testsuite.cpp
    engines/testbed/testsuite.h


diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp
index bcce7300605..9046d225d40 100644
--- a/engines/testbed/graphics.cpp
+++ b/engines/testbed/graphics.cpp
@@ -1621,7 +1621,7 @@ TestExitStatus GFXtests::pixelFormats(Common::List<Graphics::PixelFormat> &pfLis
 			showPixelFormat(Graphics::PixelFormat::createFormatCLUT8(), iter->aLoss);
 
 			Common::Point pt(0, 170);
-			Testsuite::writeOnScreen("Example displayed with Pixel Format CLUT8", pt, false);
+			Testsuite::writeOnScreen("Example displayed with Pixel Format CLUT8", pt, kWriteNoFlag);
 
 			Common::String tutorial;
 			tutorial = Common::String::format("Testing a group of Pixel Formats with %d-bit alpha channel.\nPlease, memorize the pattern displayed in the frame above.", 8 - iter->aLoss);
@@ -1645,7 +1645,7 @@ TestExitStatus GFXtests::pixelFormats(Common::List<Graphics::PixelFormat> &pfLis
 		Common::Point pt(0, 170);
 		Common::String msg;
 		msg = Common::String::format("Testing Pixel Format %s, %d of %d", iter->toString().c_str(), numFormatsTested, pfList.size());
-		Testsuite::writeOnScreen(msg, pt, true);
+		Testsuite::writeOnScreen(msg, pt, kWriteRGBColors);
 
 		g_system->delayMillis(500);
 
diff --git a/engines/testbed/testsuite.cpp b/engines/testbed/testsuite.cpp
index eb2f24d108e..325f63a7631 100644
--- a/engines/testbed/testsuite.cpp
+++ b/engines/testbed/testsuite.cpp
@@ -121,25 +121,28 @@ void Testsuite::displayMessage(const Common::String &textToDisplay, const char *
 	prompt.runModal();
 }
 
-Common::Rect Testsuite::writeOnScreen(const Common::String &textToDisplay, const Common::Point &pt, bool flag) {
-	const Graphics::Font &font(*FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont));
+Common::Rect Testsuite::writeOnScreen(const Common::String &textToDisplay, const Common::Point &pt, WriteFlags flags) {
 	uint fillColor = kColorBlack;
 	uint textColor = kColorWhite;
+	if (flags & kWriteRGBColors) {
+		Graphics::PixelFormat pf = g_system->getScreenFormat();
+		fillColor = pf.RGBToColor(0, 0, 0);
+		textColor = pf.RGBToColor(255, 255, 255);
+	}
+
+	const Graphics::Font &font(*FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont));
 
 	int height = font.getFontHeight();
 	int width = g_system->getWidth();
 
 	Common::Rect rect(pt.x, pt.y, pt.x + width, pt.y + height);
 
-	if (flag) {
-		Graphics::PixelFormat pf = g_system->getScreenFormat();
-		fillColor = pf.RGBToColor(0, 0, 0);
-		textColor = pf.RGBToColor(255, 255, 255);
-	}
-
 	g_system->fillScreen(rect, fillColor);
 
 	Graphics::Surface *screen = g_system->lockScreen();
+	if (flags & kWriteDrawFrame) {
+		screen->frameRect(Common::Rect(width, g_system->getHeight()), textColor);
+	}
 	font.drawString(screen, textToDisplay, rect.left, rect.top, screen->w, textColor, Graphics::kTextAlignCenter);
 	g_system->unlockScreen();
 	g_system->updateScreen();
diff --git a/engines/testbed/testsuite.h b/engines/testbed/testsuite.h
index 76ad57a2023..c84633492af 100644
--- a/engines/testbed/testsuite.h
+++ b/engines/testbed/testsuite.h
@@ -61,6 +61,12 @@ enum TestExitStatus {
 	kTestFailed
 };
 
+enum WriteFlags {
+	kWriteNoFlag = 0,
+	kWriteRGBColors = (1 << 0),
+	kWriteDrawFrame = (1 << 1)
+};
+
 typedef TestExitStatus (*InvokingFunction)();
 
 /**
@@ -113,7 +119,7 @@ public:
 	static bool handleInteractiveInput(const Common::String &textToDisplay, const char *opt1 = "Yes", const char *opt2 = "No", OptionSelected result = kOptionLeft);
 
 	static void displayMessage(const Common::String &textToDisplay, const char *defaultButton = "OK");
-	static Common::Rect writeOnScreen(const Common::String &textToDisplay, const Common::Point &pt, bool flag = false);
+	static Common::Rect writeOnScreen(const Common::String &textToDisplay, const Common::Point &pt, WriteFlags flag = kWriteNoFlag);
 	static void clearScreen(const Common::Rect &rect);
 	static void clearEntireScreen() {
 		const int width = g_system->getWidth();


Commit: 3ff491d22954927f3f56374d2cd37b66a0ed7b2c
    https://github.com/scummvm/scummvm/commit/3ff491d22954927f3f56374d2cd37b66a0ed7b2c
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-09-27T19:33:46+03:00

Commit Message:
TESTBED: Improve shaking test

Make it slower to allow spotting rendering errors and add a frame around
the screen to spot screen handling troubles.

Changed paths:
    engines/testbed/graphics.cpp


diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp
index 9046d225d40..4bcc6ba5b9f 100644
--- a/engines/testbed/graphics.cpp
+++ b/engines/testbed/graphics.cpp
@@ -65,7 +65,7 @@ GFXTestSuite::GFXTestSuite() {
 	addTest("ScaledCursors", &GFXtests::scaledCursors);
 
 	// Effects
-	addTest("shakingEffect", &GFXtests::shakingEffect);
+	addTest("ShakingEffect", &GFXtests::shakingEffect);
 	// addTest("focusRectangle", &GFXtests::focusRectangle);
 
 	// Overlay
@@ -1324,14 +1324,14 @@ TestExitStatus GFXtests::shakingEffect() {
 			break;
 		}
 
-		Testsuite::writeOnScreen(Common::String::format("If Shaking Effect works, this should shake %s", direction.c_str()), pt);
-		int times = 15;
+		Testsuite::writeOnScreen(Common::String::format("If Shaking Effect works, this should shake %s", direction.c_str()), pt, kWriteDrawFrame);
+		int times = 8;
 		while (times--) {
 			g_system->setShakePos(shakeXOffset, shakeYOffset);
-			g_system->delayMillis(50);
+			g_system->delayMillis(100);
 			g_system->updateScreen();
 			g_system->setShakePos(0, 0);
-			g_system->delayMillis(50);
+			g_system->delayMillis(100);
 			g_system->updateScreen();
 			shakeXOffset = -shakeXOffset;
 			shakeYOffset = -shakeYOffset;
@@ -1340,10 +1340,12 @@ TestExitStatus GFXtests::shakingEffect() {
 
 		if (Testsuite::handleInteractiveInput("Did the Shaking test work as you were expecting?", "Yes", "No", kOptionRight)) {
 			Testsuite::logDetailedPrintf("Shaking Effect didn't work");
+			Testsuite::clearEntireScreen();
 			return kTestFailed;
 		}
 	}
 
+	Testsuite::clearEntireScreen();
 	return kTestPassed;
 }
 


Commit: 2472ef30c302fee57ffb67132f25ebb3d5f4a47d
    https://github.com/scummvm/scummvm/commit/2472ef30c302fee57ffb67132f25ebb3d5f4a47d
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-09-27T19:33:46+03:00

Commit Message:
GRAPHICS: Don't constrain too much the game screen

The shaking effect can make the game screen go out of bounds and that's
totally fine.
Constraining here breaks it by shrinking the screen instead.

This fixes Trac#16233.

Changed paths:
    backends/graphics/windowed.h


diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h
index 2ba6bf625d4..124c0d1a2ad 100644
--- a/backends/graphics/windowed.h
+++ b/backends/graphics/windowed.h
@@ -357,9 +357,6 @@ protected:
 				getWidth() * getGameRenderScale(), getHeight() * getGameRenderScale(),
 				safeArea, _gameDrawRect);
 
-		// Move the game draw rect in the safe area
-		_gameDrawRect.constrain(safeArea);
-
 		if (getOverlayHeight()) {
 			const int16 overlayWidth = getOverlayWidth(),
 			            overlayHeight = getOverlayHeight();




More information about the Scummvm-git-logs mailing list