From d8bb265464de9d1864cd631c4e6b0ec4131e23ae Mon Sep 17 00:00:00 2001
From: Alyssa Milburn <fuzzie@fuzzie.org>
Date: Sun, 23 May 2010 11:59:32 +0200
Subject: [PATCH] support vertical scrolling
---
engines/parallaction/gfxbase.cpp | 4 +++-
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 fc6cb28..835bb20 100644
a
|
b
|
void Gfx::drawGfxObject(GfxObj *obj, Graphics::Surface &surf) {
|
222 | 222 | obj->getRect(obj->frame, rect); |
223 | 223 | |
224 | 224 | int x = obj->x; |
| 225 | int y = obj->y; |
225 | 226 | if (_overlayMode) { |
226 | 227 | x += _scrollPosX; |
| 228 | y += _scrollPosY; |
227 | 229 | } |
228 | | rect.translate(x, obj->y); |
| 230 | rect.translate(x, y); |
229 | 231 | data = obj->getData(obj->frame); |
230 | 232 | |
231 | 233 | if (obj->getSize(obj->frame) == obj->getRawSize(obj->frame)) { |
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index bc1759e..2990d02 100644
a
|
b
|
void Gfx::drawList(Graphics::Surface &surface, GfxObjArray &list) {
|
317 | 317 | |
318 | 318 | void Gfx::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) { |
319 | 319 | if (_doubleBuffering) { |
320 | | if (_overlayMode) |
| 320 | if (_overlayMode) { |
321 | 321 | x += _scrollPosX; |
| 322 | y += _scrollPosY; |
| 323 | } |
322 | 324 | |
323 | 325 | byte *dst = (byte*)_backBuffer.getBasePtr(x, y); |
324 | 326 | for (int i = 0; i < h; i++) { |
… |
… |
void Gfx::unlockScreen() {
|
358 | 360 | |
359 | 361 | void Gfx::updateScreenIntern() { |
360 | 362 | if (_doubleBuffering) { |
361 | | byte *data = (byte*)_backBuffer.getBasePtr(_scrollPosX, 0); |
| 363 | byte *data = (byte*)_backBuffer.getBasePtr(_scrollPosX, _scrollPosY); |
362 | 364 | _vm->_system->copyRectToScreen(data, _backBuffer.pitch, 0, 0, _vm->_screenWidth, _vm->_screenHeight); |
363 | 365 | } |
364 | 366 | |
… |
… |
void Gfx::setBackground(uint type, BackgroundInfo *info) {
|
863 | 865 | |
864 | 866 | _minScrollX = 0; |
865 | 867 | _maxScrollX = MAX<int>(0, _backgroundInfo->width - _vm->_screenWidth); |
| 868 | _minScrollY = 0; |
| 869 | _maxScrollY = MAX<int>(0, _backgroundInfo->height - _vm->_screenHeight); |
866 | 870 | } |
867 | 871 | |
868 | 872 | |