[Scummvm-cvs-logs] SF.net SVN: scummvm:[49620] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Jun 13 08:55:58 CEST 2010


Revision: 49620
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49620&view=rev
Author:   peres001
Date:     2010-06-13 06:55:58 +0000 (Sun, 13 Jun 2010)

Log Message:
-----------
Support for vertical scrolling. Patch 3005933 by fuzzie.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/gfxbase.cpp
    scummvm/trunk/engines/parallaction/graphics.cpp

Modified: scummvm/trunk/engines/parallaction/gfxbase.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/gfxbase.cpp	2010-06-13 06:55:40 UTC (rev 49619)
+++ scummvm/trunk/engines/parallaction/gfxbase.cpp	2010-06-13 06:55:58 UTC (rev 49620)
@@ -222,10 +222,12 @@
 	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)) {

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2010-06-13 06:55:40 UTC (rev 49619)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2010-06-13 06:55:58 UTC (rev 49620)
@@ -317,8 +317,10 @@
 
 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::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 @@
 
 	_minScrollX = 0;
 	_maxScrollX = MAX<int>(0, _backgroundInfo->width - _vm->_screenWidth);
+	_minScrollY = 0;
+	_maxScrollY = MAX<int>(0, _backgroundInfo->height - _vm->_screenHeight);
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list