[Scummvm-cvs-logs] SF.net SVN: scummvm: [25910] scummvm/trunk/engines/scumm/smush

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Feb 28 16:04:04 CET 2007


Revision: 25910
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25910&view=rev
Author:   fingolfin
Date:     2007-02-28 07:04:02 -0800 (Wed, 28 Feb 2007)

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

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/smush/channel.h
    scummvm/trunk/engines/scumm/smush/imuse_channel.cpp
    scummvm/trunk/engines/scumm/smush/saud_channel.cpp
    scummvm/trunk/engines/scumm/smush/smush_player.cpp

Modified: scummvm/trunk/engines/scumm/smush/channel.h
===================================================================
--- scummvm/trunk/engines/scumm/smush/channel.h	2007-02-28 14:48:26 UTC (rev 25909)
+++ scummvm/trunk/engines/scumm/smush/channel.h	2007-02-28 15:04:02 UTC (rev 25910)
@@ -73,9 +73,6 @@
 	bool _keepSize;
 
 protected:
-	void handleStrk(Chunk &c);
-	void handleSmrk(Chunk &c);
-	void handleShdr(Chunk &c);
 	bool handleSubTags(int32 &offset);
 
 public:
@@ -106,9 +103,6 @@
 protected:
 	void decode();
 	bool handleMap(Chunk &c);
-	bool handleFormat(Chunk &c);
-	bool handleRegion(Chunk &c);
-	bool handleStop(Chunk &c);
 	bool handleSubTags(int32 &offset);
 
 public:

Modified: scummvm/trunk/engines/scumm/smush/imuse_channel.cpp
===================================================================
--- scummvm/trunk/engines/scumm/smush/imuse_channel.cpp	2007-02-28 14:48:26 UTC (rev 25909)
+++ scummvm/trunk/engines/scumm/smush/imuse_channel.cpp	2007-02-28 15:04:02 UTC (rev 25910)
@@ -101,43 +101,30 @@
 	return true;
 }
 
-bool ImuseChannel::handleFormat(Chunk &src) {
-	if (src.size() != 20) error("invalid size for FRMT Chunk");
-	/*uint32 imuse_start =*/ src.readUint32BE();
-	src.skip(4);
-	_bitsize = src.readUint32BE();
-	_rate = src.readUint32BE();
-	_channels = src.readUint32BE();
-	assert(_channels == 1 || _channels == 2);
-	return true;
-}
-
-bool ImuseChannel::handleRegion(Chunk &src) {
-	if (src.size() != 8)
-		error("invalid size for REGN Chunk");
-	return true;
-}
-
-bool ImuseChannel::handleStop(Chunk &src) {
-	if (src.size() != 4)
-		error("invalid size for STOP Chunk");
-	return true;
-}
-
 bool ImuseChannel::handleMap(Chunk &map) {
 	while (!map.eos()) {
 		Chunk *sub = map.subBlock();
 		switch (sub->getType()) {
 		case MKID_BE('FRMT'):
-			handleFormat(*sub);
+			if (sub->size() != 20)
+				error("invalid size for FRMT Chunk");
+			/*uint32 imuse_start =*/ sub->readUint32BE();
+			sub->skip(4);
+			_bitsize = sub->readUint32BE();
+			_rate = sub->readUint32BE();
+			_channels = sub->readUint32BE();
+			assert(_channels == 1 || _channels == 2);
 			break;
 		case MKID_BE('TEXT'):
+			// Ignore this
 			break;
 		case MKID_BE('REGN'):
-			handleRegion(*sub);
+			if (sub->size() != 8)
+				error("invalid size for REGN Chunk");
 			break;
 		case MKID_BE('STOP'):
-			handleStop(*sub);
+			if (sub->size() != 4)
+				error("invalid size for STOP Chunk");
 			break;
 		default:
 			error("Unknown iMUS subChunk found : %s, %d", tag2str(sub->getType()), sub->size());

Modified: scummvm/trunk/engines/scumm/smush/saud_channel.cpp
===================================================================
--- scummvm/trunk/engines/scumm/smush/saud_channel.cpp	2007-02-28 14:48:26 UTC (rev 25909)
+++ scummvm/trunk/engines/scumm/smush/saud_channel.cpp	2007-02-28 15:04:02 UTC (rev 25910)
@@ -40,23 +40,6 @@
 	return (_markReached && _dataSize == 0 && _sbuffer == 0);
 }
 
-void SaudChannel::handleStrk(Chunk &b) {
-	int32 size = b.size();
-	if (size != 14 && size != 10) {
-		error("STRK has an invalid size : %d", size);
-	}
-}
-
-void SaudChannel::handleSmrk(Chunk &b) {
-	_markReached = true;
-}
-
-void SaudChannel::handleShdr(Chunk &b) {
-	int32 size = b.size();
-	if (size != 4)
-		error("SHDR has an invalid size : %d", size);
-}
-
 bool SaudChannel::handleSubTags(int32 &offset) {
 	if (_tbufferSize - offset >= 8) {
 		Chunk::type type = READ_BE_UINT32(_tbuffer + offset);
@@ -68,7 +51,9 @@
 			_inData = false;
 			if (available_size >= (size + 8)) {
 				MemoryChunk c((byte *)_tbuffer + offset);
-				handleStrk(c);
+				if (c.size() != 14 && c.size() != 10) {
+					error("STRK has an invalid size : %d", c.size());
+				}
 			} else
 				return false;
 			break;
@@ -76,7 +61,7 @@
 			_inData = false;
 			if (available_size >= (size + 8)) {
 				MemoryChunk c((byte *)_tbuffer + offset);
-				handleSmrk(c);
+				_markReached = true;
 			} else
 				return false;
 			break;
@@ -84,7 +69,8 @@
 			_inData = false;
 			if (available_size >= (size + 8)) {
 				MemoryChunk c((byte *)_tbuffer + offset);
-				handleShdr(c);
+				if (c.size() != 4)
+					error("SHDR has an invalid size : %d", c.size());
 			} else
 				return false;
 			break;

Modified: scummvm/trunk/engines/scumm/smush/smush_player.cpp
===================================================================
--- scummvm/trunk/engines/scumm/smush/smush_player.cpp	2007-02-28 14:48:26 UTC (rev 25909)
+++ scummvm/trunk/engines/scumm/smush/smush_player.cpp	2007-02-28 15:04:02 UTC (rev 25910)
@@ -366,7 +366,7 @@
 		_smixer->addChannel(c);
 	}
 
-	if (_middleAudio || (index == 0)) {
+	if (_middleAudio || index == 0) {
 		c->setParameters(max_frames, flags, vol, pan, index);
 	} else {
 		c->checkParameters(index, max_frames, flags, vol, pan);


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