diff options
author | Nicola Mettifogo | 2010-06-13 06:55:58 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2010-06-13 06:55:58 +0000 |
commit | d16eb491b17e662705e80d14c1f2ebe5f4e38cef (patch) | |
tree | 5827dca3e5512e1aaf363e74f76c32d7c2828d62 /engines | |
parent | 3cacd7bc4372dbaae5c454236b4413ab87955347 (diff) | |
download | scummvm-rg350-d16eb491b17e662705e80d14c1f2ebe5f4e38cef.tar.gz scummvm-rg350-d16eb491b17e662705e80d14c1f2ebe5f4e38cef.tar.bz2 scummvm-rg350-d16eb491b17e662705e80d14c1f2ebe5f4e38cef.zip |
Support for vertical scrolling. Patch 3005933 by fuzzie.
svn-id: r49620
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/gfxbase.cpp | 4 | ||||
-rw-r--r-- | engines/parallaction/graphics.cpp | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index fc6cb28d9e..835bb204b4 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -222,10 +222,12 @@ void Gfx::drawGfxObject(GfxObj *obj, Graphics::Surface &surf) { obj->getRect(obj->frame, rect); int x = obj->x; + int y = obj->y; if (_overlayMode) { x += _scrollPosX; + y += _scrollPosY; } - rect.translate(x, obj->y); + rect.translate(x, y); data = obj->getData(obj->frame); if (obj->getSize(obj->frame) == obj->getRawSize(obj->frame)) { diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index bc1759ecd7..2990d024d2 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -317,8 +317,10 @@ void Gfx::drawList(Graphics::Surface &surface, GfxObjArray &list) { void Gfx::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) { if (_doubleBuffering) { - if (_overlayMode) + if (_overlayMode) { x += _scrollPosX; + y += _scrollPosY; + } byte *dst = (byte*)_backBuffer.getBasePtr(x, y); for (int i = 0; i < h; i++) { @@ -358,7 +360,7 @@ void Gfx::unlockScreen() { void Gfx::updateScreenIntern() { if (_doubleBuffering) { - byte *data = (byte*)_backBuffer.getBasePtr(_scrollPosX, 0); + byte *data = (byte*)_backBuffer.getBasePtr(_scrollPosX, _scrollPosY); _vm->_system->copyRectToScreen(data, _backBuffer.pitch, 0, 0, _vm->_screenWidth, _vm->_screenHeight); } @@ -863,6 +865,8 @@ void Gfx::setBackground(uint type, BackgroundInfo *info) { _minScrollX = 0; _maxScrollX = MAX<int>(0, _backgroundInfo->width - _vm->_screenWidth); + _minScrollY = 0; + _maxScrollY = MAX<int>(0, _backgroundInfo->height - _vm->_screenHeight); } |