diff options
author | Martin Kiewitz | 2009-10-04 18:34:53 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-04 18:34:53 +0000 |
commit | 07353be65a030261f673d1816d01f08bd35c7b90 (patch) | |
tree | 648ce6b5be0eac6d8fa623c433a044b6e93a0c51 /engines/sci/gui/gui.cpp | |
parent | 9d80759a71b128c45cfd5217ed14575bff003ed2 (diff) | |
download | scummvm-rg350-07353be65a030261f673d1816d01f08bd35c7b90.tar.gz scummvm-rg350-07353be65a030261f673d1816d01f08bd35c7b90.tar.bz2 scummvm-rg350-07353be65a030261f673d1816d01f08bd35c7b90.zip |
SCI/newgui: invokeselector implemented into kAnimate
svn-id: r44627
Diffstat (limited to 'engines/sci/gui/gui.cpp')
-rw-r--r-- | engines/sci/gui/gui.cpp | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index 6358c86dee..e50af6a155 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -240,7 +240,7 @@ void SciGUI::drawPicture(GUIResourceId pictureId, uint16 style, uint16 flags, in _screen->UpdateWhole(); _gfx->SetPort(oldPort); - _s->pic_not_valid = 1; + _gfx->_picNotValid = true; } void SciGUI::drawCell(GUIResourceId viewId, GUIViewLoopNo loopNo, GUIViewCellNo cellNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo) { @@ -313,7 +313,7 @@ int16 SciGUI::paletteFind(int r, int g, int b) { } void SciGUI::paletteAnimate(int fromColor, int toColor, int speed) { - _gfx->animatePalette(fromColor, toColor, speed); + _gfx->PaletteAnimate(fromColor, toColor, speed); } int16 SciGUI::onControl(byte screenMask, Common::Rect rect) { @@ -325,8 +325,49 @@ int16 SciGUI::onControl(byte screenMask, Common::Rect rect) { return result; } -void SciGUI::animate(reg_t castListReference, bool cycle, int argc, reg_t *argv) { - // FIXME: port over from gregs engine +void SciGUI::animate(reg_t listReference, bool cycle, int argc, reg_t *argv) { + bool old_picNotValid = _gfx->_picNotValid; + + if (listReference.isNull()) { + _gfx->AnimateDisposeLastCast(); + if (_gfx->_picNotValid) { + //(this->*ShowPic)(_showMap, _showStyle); + _gfx->_picNotValid = false; + } + return; + } + + List *list = lookup_list(_s, listReference); + if (!list) { + error("kAnimate called with non-list as parameter"); + } + + if (cycle) { + _gfx->AnimateInvoke(list, argc, argv); + } + + GUIPort *oldPort = _gfx->SetPort((GUIPort *)_windowMgr->_picWind); + _gfx->AnimateDisposeLastCast(); + + _gfx->AnimateFill(); + + _gfx->AnimateSort(); + if (old_picNotValid) { + _gfx->AnimateUpdate(); + } + + _gfx->AnimateDrawCells(); + + if (_gfx->_picNotValid) { + //(this->*ShowPic)(_showMap, _showStyle); + _gfx->_picNotValid = false; + } + + //_gfx->AnimateUpdateScreen(); + _screen->UpdateWhole(); + _gfx->AnimateRestoreAndDelete(); + + _gfx->SetPort(oldPort); } void SciGUI::addToPicList(reg_t listReference, int argc, reg_t *argv) { |