aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/screen.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2012-04-24 01:11:53 +0200
committerJohannes Schickel2012-04-24 01:11:53 +0200
commitcc1ae7b190b4f586e4b0a9d2f78d9195dd88c09a (patch)
treefa0a44f3e59f30c3644244a1644c48081308270b /engines/kyra/screen.cpp
parent4d6f2875de900ea41663b99be0f148096561bf5d (diff)
downloadscummvm-rg350-cc1ae7b190b4f586e4b0a9d2f78d9195dd88c09a.tar.gz
scummvm-rg350-cc1ae7b190b4f586e4b0a9d2f78d9195dd88c09a.tar.bz2
scummvm-rg350-cc1ae7b190b4f586e4b0a9d2f78d9195dd88c09a.zip
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.
Diffstat (limited to 'engines/kyra/screen.cpp')
-rw-r--r--engines/kyra/screen.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index d3b4d6f943..711fe15348 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) {