diff options
author | Eugene Sandulenko | 2004-02-02 22:40:20 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-02-02 22:40:20 +0000 |
commit | 8a2496d6c5b11db615ab4d44a04b19e7dd9fef4c (patch) | |
tree | eba631069495044c4d224d4616f018025765c18c /scumm/smush | |
parent | c40474322fba82e9715d1f4b5453c7bd03012eb6 (diff) | |
download | scummvm-rg350-8a2496d6c5b11db615ab4d44a04b19e7dd9fef4c.tar.gz scummvm-rg350-8a2496d6c5b11db615ab4d44a04b19e7dd9fef4c.tar.bz2 scummvm-rg350-8a2496d6c5b11db615ab4d44a04b19e7dd9fef4c.zip |
Fixed most bugs, so only cosmetic visual things left.
o Support transparency for characters. Needed for cockpit rendering
o Fixed bug in NUT renderer which drawed transparent characters garbled
o Fixed long-standing (and outstanding) bug with SAUD error
o Previous fix fixed music in some cases (scene transitions)
o Fixed bug with palette being reset when smush video is rewind
o Made debug level for insane adjustable at compile time (maybe I will remove it later)
svn-id: r12717
Diffstat (limited to 'scumm/smush')
-rw-r--r-- | scumm/smush/saud_channel.cpp | 11 | ||||
-rw-r--r-- | scumm/smush/smush_mixer.cpp | 1 | ||||
-rw-r--r-- | scumm/smush/smush_player.cpp | 21 | ||||
-rw-r--r-- | scumm/smush/smush_player.h | 1 |
4 files changed, 27 insertions, 7 deletions
diff --git a/scumm/smush/saud_channel.cpp b/scumm/smush/saud_channel.cpp index 629ab95fc5..166e8ea8fc 100644 --- a/scumm/smush/saud_channel.cpp +++ b/scumm/smush/saud_channel.cpp @@ -75,7 +75,7 @@ bool SaudChannel::handleSubTags(int32 &offset) { } else return false; break; - case TYPE_SDAT: + case TYPE_SDAT: _inData = true; _dataSize = size; offset += 8; @@ -103,7 +103,7 @@ bool SaudChannel::processBuffer() { } else if (_inData) { if (_dataSize < _tbufferSize) { int32 offset = _dataSize; - while (handleSubTags(offset)); + while (handleSubTags(offset)) ; _sbufferSize = _dataSize; _sbuffer = _tbuffer; if (offset < _tbufferSize) { @@ -171,12 +171,17 @@ SaudChannel::SaudChannel(int32 track, int32 freq) : } SaudChannel::~SaudChannel() { + _dataSize = 0; + _tbufferSize = 0; + _sbufferSize = 0; + _markReached = true; if (_tbuffer) delete []_tbuffer; if (_sbuffer) { - warning("this should never happen !!!! (_sbuffer not NULL here)"); + // _sbuffer can be not empty here with insane when it seeks in video delete []_sbuffer; } + _sbuffer = 0; } bool SaudChannel::isTerminated() const { diff --git a/scumm/smush/smush_mixer.cpp b/scumm/smush/smush_mixer.cpp index d329804f5f..ea6e39b887 100644 --- a/scumm/smush/smush_mixer.cpp +++ b/scumm/smush/smush_mixer.cpp @@ -139,6 +139,7 @@ bool SmushMixer::stop() { delete _channels[i].chan; _channels[i].id = -1; _channels[i].chan = NULL; + _mixer->endStream(_channels[i].handle); } } return true; diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index 0a395f9d03..13c0c677f3 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -236,6 +236,7 @@ SmushPlayer::SmushPlayer(ScummEngine_v6 *scumm, int speed) { _speed = speed; _insanity = false; _middleAudio = false; + _skipPalette = false; } SmushPlayer::~SmushPlayer() { @@ -657,6 +658,9 @@ void SmushPlayer::handleNewPalette(Chunk &b) { checkBlock(b, TYPE_NPAL, 0x300); debug(6, "SmushPlayer::handleNewPalette()"); + if (_skipPalette) + return; + readPalette(_pal, b); setPalette(_pal); } @@ -786,7 +790,6 @@ void SmushPlayer::handleFrame(Chunk &b) { delete sub; } - // FIXME: Check either parameters are valid if (_insanity) { _vm->_insane->procPostRendering(_dst, 0, 0, 0, _frame, _nbframes-1); } @@ -808,8 +811,10 @@ void SmushPlayer::handleAnimHeader(Chunk &b) { _version = b.getWord(); _nbframes = b.getWord(); b.getWord(); - readPalette(_pal, b); - setPalette(_pal); + if (!_skipPalette) { + readPalette(_pal, b); + setPalette(_pal); + } } void SmushPlayer::setupAnim(const char *file, const char *directory) { @@ -972,9 +977,14 @@ void SmushPlayer::insanity(bool flag) { } void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos, int32 contFrame) { + if(_smixer) + _smixer->stop(); + if (file) { - if (_base) + if (_base) { + _base->seek(0, FileChunk::seek_end); delete _base; + } _base = new FileChunk(file, directory); // In this case we need to get palette and number of frames @@ -986,8 +996,11 @@ void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos, in } if (pos >= 8) pos -= 8; + + _skipPalette = false; } else { _base->reinit(pos); + _skipPalette = true; } if (pos != 8 && pos) { diff --git a/scumm/smush/smush_player.h b/scumm/smush/smush_player.h index e3048c80d8..b790f93ab1 100644 --- a/scumm/smush/smush_player.h +++ b/scumm/smush/smush_player.h @@ -68,6 +68,7 @@ private: bool _updateNeeded; bool _insanity; bool _middleAudio; + bool _skipPalette; public: SmushPlayer(ScummEngine_v6 *scumm, int speed); |