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

OMGPizzaGuy noreply at scummvm.org
Sun Apr 5 00:30:40 UTC 2026


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

Summary:
8ee9f3a4eb ULTIMA8: Improve error reporting when changing video modes
f62e16b739 ULTIMA8: Simplify setting true colour screen modes


Commit: 8ee9f3a4eb24d4f26cffc29adbc4d6ce33bc4a17
    https://github.com/scummvm/scummvm/commit/8ee9f3a4eb24d4f26cffc29adbc4d6ce33bc4a17
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2026-04-04T19:30:33-05:00

Commit Message:
ULTIMA8: Improve error reporting when changing video modes

Changed paths:
    engines/ultima/ultima8/misc/debugger.cpp
    engines/ultima/ultima8/ultima8.cpp
    engines/ultima/ultima8/ultima8.h


diff --git a/engines/ultima/ultima8/misc/debugger.cpp b/engines/ultima/ultima8/misc/debugger.cpp
index 2e5db7e0b0b..c4431cfb8cc 100644
--- a/engines/ultima/ultima8/misc/debugger.cpp
+++ b/engines/ultima/ultima8/misc/debugger.cpp
@@ -220,7 +220,9 @@ bool Debugger::cmdSetVideoMode(int argc, const char **argv) {
 		debugPrintf("Usage: %s <width> <height>\n", argv[0]);
 		return true;
 	} else {
-		Ultima8Engine::get_instance()->changeVideoMode(strtol(argv[1], 0, 0), strtol(argv[2], 0, 0));
+		Common::Error err = Ultima8Engine::get_instance()->changeVideoMode(strtol(argv[1], 0, 0), strtol(argv[2], 0, 0));
+		if (err.getCode() != Common::kNoError)
+			debugPrintf("Failed to set video mode: %s", err.getDesc().c_str());
 		return false;
 	}
 }
diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index 6ec949cd8e9..5de69acdfa3 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -517,7 +517,9 @@ Common::Error Ultima8Engine::startupGame() {
 
 	int width = ConfMan.getInt("width");
 	int height = ConfMan.getInt("height");
-	changeVideoMode(width, height);
+	Common::Error err = changeVideoMode(width, height);
+	if (err.getCode() != Common::kNoError)
+		return err;
 
 	// Show the splash screen immediately now that the screen has been set up
 	_mouse->setMouseCursor(Mouse::MOUSE_NONE);
@@ -733,13 +735,11 @@ void Ultima8Engine::paint() {
 		screen->update();
 }
 
-void Ultima8Engine::changeVideoMode(int width, int height) {
+Common::Error Ultima8Engine::changeVideoMode(int width, int height) {
 	if (_screen) {
 		Common::Rect32 old_dims = _screen->getSurfaceDims();
 		if (width == old_dims.width() && height == old_dims.height())
-			return;
-
-		delete _screen;
+			return Common::kNoError;
 	}
 
 	// Set Screen Resolution
@@ -756,9 +756,12 @@ void Ultima8Engine::changeVideoMode(int width, int height) {
 
 	Graphics::PixelFormat format = g_system->getScreenFormat();
 	if (format.bytesPerPixel != 2 && format.bytesPerPixel != 4) {
-		error("Only 16 bit and 32 bit video modes supported");
+		return Common::kUnsupportedColorMode;
 	}
 
+	if (_screen)
+		delete _screen;
+
 	// Set up blitting surface
 	Graphics::ManagedSurface *surface = new Graphics::Screen(width, height, format);
 	_screen = new RenderSurface(surface);
@@ -779,6 +782,8 @@ void Ultima8Engine::changeVideoMode(int width, int height) {
 	}
 
 	paint();
+
+	return Common::kNoError;
 }
 
 void Ultima8Engine::handleEvent(const Common::Event &event) {
diff --git a/engines/ultima/ultima8/ultima8.h b/engines/ultima/ultima8/ultima8.h
index 2ef562322d1..581c170532a 100644
--- a/engines/ultima/ultima8/ultima8.h
+++ b/engines/ultima/ultima8/ultima8.h
@@ -179,7 +179,7 @@ public:
 	bool setupGame();
 	Common::Error startupGame();
 
-	void changeVideoMode(int width, int height);
+	Common::Error changeVideoMode(int width, int height);
 
 	//! Get current GameInfo struct
 	const GameInfo *getGameInfo() const {


Commit: f62e16b739316e7452a19aec622f618140c95145
    https://github.com/scummvm/scummvm/commit/f62e16b739316e7452a19aec622f618140c95145
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2026-04-04T19:30:33-05:00

Commit Message:
ULTIMA8: Simplify setting true colour screen modes

Changed paths:
    engines/ultima/ultima8/ultima8.cpp


diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index 5de69acdfa3..8d6056e5946 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -745,14 +745,7 @@ Common::Error Ultima8Engine::changeVideoMode(int width, int height) {
 	// Set Screen Resolution
 	debug(1, "Setting Video Mode %dx%d...", width, height);
 
-	auto tryModes = g_system->getSupportedFormats();
-	for (auto g = tryModes.begin(); g != tryModes.end(); ++g) {
-		if (g->bytesPerPixel != 2 && g->bytesPerPixel != 4) {
-			g = tryModes.reverse_erase(g);
-		}
-	}
-
-	initGraphics(width, height, tryModes);
+	initGraphics(width, height, nullptr);
 
 	Graphics::PixelFormat format = g_system->getScreenFormat();
 	if (format.bytesPerPixel != 2 && format.bytesPerPixel != 4) {




More information about the Scummvm-git-logs mailing list