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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Jun 17 14:13:27 CEST 2010


Revision: 49927
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49927&view=rev
Author:   thebluegr
Date:     2010-06-17 12:13:27 +0000 (Thu, 17 Jun 2010)

Log Message:
-----------
M4/MADS: Some slight tweaks to the animation message chunks

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-17 11:54:54 UTC (rev 49926)
+++ scummvm/trunk/engines/m4/animation.cpp	2010-06-17 12:13:27 UTC (rev 49927)
@@ -132,21 +132,23 @@
 
 		for (int i = 0; i < messagesCount; ++i) {
 			AnimMessage rec;
+			rec.soundId = animStream->readUint16LE();
 			animStream->read(rec.msg, 70);
-			rec.pos.x = animStream->readUint16LE();
-			rec.pos.y = animStream->readUint16LE();
 			animStream->readUint16LE();
+			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();
-			animStream->skip(6);
+			rec.pos.x = animStream->readUint16LE();
+			rec.pos.y = animStream->readUint16LE();
 			rec.startFrame = animStream->readUint16LE();
 			rec.endFrame = animStream->readUint16LE();
-			animStream->readUint16LE();
 
 			_messages.push_back(rec);
 		}
@@ -201,7 +203,10 @@
 			fontName += "*";
 		fontName += fontResource;
 
-		_font = _vm->_font->getFont(fontName);
+		if (fontName != "")
+			_font = _vm->_font->getFont(fontName);
+		else
+			warning("Attempted to set a font with an empty name");
 	}
 
 	// Load all the sprite sets for the animation
@@ -421,6 +426,9 @@
 
 			// Add a kernel message to display the given text
 			me.kernelMsgIndex = _view->_kernelMessages.add(me.pos, colIndex * 101, 0, 0, INDEFINITE_TIMEOUT, me.msg);
+			// Play the associated sound, if it exists
+			if (me.soundId >= 0)
+				_vm->_sound->playDSRSound(me.soundId, 255, false);
 			++_messageCtr;
 		}
 	}

Modified: scummvm/trunk/engines/m4/animation.h
===================================================================
--- scummvm/trunk/engines/m4/animation.h	2010-06-17 11:54:54 UTC (rev 49926)
+++ scummvm/trunk/engines/m4/animation.h	2010-06-17 12:13:27 UTC (rev 49927)
@@ -39,6 +39,7 @@
 
 class AnimMessage {
 public:
+	int16 soundId;
 	char msg[70];
 	Common::Point pos;
 	RGB8 rgb1, rgb2;


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