[Scummvm-git-logs] scummvm master -> 05d5299c548080d3b66ed1196d649aa27eeeceda

sluicebox 22204938+sluicebox at users.noreply.github.com
Fri May 14 23:39:38 UTC 2021


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7957b50af1 SCI: Add option to use SQ4 CD Windows cursors
05d5299c54 SCI: Remove unused 640x480 mode from SCI16 code


Commit: 7957b50af114c515290cabf92ec0149c67482e39
    https://github.com/scummvm/scummvm/commit/7957b50af114c515290cabf92ec0149c67482e39
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-05-14T17:37:18-06:00

Commit Message:
SCI: Add option to use SQ4 CD Windows cursors

Changed paths:
    engines/sci/detection.cpp
    engines/sci/detection.h
    engines/sci/detection_tables.h
    engines/sci/graphics/cursor.cpp
    engines/sci/graphics/cursor.h


diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 239b6cb733..0ce05246ce 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -219,9 +219,9 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 		}
 	},
 
-	// KQ5 and KQ6 CD Windows - windows cursors
+	// KQ5 and KQ6 and SQ4 CD Windows - windows cursors
 	{
-		GAMEOPTION_KQ_WINDOWS_CURSORS,
+		GAMEOPTION_WINDOWS_CURSORS,
 		{
 			_s("Use Windows cursors"),
 			_s("Use the Windows cursors (smaller and monochrome) instead of the DOS ones"),
diff --git a/engines/sci/detection.h b/engines/sci/detection.h
index 6126961b57..ba3c3cf950 100644
--- a/engines/sci/detection.h
+++ b/engines/sci/detection.h
@@ -30,7 +30,7 @@ namespace Sci {
 #define GAMEOPTION_ORIGINAL_SAVELOAD        GUIO_GAMEOPTIONS2
 #define GAMEOPTION_MIDI_MODE                GUIO_GAMEOPTIONS3
 #define GAMEOPTION_JONES_CDAUDIO            GUIO_GAMEOPTIONS4
-#define GAMEOPTION_KQ_WINDOWS_CURSORS       GUIO_GAMEOPTIONS5
+#define GAMEOPTION_WINDOWS_CURSORS          GUIO_GAMEOPTIONS5
 #define GAMEOPTION_SQ4_SILVER_CURSORS       GUIO_GAMEOPTIONS6
 #define GAMEOPTION_EGA_UNDITHER             GUIO_GAMEOPTIONS7
 // HIGH_RESOLUTION_GRAPHICS availability is checked for in SciEngine::run()
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 58cdc1fbb0..86b2a27b77 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1637,7 +1637,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 								  GAMEOPTION_ORIGINAL_SAVELOAD,        \
 								  GAMEOPTION_MIDI_MODE,                \
 								  GAMEOPTION_RGB_RENDERING,            \
-								  GAMEOPTION_KQ_WINDOWS_CURSORS)
+								  GAMEOPTION_WINDOWS_CURSORS)
 
 	// King's Quest 5 - English Amiga (from www.back2roots.org)
 	// Executable scanning reports "1.004.018"
@@ -1992,7 +1992,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 						  GAMEOPTION_RGB_RENDERING)
 
 #define GUIO_KQ6_CD_WINDOWS GUIO7(GUIO_NOASPECT,                       \
-								  GAMEOPTION_KQ_WINDOWS_CURSORS,       \
+								  GAMEOPTION_WINDOWS_CURSORS,          \
 								  GAMEOPTION_HIGH_RESOLUTION_GRAPHICS, \
 						          GAMEOPTION_PREFER_DIGITAL_SFX,       \
 								  GAMEOPTION_ORIGINAL_SAVELOAD,        \
@@ -2117,7 +2117,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		{"resource.000", 0, "233394a5f33b475ae5975e7e9a420865", 8376352},
 		{"resource.msg", 0, "51ca9f8afc42ef442f6545b3c82a9165", 596121},
 		AD_LISTEND},
-		Common::KO_KOR, Common::kPlatformWindows, ADGF_CD, GUIO5(GUIO_NOASPECT, GAMEOPTION_KQ_WINDOWS_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_MIDI_MODE)	},
+		Common::KO_KOR, Common::kPlatformWindows, ADGF_CD, GUIO5(GUIO_NOASPECT, GAMEOPTION_WINDOWS_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_MIDI_MODE)	},
 
 	// King's Quest 6 - English Macintosh Floppy
 	// VERSION file reports "1.0"
@@ -5175,7 +5175,8 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 						  GAMEOPTION_MIDI_MODE,				\
 						  GAMEOPTION_RGB_RENDERING)
 
-#define GUIO_SQ4_CD_WINDOWS GUIO6(GUIO_MIDIGM,				\
+#define GUIO_SQ4_CD_WINDOWS GUIO7(GUIO_MIDIGM,				\
+						  GAMEOPTION_WINDOWS_CURSORS,		\
 						  GAMEOPTION_SQ4_SILVER_CURSORS,	\
 	                      GAMEOPTION_PREFER_DIGITAL_SFX,	\
 	                      GAMEOPTION_ORIGINAL_SAVELOAD,		\
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp
index 095f7e34dd..f2a445ca5c 100644
--- a/engines/sci/graphics/cursor.cpp
+++ b/engines/sci/graphics/cursor.cpp
@@ -64,6 +64,11 @@ GfxCursor::GfxCursor(ResourceManager *resMan, GfxPalette *palette, GfxScreen *sc
 	else
 		_useOriginalKQ6WinCursors = false;
 
+	if (g_sci && g_sci->getGameId() == GID_SQ4 && g_sci->getPlatform() == Common::kPlatformWindows)
+		_useOriginalSQ4WinCursors = ConfMan.getBool("windows_cursors");
+	else
+		_useOriginalSQ4WinCursors = false;
+
 	if (g_sci && g_sci->getGameId() == GID_SQ4 && getSciVersion() == SCI_VERSION_1_1)
 		_useSilverSQ4CDCursors = ConfMan.getBool("silver_cursors");
 	else
@@ -214,6 +219,9 @@ void GfxCursor::kernelSetView(GuiResourceId viewNum, int loopNum, int celNum, Co
 		default:
 			break;
 		}
+	} else if (_useOriginalSQ4WinCursors) {
+		// Use the Windows black and white cursors
+		celNum += 1;
 	}
 
 	if (!_cachedCursors.contains(viewNum))
diff --git a/engines/sci/graphics/cursor.h b/engines/sci/graphics/cursor.h
index 99ed5b49e1..689b721150 100644
--- a/engines/sci/graphics/cursor.h
+++ b/engines/sci/graphics/cursor.h
@@ -129,10 +129,15 @@ private:
 	// ugly, which is why they aren't enabled by default.
 	bool _useOriginalKQ6WinCursors;
 
+	// The Windows CD version of SQ4 used its own black and white cursors.
+	// If this is true (set from the windows_cursors ini setting) then we use
+	// them instead of the DOS color cursors, which are the default.
+	bool _useOriginalSQ4WinCursors;
+
 	// The CD version of SQ4 contains a complete set of silver mouse cursors.
 	// If this is true (set from the silver_cursors ini setting), then we use
 	// these instead and replace the game's gold cursors with their silver
-	// equivalents.
+	// equivalents. If this is true, _useOriginalSQ4WinCursors is ignored.
 	bool _useSilverSQ4CDCursors;
 };
 


Commit: 05d5299c548080d3b66ed1196d649aa27eeeceda
    https://github.com/scummvm/scummvm/commit/05d5299c548080d3b66ed1196d649aa27eeeceda
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-05-14T17:37:19-06:00

Commit Message:
SCI: Remove unused 640x480 mode from SCI16 code

This is old SCI32 code that should have been removed from
GfxScreen when GfxScreen32 was created.

Changed paths:
    engines/sci/graphics/screen.cpp
    engines/sci/graphics/screen.h


diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp
index 48c8916c5a..24b6569f04 100644
--- a/engines/sci/graphics/screen.cpp
+++ b/engines/sci/graphics/screen.cpp
@@ -54,10 +54,8 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) {
 	_curPaletteMapValue = 0;
 	_paletteModsEnabled = false;
 
-	// King's Quest 6 and Gabriel Knight 1 have hires content, gk1/cd was able
-	// to provide that under DOS as well, but as gk1/floppy does support
-	// upscaled hires scriptswise, but doesn't actually have the hires content
-	// we need to limit it to platform windows.
+	// King's Quest 6 has hires content in the Windows version which we also
+	// allow to be optionally enabled in the DOS version.
 	if ((g_sci->getPlatform() == Common::kPlatformWindows) || (g_sci->forceHiresGraphics())) {
 		if (g_sci->getGameId() == GID_KQ6)
 			_upscaledHires = GFX_SCREEN_UPSCALED_640x440;
@@ -131,15 +129,6 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) {
 		for (int i = 0; i <= _scriptWidth; i++)
 			_upscaledWidthMapping[i] = i * 2;
 		break;
-	case GFX_SCREEN_UPSCALED_640x480:
-		// Gabriel Knight 1 (VESA, Mac)
-		_displayWidth = 640;
-		_displayHeight = 480;
-		for (int i = 0; i <= _scriptHeight; i++)
-			_upscaledHeightMapping[i] = (i * 12) / 5;
-		for (int i = 0; i <= _scriptWidth; i++)
-			_upscaledWidthMapping[i] = i * 2;
-		break;
 	default:
 		if (!_displayWidth)
 			_displayWidth = _width;
@@ -1010,9 +999,6 @@ void GfxScreen::adjustBackUpscaledCoordinates(int16 &y, int16 &x) {
 		x /= 2;
 		y = (y * 5) / 11;
 		break;
-	case GFX_SCREEN_UPSCALED_640x480:
-		x /= 2;
-		y = (y * 5) / 12;
 	default:
 		break;
 	}
diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h
index b70c370c6c..7311232ee9 100644
--- a/engines/sci/graphics/screen.h
+++ b/engines/sci/graphics/screen.h
@@ -42,8 +42,7 @@ enum GfxScreenUpscaledMode {
 	GFX_SCREEN_UPSCALED_DISABLED	= 0,
 	GFX_SCREEN_UPSCALED_480x300     = 1,
 	GFX_SCREEN_UPSCALED_640x400		= 2,
-	GFX_SCREEN_UPSCALED_640x440		= 3,
-	GFX_SCREEN_UPSCALED_640x480		= 4
+	GFX_SCREEN_UPSCALED_640x440		= 3
 };
 
 enum GfxScreenMasks {
@@ -186,7 +185,7 @@ private:
 	int16 _ditheredPicColors[DITHERED_BG_COLORS_SIZE];
 
 	// These screens have the real resolution of the game engine (320x200 for
-	// SCI0/SCI1/SCI11 games, 640x480 for SCI2 games). SCI0 games will be
+	// SCI0/SCI1/SCI11 PC games, other resolutions on Mac). SCI0 games will be
 	// dithered in here at any time.
 	byte *_visualScreen;
 	byte *_priorityScreen;
@@ -267,7 +266,6 @@ public:
 
 			case GFX_SCREEN_UPSCALED_640x400:
 			case GFX_SCREEN_UPSCALED_640x440:
-			case GFX_SCREEN_UPSCALED_640x480:
 				putScaledPixelOnDisplay(x, y, color);
 				break;
 			default:
@@ -313,7 +311,6 @@ public:
 		switch (_upscaledHires) {
 		case GFX_SCREEN_UPSCALED_640x400:
 		case GFX_SCREEN_UPSCALED_640x440:
-		case GFX_SCREEN_UPSCALED_640x480:
 			// For regular upscaled modes forward to the regular putPixel
 			putPixel(x, y, drawMask, color, priority, control);
 			return;
@@ -377,18 +374,6 @@ public:
 			}
 			break;
 		}
-		case GFX_SCREEN_UPSCALED_640x480: {
-			int16 startY = (y * 12) / 5;
-			int16 endY = ((y + 1) * 12) / 5;
-			displayOffset = (startY * _displayWidth) + x * 2;
-
-			for (int16 curY = startY; curY < endY; curY++) {
-				_displayScreen[displayOffset] = color;
-				_displayScreen[displayOffset + 1] = color;
-				displayOffset += _displayWidth;
-			}
-			break;
-		}
 		default:
 			break;
 		}
@@ -418,8 +403,7 @@ public:
 				_displayScreen[offset] = color;
 				break;
 			case GFX_SCREEN_UPSCALED_640x400:
-			case GFX_SCREEN_UPSCALED_640x440:
-			case GFX_SCREEN_UPSCALED_640x480: {
+			case GFX_SCREEN_UPSCALED_640x440: {
 				// to 1-> 4 pixels upscaling for all of those, so that fonts won't look weird
 				int displayOffset = (_upscaledHeightMapping[startingY] + y * 2) * _displayWidth + x * 2;
 				_displayScreen[displayOffset] = color;




More information about the Scummvm-git-logs mailing list