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

csnover csnover at users.noreply.github.com
Sat Jul 8 06:45:26 CEST 2017


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:
9e90624052 SCI32: Add workarounds for PQ4
f59269006c SCI32: Implement kShowStyle HShutterOut transition


Commit: 9e90624052af7350b07f50714ed0782b8f72a120
    https://github.com/scummvm/scummvm/commit/9e90624052af7350b07f50714ed0782b8f72a120
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-07-07T23:41:53-05:00

Commit Message:
SCI32: Add workarounds for PQ4

Changed paths:
    engines/sci/engine/workarounds.cpp


diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 66c40d6..ac02769 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -363,6 +363,8 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
 	{ GID_PQ4,           170,   170, -1,        "hideAndSeek", "handleEvent",                     NULL,     1, { WORKAROUND_FAKE,   0 } }, // when clicking to move right while still moving left during the Emo shootout - bug #9847
 	{ GID_PQ4,           275, 64964, -1,              "DPath", "init",                            NULL,     1, { WORKAROUND_FAKE,   0 } }, // when Sherry walks out of the morgue on day 3
 	{ GID_PQ4,           240, 64964, -1,              "DPath", "init",                            NULL,     1, { WORKAROUND_FAKE,   0 } }, // when encountering Sherry and the reporter outside the morgue at the end of day 3
+	{ GID_PQ4,          2010,  2010, -1,         "enemyShip1", "cantBeHere",                      NULL,     7, { WORKAROUND_FAKE,   0 } }, // when crashing into a UFO in the asteroids minigame in the Shortstop Bar
+	{ GID_PQ4,          2010,  2010, -1,         "enemyShip2", "cantBeHere",                      NULL,     7, { WORKAROUND_FAKE,   0 } }, // when crashing into a UFO in the asteroids minigame in the Shortstop Bar
 	{ GID_PQSWAT,         -1, 64950,  0,                 NULL, "handleEvent",                     NULL,     0, { WORKAROUND_FAKE,   0 } }, // Using any menus in-game
 	{ GID_PQSWAT,         -1,    73,  0,   "theLashInterface", "transmit",                        NULL,     0, { WORKAROUND_FAKE,   0 } }, // Clicking the transmit button in LASH
 	{ GID_PQSWAT,       2990,  2990,  0,    "talkToSchienbly", "changeState",                     NULL,     1, { WORKAROUND_FAKE,   0 } }, // When the video of Schienbly talking for the first time ends


Commit: f59269006c0c7ff42cea4fe106eef2a111d06d64
    https://github.com/scummvm/scummvm/commit/f59269006c0c7ff42cea4fe106eef2a111d06d64
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-07-07T23:42:30-05:00

Commit Message:
SCI32: Implement kShowStyle HShutterOut transition

This transition style was used when exiting the asteroids minigame
in PQ4, though it appears likely that this was an error in the
original game script since it does not actually do anything in the
context that it is used (neither here nor in the original
interpreter).

Still, this code is already written, and it fixes the crash, so in
it goes.

Fixes Trac#9856.

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


diff --git a/engines/sci/graphics/transitions32.cpp b/engines/sci/graphics/transitions32.cpp
index 8f18a60..df9c2da 100644
--- a/engines/sci/graphics/transitions32.cpp
+++ b/engines/sci/graphics/transitions32.cpp
@@ -320,6 +320,9 @@ void GfxTransitions32::kernelSetShowStyle(const uint16 argc, const reg_t planeOb
 			case kShowStyleWipeRight:
 				configure21EarlyHorizontalWipe(*entry, priority);
 				break;
+			case kShowStyleHShutterOut:
+				configure21EarlyHorizontalShutter(*entry, priority);
+				break;
 			case kShowStyleIrisOut:
 			case kShowStyleIrisIn:
 				configure21EarlyIris(*entry, priority);
@@ -382,6 +385,7 @@ ShowStyleList::iterator GfxTransitions32::deleteShowStyle(const ShowStyleList::i
 	case kShowStyleWipeRight:
 	case kShowStyleIrisOut:
 	case kShowStyleIrisIn:
+	case kShowStyleHShutterOut:
 		if (getSciVersion() <= SCI_VERSION_2_1_EARLY) {
 			for (uint i = 0; i < showStyle->screenItems.size(); ++i) {
 				ScreenItem *screenItem = showStyle->screenItems[i];
@@ -436,6 +440,47 @@ void GfxTransitions32::configure21EarlyHorizontalWipe(PlaneShowStyle &showStyle,
 	}
 }
 
+void GfxTransitions32::configure21EarlyHorizontalShutter(PlaneShowStyle &showStyle, const int16 priority) {
+	showStyle.numEdges = 2;
+	const int numScreenItems = showStyle.numEdges * showStyle.divisions;
+	showStyle.screenItems.reserve(numScreenItems);
+
+	CelInfo32 celInfo;
+	celInfo.type = kCelTypeColor;
+	celInfo.color = showStyle.color;
+
+	const int width = showStyle.width;
+	const int divisions = showStyle.divisions;
+
+	for (int i = 0; i < divisions; ++i) {
+		Common::Rect rect;
+
+		// Left
+		rect.top = 0;
+		rect.right = (width + 1) * (i + 1) / (2 * divisions);
+		rect.bottom = showStyle.height;
+		const int16 leftLeft = rect.left;
+
+		showStyle.screenItems.push_back(new ScreenItem(showStyle.plane, celInfo, rect));
+		showStyle.screenItems.back()->_priority = priority;
+		showStyle.screenItems.back()->_fixedPriority = true;
+
+		// Right
+		rect.left = width - rect.right;
+		rect.right = width - leftLeft;
+
+		showStyle.screenItems.push_back(new ScreenItem(showStyle.plane, celInfo, rect));
+		showStyle.screenItems.back()->_priority = priority;
+		showStyle.screenItems.back()->_fixedPriority = true;
+	}
+
+	if (showStyle.fadeUp) {
+		for (int i = 0; i < numScreenItems; ++i) {
+			g_sci->_gfxFrameout->addScreenItem(*showStyle.screenItems[i]);
+		}
+	}
+}
+
 void GfxTransitions32::configure21EarlyIris(PlaneShowStyle &showStyle, const int16 priority) {
 	showStyle.numEdges = 4;
 	const int numScreenItems = showStyle.numEdges * showStyle.divisions;
@@ -532,7 +577,6 @@ bool GfxTransitions32::processShowStyle(PlaneShowStyle &showStyle, uint32 now) {
 	default:
 	case kShowStyleNone:
 		return processNone(showStyle);
-	case kShowStyleHShutterOut:
 	case kShowStyleHShutterIn:
 	case kShowStyleVShutterOut:
 	case kShowStyleVShutterIn:
@@ -541,6 +585,12 @@ bool GfxTransitions32::processShowStyle(PlaneShowStyle &showStyle, uint32 now) {
 	case kShowStyleDissolveNoMorph:
 	case kShowStyleMorph:
 		return processMorph(showStyle);
+	case kShowStyleHShutterOut:
+		if (getSciVersion() > SCI_VERSION_2_1_EARLY) {
+			return processMorph(showStyle);
+		} else {
+			return processHShutterOut(showStyle);
+		}
 	case kShowStyleWipeLeft:
 		if (getSciVersion() > SCI_VERSION_2_1_EARLY) {
 			return processMorph(showStyle);
@@ -589,8 +639,12 @@ bool GfxTransitions32::processNone(PlaneShowStyle &showStyle) {
 	return true;
 }
 
-void GfxTransitions32::processHShutterOut(PlaneShowStyle &showStyle) {
-	error("HShutterOut is not known to be used by any game. Please submit a bug report with details about the game you were playing and what you were doing that triggered this error. Thanks!");
+bool GfxTransitions32::processHShutterOut(PlaneShowStyle &showStyle) {
+	if (getSciVersion() > SCI_VERSION_2_1_EARLY) {
+		error("HShutterOut is not known to be used by any game. Please submit a bug report with details about the game you were playing and what you were doing that triggered this error. Thanks!");
+	}
+
+	return processWipe(-1, showStyle);
 }
 
 void GfxTransitions32::processHShutterIn(const PlaneShowStyle &showStyle) {
diff --git a/engines/sci/graphics/transitions32.h b/engines/sci/graphics/transitions32.h
index 685012f..c4c5228 100644
--- a/engines/sci/graphics/transitions32.h
+++ b/engines/sci/graphics/transitions32.h
@@ -337,6 +337,12 @@ private:
 	void configure21EarlyHorizontalWipe(PlaneShowStyle &showStyle, const int16 priority);
 
 	/**
+	 * Initializes the given PlaneShowStyle for a
+	 * horizontal shutter effect for SCI2 to 2.1early.
+	 */
+	void configure21EarlyHorizontalShutter(PlaneShowStyle &showStyle, const int16 priority);
+
+	/**
 	 * Initializes the given PlaneShowStyle for an
 	 * iris effect for SCI2 to 2.1early.
 	 */
@@ -364,7 +370,7 @@ private:
 	 * Performs a transition that renders into a room
 	 * with a horizontal shutter effect.
 	 */
-	void processHShutterOut(PlaneShowStyle &showStyle);
+	bool processHShutterOut(PlaneShowStyle &showStyle);
 
 	/**
 	 * Performs a transition that renders to black





More information about the Scummvm-git-logs mailing list