aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2007-02-28 15:04:02 +0000
committerMax Horn2007-02-28 15:04:02 +0000
commit5e2fe7dc7fb294373e1d2907dfd48598da495777 (patch)
tree5ff48d8c6d6fa53b97aa8d52ad6769ae1b915dac /engines/scumm
parent8c8abca6f80fc63b5c11fa43319cdf56b4845660 (diff)
downloadscummvm-rg350-5e2fe7dc7fb294373e1d2907dfd48598da495777.tar.gz
scummvm-rg350-5e2fe7dc7fb294373e1d2907dfd48598da495777.tar.bz2
scummvm-rg350-5e2fe7dc7fb294373e1d2907dfd48598da495777.zip
cleanup
svn-id: r25910
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/smush/channel.h6
-rw-r--r--engines/scumm/smush/imuse_channel.cpp39
-rw-r--r--engines/scumm/smush/saud_channel.cpp26
-rw-r--r--engines/scumm/smush/smush_player.cpp2
4 files changed, 20 insertions, 53 deletions
diff --git a/engines/scumm/smush/channel.h b/engines/scumm/smush/channel.h
index 37b55030ea..2dd523dc06 100644
--- a/engines/scumm/smush/channel.h
+++ b/engines/scumm/smush/channel.h
@@ -73,9 +73,6 @@ private:
bool _keepSize;
protected:
- void handleStrk(Chunk &c);
- void handleSmrk(Chunk &c);
- void handleShdr(Chunk &c);
bool handleSubTags(int32 &offset);
public:
@@ -106,9 +103,6 @@ private:
protected:
void decode();
bool handleMap(Chunk &c);
- bool handleFormat(Chunk &c);
- bool handleRegion(Chunk &c);
- bool handleStop(Chunk &c);
bool handleSubTags(int32 &offset);
public:
diff --git a/engines/scumm/smush/imuse_channel.cpp b/engines/scumm/smush/imuse_channel.cpp
index 44baedc076..e69b08014b 100644
--- a/engines/scumm/smush/imuse_channel.cpp
+++ b/engines/scumm/smush/imuse_channel.cpp
@@ -101,43 +101,30 @@ bool ImuseChannel::appendData(Chunk &b, int32 size) {
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());
diff --git a/engines/scumm/smush/saud_channel.cpp b/engines/scumm/smush/saud_channel.cpp
index 902934f943..3541d37ed5 100644
--- a/engines/scumm/smush/saud_channel.cpp
+++ b/engines/scumm/smush/saud_channel.cpp
@@ -40,23 +40,6 @@ bool SaudChannel::isTerminated() const {
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 @@ bool SaudChannel::handleSubTags(int32 &offset) {
_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 @@ bool SaudChannel::handleSubTags(int32 &offset) {
_inData = false;
if (available_size >= (size + 8)) {
MemoryChunk c((byte *)_tbuffer + offset);
- handleSmrk(c);
+ _markReached = true;
} else
return false;
break;
@@ -84,7 +69,8 @@ bool SaudChannel::handleSubTags(int32 &offset) {
_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;
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 3310415f30..de6083a3a4 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -366,7 +366,7 @@ void SmushPlayer::handleSoundBuffer(int32 track_id, int32 index, int32 max_frame
_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);