[Scummvm-cvs-logs] scummvm master -> cc1ae7b190b4f586e4b0a9d2f78d9195dd88c09a

lordhoto lordhoto at gmail.com
Tue Apr 24 01:18:27 CEST 2012


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:
cc1ae7b190 KYRA: Fix crahes in Kyra 1-3 and LoL when EGA/CGA graphics mode is selected.


Commit: cc1ae7b190b4f586e4b0a9d2f78d9195dd88c09a
    https://github.com/scummvm/scummvm/commit/cc1ae7b190b4f586e4b0a9d2f78d9195dd88c09a
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-04-23T16:11:53-07:00

Commit Message:
KYRA: Fix crahes in Kyra 1-3 and LoL when EGA/CGA graphics mode is selected.

This is a regression from 86a817beb5eef248c5f5e28f18133db802a59c2e.

Formerly Kyra always queried the render_mode and initializes its Screen
functionality accordingly, even when the game actually only supported VGA.
While in the "Edit game..." options only VGA was selectable, the global options
still allowed for example EGA to be selected and thus messing up the internal
state. I only check the render_mode setting for EoB 1 and 2 now, which are
the only games which support the setting inside Screen.

Changed paths:
    engines/kyra/screen.cpp



diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index d3b4d6f..711fe15 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -95,8 +95,23 @@ bool Screen::init() {
 	_use16ColorMode = _vm->gameFlags().use16ColorMode;
 	_isAmiga = (_vm->gameFlags().platform == Common::kPlatformAmiga);
 
-	if (ConfMan.hasKey("render_mode"))
-		_renderMode = Common::parseRenderMode(ConfMan.get("render_mode"));
+	// We only check the "render_mode" setting for both Eye of the Beholder
+	// games here, since all the other games do not support the render_mode
+	// setting or handle it differently, like Kyra 1 PC-98. This avoids
+	// graphics glitches and crashes in other games, when the user sets his
+	// global render_mode setting to EGA for example.
+	// TODO/FIXME: It would be nice not to hardcode this. But there is no
+	// trivial/non annoying way to do mode checks in an easy fashion right
+	// now.
+	// In a more general sense, we might want to think about a way to only
+	// pass valid config values, as in values which the engine can work with,
+	// to the engines. We already limit the selection via our GUIO flags in
+	// the game specific settings, but this is not enough due to global
+	// settings allowing everything.
+	if (_vm->game() == GI_EOB1 || _vm->game() == GI_EOB2) {
+		if (ConfMan.hasKey("render_mode"))
+			_renderMode = Common::parseRenderMode(ConfMan.get("render_mode"));
+	}
 
 	// CGA and EGA modes use additional pages to do the CGA/EGA specific graphics conversions.
 	if (_renderMode == Common::kRenderCGA || _renderMode == Common::kRenderEGA) {






More information about the Scummvm-git-logs mailing list