[Scummvm-cvs-logs] SF.net SVN: scummvm:[50366] scummvm/trunk/engines/m4

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sun Jun 27 07:18:22 CEST 2010


Revision: 50366
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50366&view=rev
Author:   dreammaster
Date:     2010-06-27 05:18:21 +0000 (Sun, 27 Jun 2010)

Log Message:
-----------
Several bugfixes to the loading, display, and digital sound playing of messages during cutscenes

Modified Paths:
--------------
    scummvm/trunk/engines/m4/animation.cpp
    scummvm/trunk/engines/m4/animation.h

Modified: scummvm/trunk/engines/m4/animation.cpp
===================================================================
--- scummvm/trunk/engines/m4/animation.cpp	2010-06-27 05:17:40 UTC (rev 50365)
+++ scummvm/trunk/engines/m4/animation.cpp	2010-06-27 05:18:21 UTC (rev 50366)
@@ -132,23 +132,24 @@
 
 		for (int i = 0; i < messagesCount; ++i) {
 			AnimMessage rec;
-			rec.soundId = animStream->readUint16LE();
-			animStream->read(rec.msg, 70);
-			animStream->readUint16LE();
-			animStream->readUint16LE();
+			rec.soundId = animStream->readSint16LE();
+			animStream->read(rec.msg, 64);
+			animStream->skip(4);
+			rec.pos.x = animStream->readSint16LE();
+			rec.pos.y = animStream->readSint16LE();
+			rec.flags = animStream->readUint16LE();
 			rec.rgb1.r = animStream->readByte();
 			rec.rgb1.g = animStream->readByte();
 			rec.rgb1.b = animStream->readByte();
 			rec.rgb2.r = animStream->readByte();
 			rec.rgb2.g = animStream->readByte();
 			rec.rgb2.b = animStream->readByte();
-			animStream->readUint16LE();
-			animStream->readUint16LE();
-			rec.kernelMsgIndex = animStream->readUint16LE();
-			rec.pos.x = animStream->readUint16LE();
-			rec.pos.y = animStream->readUint16LE();
+			animStream->skip(2);	// Space for kernelMsgIndex
+			rec.kernelMsgIndex = -1;
+			animStream->skip(6);
 			rec.startFrame = animStream->readUint16LE();
 			rec.endFrame = animStream->readUint16LE();
+			animStream->skip(2);
 
 			_messages.push_back(rec);
 		}
@@ -166,8 +167,8 @@
 			rec.seqIndex = animStream->readByte();
 			rec.spriteSlot.spriteListIndex = animStream->readByte();
 			rec.spriteSlot.frameNumber = animStream->readUint16LE();
-			rec.spriteSlot.xp = animStream->readUint16LE();
-			rec.spriteSlot.yp = animStream->readUint16LE();
+			rec.spriteSlot.xp = animStream->readSint16LE();
+			rec.spriteSlot.yp = animStream->readSint16LE();
 			rec.spriteSlot.depth = animStream->readByte();
 			rec.spriteSlot.scale = (int8)animStream->readByte();
 
@@ -425,10 +426,12 @@
 			_vm->_palette->setEntry(colIndex + 1, me.rgb2.r, me.rgb2.g, me.rgb2.b);
 
 			// Add a kernel message to display the given text
-			me.kernelMsgIndex = _view->_kernelMessages.add(me.pos, colIndex * 101, 0, 0, INDEFINITE_TIMEOUT, me.msg);
+			me.kernelMsgIndex = _view->_kernelMessages.add(me.pos, colIndex * 0x101, 0, 0, INDEFINITE_TIMEOUT, me.msg);
+			assert(me.kernelMsgIndex >= 0);
+
 			// Play the associated sound, if it exists
-			if (me.soundId >= 0)
-				_vm->_sound->playDSRSound(me.soundId, 255, false);
+			if (me.soundId > 0)
+				_vm->_sound->playDSRSound(me.soundId - 1, 255, false);
 			++_messageCtr;
 		}
 	}

Modified: scummvm/trunk/engines/m4/animation.h
===================================================================
--- scummvm/trunk/engines/m4/animation.h	2010-06-27 05:17:40 UTC (rev 50365)
+++ scummvm/trunk/engines/m4/animation.h	2010-06-27 05:18:21 UTC (rev 50366)
@@ -40,12 +40,12 @@
 class AnimMessage {
 public:
 	int16 soundId;
-	char msg[70];
+	char msg[64];
 	Common::Point pos;
 	RGB8 rgb1, rgb2;
+	uint16 flags;
+	int startFrame, endFrame;
 	int kernelMsgIndex;
-
-	int startFrame, endFrame;
 };
 
 class AnimFrameEntry {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list