diff options
author | Eugene Sandulenko | 2019-12-10 00:32:35 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-10 00:32:54 +0100 |
commit | 303b418dda38c4d4b88411c0a73ce387911b8ccb (patch) | |
tree | 80a22de56ab99a618e0c94c77d876fab25000d2d /engines/director/lingo | |
parent | 080c2b8410c6c2d48f72a156a43710776872b9c3 (diff) | |
download | scummvm-rg350-303b418dda38c4d4b88411c0a73ce387911b8ccb.tar.gz scummvm-rg350-303b418dda38c4d4b88411c0a73ce387911b8ccb.tar.bz2 scummvm-rg350-303b418dda38c4d4b88411c0a73ce387911b8ccb.zip |
DIRECTOR: Implement zoomBox rendering
Diffstat (limited to 'engines/director/lingo')
-rw-r--r-- | engines/director/lingo/lingo-builtins.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index 09b8c11ca3..a8e8c75e6a 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -1280,9 +1280,6 @@ void Lingo::b_unLoadCast(int nargs) { void Lingo::b_zoomBox(int nargs) { // zoomBox startSprite, endSprite [, delatTicks] // ticks are in 1/60th, default 1 - - g_lingo->printSTUBWithArglist("b_zoomBox", nargs); - if (nargs < 2 || nargs > 3) { warning("b_zoomBox: expected 2 or 3 arguments, got %d", nargs); @@ -1305,10 +1302,9 @@ void Lingo::b_zoomBox(int nargs) { startSprite.toInt(); endSprite.toInt(); - Frame *frame = g_director->getCurrentScore()->_frames[g_director->getCurrentScore()->getCurrentFrame()]; - Frame *frame2 = nullptr; - if (g_director->getCurrentScore()->_frames.size() > g_director->getCurrentScore()->getCurrentFrame()) - frame2 = g_director->getCurrentScore()->_frames[g_director->getCurrentScore()->getCurrentFrame() + 1]; + Score *score = g_director->getCurrentScore(); + uint16 curFrame = score->getCurrentFrame(); + Frame *frame = score->_frames[curFrame]; Common::Rect *startRect = frame->getSpriteRect(startSprite.u.i); if (!startRect) { @@ -1316,17 +1312,28 @@ void Lingo::b_zoomBox(int nargs) { return; } + // Looks for endSprite in the current frame, otherwise + // Looks for endSprite in the next frame Common::Rect *endRect = frame->getSpriteRect(endSprite.u.i); - if (!endRect && frame2) - endRect = frame2->getSpriteRect(endSprite.u.i); + if (!endRect) { + if (score->_frames.size() > curFrame) + score->_frames[curFrame + 1]->getSpriteRect(endSprite.u.i); + } if (!endRect) { warning("b_zoomBox: unknown end sprite #%d", endSprite.u.i); return; } - startRect->debugPrint(0, "b_zoomBox: start: "); - endRect->debugPrint(0, "b_zoomBox: end: "); + ZoomBox *box = new ZoomBox; + box->start = *startRect; + box->end = *endRect; + box->delay = delayTicks; + box->step = 0; + box->startTime = g_system->getMillis(); + box->nextTime = g_system->getMillis() + 1000 * box->step / 60; + + score->addZoomBox(box); } void Lingo::b_updateStage(int nargs) { |