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
This commit is contained in:
Travis Howell
2005-04-03 06:27:44 +00:00
parent 27cba7619e
commit d7b6860730
5 changed files with 10 additions and 37 deletions
+2 -2
View File
@@ -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);
-8
View File
@@ -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");
-1
View File
@@ -83,7 +83,6 @@ public:
short getShort();
uint16 getWord();
uint32 getDword();
void reinit(uint32 offset);
};
class MemoryChunk : public BaseChunk {
+8 -25
View File
@@ -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)
_middleAudio = true;
pos -= 8;
_skipPalette = false;
} else {
_base->reinit(pos);
_skipPalette = true;
}
if (pos != 8 && pos) {
_middleAudio = true;
}
}
_base->seek(pos, FileChunk::seek_start);
-1
View File
@@ -75,7 +75,6 @@ private:
bool _updateNeeded;
bool _insanity;
bool _middleAudio;
bool _skipPalette;
#ifdef _WIN32_WCE
bool _inTimer;
int16 _inTimerCount;