[Scummvm-git-logs] scummvm master -> e23f5fe85517083bdd396e91f1963480dfd85fb4

sluicebox noreply at scummvm.org
Tue Mar 22 11:35:05 UTC 2022


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:
e23f5fe855 SCI32: Update kSetShowStyle version checks for Mac


Commit: e23f5fe85517083bdd396e91f1963480dfd85fb4
    https://github.com/scummvm/scummvm/commit/e23f5fe85517083bdd396e91f1963480dfd85fb4
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-03-22T07:32:55-04:00

Commit Message:
SCI32: Update kSetShowStyle version checks for Mac

Consolidated kSetShowStyle version/argument checks and updated them to
handle SCI2.1 Mac games and PC demos. (The demos where the wrong
arguments were being applied happened to work anyway.)

Fixes LSL7 Mac pixel dissolve at the start of the game between the
postcard and the boat (rooms 120 and 130)

Changed paths:
    engines/sci/detection.h
    engines/sci/engine/kgraphics32.cpp
    engines/sci/graphics/transitions32.cpp
    engines/sci/graphics/transitions32.h


diff --git a/engines/sci/detection.h b/engines/sci/detection.h
index 9b545233830..14efa8f6638 100644
--- a/engines/sci/detection.h
+++ b/engines/sci/detection.h
@@ -142,8 +142,8 @@ enum SciVersion {
 	SCI_VERSION_2, // GK1, PQ4 floppy, QFG4 floppy
 	SCI_VERSION_2_1_EARLY, // GK2 demo, KQ7 1.4/1.51, LSL6 hires, PQ4CD, QFG4CD
 	SCI_VERSION_2_1_MIDDLE, // GK2, Hoyle 5, KQ7 2.00b, MUMG Deluxe, Phantasmagoria 1, PQ:SWAT, Shivers 1, SQ6, Torin
-	SCI_VERSION_2_1_LATE, // demos and Mac versions of LSL7, Lighthouse, RAMA
-	SCI_VERSION_3 // LSL7, Lighthouse, RAMA, Phantasmagoria 2
+	SCI_VERSION_2_1_LATE, // Demos and Mac versions of LSL7, Lighthouse, RAMA
+	SCI_VERSION_3 // LSL7, Lighthouse, RAMA, Phantasmagoria 2, interactive Lighthouse demos
 };
 
 /** MIDI devices */
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp
index 68365243377..43293518a5e 100644
--- a/engines/sci/engine/kgraphics32.cpp
+++ b/engines/sci/engine/kgraphics32.cpp
@@ -396,18 +396,23 @@ reg_t kSetShowStyle(EngineState *s, int argc, reg_t *argv) {
 	int16 divisions;
 
 	// SCI 2–2.1early
-	if (getSciVersion() < SCI_VERSION_2_1_MIDDLE) {
+	// KQ7 2.0b uses a mismatched version of the Styler script (SCI2.1early script
+	// for SCI2.1mid engine), so the calls it makes to kSetShowStyle are wrong and
+	// put `divisions` where `pFadeArray` is supposed to be.
+	if (getSciVersion() <= SCI_VERSION_1_EARLY || g_sci->getGameId() == GID_KQ7) {
 		blackScreen = 0;
 		pFadeArray = NULL_REG;
 		divisions = argc > 7 ? argv[7].toSint16() : -1;
 	}
-	// SCI 2.1mid
-	else if (getSciVersion() < SCI_VERSION_2_1_LATE) {
+	// SCI 2.1mid and RAMA demo (2.1late) and noninteractive Lighthouse demo (2.1late)
+	else if (getSciVersion() <= SCI_VERSION_2_1_MIDDLE ||
+		(g_sci->getGameId() == GID_RAMA && g_sci->isDemo()) ||
+		(g_sci->getGameId() == GID_LIGHTHOUSE && g_sci->isDemo() && getSciVersion() == SCI_VERSION_2_1_LATE)) {
 		blackScreen = 0;
 		pFadeArray = argc > 7 ? argv[7] : NULL_REG;
 		divisions = argc > 8 ? argv[8].toSint16() : -1;
 	}
-	// SCI 2.1late-3
+	// SCI 2.1late-3. Includes Mac 2.1late games and LSL7 demo (2.1late)
 	else {
 		blackScreen = argv[7].toSint16();
 		pFadeArray = argc > 8 ? argv[8] : NULL_REG;
@@ -420,7 +425,7 @@ reg_t kSetShowStyle(EngineState *s, int argc, reg_t *argv) {
 
 	// The order of planeObj and showStyle are reversed because this is how
 	// SSCI3 called the corresponding method on the KernelMgr
-	g_sci->_gfxTransitions32->kernelSetShowStyle(argc, planeObj, (ShowStyleType)type, seconds, back, priority, animate, refFrame, pFadeArray, divisions, blackScreen);
+	g_sci->_gfxTransitions32->kernelSetShowStyle(planeObj, (ShowStyleType)type, seconds, back, priority, animate, refFrame, pFadeArray, divisions, blackScreen);
 
 	return s->r_acc;
 }
diff --git a/engines/sci/graphics/transitions32.cpp b/engines/sci/graphics/transitions32.cpp
index 87124a252a1..1a49326b995 100644
--- a/engines/sci/graphics/transitions32.cpp
+++ b/engines/sci/graphics/transitions32.cpp
@@ -173,31 +173,12 @@ void GfxTransitions32::processEffects(PlaneShowStyle &showStyle) {
 	}
 }
 
-// TODO: 10-argument version is only in SCI3; argc checks are currently wrong for this version
-// and need to be fixed in future
-void GfxTransitions32::kernelSetShowStyle(const uint16 argc, const reg_t planeObj, const ShowStyleType type, const int16 seconds, const int16 back, const int16 priority, const int16 animate, const int16 frameOutNow, reg_t pFadeArray, int16 divisions, const int16 blackScreen) {
-
-	bool hasDivisions = false;
-	bool hasFadeArray = false;
-
-	// KQ7 2.0b uses a mismatched version of the Styler script (SCI2.1early script
-	// for SCI2.1mid engine), so the calls it makes to kSetShowStyle are wrong and
-	// put `divisions` where `pFadeArray` is supposed to be
-	if (getSciVersion() == SCI_VERSION_2_1_MIDDLE && g_sci->getGameId() == GID_KQ7) {
-		hasDivisions = argc > 7;
-		hasFadeArray = false;
-		divisions = argc > 7 ? pFadeArray.toSint16() : -1;
-		pFadeArray = NULL_REG;
-	} else if (getSciVersion() < SCI_VERSION_2_1_MIDDLE) {
-		hasDivisions = argc > 7;
-		hasFadeArray = false;
-	} else if (getSciVersion() < SCI_VERSION_3) {
-		hasDivisions = argc > 8;
-		hasFadeArray = argc > 7;
-	} else {
-		hasDivisions = argc > 9;
-		hasFadeArray = argc > 8;
-	}
+void GfxTransitions32::kernelSetShowStyle(const reg_t planeObj, const ShowStyleType type, const int16 seconds,
+	const int16 back, const int16 priority, const int16 animate, const int16 frameOutNow,
+	const reg_t pFadeArray, const int16 divisions, const int16 blackScreen) {
+
+	const bool hasFadeArray = !pFadeArray.isNull();
+	const bool hasDivisions = (divisions != -1);
 
 	bool isFadeUp;
 	int16 color;
diff --git a/engines/sci/graphics/transitions32.h b/engines/sci/graphics/transitions32.h
index c736753e97f..817c4215a21 100644
--- a/engines/sci/graphics/transitions32.h
+++ b/engines/sci/graphics/transitions32.h
@@ -256,7 +256,9 @@ public:
 	 */
 	void processEffects(PlaneShowStyle &showStyle);
 
-	void kernelSetShowStyle(const uint16 argc, const reg_t planeObj, const ShowStyleType type, const int16 seconds, const int16 direction, const int16 priority, const int16 animate, const int16 frameOutNow, reg_t pFadeArray, int16 divisions, const int16 blackScreen);
+	void kernelSetShowStyle(const reg_t planeObj, const ShowStyleType type, const int16 seconds,
+		const int16 direction, const int16 priority, const int16 animate, const int16 frameOutNow,
+		const reg_t pFadeArray, const int16 divisions, const int16 blackScreen);
 
 	/**
 	 * Sets the range that will be used by `GfxFrameout::palMorphFrameOut` to




More information about the Scummvm-git-logs mailing list