[Scummvm-cvs-logs] scummvm master -> 33cac793736c1d419cc69e1caac0feb248657a6f

csnover csnover at users.noreply.github.com
Thu Mar 17 04:00:51 CET 2016


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:
33cac79373 SCI32: Work around bad Styler script in KQ7 2.0b


Commit: 33cac793736c1d419cc69e1caac0feb248657a6f
    https://github.com/scummvm/scummvm/commit/33cac793736c1d419cc69e1caac0feb248657a6f
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-03-16T22:00:38-05:00

Commit Message:
SCI32: Work around bad Styler script in KQ7 2.0b

The SCI2.1mid version of the game includes scripts designed for
SCI2.1early which means wrong parameters are sent to the kernel.

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



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index fc9f5d8..30e59c2 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -1120,11 +1120,20 @@ inline ShowStyleEntry *GfxFrameout::deleteShowStyleInternal(ShowStyleEntry *cons
 // and need to be fixed in future
 // TODO: SQ6 does not use 'priority' (exists since SCI2) or 'blackScreen' (exists since SCI3);
 // check to see if other versions use or if they are just always ignored
-void GfxFrameout::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, const reg_t &pFadeArray, const int16 divisions, const int16 blackScreen) {
+void GfxFrameout::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;
-	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_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) {
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index aef2153..7cc1adf 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -333,7 +333,7 @@ private:
 public:
 	// NOTE: This signature is taken from SCI3 Phantasmagoria 2
 	// and is valid for all implementations of SCI32
-	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, const reg_t &pFadeArray, const int16 divisions, const int16 blackScreen);
+	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);
 
 #pragma mark -
 #pragma mark Rendering






More information about the Scummvm-git-logs mailing list