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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Tue May 27 00:02:21 CEST 2008


Revision: 32308
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32308&view=rev
Author:   drmccoy
Date:     2008-05-26 15:02:20 -0700 (Mon, 26 May 2008)

Log Message:
-----------
More split screen fixes.
I never get tired out those... ;)

Modified Paths:
--------------
    scummvm/trunk/engines/gob/inter_v2.cpp
    scummvm/trunk/engines/gob/inter_v4.cpp
    scummvm/trunk/engines/gob/video.cpp

Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp	2008-05-26 22:01:29 UTC (rev 32307)
+++ scummvm/trunk/engines/gob/inter_v2.cpp	2008-05-26 22:02:20 UTC (rev 32308)
@@ -1502,18 +1502,27 @@
 }
 
 void Inter_v2::o2_setScrollOffset() {
-	int16 offset;
+	int16 offsetX, offsetY;
 
-	offset = _vm->_parse->parseValExpr();
+	offsetX = _vm->_parse->parseValExpr();
+	offsetY = _vm->_parse->parseValExpr();
 
-	if (offset == -1) {
-		_vm->_parse->parseValExpr();
+	if (offsetX == -1) {
 		WRITE_VAR(2, _vm->_draw->_scrollOffsetX);
 		WRITE_VAR(3, _vm->_draw->_scrollOffsetY);
 	} else {
-		_vm->_draw->_scrollOffsetX = offset;
-		_vm->_draw->_scrollOffsetY = _vm->_parse->parseValExpr();
+		int16 screenW = _vm->_video->_surfWidth;
+		int16 screenH = _vm->_video->_surfHeight;
+
+		if (screenW > _vm->_width)
+			screenW -= _vm->_width;
+		if (screenH > _vm->_height)
+			screenH -= _vm->_height;
+
+		_vm->_draw->_scrollOffsetX = CLIP<int16>(offsetX, 0, screenW);
+		_vm->_draw->_scrollOffsetY = CLIP<int16>(offsetY, 0, screenH);
 	}
+
 	_vm->_util->setScrollOffset();
 	_noBusyWait = true;
 }

Modified: scummvm/trunk/engines/gob/inter_v4.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v4.cpp	2008-05-26 22:01:29 UTC (rev 32307)
+++ scummvm/trunk/engines/gob/inter_v4.cpp	2008-05-26 22:02:20 UTC (rev 32308)
@@ -505,7 +505,7 @@
 		/* 30 */
 		OPCODE(o1_returnTo),
 		OPCODE(o1_loadSpriteContent),
-		OPCODE(o3_copySprite),
+		OPCODE(o1_copySprite),
 		OPCODE(o1_fillRect),
 		/* 34 */
 		OPCODE(o1_drawLine),
@@ -772,6 +772,10 @@
 	memset(_vm->_global->_greenPalette, 0, 256);
 	memset(_vm->_global->_bluePalette, 0, 256);
 
+	_vm->_video->_splitSurf = 0;
+	_vm->_draw->_spritesArray[24] = 0;
+	_vm->_draw->_spritesArray[25] = 0;
+
 	_vm->_global->_videoMode = videoMode;
 	_vm->_video->initPrimary(videoMode);
 	WRITE_VAR(15, _vm->_global->_fakeVideoMode);
@@ -786,9 +790,6 @@
 
 	_vm->_util->setScrollOffset();
 
-	_vm->_video->_splitSurf = 0;
-	_vm->_draw->_spritesArray[24] = 0;
-	_vm->_draw->_spritesArray[25] = 0;
 	if (offY > 0) {
 		_vm->_draw->_spritesArray[24] = new SurfaceDesc(videoMode, _vm->_width, offY);
 		_vm->_draw->_spritesArray[25] = new SurfaceDesc(videoMode, _vm->_width, offY);

Modified: scummvm/trunk/engines/gob/video.cpp
===================================================================
--- scummvm/trunk/engines/gob/video.cpp	2008-05-26 22:01:29 UTC (rev 32307)
+++ scummvm/trunk/engines/gob/video.cpp	2008-05-26 22:02:20 UTC (rev 32308)
@@ -182,8 +182,8 @@
 		int screenOffset = _scrollOffsetY * _surfWidth + _scrollOffsetX;
 		int screenX = _screenDeltaX;
 		int screenY = _screenDeltaY;
-		int screenWidth = MIN<int>(_surfWidth, _vm->_width);
-		int screenHeight = MIN<int>(_surfHeight - _splitHeight2, _vm->_height);
+		int screenWidth = MIN<int>(_surfWidth - _scrollOffsetX, _vm->_width);
+		int screenHeight = MIN<int>(_surfHeight - _splitHeight2 - _scrollOffsetY, _vm->_height);
 
 		g_system->copyRectToScreen(_vm->_global->_primarySurfDesc->getVidMem() + screenOffset,
 				_surfWidth, screenX, screenY, screenWidth, 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