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

sluicebox 22204938+sluicebox at users.noreply.github.com
Fri May 21 08:37:59 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:
0959489b49 SCI: Allow sounds with empty channels
e09c6d13e4 SCI32: Handle kShowStyleDissolve Mac palette


Commit: 0959489b49e35df801ba1b26c3f6a00a8e1889fa
    https://github.com/scummvm/scummvm/commit/0959489b49e35df801ba1b26c3f6a00a8e1889fa
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-05-21T02:30:15-06:00

Commit Message:
SCI: Allow sounds with empty channels

Occurs in fan games such as SQ4 Update

Changed paths:
    engines/sci/resource/resource_audio.cpp


diff --git a/engines/sci/resource/resource_audio.cpp b/engines/sci/resource/resource_audio.cpp
index e868176385..908b555331 100644
--- a/engines/sci/resource/resource_audio.cpp
+++ b/engines/sci/resource/resource_audio.cpp
@@ -854,8 +854,6 @@ SoundResource::SoundResource(uint32 resourceNr, ResourceManager *resMan, SciVers
 		_tracks = new Track[_trackCount];
 		data = *_resource;
 
-		byte channelCount;
-
 		for (int trackNr = 0; trackNr < _trackCount; trackNr++) {
 			// Track info starts with track type:BYTE
 			// Then the channel information gets appended Unknown:WORD, ChannelOffset:WORD, ChannelSize:WORD
@@ -865,11 +863,10 @@ SoundResource::SoundResource(uint32 resourceNr, ResourceManager *resMan, SciVers
 			_tracks[trackNr].type = *data++;
 			// Counting # of channels used
 			SciSpan<const byte> data2 = data;
-			channelCount = 0;
+			byte channelCount = 0;
 			while (*data2 != 0xFF) {
 				data2 += 6;
 				channelCount++;
-				_tracks[trackNr].channelCount++;
 			}
 			_tracks[trackNr].channels = new Channel[channelCount];
 			_tracks[trackNr].channelCount = 0;
@@ -897,6 +894,12 @@ SoundResource::SoundResource(uint32 resourceNr, ResourceManager *resMan, SciVers
 						size = _resource->size() - dataOffset;
 					}
 
+					if (size == 0) {
+						warning("Empty channel in sound resource %d: track %d, channel %d", resourceNr, trackNr, channelNr);
+						data += 6;
+						continue;
+					}
+
 					channel->data = _resource->subspan(dataOffset, size);
 
 					channel->curPos = 0;


Commit: e09c6d13e4ca5922de1486fd19f9d2e2456e6a10
    https://github.com/scummvm/scummvm/commit/e09c6d13e4ca5922de1486fd19f9d2e2456e6a10
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-05-21T02:35:21-06:00

Commit Message:
SCI32: Handle kShowStyleDissolve Mac palette

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


diff --git a/engines/sci/graphics/transitions32.cpp b/engines/sci/graphics/transitions32.cpp
index fd75cc426e..d951cac33f 100644
--- a/engines/sci/graphics/transitions32.cpp
+++ b/engines/sci/graphics/transitions32.cpp
@@ -210,6 +210,19 @@ void GfxTransitions32::kernelSetShowStyle(const uint16 argc, const reg_t planeOb
 		color = g_sci->_gfxPalette32->getPlatformBlack();
 	}
 
+	// HACK: Swap Mac black/white colors to PC palette for kShowStyleDissolve.
+	// We perform most SCI32 Mac palette conversions while drawing pics, views, and color CelObjs.
+	// That doesn't work for kShowStyleDisolve, it uses a CelObjMem that's initialized from the
+	// current frameout buffer after Mac palette conversions have already taken place.
+	// Example: GK1 room 471 which dissolves from an already black screen to black.
+	if (type == kShowStyleDissolve && g_sci->getPlatform() == Common::kPlatformMacintosh) {
+		if (color == 0) {
+			color == 255;
+		} else if (color == 255) {
+			color = 0;
+		}
+	}
+
 	Plane *plane = g_sci->_gfxFrameout->getPlanes().findByObject(planeObj);
 	if (plane == nullptr) {
 		error("Plane %04x:%04x is not present in active planes list", PRINT_REG(planeObj));




More information about the Scummvm-git-logs mailing list