[Scummvm-cvs-logs] scummvm master -> 5b7754e3f095eb8a469dd4b7de5a6379f8e13c27

athrxx athrxx at scummvm.org
Wed Jun 15 17:38:57 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:
5b7754e3f0 SCUMM: fix bug #3316738


Commit: 5b7754e3f095eb8a469dd4b7de5a6379f8e13c27
    https://github.com/scummvm/scummvm/commit/5b7754e3f095eb8a469dd4b7de5a6379f8e13c27
Author: athrxx (athrxx at scummvm.org)
Date: 2011-06-15T08:12:17-07:00

Commit Message:
SCUMM: fix bug #3316738

This provides fallback to 8bit color mode for SCUMM3 FM-TOWNS games on platforms which set the USE_RGB_COLOR define even though that color mode is not being fully implemented for that platform.

Changed paths:
    engines/scumm/cursor.cpp
    engines/scumm/palette.cpp
    engines/scumm/scumm.cpp



diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index e9b5260..8676c85 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -114,17 +114,21 @@ void ScummEngine_v6::setCursorTransparency(int a) {
 void ScummEngine::updateCursor() {
 	int transColor = (_game.heversion >= 80) ? 5 : 255;
 #ifdef USE_RGB_COLOR
-	Graphics::PixelFormat format = _system->getScreenFormat();
-	CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
-							_cursor.hotspotX, _cursor.hotspotY,
-							(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
-							(_game.heversion == 70 ? 2 : 1),
-							&format);
-#else
+	if (_bytesPerPixelOutput == 2) {
+		Graphics::PixelFormat format = _system->getScreenFormat();
+		CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
+								_cursor.hotspotX, _cursor.hotspotY,
+								(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
+								(_game.heversion == 70 ? 2 : 1),
+								&format);
+	} else {
+#endif
 	CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
 							_cursor.hotspotX, _cursor.hotspotY,
 							(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
 							(_game.heversion == 70 ? 2 : 1));
+#ifdef USE_RGB_COLOR
+	}
 #endif
 }
 
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index ba13ff4..3e8c35c 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -222,10 +222,12 @@ void ScummEngine::resetPalette() {
 			if (_game.id == GID_INDY4 || _game.id == GID_MONKEY2)
 				_townsClearLayerFlag = 0;
 #ifdef USE_RGB_COLOR
-			else if (_game.id == GID_LOOM)
-				towns_setTextPaletteFromPtr(tableTownsLoomPalette);
-			else if (_game.version == 3)
-				towns_setTextPaletteFromPtr(tableTownsV3Palette);
+			else if (_bytesPerPixelOutput == 2) {
+				if (_game.id == GID_LOOM)
+					towns_setTextPaletteFromPtr(tableTownsLoomPalette);
+				else if (_game.version == 3)
+					towns_setTextPaletteFromPtr(tableTownsV3Palette);
+			}
 #endif
 
 			_townsScreen->toggleLayers(_townsActiveLayerFlags);
@@ -1014,7 +1016,7 @@ void ScummEngine::setCurrentPalette(int palindex) {
 		setPCEPaletteFromPtr(pals);
 #ifdef USE_RGB_COLOR
 #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
-	} else if (_game.platform == Common::kPlatformFMTowns) {
+	} else if (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2) {
 		towns_setPaletteFromPtr(pals);
 #endif
 #endif
@@ -1117,7 +1119,7 @@ void ScummEngine::updatePalette() {
 
 #ifdef USE_RGB_COLOR
 #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
-	if (_game.platform == Common::kPlatformFMTowns) {
+	if (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2) {
 		p = palette_colors;
 		for (i = first; i < first + num; ++i) {
 			_16BitPalette[i] = get16BitColor(p[0], p[1], p[2]);
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 0a53383..97dd68a 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1156,8 +1156,15 @@ Common::Error ScummEngine::init() {
 #ifdef USE_RGB_COLOR
 			Graphics::PixelFormat format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
 			initGraphics(screenWidth, screenHeight, screenWidth > 320, &format);
-			if (format != _system->getScreenFormat())
-				return Common::kUnsupportedColorMode;
+			if (format != _system->getScreenFormat()) {
+				if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) {
+					warning("Your ScummVM build does not support the type of 16bit color mode required by this target.\nStarting game in 8bit color mode...\nYou may experience color glitches");
+					_bytesPerPixelOutput = 1;
+					initGraphics(screenWidth, screenHeight, (screenWidth > 320));
+				} else {
+					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");
@@ -1364,8 +1371,7 @@ void ScummEngine::resetScumm() {
 #ifdef USE_RGB_COLOR
 	if (_game.features & GF_16BIT_COLOR
 #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
-
-		|| _game.platform == Common::kPlatformFMTowns
+		|| (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2)
 #endif
 		)
 		_16BitPalette = (uint16 *)calloc(512, sizeof(uint16));






More information about the Scummvm-git-logs mailing list