diff options
author | Gregory Montoir | 2004-04-06 20:15:19 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-04-06 20:15:19 +0000 |
commit | 4fef6d8972cf34f0c6ea709b801183df65757b7f (patch) | |
tree | f4526de9e07783078bfe48de7cf5ce9ab4039e14 /queen/cutaway.cpp | |
parent | 36d667b2b599a8c58c7e0d52e47afc2a3f828ea0 (diff) | |
download | scummvm-rg350-4fef6d8972cf34f0c6ea709b801183df65757b7f.tar.gz scummvm-rg350-4fef6d8972cf34f0c6ea709b801183df65757b7f.tar.bz2 scummvm-rg350-4fef6d8972cf34f0c6ea709b801183df65757b7f.zip |
fix for bug #928549.
Animations on objects/persons setup by cutaways can still be played after the end of the cutscene. (the only ?) one room in which this is reproducable is the first time you talk to the Oracle (first c44, then c47).
As a Cutaway object is created for each cutscene, the _cutAnim member should be moved to an more "persistant" object.
Otherwise we're reading data from free'd memory...
svn-id: r13488
Diffstat (limited to 'queen/cutaway.cpp')
-rw-r--r-- | queen/cutaway.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index 57633b7522..bb12e390f6 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -1229,23 +1229,20 @@ void Cutaway::talk(char *nextFilename) { int Cutaway::makeComplexAnimation(int16 currentImage, Cutaway::CutawayAnim *objAnim, int frameCount) { int frameIndex[256]; int i; - int bobNum = objAnim[0].object; - assert(bobNum < 21); + assert(frameCount < 30); + AnimFrame cutAnim[30]; memset(frameIndex, 0, sizeof(frameIndex)); debug(6, "[Cutaway::makeComplexAnimation] currentImage = %i", currentImage); - BobSlot *bob = _vm->graphics()->bob(bobNum); - bob->xflip = objAnim[0].flip; - for (i = 0; i < frameCount; i++) { - _cutAnim[bobNum][i].frame = objAnim[i].unpackFrame; - _cutAnim[bobNum][i].speed = objAnim[i].speed; + cutAnim[i].frame = objAnim[i].unpackFrame; + cutAnim[i].speed = objAnim[i].speed; frameIndex[objAnim[i].unpackFrame] = 1; } - _cutAnim[bobNum][frameCount].frame = 0; - _cutAnim[bobNum][frameCount].speed = 0; + cutAnim[frameCount].frame = 0; + cutAnim[frameCount].speed = 0; int nextFrameIndex = 1; @@ -1254,20 +1251,17 @@ int Cutaway::makeComplexAnimation(int16 currentImage, Cutaway::CutawayAnim *objA frameIndex[i] = nextFrameIndex++; for (i = 0; i < frameCount; i++) { - _cutAnim[bobNum][i].frame = currentImage + frameIndex[objAnim[i].unpackFrame]; - //debug(6, "_cutAnim[%i][%i].frame = %i", bobNum, i, _cutAnim[bobNum][i].frame); + cutAnim[i].frame = currentImage + frameIndex[objAnim[i].unpackFrame]; } for (i = 1; i < 256; i++) { if (frameIndex[i]) { currentImage++; - //debug(6, "bankUnpack(%i, %i, %i)", i, currentImage, objAnim[0].bank); _vm->bankMan()->unpack(i, currentImage, objAnim[0].bank); } } - bob->animString(_cutAnim[bobNum]); - + _vm->graphics()->setBobCutawayAnim(objAnim[0].object, objAnim[0].flip, cutAnim, frameCount + 1); return currentImage; } |