[Scummvm-git-logs] scummvm master -> 66c665dba993ebaf0175492880c3c81ef35c0b13

sev- noreply at scummvm.org
Tue Jun 13 21:01:56 UTC 2023


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:
95e6a3db9a DIRECTOR: Fix negative cast numbers in FilmLoop reading
66c665dba9 DIRECTOR: Enhanced debug output for filmloop loading


Commit: 95e6a3db9a849e730b83b890c6596041622b9951
    https://github.com/scummvm/scummvm/commit/95e6a3db9a849e730b83b890c6596041622b9951
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-06-13T22:58:26+02:00

Commit Message:
DIRECTOR: Fix negative cast numbers in FilmLoop reading

This fixes totaldistortion-win aquarium movie loading

  --start-movie="ATD\HD\ccTWRRAD.DXR"

Changed paths:
    engines/director/castmember/filmloop.cpp


diff --git a/engines/director/castmember/filmloop.cpp b/engines/director/castmember/filmloop.cpp
index 054221ef829..6fbdf262357 100644
--- a/engines/director/castmember/filmloop.cpp
+++ b/engines/director/castmember/filmloop.cpp
@@ -89,7 +89,7 @@ Common::Array<Channel> *FilmLoopCastMember::getSubChannels(Common::Rect &bbox, C
 		int16 width = src._width * widgetRect.width() / _initialRect.width();
 		int16 height = src._height * widgetRect.height() / _initialRect.height();
 
-		// Film loop frames are constructed as a series of Channels, much like how a normal frame 
+		// Film loop frames are constructed as a series of Channels, much like how a normal frame
 		// is rendered by the Score. We don't include a pointer to the current Score here,
 		// that's only for querying the constraint channel which is not used.
 		Channel chan(nullptr, &src);
@@ -360,6 +360,11 @@ void FilmLoopCastMember::loadFilmLoopDataV4(Common::SeekableReadStreamEndian &st
 					s->_value._castId.asString().c_str(), s->_value._startPoint.x, s->_value._startPoint.y,
 					s->_value._width, s->_value._height);
 
+			if (s->_key == -1) {
+				debugC(5, kDebugLoading, "Skipping channel -1");
+				continue;
+			}
+
 			Common::Point topLeft = s->_value._startPoint;
 			if (s->_value._cast) {
 				topLeft -= s->_value._cast->getRegistrationOffset(s->_value._width, s->_value._height);


Commit: 66c665dba993ebaf0175492880c3c81ef35c0b13
    https://github.com/scummvm/scummvm/commit/66c665dba993ebaf0175492880c3c81ef35c0b13
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-06-13T23:01:27+02:00

Commit Message:
DIRECTOR: Enhanced debug output for filmloop loading

Changed paths:
    engines/director/castmember/filmloop.cpp


diff --git a/engines/director/castmember/filmloop.cpp b/engines/director/castmember/filmloop.cpp
index 6fbdf262357..279fd6bfbc3 100644
--- a/engines/director/castmember/filmloop.cpp
+++ b/engines/director/castmember/filmloop.cpp
@@ -117,7 +117,7 @@ void FilmLoopCastMember::loadFilmLoopData(Common::SeekableReadStreamEndian &stre
 
 	uint32 size = stream.readUint32BE();
 	if (debugChannelSet(5, kDebugLoading)) {
-		debugC(5, kDebugLoading, "SCVW body:");
+		debugC(5, kDebugLoading, "loadFilmLoopData: SCVW body:");
 		uint32 pos = stream.pos();
 		stream.seek(0);
 		stream.hexdump(size);
@@ -129,7 +129,7 @@ void FilmLoopCastMember::loadFilmLoopData(Common::SeekableReadStreamEndian &stre
 	while (stream.pos() < size) {
 		uint16 frameSize = stream.readUint16BE() - 2;
 		if (debugChannelSet(5, kDebugLoading)) {
-			debugC(5, kDebugLoading, "Frame entry:");
+			debugC(5, kDebugLoading, "loadFilmLoopData: Frame entry:");
 			stream.hexdump(frameSize);
 		}
 
@@ -137,7 +137,7 @@ void FilmLoopCastMember::loadFilmLoopData(Common::SeekableReadStreamEndian &stre
 			int msgWidth = stream.readByte() * 2;
 			int order = stream.readByte() * 2 - 0x20;
 			frameSize -= 2;
-			debugC(8, kDebugLoading, "Message: msgWidth %d, order %d", msgWidth, order);
+			debugC(8, kDebugLoading, "loadFilmLoopData: Message: msgWidth %d, order %d", msgWidth, order);
 			if (debugChannelSet(8, kDebugLoading)) {
 				stream.hexdump(msgWidth);
 			}
@@ -214,7 +214,7 @@ void FilmLoopCastMember::loadFilmLoopData(Common::SeekableReadStreamEndian &stre
 		}
 
 		for (Common::HashMap<int, Sprite>::iterator s = newFrame.sprites.begin(); s != newFrame.sprites.end(); ++s) {
-			debugC(5, kDebugLoading, "Sprite: channel %d, castId %s, bbox %d %d %d %d", s->_key,
+			debugC(5, kDebugLoading, "loadFilmLoopData: Sprite: channel %d, castId %s, bbox %d %d %d %d", s->_key,
 					s->_value._castId.asString().c_str(), s->_value._startPoint.x, s->_value._startPoint.y,
 					s->_value._width, s->_value._height);
 
@@ -235,14 +235,14 @@ void FilmLoopCastMember::loadFilmLoopData(Common::SeekableReadStreamEndian &stre
 					_initialRect.extend(spriteBbox);
 				}
 			}
-			debugC(8, kDebugLoading, "New bounding box: %d %d %d %d", _initialRect.left, _initialRect.top, _initialRect.width(), _initialRect.height());
+			debugC(8, kDebugLoading, "loadFilmLoopData: New bounding box: %d %d %d %d", _initialRect.left, _initialRect.top, _initialRect.width(), _initialRect.height());
 
 		}
 
 		_frames.push_back(newFrame);
 
 	}
-	debugC(5, kDebugLoading, "Full bounding box: %d %d %d %d", _initialRect.left, _initialRect.top, _initialRect.width(), _initialRect.height());
+	debugC(5, kDebugLoading, "loadFilmLoopData: Full bounding box: %d %d %d %d", _initialRect.left, _initialRect.top, _initialRect.width(), _initialRect.height());
 }
 
 void FilmLoopCastMember::loadFilmLoopDataV4(Common::SeekableReadStreamEndian &stream) {
@@ -251,7 +251,7 @@ void FilmLoopCastMember::loadFilmLoopDataV4(Common::SeekableReadStreamEndian &st
 
 	uint32 size = stream.readUint32BE();
 	if (debugChannelSet(5, kDebugLoading)) {
-		debugC(5, kDebugLoading, "SCVW body:");
+		debugC(5, kDebugLoading, "loadFilmLoopDataV4: SCVW body:");
 		uint32 pos = stream.pos();
 		stream.seek(0);
 		stream.hexdump(size);
@@ -259,7 +259,7 @@ void FilmLoopCastMember::loadFilmLoopDataV4(Common::SeekableReadStreamEndian &st
 	}
 	uint32 framesOffset = stream.readUint32BE();
 	if (debugChannelSet(5, kDebugLoading)) {
-		debugC(5, kDebugLoading, "SCVW header:");
+		debugC(5, kDebugLoading, "loadFilmLoopDataV4: SCVW header:");
 		stream.hexdump(framesOffset - 8);
 	}
 	stream.skip(6);
@@ -271,7 +271,7 @@ void FilmLoopCastMember::loadFilmLoopDataV4(Common::SeekableReadStreamEndian &st
 	while (stream.pos() < size) {
 		uint16 frameSize = stream.readUint16BE() - 2;
 		if (debugChannelSet(5, kDebugLoading)) {
-			debugC(5, kDebugLoading, "Frame entry:");
+			debugC(5, kDebugLoading, "loadFilmLoopDataV4: Frame entry:");
 			stream.hexdump(frameSize);
 		}
 
@@ -288,7 +288,7 @@ void FilmLoopCastMember::loadFilmLoopDataV4(Common::SeekableReadStreamEndian &st
 			if (newFrame.sprites.contains(channel)) {
 				sprite = newFrame.sprites.getVal(channel);
 			}
-			debugC(8, kDebugLoading, "Message: msgWidth %d, channel %d, channelOffset %d", msgWidth, channel, channelOffset);
+			debugC(8, kDebugLoading, "loadFilmLoopDataV4: Message: msgWidth %d, channel %d, channelOffset %d", msgWidth, channel, channelOffset);
 			if (debugChannelSet(8, kDebugLoading)) {
 				stream.hexdump(msgWidth);
 			}
@@ -356,12 +356,12 @@ void FilmLoopCastMember::loadFilmLoopDataV4(Common::SeekableReadStreamEndian &st
 		}
 
 		for (Common::HashMap<int, Sprite>::iterator s = newFrame.sprites.begin(); s != newFrame.sprites.end(); ++s) {
-			debugC(5, kDebugLoading, "Sprite: channel %d, castId %s, bbox %d %d %d %d", s->_key,
+			debugC(5, kDebugLoading, "loadFilmLoopDataV4: Sprite: channel %d, castId %s, bbox %d %d %d %d", s->_key,
 					s->_value._castId.asString().c_str(), s->_value._startPoint.x, s->_value._startPoint.y,
 					s->_value._width, s->_value._height);
 
 			if (s->_key == -1) {
-				debugC(5, kDebugLoading, "Skipping channel -1");
+				debugC(5, kDebugLoading, "loadFilmLoopDataV4: Skipping channel -1");
 				continue;
 			}
 
@@ -382,14 +382,14 @@ void FilmLoopCastMember::loadFilmLoopDataV4(Common::SeekableReadStreamEndian &st
 					_initialRect.extend(spriteBbox);
 				}
 			}
-			debugC(8, kDebugLoading, "New bounding box: %d %d %d %d", _initialRect.left, _initialRect.top, _initialRect.width(), _initialRect.height());
+			debugC(8, kDebugLoading, "loadFilmLoopDataV4: New bounding box: %d %d %d %d", _initialRect.left, _initialRect.top, _initialRect.width(), _initialRect.height());
 
 		}
 
 		_frames.push_back(newFrame);
 
 	}
-	debugC(5, kDebugLoading, "Full bounding box: %d %d %d %d", _initialRect.left, _initialRect.top, _initialRect.width(), _initialRect.height());
+	debugC(5, kDebugLoading, "loadFilmLoopDataV4: Full bounding box: %d %d %d %d", _initialRect.left, _initialRect.top, _initialRect.width(), _initialRect.height());
 
 }
 




More information about the Scummvm-git-logs mailing list