aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-04-03 06:27:44 +0000
committerTravis Howell2005-04-03 06:27:44 +0000
commitd7b6860730a104bd85491ea90deafebd57da9d90 (patch)
tree841fac2ac4e3a93cf98fe5ba6f3bbaeb843a8f5b
parent27cba7619ec217d541d7160bb7daa00cb9b30b83 (diff)
downloadscummvm-rg350-d7b6860730a104bd85491ea90deafebd57da9d90.tar.gz
scummvm-rg350-d7b6860730a104bd85491ea90deafebd57da9d90.tar.bz2
scummvm-rg350-d7b6860730a104bd85491ea90deafebd57da9d90.zip
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
-rw-r--r--scumm/insane/insane.cpp4
-rw-r--r--scumm/smush/chunk.cpp8
-rw-r--r--scumm/smush/chunk.h1
-rw-r--r--scumm/smush/smush_player.cpp33
-rw-r--r--scumm/smush/smush_player.h1
5 files changed, 10 insertions, 37 deletions
diff --git a/scumm/insane/insane.cpp b/scumm/insane/insane.cpp
index 7ab6e0ee0f..80ea65f2aa 100644
--- a/scumm/insane/insane.cpp
+++ b/scumm/insane/insane.cpp
@@ -857,7 +857,7 @@ void Insane::smush_rewindCurrentSan(int arg_0, int arg_4, int arg_8) {
debugC(DEBUG_INSANE, "smush_rewindCurrentSan(%d, %d, %d)", arg_0, arg_4, arg_8);
_smush_setupsan2 = arg_0;
- smush_setupSanFile(0, 8, 0);
+ smush_setupSanFile(0, 0, 0);
_smush_isSanFileSetup = 1;
smush_setFrameSteps(arg_4, arg_8);
@@ -1437,7 +1437,7 @@ void Insane::smush_setupSanFromStart(const char *filename, int32 setupsan2, int3
debugC(DEBUG_INSANE, "Insane::smush_setupFromStart(%s)", filename);
_smush_setupsan1 = setupsan1;
_smush_setupsan2 = setupsan2;
- smush_setupSanFile(filename, 8, 0);
+ smush_setupSanFile(filename, 0, 0);
_smush_isSanFileSetup = 1;
smush_setFrameSteps(step1, step2);
smush_warpMouse(160, 100, -1);
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;