diff options
author | Gregory Montoir | 2003-11-26 23:03:21 +0000 |
---|---|---|
committer | Gregory Montoir | 2003-11-26 23:03:21 +0000 |
commit | 2f444d2a076bdbe7c5b805c9e923c9c75b7a630f (patch) | |
tree | e4aeb41a4763f297d54259d42dcb23d7ef9114a1 /queen | |
parent | 28ac3d653dfdf80b44b1085641480678e1f5b388 (diff) | |
download | scummvm-rg350-2f444d2a076bdbe7c5b805c9e923c9c75b7a630f.tar.gz scummvm-rg350-2f444d2a076bdbe7c5b805c9e923c9c75b7a630f.tar.bz2 scummvm-rg350-2f444d2a076bdbe7c5b805c9e923c9c75b7a630f.zip |
fix some animation issues
svn-id: r11380
Diffstat (limited to 'queen')
-rw-r--r-- | queen/command.cpp | 2 | ||||
-rw-r--r-- | queen/cutaway.cpp | 1 | ||||
-rw-r--r-- | queen/graphics.cpp | 17 | ||||
-rw-r--r-- | queen/graphics.h | 2 | ||||
-rw-r--r-- | queen/logic.cpp | 8 | ||||
-rw-r--r-- | queen/talk.cpp | 1 |
6 files changed, 16 insertions, 15 deletions
diff --git a/queen/command.cpp b/queen/command.cpp index b446da3aee..e3e3a8a9d1 100644 --- a/queen/command.cpp +++ b/queen/command.cpp @@ -1297,7 +1297,7 @@ void Command::setObjects(uint16 command) { uint16 dstObj = ABS(cmdObj->dstObj); ObjectData *objData = _logic->objectData(dstObj); - debug(0, "Command::setObjects() - dstObj=%X srcObj=%X", cmdObj->dstObj, cmdObj->srcObj); + debug(0, "Command::setObjects() - dstObj=%X srcObj=%X _curCmd.subject1=%X", cmdObj->dstObj, cmdObj->srcObj, _curCmd.subject1); if (cmdObj->dstObj > 0) { // show the object diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index fc9aafc9cf..189bc9019e 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -1374,7 +1374,6 @@ void Cutaway::run(char *nextFilename) { k++; if (object->name > 0) { BobSlot *bs = _graphics->bob(k); - bs->animating = true; bs->animReset(); } } diff --git a/queen/graphics.cpp b/queen/graphics.cpp index b607f8ed0d..34fe174450 100644 --- a/queen/graphics.cpp +++ b/queen/graphics.cpp @@ -323,29 +323,31 @@ void BobSlot::animNormal(uint16 firstFrame, uint16 lastFrame, uint16 spd, bool r void BobSlot::animReset() { - if(active && animating) { + if(active) { const AnimFrame *af = anim.string.buffer; if (af != NULL) { + animating = true; anim.string.curPos = af; frameNum = af->frame; anim.speed = af->speed / 4; } else { - anim.speed = anim.speedBak; - frameNum = anim.normal.firstFrame; - frameDir = 1; + animating = false; +// anim.speed = anim.speedBak; +// frameNum = anim.normal.firstFrame; +// frameDir = 1; } } } -void Graphics::bobDraw(uint32 bobnum, int16 x, int16 y, uint16 scale, bool xflip, const Box& box) { +void Graphics::bobDraw(uint32 frameNum, int16 x, int16 y, uint16 scale, bool xflip, const Box& box) { uint16 w, h; - debug(9, "Graphics::bobDraw(%d, %d, %d, %d)", bobnum, x, y, scale); + debug(9, "Graphics::bobDraw(%d, %d, %d, %d)", frameNum, x, y, scale); - BobFrame *pbf = &_frames[bobnum]; + BobFrame *pbf = &_frames[frameNum]; if (scale < 100) { bobShrink(pbf, scale); pbf = &_shrinkBuffer; @@ -531,6 +533,7 @@ void Graphics::bobDrawAll() { for (i = 0; i < _sortedBobsCount; ++i) { BobSlot *pbs = _sortedBobs[i]; if (pbs->active) { + BobFrame *pbf = &_frames[ pbs->frameNum ]; uint16 xh, yh, x, y; diff --git a/queen/graphics.h b/queen/graphics.h index 5ac6331829..12fcae44c8 100644 --- a/queen/graphics.h +++ b/queen/graphics.h @@ -142,7 +142,7 @@ public: void bobAnimString(uint32 bobnum, const AnimFrame *buf); // stringanim() void bobAnimNormal(uint32 bobnum, uint16 firstFrame, uint16 lastFrame, uint16 speed, bool rebound, bool xflip); // makeanim() void bobMove(uint32 bobnum, int16 endx, int16 endy, int16 speed); // movebob() - void bobDraw(uint32 bobnum, int16 x, int16 y, uint16 scale, bool xflip, const Box& box); // bob() + void bobDraw(uint32 frameNum, int16 x, int16 y, uint16 scale, bool xflip, const Box& box); // bob() void bobDrawInventoryItem(uint32 bobnum, uint16 x, uint16 y); // invbob() void bobPaste(uint32 frameNum, int16 x, int16 y); // bobpaste() void bobShrink(const BobFrame* pbf, uint16 percentage); // shrinkbob() diff --git a/queen/logic.cpp b/queen/logic.cpp index 8bad76f41e..63c6e2f620 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -566,7 +566,7 @@ uint16 Logic::findFrame(uint16 obj) { img = _objectData[i].image; if(img <= -10) { GraphicData* pgd = &_graphicData[-(img + 10)]; - if(pgd->lastFrame != 0) { + if(pgd->lastFrame > 0) { // skip all the frames of the animation idx += ABS(pgd->lastFrame) - pgd->firstFrame + 1; } @@ -1131,15 +1131,15 @@ uint16 Logic::roomRefreshObject(uint16 obj) { return curImage; } + // find frame used for object + curImage = findFrame(obj); + if (pod->name < 0 || pod->image < 0) { // object is hidden or disabled _graphics->bobClear(curBob); return curImage; } - // find frame used for object - curImage = findFrame(obj); - int image = pod->image; if (image > 5000) { image -= 5000; diff --git a/queen/talk.cpp b/queen/talk.cpp index bcb8a3f86e..d4702d2261 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -352,7 +352,6 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) { pbs->y = person.actor->y; // Better kick start the persons anim sequence - pbs->animating = true; pbs->animReset(); } |