[Scummvm-cvs-logs] SF.net SVN: scummvm:[47150] scummvm/trunk/engines/teenagent/music.cpp

megath at users.sourceforge.net megath at users.sourceforge.net
Fri Jan 8 12:06:02 CET 2010


Revision: 47150
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47150&view=rev
Author:   megath
Date:     2010-01-08 11:05:59 +0000 (Fri, 08 Jan 2010)

Log Message:
-----------
minor cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/music.cpp

Modified: scummvm/trunk/engines/teenagent/music.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/music.cpp	2010-01-08 10:39:00 UTC (rev 47149)
+++ scummvm/trunk/engines/teenagent/music.cpp	2010-01-08 11:05:59 UTC (rev 47150)
@@ -43,7 +43,7 @@
 bool MusicPlayer::load(int id) {
 	Resources *res = Resources::instance();
 
-	Common::SeekableReadStream *stream	= res->mmm.getStream(id);
+	Common::SeekableReadStream *stream = res->mmm.getStream(id);
 	if (stream == NULL)
 		return false;
 
@@ -90,18 +90,24 @@
 	while (!stream->eos()) {
 
 		byte cmd = stream->readByte();
+		debug(1, "cmd = %02x", cmd);
 
-		if ((cmd & 0xF0) == 0x50) {
-			row.channels[(cmd & 0x0F) - 1].sample = stream->readByte();
-		} else if ((cmd & 0xF0) == 0x40) {
-			row.channels[(cmd & 0x0F) - 1].volume = (stream->readByte() + 1) * 2;
-		} else {
+		if (cmd < 0x40) {
 			row.channels[0].note = cmd;
 			row.channels[1].note = stream->readByte();
 			row.channels[2].note = stream->readByte();
 			_rows.push_back(row);
+		} else if ((cmd & 0xF0) == 0x50) {
+			byte sample = stream->readByte();
+			//debug(1, "%02x: set sample %02x", cmd, sample);
+			row.channels[(cmd & 0x0F) - 1].sample = sample;
+		} else if ((cmd & 0xF0) == 0x40) {
+			byte vol = stream->readByte();
+			//debug(1, "%02x: set volume %02x -> %02x", cmd, row.channels[(cmd & 0x0F) - 1].volume, vol);
+			row.channels[(cmd & 0x0F) - 1].volume = vol;
+		} else {
+			debug(0, "unhandled music command %02x", cmd);
 		}
-
 	}
 	_currRow = 0;
 	_id = id;


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