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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Wed Feb 7 14:08:17 CET 2007


Revision: 25407
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25407&view=rev
Author:   drmccoy
Date:     2007-02-07 05:08:17 -0800 (Wed, 07 Feb 2007)

Log Message:
-----------
- Fixed another freeze in Ween
- Changed cursor visibility handling a bit

Modified Paths:
--------------
    scummvm/trunk/engines/gob/draw.cpp
    scummvm/trunk/engines/gob/draw_v2.cpp
    scummvm/trunk/engines/gob/game.cpp
    scummvm/trunk/engines/gob/game.h
    scummvm/trunk/engines/gob/game_v1.cpp
    scummvm/trunk/engines/gob/game_v2.cpp
    scummvm/trunk/engines/gob/inter_v1.cpp

Modified: scummvm/trunk/engines/gob/draw.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw.cpp	2007-02-07 02:17:09 UTC (rev 25406)
+++ scummvm/trunk/engines/gob/draw.cpp	2007-02-07 13:08:17 UTC (rev 25407)
@@ -248,6 +248,7 @@
 void Draw::blitInvalidated(void) {
 	int16 i;
 
+
 	if (_cursorIndex == 4)
 		blitCursor();
 

Modified: scummvm/trunk/engines/gob/draw_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw_v2.cpp	2007-02-07 02:17:09 UTC (rev 25406)
+++ scummvm/trunk/engines/gob/draw_v2.cpp	2007-02-07 13:08:17 UTC (rev 25407)
@@ -818,8 +818,7 @@
 	if (_cursorIndex == -1)
 		return;
 	
-	if (_showCursor == 2)
-		_showCursor = 0;
+	_showCursor = (_showCursor & ~2) | ((_showCursor & 1) << 1);
 }
 
 void Draw_v2::animateCursor(int16 cursor) {
@@ -832,17 +831,8 @@
 	int16 maxY;
 	int16 cursorIndex;
 
-	_showCursor |= 2;
+	_showCursor |= 1;
 
-	/*
-	if (((_backSurface->width - 9) < _vm->_global->_inter_mouseX) ||
-			((_backSurface->height - 4) < _vm->_global->_inter_mouseY)) {
-		_vm->_global->_inter_mouseX = MIN((int) _vm->_global->_inter_mouseX, _backSurface->width - 9);
-		_vm->_global->_inter_mouseY = MIN((int) _vm->_global->_inter_mouseY, _backSurface->height - 4);
-		_vm->_util->setMousePos(_vm->_global->_inter_mouseX, _vm->_global->_inter_mouseY);
-	}
-	*/
-
 	// .-- _draw_animateCursorSUB1 ---
 	cursorIndex = cursor;
 	if (cursorIndex == -1) {
@@ -891,8 +881,6 @@
 			} else {
 				if ((_noInvalidated != 0) && (_vm->_global->_inter_mouseX == _cursorX) &&
 						(_vm->_global->_inter_mouseY == _cursorY)) {
-					if (!CursorMan.isVisible())
-						_showCursor = 0;
 					_vm->_video->waitRetrace(_vm->_global->_videoMode);
 					return;
 				}
@@ -932,26 +920,23 @@
 		CursorMan.replaceCursor(_scummvmCursor->vidPtr, _cursorWidth, _cursorHeight, 0, 0, 0);
 
 		if (_frontSurface != _backSurface) {
-			_showCursor |= 1;
 			if (_noInvalidated == 0) {
-				_showCursor = CursorMan.isVisible() ? 2 : 0;
 				int16 tmp = _cursorIndex;
 				_cursorIndex = -1;
 				blitInvalidated();
 				_cursorIndex = tmp;
 			} else {
+				_showCursor = 3;
 				_vm->_video->waitRetrace(_vm->_global->_videoMode);
 				if (minY < 50)
 					_vm->_util->delay(5);
-				_showCursor = (_showCursor & ~2) | ((_showCursor & 1) << 1);
 			}
-			_showCursor &= ~1;
 		}
 	} else
 		blitCursor();
 
-	if (CursorMan.isVisible())
-		_showCursor = 2;
+	_showCursor &= ~1;
+
 	_cursorX = newX;
 	_cursorY = newY;
 }

Modified: scummvm/trunk/engines/gob/game.cpp
===================================================================
--- scummvm/trunk/engines/gob/game.cpp	2007-02-07 02:17:09 UTC (rev 25406)
+++ scummvm/trunk/engines/gob/game.cpp	2007-02-07 13:08:17 UTC (rev 25407)
@@ -754,7 +754,7 @@
 	}
 }
 
-void Game::collSub(int16 offset) {
+void Game::collSub(uint16 offset) {
 	char *savedIP;
 	int16 collStackSize;
 
@@ -1156,6 +1156,8 @@
 	Video::SurfaceDesc *surfDescBak;
 	Video::SurfaceDesc frontSurfBak;
 
+	_vm->_draw->_showCursor = 0;
+
 	int8 byte_31344 = 0;
 
 	if ((frame < 0) || (frame > lastFrame))

Modified: scummvm/trunk/engines/gob/game.h
===================================================================
--- scummvm/trunk/engines/gob/game.h	2007-02-07 02:17:09 UTC (rev 25406)
+++ scummvm/trunk/engines/gob/game.h	2007-02-07 13:08:17 UTC (rev 25407)
@@ -43,8 +43,8 @@
 		int16 bottom;
 		int16 flags;
 		int16 key;
-		int16 funcEnter;
-		int16 funcLeave;
+		uint16 funcEnter;
+		uint16 funcLeave;
 		int16 field_12; // New in GOB2
 	};
 
@@ -230,7 +230,7 @@
 	virtual void playTot(int16 skipPlay) = 0;
 	virtual void clearCollisions(void) = 0;
 	virtual int16 addNewCollision(int16 id, int16 left, int16 top, int16 right,
-			int16 bottom, int16 flags, int16 key, int16 funcEnter, int16 funcLeave) = 0;
+			int16 bottom, int16 flags, int16 key, uint16 funcEnter, uint16 funcLeave) = 0;
 	virtual void collisionsBlock(void) = 0;
 	virtual int16 multiEdit(int16 time, int16 index, int16 *pCurPos,
 					InputDesc *inpDesc, int16 *collResId, int16 *collIndex) = 0;
@@ -274,7 +274,7 @@
 	GobEngine *_vm;
 		
 	void setCollisions(void);
-	void collSub(int16 offset);
+	void collSub(uint16 offset);
 	void collAreaSub(int16 index, int8 enter);
 	int16 openLocTextFile(char *locTextFile, int language);
 
@@ -288,7 +288,7 @@
 	virtual void playTot(int16 skipPlay);
 	virtual void clearCollisions(void);
 	virtual int16 addNewCollision(int16 id, int16 left, int16 top, int16 right,
-			int16 bottom, int16 flags, int16 key, int16 funcEnter, int16 funcLeave);
+			int16 bottom, int16 flags, int16 key, uint16 funcEnter, uint16 funcLeave);
 	virtual void collisionsBlock(void);
 	virtual int16 multiEdit(int16 time, int16 index, int16 *pCurPos,
 					InputDesc *inpDesc, int16 *collResId, int16 *collIndex);
@@ -313,7 +313,7 @@
 	virtual void playTot(int16 skipPlay);
 	virtual void clearCollisions(void);
 	virtual int16 addNewCollision(int16 id, int16 left, int16 top, int16 right,
-			int16 bottom, int16 flags, int16 key, int16 funcEnter, int16 funcLeave);
+			int16 bottom, int16 flags, int16 key, uint16 funcEnter, uint16 funcLeave);
 	virtual void collisionsBlock(void);
 	virtual int16 multiEdit(int16 time, int16 index, int16 *pCurPos,
 					InputDesc *inpDesc, int16 *collResId, int16 *collIndex);

Modified: scummvm/trunk/engines/gob/game_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v1.cpp	2007-02-07 02:17:09 UTC (rev 25406)
+++ scummvm/trunk/engines/gob/game_v1.cpp	2007-02-07 13:08:17 UTC (rev 25407)
@@ -262,7 +262,7 @@
 }
 
 int16 Game_v1::addNewCollision(int16 id, int16 left, int16 top, int16 right, int16 bottom,
-	    int16 flags, int16 key, int16 funcEnter, int16 funcLeave) {
+	    int16 flags, int16 key, uint16 funcEnter, uint16 funcLeave) {
 	int16 i;
 	Collision *ptr;
 

Modified: scummvm/trunk/engines/gob/game_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v2.cpp	2007-02-07 02:17:09 UTC (rev 25406)
+++ scummvm/trunk/engines/gob/game_v2.cpp	2007-02-07 13:08:17 UTC (rev 25407)
@@ -308,7 +308,7 @@
 }
 
 int16 Game_v2::addNewCollision(int16 id, int16 left, int16 top, int16 right, int16 bottom,
-	    int16 flags, int16 key, int16 funcEnter, int16 funcLeave) {
+	    int16 flags, int16 key, uint16 funcEnter, uint16 funcLeave) {
 	int16 i;
 	Collision *ptr;
 

Modified: scummvm/trunk/engines/gob/inter_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v1.cpp	2007-02-07 02:17:09 UTC (rev 25406)
+++ scummvm/trunk/engines/gob/inter_v1.cpp	2007-02-07 13:08:17 UTC (rev 25407)
@@ -950,6 +950,7 @@
 void Inter_v1::o1_initCursorAnim(void) {
 	int16 ind;
 
+	_vm->_draw->_showCursor = 3;
 	ind = _vm->_parse->parseValExpr();
 	_vm->_draw->_cursorAnimLow[ind] = load16();
 	_vm->_draw->_cursorAnimHigh[ind] = load16();
@@ -959,6 +960,7 @@
 void Inter_v1::o1_clearCursorAnim(void) {
 	int16 ind;
 
+	_vm->_draw->_showCursor = 0;
 	ind = _vm->_parse->parseValExpr();
 	_vm->_draw->_cursorAnimLow[ind] = -1;
 	_vm->_draw->_cursorAnimHigh[ind] = 0;
@@ -1530,6 +1532,7 @@
 		storeKey(key);
 		return false;
 	} else {
+		_vm->_draw->_showCursor &= ~2;
 		_vm->_util->longDelay(1);
 		key = _vm->_game->checkCollisions(0, 0, 0, 0);
 		storeKey(key);
@@ -1814,11 +1817,12 @@
 }
 
 bool Inter_v1::o1_callSub(char &cmdCount, int16 &counter, int16 &retFlag) {
-	char *storedIP = _vm->_global->_inter_execPtr;
+	char *storedIP;
+	uint32 offset;
 
-//	_vm->_global->_inter_execPtr = (char *)_vm->_game->_totFileData + READ_LE_UINT16(_vm->_global->_inter_execPtr);
+	storedIP = _vm->_global->_inter_execPtr;
+	offset = READ_LE_UINT16(_vm->_global->_inter_execPtr);
 
-	uint16 offset = READ_LE_UINT16(_vm->_global->_inter_execPtr);
 	debugC(5, kDebugGameFlow, "tot = \"%s\", offset = %d", _vm->_game->_curTotFile, offset);
 
 	// Skipping the copy protection screen in Gobliiins


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