From d7b6860730a104bd85491ea90deafebd57da9d90 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 3 Apr 2005 06:27:44 +0000 Subject: Removed reinit() and replaced with offsets of zero. We only need to skip type/size. Removed AnimHeader check in parseNextFrame() and _skipPalette, since AnimHeader is correctly skipped when required now. svn-id: r17343 --- scumm/smush/chunk.cpp | 8 -------- scumm/smush/chunk.h | 1 - scumm/smush/smush_player.cpp | 33 ++++++++------------------------- scumm/smush/smush_player.h | 1 - 4 files changed, 8 insertions(+), 35 deletions(-) (limited to 'scumm/smush') diff --git a/scumm/smush/chunk.cpp b/scumm/smush/chunk.cpp index bd954e1eae..33ee752301 100644 --- a/scumm/smush/chunk.cpp +++ b/scumm/smush/chunk.cpp @@ -155,14 +155,6 @@ uint32 FileChunk::getDword() { return _data.readUint32LE(); } -void FileChunk::reinit(uint32 offset) { - _data.seek(offset); - _type = _data.readUint32BE(); - _size = _data.readUint32BE(); - _offset = _data.pos(); - _curPos = 0; -} - MemoryChunk::MemoryChunk(byte *data) { if (data == 0) error("Chunk() called with NULL pointer"); diff --git a/scumm/smush/chunk.h b/scumm/smush/chunk.h index 0586094dc0..f16fe22d28 100644 --- a/scumm/smush/chunk.h +++ b/scumm/smush/chunk.h @@ -83,7 +83,6 @@ public: short getShort(); uint16 getWord(); uint32 getDword(); - void reinit(uint32 offset); }; class MemoryChunk : public BaseChunk { diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index e3bd305ea4..a27d0d4a95 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -252,7 +252,6 @@ SmushPlayer::SmushPlayer(ScummEngine_v6 *scumm, int speed) { _speed = speed; _insanity = false; _middleAudio = false; - _skipPalette = false; #ifdef _WIN32_WCE _inTimer = false; _inTimerCount = 0; @@ -716,9 +715,6 @@ void SmushPlayer::handleNewPalette(Chunk &b) { checkBlock(b, TYPE_NPAL, 0x300); debugC(DEBUG_SMUSH, "SmushPlayer::handleNewPalette()"); - if (_skipPalette) - return; - readPalette(_pal, b); setPalette(_pal); } @@ -972,10 +968,8 @@ void SmushPlayer::handleAnimHeader(Chunk &b) { _version = b.getWord(); _nbframes = b.getWord(); b.getWord(); - if (!_skipPalette) { - readPalette(_pal, b); - setPalette(_pal); - } + readPalette(_pal, b); + setPalette(_pal); } void SmushPlayer::setupAnim(const char *file) { @@ -1045,9 +1039,6 @@ void SmushPlayer::parseNextFrame() { case TYPE_FRME: handleFrame(*sub); break; - case TYPE_AHDR: // FT INSANE may seek file to the beginning - handleAnimHeader(*sub); - break; default: error("Unknown Chunk found at %x: %x, %d", _base->tell(), sub->getType(), sub->getSize()); } @@ -1145,7 +1136,6 @@ void SmushPlayer::insanity(bool flag) { } void SmushPlayer::seekSan(const char *file, int32 pos, int32 contFrame) { - Common::StackLock lock(_mutex); if(_smixer) @@ -1158,24 +1148,17 @@ void SmushPlayer::seekSan(const char *file, int32 pos, int32 contFrame) { } _base = new FileChunk(file); - // In this case we need to get palette and number of frames - if (pos > 8) { + if (pos) { + assert(pos != 8); + // In this case we need to get palette and number of frames Chunk *sub = _base->subBlock(); checkBlock(*sub, TYPE_AHDR); handleAnimHeader(*sub); delete sub; - } - if (pos >= 8) - pos -= 8; - - _skipPalette = false; - } else { - _base->reinit(pos); - _skipPalette = true; - } - if (pos != 8 && pos) { - _middleAudio = true; + _middleAudio = true; + pos -= 8; + } } _base->seek(pos, FileChunk::seek_start); diff --git a/scumm/smush/smush_player.h b/scumm/smush/smush_player.h index 8cd06a2f44..78ba109e42 100644 --- a/scumm/smush/smush_player.h +++ b/scumm/smush/smush_player.h @@ -75,7 +75,6 @@ private: bool _updateNeeded; bool _insanity; bool _middleAudio; - bool _skipPalette; #ifdef _WIN32_WCE bool _inTimer; int16 _inTimerCount; -- cgit v1.2.3