diff options
author | Eugene Sandulenko | 2013-12-09 18:00:26 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2013-12-09 18:00:26 +0200 |
commit | c732ee501cea60f5634cb19e86877cf3ab40feef (patch) | |
tree | 2a62236b872e069f37413a824b7bfcd5ed81d2be | |
parent | 354794386cbdd8061a32e20659f14fb2965539c9 (diff) | |
download | scummvm-rg350-c732ee501cea60f5634cb19e86877cf3ab40feef.tar.gz scummvm-rg350-c732ee501cea60f5634cb19e86877cf3ab40feef.tar.bz2 scummvm-rg350-c732ee501cea60f5634cb19e86877cf3ab40feef.zip |
FULLPIPE: Implement Scene::updateScrolling()
-rw-r--r-- | engines/fullpipe/scene.cpp | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index 78c58bdea8..c26187419f 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -470,7 +470,48 @@ void Scene::draw() { } void Scene::updateScrolling() { - debug(0, "STUB Scene::updateScrolling()"); + if (_messageQueueId && !_x && !_y) { + MessageQueue *mq = g_fullpipe->_globalMessageQueueList->getMessageQueueById(_messageQueueId); + + if (mq) + mq->update(); + + _messageQueueId = 0; + } + + if (_x || _y) { + int offsetX = 0; + int offsetY = 0; + + if (_x < 0) { + if (!g_fullpipe->_sceneRect.left && !(((PictureObject *)_picObjList[0])->_flags & 2)) + _x = 0; + + if (_x <= -g_fullpipe->_scrollSpeed) { + offsetX = -g_fullpipe->_scrollSpeed; + _x += g_fullpipe->_scrollSpeed; + } + } else if (_x >= g_fullpipe->_scrollSpeed) { + offsetX = g_fullpipe->_scrollSpeed; + _x -= g_fullpipe->_scrollSpeed; + } else { + _x = 0; + } + + if (_y > 0) { + offsetY = g_fullpipe->_scrollSpeed; + _y -= g_fullpipe->_scrollSpeed; + } + + if (_y < 0) { + offsetY -= g_fullpipe->_scrollSpeed; + _y += g_fullpipe->_scrollSpeed; + } + + g_fullpipe->_sceneRect.translate(offsetX, offsetY); + } + + updateScrolling2(); } void Scene::updateScrolling2() { @@ -603,7 +644,7 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) { } } _bigPictureArray[bgNumX][0]->getDimensions(&point); - int v32 = point.x + bgPosX; + int oldx = point.x + bgPosX; bgPosX += point.x; bgNumX++; @@ -612,7 +653,7 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) { break; bgNumX = 0; } - if (v32 >= g_fullpipe->_sceneRect.right - 1) + if (oldx >= g_fullpipe->_sceneRect.right - 1) break; } } |