[Scummvm-cvs-logs] SF.net SVN: scummvm: [28771] scummvm/trunk/engines/saga
sev at users.sourceforge.net
sev at users.sourceforge.net
Fri Aug 31 12:59:33 CEST 2007
Revision: 28771
http://scummvm.svn.sourceforge.net/scummvm/?rev=28771&view=rev
Author: sev
Date: 2007-08-31 03:59:33 -0700 (Fri, 31 Aug 2007)
Log Message:
-----------
Fix end credits in IHNM. Now video length is determined properly.
Modified Paths:
--------------
scummvm/trunk/engines/saga/animation.cpp
scummvm/trunk/engines/saga/animation.h
Modified: scummvm/trunk/engines/saga/animation.cpp
===================================================================
--- scummvm/trunk/engines/saga/animation.cpp 2007-08-31 10:10:11 UTC (rev 28770)
+++ scummvm/trunk/engines/saga/animation.cpp 2007-08-31 10:59:33 UTC (rev 28771)
@@ -385,6 +385,7 @@
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 @@
} 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 @@
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 @@
}
} while (markByte != SAGA_FRAME_END);
}
+
+ return currentFrame;
}
void Anim::animInfo() {
Modified: scummvm/trunk/engines/saga/animation.h
===================================================================
--- scummvm/trunk/engines/saga/animation.h 2007-08-31 10:10:11 UTC (rev 28770)
+++ scummvm/trunk/engines/saga/animation.h 2007-08-31 10:59:33 UTC (rev 28771)
@@ -160,7 +160,7 @@
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) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list