aboutsummaryrefslogtreecommitdiff
path: root/scumm/smush
diff options
context:
space:
mode:
authorEugene Sandulenko2004-01-25 05:25:50 +0000
committerEugene Sandulenko2004-01-25 05:25:50 +0000
commit87730caa0298fca70c609c5d589620ea04df8830 (patch)
treee859b82501c77e5df533fc87c8f5542a186a384d /scumm/smush
parentf4e26c9412b4edaf50602091f29a1c2362147107 (diff)
downloadscummvm-rg350-87730caa0298fca70c609c5d589620ea04df8830.tar.gz
scummvm-rg350-87730caa0298fca70c609c5d589620ea04df8830.tar.bz2
scummvm-rg350-87730caa0298fca70c609c5d589620ea04df8830.zip
Fixed plenty of bugs:
o Seek error. Now it seems to cover all cases o Shadows in tunnels on mineroad o Renamed some function to match functionality o bug #867555 (Problems between Mink Farm and Poyhoga) o Ben disappearing in car chase svn-id: r12586
Diffstat (limited to 'scumm/smush')
-rw-r--r--scumm/smush/chunk.cpp3
-rw-r--r--scumm/smush/chunk.h2
-rw-r--r--scumm/smush/smush_player.cpp22
3 files changed, 14 insertions, 13 deletions
diff --git a/scumm/smush/chunk.cpp b/scumm/smush/chunk.cpp
index 1c4a23b49f..9962ef362e 100644
--- a/scumm/smush/chunk.cpp
+++ b/scumm/smush/chunk.cpp
@@ -189,8 +189,7 @@ uint32 FileChunk::getDword() {
return _data->readUint32LE();
}
-void FileChunk::reinit() {
- _data->seek(0);
+void FileChunk::reinit(uint32 offset) {
_offset = 0;
_type = _data->readUint32BE();
_size = _data->readUint32BE();
diff --git a/scumm/smush/chunk.h b/scumm/smush/chunk.h
index 25b4a8c7a8..3e5bc59c9a 100644
--- a/scumm/smush/chunk.h
+++ b/scumm/smush/chunk.h
@@ -83,7 +83,7 @@ public:
short getShort();
uint16 getWord();
uint32 getDword();
- void reinit();
+ void reinit(uint32 offset);
};
class MemoryChunk : public BaseChunk {
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index d3613d56aa..fdb3b901ce 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -292,7 +292,7 @@ void SmushPlayer::deinit() {
void SmushPlayer::checkBlock(const Chunk &b, Chunk::type type_expected, uint32 min_size) {
if (type_expected != b.getType()) {
- error("Chunk type is different from expected : %d != %d", b.getType(), type_expected);
+ error("Chunk type is different from expected : %x != %x", b.getType(), type_expected);
}
if (min_size > b.getSize()) {
error("Chunk size is inferior than minimum required size : %d < %d", b.getSize(), min_size);
@@ -867,7 +867,7 @@ void SmushPlayer::parseNextFrame() {
handleFrame(*sub);
break;
default:
- error("Unknown Chunk found at %x: %d, %d", _base->tell(), sub->getType(), sub->getSize());
+ error("Unknown Chunk found at %x: %x, %d", _base->tell(), sub->getType(), sub->getSize());
}
delete sub;
}
@@ -951,24 +951,26 @@ 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;
} else {
- _base->reinit();
+ _base->reinit(pos);
+ debug(0, "Yup");
}
- sub = _base->subBlock();
- checkBlock(*sub, TYPE_AHDR);
- handleAnimHeader(*sub);
-
- if (pos != 8) {
- _base->reinit();
+ 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);
}
_frame = contFrame;