aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2003-12-28 07:57:36 +0000
committerEugene Sandulenko2003-12-28 07:57:36 +0000
commit47c698c8b8453b6762f2752cc2e8e41f8472f81e (patch)
treee68b83139a96af3295fe449465a77b00ca250d16
parente91224589f740e52bc5788b9e1e90cbe4d22dc28 (diff)
downloadscummvm-rg350-47c698c8b8453b6762f2752cc2e8e41f8472f81e.tar.gz
scummvm-rg350-47c698c8b8453b6762f2752cc2e8e41f8472f81e.tar.bz2
scummvm-rg350-47c698c8b8453b6762f2752cc2e8e41f8472f81e.zip
Proper FLU files seeking. No more seek crashes
svn-id: r11991
-rw-r--r--scumm/smush/insane.cpp16
-rw-r--r--scumm/smush/insane.h3
-rw-r--r--scumm/smush/smush_player.cpp5
-rw-r--r--scumm/smush/smush_player.h2
4 files changed, 11 insertions, 15 deletions
diff --git a/scumm/smush/insane.cpp b/scumm/smush/insane.cpp
index 7347c91a6c..f2f78a7afa 100644
--- a/scumm/smush/insane.cpp
+++ b/scumm/smush/insane.cpp
@@ -3991,7 +3991,7 @@ void Insane::smush_rewindCurrentSan(int arg_0, int arg_4, int arg_8) {
debug(0, "smush_rewindCurrentSan(%d, %d, %d)", arg_0, arg_4, arg_8);
_smush_setupsan2 = arg_0;
- smush_setupSanFile(0, 8);
+ smush_setupSanFile(0, 8, 0);
_smush_isSanFileSetup = 1;
smush_setFrameSteps(arg_4, arg_8);
@@ -8158,7 +8158,7 @@ void Insane::smush_setupSanWithFlu(const char *filename, int32 setupsan2, int32
if (tmp[2] <= 1) {
/* 0x300 -- palette, 0x8 -- header */
offset = READ_LE_UINT32(tmp + 0x308 + numFrames*4);
- smush_setupSanFile(filename, offset);
+ smush_setupSanFile(filename, offset, numFrames);
memcpy(_smush_earlyFluContents, tmp+2, 0x306);
_smush_earlyFluContents[0x30e] = 0;
_smush_earlyFluContents[0x30f] = 0;
@@ -8168,12 +8168,12 @@ void Insane::smush_setupSanWithFlu(const char *filename, int32 setupsan2, int32
_smush_earlyFluContents[0x307] = 0;
} else {
offset = READ_LE_UINT32(tmp + 0x31c + numFrames*4);
- smush_setupSanFile(filename, offset);
+ smush_setupSanFile(filename, offset, numFrames);
memcpy(_smush_earlyFluContents, tmp+2, 0x31a);
}
_smush_isSanFileSetup = 1;
_smush_setupsan4 = 1;
- _smush_numFrames = numFrames;
+ _smush_curFrame = numFrames;
smush_setFrameSteps(step1, step2);
}
@@ -8181,11 +8181,9 @@ void Insane::smush_setupSanFromStart(const char *filename, int32 setupsan2, int3
int32 step2, int32 setupsan1) {
_smush_setupsan1 = setupsan1;
_smush_setupsan2 = setupsan2;
- smush_setupSanFile(filename, 8);
+ smush_setupSanFile(filename, 8, 0);
_smush_isSanFileSetup = 1;
smush_setFrameSteps(step1, step2);
-
- _smush_curFrame = 0; // HACK
}
void Insane::smush_setFrameSteps(int32 step1, int32 step2) {
@@ -8194,10 +8192,10 @@ void Insane::smush_setFrameSteps(int32 step1, int32 step2) {
_smush_frameStep = step1;
}
-void Insane::smush_setupSanFile(const char *filename, int32 offset) {
+ void Insane::smush_setupSanFile(const char *filename, int32 offset, int32 contFrame) {
debug(0, "smush_setupSanFile(%s, %x)", filename, offset);
- _player->seekSan(filename, _scumm->getGameDataPath(), offset);
+ _player->seekSan(filename, _scumm->getGameDataPath(), offset, contFrame);
_scumm->_imuseDigital->pause(false);
}
diff --git a/scumm/smush/insane.h b/scumm/smush/insane.h
index 02aab9c779..1ad1265a36 100644
--- a/scumm/smush/insane.h
+++ b/scumm/smush/insane.h
@@ -153,7 +153,6 @@ class Insane {
int32 _smush_setupsan1;
int16 _smush_setupsan2;
int32 _smush_setupsan4;
- int16 _smush_numFrames;
int16 _smush_frameStep;
int16 _smush_curFrame;
int16 _smush_frameNum1;
@@ -440,7 +439,7 @@ class Insane {
void smush_setupSanFromStart(const char *filename, int32 setupsan2, int32 step1,
int32 step2, int32 setupsan1);
void smush_setFrameSteps(int32 step1, int32 step2);
- void smush_setupSanFile(const char *filename, int32 offset);
+ void smush_setupSanFile(const char *filename, int32 offset, int32 contFrame);
int32 getLastKey(bool arg_0);
void drawSpeedyActor(int32 arg_0);
void actor11Reaction(int32 buttons);
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index 45b6280df4..9cc3833844 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -961,7 +961,7 @@ void SmushPlayer::insanity(bool flag) {
}
// FIXME: now it will work with offsets = 8. No Flu files are supported
-void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos) {
+void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos, int32 contFrame) {
Chunk *sub;
if (file) {
@@ -983,8 +983,7 @@ void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos) {
_middleAudio = true;
}
- // FIXME: is this really applicable for FLU files? HACK
- _frame = 0;
+ _frame = contFrame;
}
void SmushPlayer::play(const char *filename, const char *directory) {
diff --git a/scumm/smush/smush_player.h b/scumm/smush/smush_player.h
index d45f5446ca..b5a5b3a114 100644
--- a/scumm/smush/smush_player.h
+++ b/scumm/smush/smush_player.h
@@ -79,7 +79,7 @@ public:
protected:
void insanity(bool);
void setPalette(const byte *palette);
- void seekSan(const char *file, const char *directory, int32 pos);
+ void seekSan(const char *file, const char *directory, int32 pos, int32 contFrame);
private:
void updatePalette(void);