[Scummvm-cvs-logs] scummvm master -> 283872018b676113ea429af6cf5ee4c1fe498072

athrxx athrxx at scummvm.org
Thu Jun 16 20:59:20 CEST 2011


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:
283872018b SCUMM: slightly changed behavior of 16bit mode detection


Commit: 283872018b676113ea429af6cf5ee4c1fe498072
    https://github.com/scummvm/scummvm/commit/283872018b676113ea429af6cf5ee4c1fe498072
Author: athrxx (athrxx at scummvm.org)
Date: 2011-06-16T11:52:07-07:00

Commit Message:
SCUMM: slightly changed behavior of 16bit mode detection

(another attempt to fix SCUMM FM-TOWNS for ANDROID)

Changed paths:
    engines/scumm/charset.cpp
    engines/scumm/scumm.cpp



diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index dce6c9c..9238b25 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 c74e4d1..1ccf215 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));
 		}






More information about the Scummvm-git-logs mailing list