Skip to content

Commit

Permalink
FULLPIPE: Implement Scene::updateScrolling()
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Dec 9, 2013
1 parent 3547943 commit c732ee5
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions engines/fullpipe/scene.cpp
Expand Up @@ -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() {
Expand Down Expand Up @@ -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++;

Expand All @@ -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;
}
}
Expand Down

0 comments on commit c732ee5

Please sign in to comment.