[Scummvm-cvs-logs] SF.net SVN: scummvm: [26547] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Thu Apr 19 15:51:58 CEST 2007


Revision: 26547
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26547&view=rev
Author:   drmccoy
Date:     2007-04-19 06:51:57 -0700 (Thu, 19 Apr 2007)

Log Message:
-----------
- Fixed handling of the case split screen + vertical scrolling area
- Added manual vertical scrolling
- Restricting the mouse cursor to the upper part of the split screen now

Modified Paths:
--------------
    scummvm/trunk/engines/gob/game.cpp
    scummvm/trunk/engines/gob/inter_v2.cpp
    scummvm/trunk/engines/gob/util.cpp
    scummvm/trunk/engines/gob/video.cpp
    scummvm/trunk/engines/gob/video.h

Modified: scummvm/trunk/engines/gob/game.cpp
===================================================================
--- scummvm/trunk/engines/gob/game.cpp	2007-04-19 06:46:56 UTC (rev 26546)
+++ scummvm/trunk/engines/gob/game.cpp	2007-04-19 13:51:57 UTC (rev 26547)
@@ -303,10 +303,18 @@
 		off = MIN(_vm->_draw->_cursorWidth, _vm->_draw->_scrollOffsetX);
 		off = MAX(off / 2, 1);
 		_vm->_draw->_scrollOffsetX -= off;
+	} else if ((y == 0) && (_vm->_draw->_scrollOffsetY > 0)) {
+		uint16 off;
+
+		off = MIN(_vm->_draw->_cursorHeight, _vm->_draw->_scrollOffsetY);
+		off = MAX(off / 2, 1);
+		_vm->_draw->_scrollOffsetY -= off;
 	}
 
 	int16 cursorRight = x + _vm->_draw->_cursorWidth;
 	int16 screenRight = _vm->_draw->_scrollOffsetX + 320;
+	int16 cursorBottom = y + _vm->_draw->_cursorHeight;
+	int16 screenBottom = _vm->_draw->_scrollOffsetY + 200;
 
 	if ((cursorRight >= 320) && (screenRight < _vm->_video->_surfWidth)) {
 		uint16 off;
@@ -318,6 +326,18 @@
 		_vm->_draw->_scrollOffsetX += off;
 
 		_vm->_util->setMousePos(320 - _vm->_draw->_cursorWidth, y);
+	} else if ((cursorBottom >= (200 - _vm->_video->_splitHeight2)) &&
+			(screenBottom < _vm->_video->_surfHeight)) {
+		uint16 off;
+
+		off = MIN(_vm->_draw->_cursorHeight,
+				(int16) (_vm->_video->_surfHeight - screenBottom));
+		off = MAX(off / 2, 1);
+
+		_vm->_draw->_scrollOffsetY += off;
+
+		_vm->_util->setMousePos(x, 200 - _vm->_video->_splitHeight2 -
+				_vm->_draw->_cursorHeight);
 	}
 
 	_vm->_util->setScrollOffset();

Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp	2007-04-19 06:46:56 UTC (rev 26546)
+++ scummvm/trunk/engines/gob/inter_v2.cpp	2007-04-19 13:51:57 UTC (rev 26547)
@@ -1376,7 +1376,9 @@
 	if (height > 0)
 		_vm->_video->_surfHeight = height;
 	
-	_vm->_video->_splitHeight = _vm->_video->_surfHeight - offY;
+	_vm->_video->_splitHeight1 = MIN(200, _vm->_video->_surfHeight - offY);
+	_vm->_video->_splitHeight2 = offY;
+	_vm->_video->_splitStart = _vm->_video->_surfHeight - offY;
 
 	_vm->_draw->closeScreen();
 	_vm->_util->clearPalette();

Modified: scummvm/trunk/engines/gob/util.cpp
===================================================================
--- scummvm/trunk/engines/gob/util.cpp	2007-04-19 06:46:56 UTC (rev 26546)
+++ scummvm/trunk/engines/gob/util.cpp	2007-04-19 13:51:57 UTC (rev 26547)
@@ -125,8 +125,13 @@
 	}
 
 	_vm->_global->_speedFactor = MIN(_fastMode + 1, 3);
-	if (scroll && hasMove)
+	if (scroll && hasMove) {
+		if (y >= (200 - _vm->_video->_splitHeight2)) {
+			y = 200 - _vm->_video->_splitHeight2 - 1;
+			_vm->_util->setMousePos(x, y);
+		}
 		_vm->_game->evaluateScroll(x, y);
+	}
 }
 
 void Util::clearKeyBuf(void) {

Modified: scummvm/trunk/engines/gob/video.cpp
===================================================================
--- scummvm/trunk/engines/gob/video.cpp	2007-04-19 06:46:56 UTC (rev 26546)
+++ scummvm/trunk/engines/gob/video.cpp	2007-04-19 13:51:57 UTC (rev 26547)
@@ -89,7 +89,9 @@
 	_surfHeight = 200;
 	_scrollOffsetX = 0;
 	_scrollOffsetY = 0;
-	_splitHeight = 200;
+	_splitHeight1 = 200;
+	_splitHeight2 = 0;
+	_splitStart = 0;
 
 	_curSparse = 0;
 	_lastSparse = 0xFFFFFFFF;
@@ -162,11 +164,11 @@
 	if (_vm->_global->_primarySurfDesc) {
 		g_system->copyRectToScreen(_vm->_global->_primarySurfDesc->getVidMem() +
 				_scrollOffsetY * _surfWidth + _scrollOffsetX, _surfWidth,
-				0, 0, 320, _splitHeight);
-		if (_splitHeight < _surfHeight)
+				0, 0, 320, _splitHeight1);
+		if (_splitHeight2 > 0)
 			g_system->copyRectToScreen(_vm->_global->_primarySurfDesc->getVidMem() +
-					_splitHeight * _surfWidth, _surfWidth, 0, _splitHeight, 320,
-					_surfHeight - _splitHeight);
+					_splitStart * _surfWidth, _surfWidth, 0,
+					200 - _splitHeight2, 320, _splitHeight2);
 		g_system->updateScreen();
 	}
 }

Modified: scummvm/trunk/engines/gob/video.h
===================================================================
--- scummvm/trunk/engines/gob/video.h	2007-04-19 06:46:56 UTC (rev 26546)
+++ scummvm/trunk/engines/gob/video.h	2007-04-19 13:51:57 UTC (rev 26547)
@@ -99,7 +99,9 @@
 	int16 _surfHeight;
 	int16 _scrollOffsetX;
 	int16 _scrollOffsetY;
-	int16 _splitHeight;
+	int16 _splitHeight1;
+	int16 _splitHeight2;
+	int16 _splitStart;
 
 	void freeDriver();
 	void initPrimary(int16 mode);


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