aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorathrxx2011-06-16 20:51:09 +0200
committerathrxx2011-06-16 20:52:07 +0200
commit283872018b676113ea429af6cf5ee4c1fe498072 (patch)
treefaa25ca9bcd0d541b9f92e86cdeb08c0996a2b4b /engines/scumm
parentae67a9a958e26a237ddb7910f6c4a1b6b088dc77 (diff)
downloadscummvm-rg350-283872018b676113ea429af6cf5ee4c1fe498072.tar.gz
scummvm-rg350-283872018b676113ea429af6cf5ee4c1fe498072.tar.bz2
scummvm-rg350-283872018b676113ea429af6cf5ee4c1fe498072.zip
SCUMM: slightly changed behavior of 16bit mode detection
(another attempt to fix SCUMM FM-TOWNS for ANDROID)
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/charset.cpp1
-rw-r--r--engines/scumm/scumm.cpp39
2 files changed, 23 insertions, 17 deletions
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index dce6c9c144..9238b25feb 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -50,6 +50,7 @@ void ScummEngine::loadCJKFont() {
if (_game.version <= 5 && _game.platform == Common::kPlatformFMTowns && _language == Common::JA_JPN) { // FM-TOWNS v3 / v5 Kanji
#ifdef DISABLE_TOWNS_DUAL_LAYER_MODE
+ GUIErrorMessage("FM-Towns Kanji font drawing requires dual graphics layer support which is disabled in this build");
error("FM-Towns Kanji font drawing requires dual graphics layer support which is disabled in this build");
#else
// use FM-TOWNS font rom, since game files don't have kanji font resources
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index c74e4d1824..1ccf215605 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1155,24 +1155,29 @@ Common::Error ScummEngine::init() {
#endif
) {
#ifdef USE_RGB_COLOR
- _outputPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
- Common::List<Graphics::PixelFormat> tryModes = _system->getSupportedFormats();
- // Try default 555 mode first
- tryModes.push_front(_outputPixelFormat);
-
- for (Common::List<Graphics::PixelFormat>::iterator g = tryModes.begin(); g != tryModes.end(); ++g) {
- if (g->bytesPerPixel != 2 || g->aBits())
- continue;
- _outputPixelFormat = *g;
+ _outputPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
+
+ if (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine) {
initGraphics(screenWidth, screenHeight, screenWidth > 320, &_outputPixelFormat);
- // Other modes than 555 are only supported for FM-TOWNS games and LOOM PCE.
- // Especially the HE games require 555.
- if (*g == _system->getScreenFormat() || (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine))
- break;
+ if (_outputPixelFormat != _system->getScreenFormat())
+ return Common::kUnsupportedColorMode;
+ } else {
+ Common::List<Graphics::PixelFormat> tryModes = _system->getSupportedFormats();
+ for (Common::List<Graphics::PixelFormat>::iterator g = tryModes.begin(); g != tryModes.end(); ++g) {
+ if (g->bytesPerPixel != 2 || g->aBits())
+ g = tryModes.erase(g);
+
+ if (*g == _outputPixelFormat) {
+ tryModes.clear();
+ tryModes.push_back(_outputPixelFormat);
+ break;
+ }
+ }
+
+ initGraphics(screenWidth, screenHeight, screenWidth > 320, tryModes);
+ if (_system->getScreenFormat().bytesPerPixel != 2)
+ return Common::kUnsupportedColorMode;
}
-
- if (_outputPixelFormat != _system->getScreenFormat())
- return Common::kUnsupportedColorMode;
#else
if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) {
warning("Starting game without the required 16bit color support.\nYou may experience color glitches");
@@ -1184,7 +1189,7 @@ Common::Error ScummEngine::init() {
} else {
#ifdef DISABLE_TOWNS_DUAL_LAYER_MODE
if (_game.platform == Common::kPlatformFMTowns && _game.version == 5)
- error("This game requires dual graphics layer support which is disabled in this build");
+ return Common::Error(Common::kUnsupportedColorMode, "This game requires dual graphics layer support which is disabled in this build");
#endif
initGraphics(screenWidth, screenHeight, (screenWidth > 320));
}