[Scummvm-git-logs] scummvm master -> 3ee7094fa62cdae918e7d1738c83289550a446d4

sev- noreply at scummvm.org
Thu Jul 27 12:19:13 UTC 2023


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:
3ee7094fa6 DIRECTOR: Fix filmloop loading for D4


Commit: 3ee7094fa62cdae918e7d1738c83289550a446d4
    https://github.com/scummvm/scummvm/commit/3ee7094fa62cdae918e7d1738c83289550a446d4
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-07-27T14:19:03+02:00

Commit Message:
DIRECTOR: Fix filmloop loading for D4

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


diff --git a/engines/director/castmember/filmloop.cpp b/engines/director/castmember/filmloop.cpp
index c41a7dcf0b9..9d545c10c56 100644
--- a/engines/director/castmember/filmloop.cpp
+++ b/engines/director/castmember/filmloop.cpp
@@ -244,8 +244,9 @@ void FilmLoopCastMember::loadFilmLoopDataD4(Common::SeekableReadStreamEndian &st
 			uint16 order = stream.readUint16BE();
 			frameSize -= 4;
 
-			int channel = (order / channelSize) - 1;
+			int channel = order / channelSize;
 			int channelOffset = order % channelSize;
+			int offset = order;
 
 			debugC(8, kDebugLoading, "loadFilmLoopDataD4: Message: msgWidth %d, channel %d, channelOffset %d", msgWidth, channel, channelOffset);
 			if (debugChannelSet(8, kDebugLoading)) {
@@ -265,12 +266,13 @@ void FilmLoopCastMember::loadFilmLoopDataD4(Common::SeekableReadStreamEndian &st
 				sprite._puppet = 1;
 				sprite._stretch = 1;
 
-				uint16 needSize = MIN((uint16)(nextStart - channelOffset), segSize);
+				uint16 needSize = MIN((uint16)(nextStart - offset), segSize);
 				int startPosition = stream.pos() - channelOffset;
 				int finishPosition = stream.pos() + needSize;
 				readSpriteDataD4(stream, sprite, startPosition, finishPosition);
 				newFrame.sprites.setVal(channel, sprite);
 				segSize -= needSize;
+				offset += needSize;
 				channel += 1;
 				channelOffset = 0;
 				nextStart += kSprChannelSizeD4;




More information about the Scummvm-git-logs mailing list