[Scummvm-git-logs] scummvm master -> 7a4974a35cffd933c7ef3598437a32f7d060eee6

bluegr noreply at scummvm.org
Sat Oct 5 22:25:17 UTC 2024


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:
7a4974a35c SCI: Improve KQ6 CD `enable_high_resolution_graphics`


Commit: 7a4974a35cffd933c7ef3598437a32f7d060eee6
    https://github.com/scummvm/scummvm/commit/7a4974a35cffd933c7ef3598437a32f7d060eee6
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-10-06T01:25:14+03:00

Commit Message:
SCI: Improve KQ6 CD `enable_high_resolution_graphics`

- KQ6 CD DOS now delivers a DOS experience by default instead of Windows
- KQ6 CD Windows no longer offers an option that has no effect

Changed paths:
    engines/sci/detection_tables.h
    engines/sci/engine/kernel.cpp
    engines/sci/engine/kmisc.cpp
    engines/sci/engine/savegame.cpp
    engines/sci/graphics/screen.cpp
    engines/sci/metaengine.cpp
    engines/sci/sci.cpp
    engines/sci/sci.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 7058bf65979..0eade5fd2a3 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -2263,10 +2263,9 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 						  GAMEOPTION_MIDI_MODE,                \
 						  GAMEOPTION_RGB_RENDERING)
 
-#define GUIO_KQ6_CD_WINDOWS GUIO7(GUIO_NOASPECT,                       \
+#define GUIO_KQ6_CD_WINDOWS GUIO6(GUIO_NOASPECT,                       \
 								  GAMEOPTION_WINDOWS_CURSORS,          \
-								  GAMEOPTION_HIGH_RESOLUTION_GRAPHICS, \
-						          GAMEOPTION_PREFER_DIGITAL_SFX,       \
+								  GAMEOPTION_PREFER_DIGITAL_SFX,       \
 								  GAMEOPTION_ORIGINAL_SAVELOAD,        \
 								  GAMEOPTION_MIDI_MODE,                \
 								  GAMEOPTION_RGB_RENDERING)
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 1d1913a8523..600d0e95239 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -771,7 +771,7 @@ void Kernel::loadKernelNames(GameFeatures *features) {
 			// function has been replaced with kPortrait. In KQ6 Mac,
 			// kPlayBack has been replaced by kShowMovie.
 			if ((g_sci->getPlatform() == Common::kPlatformWindows) || 
-				(g_sci->getPlatform() == Common::kPlatformDOS && g_sci->forceHiresGraphics()))
+				(g_sci->getPlatform() == Common::kPlatformDOS && g_sci->useHiresGraphics()))
 				_kernelNames[0x26] = "Portrait";
 			else if (g_sci->getPlatform() == Common::kPlatformMacintosh)
 				_kernelNames[0x84] = "ShowMovie";
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 2ba9fb195d0..a294b6ada52 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -785,9 +785,9 @@ reg_t kPlatform(EngineState *s, int argc, reg_t *argv) {
 		return NULL_REG;
 	}
 
-	// treat DOS with hires graphics as Windows so that hires graphics are enabled
+	// treat KQ6 DOS with hires graphics as Windows so that hires graphics are enabled
 	bool isWindows = (g_sci->getPlatform() == Common::kPlatformWindows) ||
-		             (g_sci->getPlatform() == Common::kPlatformDOS && g_sci->forceHiresGraphics());
+	                 (g_sci->getGameId() == GID_KQ6 && g_sci->getPlatform() == Common::kPlatformDOS && g_sci->useHiresGraphics());
 
 	uint16 operation = argv[0].toUint16();
 	switch (operation) {
@@ -804,7 +804,7 @@ reg_t kPlatform(EngineState *s, int argc, reg_t *argv) {
 		else
 			return make_reg(0, kSciPlatformDOS);
 	case kPlatformUnknown5:
-		// This case needs to return the opposite of case 6 to get hires graphics
+		// KQ6: subop 5 needs to return the opposite of subop 6 to get hires graphics
 		return make_reg(0, !isWindows);
 	case kPlatformIsHiRes:
 	case kPlatformWin311OrHigher:
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 506c614e840..76ff2c82cdc 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -1380,7 +1380,7 @@ void gamestate_afterRestoreFixUp(EngineState *s, int savegameId) {
 			// will result in some graphics being incorrect (lowres).
 			// That's why we are setting the global after restoring a saved game depending on hires/lowres state.
 			// The CD demo of KQ6 does the same and uses the exact same global.
-			if ((g_sci->getPlatform() == Common::kPlatformWindows) || (g_sci->forceHiresGraphics())) {
+			if ((g_sci->getPlatform() == Common::kPlatformWindows) || (g_sci->useHiresGraphics())) {
 				s->variables[VAR_GLOBAL][0xA9].setOffset(1);
 			} else {
 				s->variables[VAR_GLOBAL][0xA9].setOffset(0);
diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp
index f679247359a..44880760b0d 100644
--- a/engines/sci/graphics/screen.cpp
+++ b/engines/sci/graphics/screen.cpp
@@ -58,7 +58,7 @@ GfxScreen::GfxScreen(ResourceManager *resMan, Common::RenderMode renderMode) : _
 	// allow to be optionally enabled in the DOS version.
 	if (g_sci->getGameId() == GID_KQ6) {
 		if ((g_sci->getPlatform() == Common::kPlatformWindows) ||
-			(g_sci->getPlatform() == Common::kPlatformDOS && g_sci->forceHiresGraphics())) {
+			(g_sci->getPlatform() == Common::kPlatformDOS && g_sci->useHiresGraphics())) {
 			_upscaledHires = GFX_SCREEN_UPSCALED_640x440;
 		}
 	}
@@ -71,7 +71,7 @@ GfxScreen::GfxScreen(ResourceManager *resMan, Common::RenderMode renderMode) : _
 			_height = 300; // regular visual, priority and control map are 480x300 (this is different than other upscaled SCI games)
 		} else {
 			// Macintosh SCI1/1.1 games use hi-res native fonts if hi-res graphics are enabled
-			if (g_sci->hasMacFonts() && g_sci->forceHiresGraphics()) {
+			if (g_sci->hasMacFonts() && g_sci->useHiresGraphics()) {
 				_upscaledHires = GFX_SCREEN_UPSCALED_640x400;
 			}
 		}
diff --git a/engines/sci/metaengine.cpp b/engines/sci/metaengine.cpp
index 1f53e20ecef..f004593d0d4 100644
--- a/engines/sci/metaengine.cpp
+++ b/engines/sci/metaengine.cpp
@@ -671,6 +671,14 @@ void SciMetaEngine::registerDefaultSettings(const Common::String &target) const
 
 	for (const PopUpOptionsMap *entry = popUpOptionsList; entry->guioFlag; ++entry)
 		ConfMan.registerDefault(entry->configOption, entry->defaultState);
+
+	// enable_high_resolution_graphics is normally enabled by default,
+	// except for KQ6 where it overrides the DOS platform with Windows.
+	// If it were enabled by default for KQ6, then the DOS platform
+	// would produce the Windows experience by default instead of DOS.
+	if (ConfMan.get("gameid", target) == "kq6" && ConfMan.get("platform", target) == "pc") {
+		ConfMan.registerDefault("enable_high_resolution_graphics", false);
+	}
 }
 
 GUI::OptionsContainerWidget *SciMetaEngine::buildEngineOptionsWidget(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const {
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 366e1d539b6..de2cdffed6b 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -136,7 +136,7 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc, SciGameId gam
 	_console(nullptr),
 	_tts(nullptr),
 	_rng("sci"),
-	_forceHiresGraphics(false),
+	_useHiresGraphics(false),
 	_inErrorString(false) {
 
 	assert(g_sci == nullptr);
@@ -312,10 +312,10 @@ Common::Error SciEngine::run() {
 		// so read the user option now.
 		// We need to do this, because the option's default is "true", but we don't want "true"
 		// for any game that does not have this option.
-		_forceHiresGraphics = ConfMan.getBool("enable_high_resolution_graphics");
+		_useHiresGraphics = ConfMan.getBool("enable_high_resolution_graphics");
 	} else if (hasMacFonts()) {
 		// Default to using hires Mac fonts if GUI option isn't present, as it was added later.
-		_forceHiresGraphics = true;
+		_useHiresGraphics = true;
 	}
 
 	if (getSciVersion() < SCI_VERSION_2) {
@@ -894,8 +894,8 @@ bool SciEngine::isCD() const {
 	return _gameDescription->flags & ADGF_CD;
 }
 
-bool SciEngine::forceHiresGraphics() const {
-	return _forceHiresGraphics;
+bool SciEngine::useHiresGraphics() const {
+	return _useHiresGraphics;
 }
 
 bool SciEngine::isBE() const{
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index a709d1404f4..d9668ebaa75 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -196,7 +196,7 @@ public:
 	Common::Platform getPlatform() const;
 	bool isDemo() const;
 	bool isCD() const;
-	bool forceHiresGraphics() const;
+	bool useHiresGraphics() const;
 
 	/** 
 	 * Returns true if the game's original platform is Macintosh or Amiga.
@@ -421,7 +421,7 @@ private:
 	Console *_console;
 	Common::RandomSource _rng;
 	Common::MacResManager _macExecutable;
-	bool _forceHiresGraphics; // user-option for GK1, KQ6, PQ4
+	bool _useHiresGraphics; // user-option for GK1, KQ6, PQ4
 	bool _inErrorString; /**< Set while `errorString` is executing */
 };
 




More information about the Scummvm-git-logs mailing list