Ticket #9187: 0001-support-vertical-scrolling.patch

File 0001-support-vertical-scrolling.patch, 2.1 KB (added by fuzzie, 11 years ago)
  • engines/parallaction/gfxbase.cpp

    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) {  
    222222        obj->getRect(obj->frame, rect);
    223223
    224224        int x = obj->x;
     225        int y = obj->y;
    225226        if (_overlayMode) {
    226227                x += _scrollPosX;
     228                y += _scrollPosY;
    227229        }
    228         rect.translate(x, obj->y);
     230        rect.translate(x, y);
    229231        data = obj->getData(obj->frame);
    230232
    231233        if (obj->getSize(obj->frame) == obj->getRawSize(obj->frame)) {
  • engines/parallaction/graphics.cpp

    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) {  
    317317
    318318void Gfx::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
    319319        if (_doubleBuffering) {
    320                 if (_overlayMode)
     320                if (_overlayMode) {
    321321                        x += _scrollPosX;
     322                        y += _scrollPosY;
     323                }
    322324
    323325                byte *dst = (byte*)_backBuffer.getBasePtr(x, y);
    324326                for (int i = 0; i < h; i++) {
    void Gfx::unlockScreen() {  
    358360
    359361void Gfx::updateScreenIntern() {
    360362        if (_doubleBuffering) {
    361                 byte *data = (byte*)_backBuffer.getBasePtr(_scrollPosX, 0);
     363                byte *data = (byte*)_backBuffer.getBasePtr(_scrollPosX, _scrollPosY);
    362364                _vm->_system->copyRectToScreen(data, _backBuffer.pitch, 0, 0, _vm->_screenWidth, _vm->_screenHeight);
    363365        }
    364366
    void Gfx::setBackground(uint type, BackgroundInfo *info) {  
    863865
    864866        _minScrollX = 0;
    865867        _maxScrollX = MAX<int>(0, _backgroundInfo->width - _vm->_screenWidth);
     868        _minScrollY = 0;
     869        _maxScrollY = MAX<int>(0, _backgroundInfo->height - _vm->_screenHeight);
    866870}
    867871
    868872