diff options
author | Filippos Karapetis | 2011-09-26 05:23:42 +0300 |
---|---|---|
committer | Filippos Karapetis | 2011-09-26 05:23:42 +0300 |
commit | 2be8db90ee8b8f427c1e3483b79b187e67183eb6 (patch) | |
tree | 2433bd05b34a694c237c0c191c2e391717b020ad | |
parent | 5dbb51db6d7e0a1e7c8865b7e1d514ed96d99f56 (diff) | |
download | scummvm-rg350-2be8db90ee8b8f427c1e3483b79b187e67183eb6.tar.gz scummvm-rg350-2be8db90ee8b8f427c1e3483b79b187e67183eb6.tar.bz2 scummvm-rg350-2be8db90ee8b8f427c1e3483b79b187e67183eb6.zip |
AGI: Fixed bug #3196882 - "KQ3: PCSpeaker affects render mode"
-rw-r--r-- | engines/agi/agi.cpp | 33 | ||||
-rw-r--r-- | engines/agi/agi.h | 2 | ||||
-rw-r--r-- | engines/agi/preagi.cpp | 16 |
3 files changed, 19 insertions, 32 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 49b43356ea..4ed606c3ba 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -525,6 +525,21 @@ AgiBase::~AgiBase() { } } +void AgiBase::initRenderMode() { + _renderMode = Common::kRenderEGA; + + if (ConfMan.hasKey("platform")) { + Common::Platform platform = Common::parsePlatform(ConfMan.get("platform")); + _renderMode = (platform == Common::kPlatformAmiga) ? Common::kRenderAmiga : Common::kRenderEGA; + } + + if (ConfMan.hasKey("render_mode")) { + Common::RenderMode tmpMode = Common::parseRenderMode(ConfMan.get("render_mode").c_str()); + if (tmpMode != Common::kRenderDefault) + _renderMode = tmpMode; + } +} + AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) { // Setup mixer @@ -620,23 +635,7 @@ void AgiEngine::initialize() { } } - if (ConfMan.hasKey("render_mode")) { - _renderMode = Common::parseRenderMode(ConfMan.get("render_mode").c_str()); - } else if (ConfMan.hasKey("platform")) { - switch (Common::parsePlatform(ConfMan.get("platform"))) { - case Common::kPlatformAmiga: - _renderMode = Common::kRenderAmiga; - break; - case Common::kPlatformPC: - _renderMode = Common::kRenderEGA; - break; - default: - _renderMode = Common::kRenderEGA; - break; - } - } else { - _renderMode = Common::kRenderDefault; - } + initRenderMode(); _buttonStyle = AgiButtonStyle(_renderMode); _defaultButtonStyle = AgiButtonStyle(); diff --git a/engines/agi/agi.h b/engines/agi/agi.h index d82bc58c76..07729b6ca1 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -776,6 +776,8 @@ protected: virtual void initialize() = 0; + void initRenderMode(); + public: GfxMgr *_gfx; diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp index 8d407ecd00..0b5afc7f8c 100644 --- a/engines/agi/preagi.cpp +++ b/engines/agi/preagi.cpp @@ -54,21 +54,7 @@ PreAgiEngine::PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : } void PreAgiEngine::initialize() { - if (ConfMan.hasKey("render_mode")) { - _renderMode = Common::parseRenderMode(ConfMan.get("render_mode").c_str()); - } else if (ConfMan.hasKey("platform")) { - switch (Common::parsePlatform(ConfMan.get("platform"))) { - case Common::kPlatformAmiga: - _renderMode = Common::kRenderAmiga; - break; - case Common::kPlatformPC: - _renderMode = Common::kRenderEGA; - break; - default: - _renderMode = Common::kRenderEGA; - break; - } - } + initRenderMode(); _gfx = new GfxMgr(this); _picture = new PictureMgr(this, _gfx); |