diff options
author | Eugene Sandulenko | 2007-08-31 10:59:33 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2007-08-31 10:59:33 +0000 |
commit | dc0088f8fd2f168a38042678f7e0f3a2c083f47f (patch) | |
tree | a9295129035ffad3da8d6ced7e0a3336a55ec387 /engines/saga | |
parent | 091ef596d11641cd5908882a59888ecf0b778a77 (diff) | |
download | scummvm-rg350-dc0088f8fd2f168a38042678f7e0f3a2c083f47f.tar.gz scummvm-rg350-dc0088f8fd2f168a38042678f7e0f3a2c083f47f.tar.bz2 scummvm-rg350-dc0088f8fd2f168a38042678f7e0f3a2c083f47f.zip |
Fix end credits in IHNM. Now video length is determined properly.
svn-id: r28771
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/animation.cpp | 13 | ||||
-rw-r--r-- | engines/saga/animation.h | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp index b16c26a2a1..d978956abc 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -385,6 +385,7 @@ void Anim::load(uint16 animId, const byte *animResourceData, size_t animResource anim->start += temp; // Cache frame offsets + anim->maxFrame = fillFrameOffsets(anim, false); anim->frameOffsets = (size_t *)malloc((anim->maxFrame + 1) * sizeof(*anim->frameOffsets)); if (anim->frameOffsets == NULL) { memoryError("Anim::load"); @@ -808,8 +809,8 @@ void Anim::decodeFrame(AnimationData *anim, size_t frameOffset, byte *buf, size_ } while (1); } -void Anim::fillFrameOffsets(AnimationData *anim) { - uint16 currentFrame; +int Anim::fillFrameOffsets(AnimationData *anim, bool reallyFill) { + uint16 currentFrame = 0; byte markByte; uint16 control; uint16 runcount; @@ -822,8 +823,10 @@ void Anim::fillFrameOffsets(AnimationData *anim) { readS._bigEndian = !_vm->isBigEndian(); // RLE has inversion BE<>LE - for (currentFrame = 0; currentFrame <= anim->maxFrame; currentFrame++) { - anim->frameOffsets[currentFrame] = readS.pos(); + while (!readS.eos()) { + if (reallyFill) + anim->frameOffsets[currentFrame] = readS.pos(); + currentFrame++; // For some strange reason, the animation header is in little // endian format, but the actual RLE encoded frame data, @@ -905,6 +908,8 @@ void Anim::fillFrameOffsets(AnimationData *anim) { } } while (markByte != SAGA_FRAME_END); } + + return currentFrame; } void Anim::animInfo() { diff --git a/engines/saga/animation.h b/engines/saga/animation.h index 7ea36d498e..90b24340a3 100644 --- a/engines/saga/animation.h +++ b/engines/saga/animation.h @@ -160,7 +160,7 @@ public: private: void decodeFrame(AnimationData *anim, size_t frameOffset, byte *buf, size_t bufLength); - void fillFrameOffsets(AnimationData *anim); + int fillFrameOffsets(AnimationData *anim, bool reallyFill = true); void validateAnimationId(uint16 animId) { if (animId >= MAX_ANIMATIONS) { |