aboutsummaryrefslogtreecommitdiff
path: root/scumm/smush
diff options
context:
space:
mode:
authorEugene Sandulenko2004-01-28 04:07:54 +0000
committerEugene Sandulenko2004-01-28 04:07:54 +0000
commitece80a4a1f82abcef5c5aa0c12f665a89d7c85e2 (patch)
tree475b30f8b74d5f9c8b191c196b9e8871ea225620 /scumm/smush
parent4c430c9b4ae7e834968e7eef5c52649ae63d5c92 (diff)
downloadscummvm-rg350-ece80a4a1f82abcef5c5aa0c12f665a89d7c85e2.tar.gz
scummvm-rg350-ece80a4a1f82abcef5c5aa0c12f665a89d7c85e2.tar.bz2
scummvm-rg350-ece80a4a1f82abcef5c5aa0c12f665a89d7c85e2.zip
Partial fix for bug #885488 (Some INSANE trouble)
o Finally fixed seek error. Now I never encounter it, though there are weird SAUD errors in some cases. o Started to hunt cave-dude-only bug svn-id: r12653
Diffstat (limited to 'scumm/smush')
-rw-r--r--scumm/smush/chunk.cpp1
-rw-r--r--scumm/smush/smush_player.cpp16
2 files changed, 8 insertions, 9 deletions
diff --git a/scumm/smush/chunk.cpp b/scumm/smush/chunk.cpp
index 9962ef362e..6df6a7fb74 100644
--- a/scumm/smush/chunk.cpp
+++ b/scumm/smush/chunk.cpp
@@ -191,6 +191,7 @@ uint32 FileChunk::getDword() {
void FileChunk::reinit(uint32 offset) {
_offset = 0;
+ _data->seek(0);
_type = _data->readUint32BE();
_size = _data->readUint32BE();
_curPos = 0;
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index fa9dd24a15..227f3b601c 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -872,6 +872,9 @@ 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());
}
@@ -964,28 +967,23 @@ void SmushPlayer::insanity(bool flag) {
}
void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos, int32 contFrame) {
- Chunk *sub;
-
if (file) {
if (_base)
delete _base;
_base = new FileChunk(file, directory);
- pos = 0;
+ if (pos >= 8)
+ pos -= 8;
} else {
_base->reinit(pos);
}
if (pos != 8 && pos) {
- _base->seek(pos, FileChunk::seek_start);
_middleAudio = true;
- } else {
- _base->seek(pos, FileChunk::seek_start);
- sub = _base->subBlock();
- checkBlock(*sub, TYPE_AHDR);
- handleAnimHeader(*sub);
}
+ _base->seek(pos, FileChunk::seek_start);
+
_frame = contFrame;
}