diff options
author | Filippos Karapetis | 2007-09-21 08:41:27 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-09-21 08:41:27 +0000 |
commit | 381fba98c571e460c1e01d8adf951f5b0aa70ce3 (patch) | |
tree | d5af21bf8043fe1dfc33643e35a58ac97ddcc7f5 /engines | |
parent | d042f82a8a8968cdbea969bd427c50794b43738d (diff) | |
download | scummvm-rg350-381fba98c571e460c1e01d8adf951f5b0aa70ce3.tar.gz scummvm-rg350-381fba98c571e460c1e01d8adf951f5b0aa70ce3.tar.bz2 scummvm-rg350-381fba98c571e460c1e01d8adf951f5b0aa70ce3.zip |
The animation of the crystals in Mickey is shown correctly now
svn-id: r29003
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agi/picture.cpp | 22 | ||||
-rw-r--r-- | engines/agi/picture.h | 1 |
2 files changed, 16 insertions, 7 deletions
diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp index 42d7c88fa0..52b57d0189 100644 --- a/engines/agi/picture.cpp +++ b/engines/agi/picture.cpp @@ -44,6 +44,7 @@ PictureMgr::PictureMgr(AgiBase *agi, GfxMgr *gfx) { _pictureVersion = AGIPIC_V2; _minCommand = 0xf0; _flags = 0; + _currentStep = 0; } void PictureMgr::putVirtPixel(int x, int y) { @@ -577,6 +578,7 @@ void PictureMgr::plotBrush() { void PictureMgr::drawPicture() { uint8 act; int drawing; + int iteration = 0; _patCode = 0; _patNum = 0; @@ -749,21 +751,27 @@ void PictureMgr::drawPicture() { default: warning("Unknown picture opcode (%x) at (%x)", act, _foffs - 1); } - if ((_flags & kPicFStep) && _vm->getGameType() == GType_PreAGI) { - // FIXME: This is used by Mickey for the crystal animation, but - // currently it's very very very slow - /* + + // This is used by Mickey for the crystal animation + // One frame of the crystal animation is shown on each iteration, based on _currentStep + if ((_flags & kPicFStep) && _vm->getGameType() == GType_PreAGI && _currentStep == iteration) { int storedXOffset = _xOffset; int storedYOffset = _yOffset; - // FIXME: picture coordinates are correct for Mickey only + // Note that picture coordinates are correct for Mickey only showPic(10, 0, _width, _height); _gfx->doUpdate(); g_system->updateScreen(); _xOffset = storedXOffset; _yOffset = storedYOffset; - g_system->delayMillis(25); - */ + _currentStep++; + if (_currentStep > 14) // crystal animation is 15 frames + _currentStep = 0; + // reset the picture step flag - it will be set when the next frame of the crystal animation is drawn + _flags &= ~kPicFStep; + return; // return back to the game loop } + + iteration++; } } diff --git a/engines/agi/picture.h b/engines/agi/picture.h index 28515035e1..1d764cd7bd 100644 --- a/engines/agi/picture.h +++ b/engines/agi/picture.h @@ -139,6 +139,7 @@ private: int _xOffset, _yOffset; int _flags; + int _currentStep; }; } // End of namespace Agi |