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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Thu Apr 5 21:20:13 CEST 2007


Revision: 26387
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26387&view=rev
Author:   drmccoy
Date:     2007-04-05 12:20:12 -0700 (Thu, 05 Apr 2007)

Log Message:
-----------
Implemented scrolling and split screen (for the text field, the bottom 40 lines) in Gob3

Modified Paths:
--------------
    scummvm/trunk/engines/gob/game_v2.cpp
    scummvm/trunk/engines/gob/inter_v1.cpp
    scummvm/trunk/engines/gob/inter_v2.cpp
    scummvm/trunk/engines/gob/video.cpp
    scummvm/trunk/engines/gob/video.h

Modified: scummvm/trunk/engines/gob/game_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v2.cpp	2007-04-05 16:04:59 UTC (rev 26386)
+++ scummvm/trunk/engines/gob/game_v2.cpp	2007-04-05 19:20:12 UTC (rev 26387)
@@ -444,6 +444,46 @@
 		key = checkKeys(&_vm->_global->_inter_mouseX,
 				&_vm->_global->_inter_mouseY, &_mouseButtons, handleMouse);
 
+		if ((_vm->_global->_videoMode == 0x14) && (handleMouse != 0)) {
+			int16 cursorRight;
+			int16 screenRight;
+			
+			if ((_vm->_global->_inter_mouseX == 0) &&
+				  (_vm->_draw->_scrollOffsetX > 0)) {
+				uint16 off;
+
+				off = MIN(_vm->_draw->_cursorWidth, _vm->_draw->_scrollOffsetX);
+				off = MAX(off / 2, 1);
+				_vm->_draw->_scrollOffsetX -= off;
+				_vm->_global->_inter_mouseX -= off;
+				_vm->_global->_inter_mouseX =
+					MAX(_vm->_global->_inter_mouseX, (int16) 1);
+			}
+
+			_vm->_global->_inter_mouseX += _vm->_draw->_scrollOffsetX;
+			cursorRight = _vm->_global->_inter_mouseX + _vm->_draw->_cursorWidth;
+			screenRight = _vm->_draw->_scrollOffsetX + 320;
+
+			if ((cursorRight >= screenRight) &&
+			    (screenRight < _vm->_video->_surfWidth)) {
+				uint16 off;
+				int16 max;
+
+				off = MIN(_vm->_draw->_cursorWidth,
+						(int16) (_vm->_video->_surfWidth - screenRight));
+				off = MAX(off / 2, 1);
+				max = _vm->_video->_surfWidth - _vm->_draw->_cursorWidth;
+
+				_vm->_draw->_scrollOffsetX += off;
+				_vm->_global->_inter_mouseX += off - 1; 
+				_vm->_global->_inter_mouseX = MIN(_vm->_global->_inter_mouseX, max);
+			}
+
+			_vm->_util->setScrollOffset();
+			_vm->_util->setMousePos(MAX(0, _vm->_global->_inter_mouseX -
+						_vm->_draw->_scrollOffsetX), _vm->_global->_inter_mouseY);
+		}
+
 		if ((handleMouse == 0) && (_mouseButtons != 0)) {
 			_vm->_util->waitMouseRelease(0);
 			key = 3;

Modified: scummvm/trunk/engines/gob/inter_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v1.cpp	2007-04-05 16:04:59 UTC (rev 26386)
+++ scummvm/trunk/engines/gob/inter_v1.cpp	2007-04-05 19:20:12 UTC (rev 26387)
@@ -2152,6 +2152,8 @@
 bool Inter_v1::o1_setMousePos(OpFuncParams &params) {
 	_vm->_global->_inter_mouseX = _vm->_parse->parseValExpr();
 	_vm->_global->_inter_mouseY = _vm->_parse->parseValExpr();
+	_vm->_global->_inter_mouseX -= _vm->_draw->_scrollOffsetX;
+	_vm->_global->_inter_mouseY -= _vm->_draw->_scrollOffsetY;
 	if (_vm->_global->_useMouse != 0)
 		_vm->_util->setMousePos(_vm->_global->_inter_mouseX,
 				_vm->_global->_inter_mouseY);

Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp	2007-04-05 16:04:59 UTC (rev 26386)
+++ scummvm/trunk/engines/gob/inter_v2.cpp	2007-04-05 19:20:12 UTC (rev 26387)
@@ -1375,9 +1375,7 @@
 	if (height > 0)
 		_vm->_video->_surfHeight = height;
 	
-	if (offY != 0)
-		warning("Inter_v2::o2_initScreen(): Stub: Horizontal split (%d/%d)",
-				_vm->_video->_surfHeight - offY, offY);
+	_vm->_video->_splitHeight = _vm->_video->_surfHeight - offY;
 
 	_vm->_draw->closeScreen();
 	_vm->_util->clearPalette();

Modified: scummvm/trunk/engines/gob/video.cpp
===================================================================
--- scummvm/trunk/engines/gob/video.cpp	2007-04-05 16:04:59 UTC (rev 26386)
+++ scummvm/trunk/engines/gob/video.cpp	2007-04-05 19:20:12 UTC (rev 26387)
@@ -89,6 +89,7 @@
 	_surfHeight = 200;
 	_scrollOffsetX = 0;
 	_scrollOffsetY = 0;
+	_splitHeight = 200;
 }
 
 char Video::initDriver(int16 vidMode) {
@@ -158,7 +159,11 @@
 	if (_vm->_global->_primarySurfDesc) {
 		g_system->copyRectToScreen(_vm->_global->_primarySurfDesc->getVidMem() +
 				_scrollOffsetY * _surfWidth + _scrollOffsetX, _surfWidth,
-				0, 0, 320, 200);
+				0, 0, 320, _splitHeight);
+		if (_splitHeight < _surfHeight)
+			g_system->copyRectToScreen(_vm->_global->_primarySurfDesc->getVidMem() +
+					_splitHeight * _surfWidth, _surfWidth, 0, _splitHeight, 320,
+					_surfHeight - _splitHeight);
 		g_system->updateScreen();
 	}
 }

Modified: scummvm/trunk/engines/gob/video.h
===================================================================
--- scummvm/trunk/engines/gob/video.h	2007-04-05 16:04:59 UTC (rev 26386)
+++ scummvm/trunk/engines/gob/video.h	2007-04-05 19:20:12 UTC (rev 26387)
@@ -99,6 +99,7 @@
 	int16 _surfHeight;
 	int16 _scrollOffsetX;
 	int16 _scrollOffsetY;
+	int16 _splitHeight;
 
 	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