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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Mon Dec 15 02:45:16 CET 2008


Revision: 35372
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35372&view=rev
Author:   drmccoy
Date:     2008-12-15 01:45:16 +0000 (Mon, 15 Dec 2008)

Log Message:
-----------
Another collision stuff change for Urban Runner. Now you can actually move! :)

Modified Paths:
--------------
    scummvm/trunk/engines/gob/game.h
    scummvm/trunk/engines/gob/game_v6.cpp

Modified: scummvm/trunk/engines/gob/game.h
===================================================================
--- scummvm/trunk/engines/gob/game.h	2008-12-15 00:27:05 UTC (rev 35371)
+++ scummvm/trunk/engines/gob/game.h	2008-12-15 01:45:16 UTC (rev 35372)
@@ -324,6 +324,8 @@
 
 	virtual int16 adjustKey(int16 key);
 
+	virtual int16 checkMousePoint(int16 all, int16 *resId, int16 *resIndex);
+
 	void sub_1BA78();
 };
 

Modified: scummvm/trunk/engines/gob/game_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v6.cpp	2008-12-15 00:27:05 UTC (rev 35371)
+++ scummvm/trunk/engines/gob/game_v6.cpp	2008-12-15 01:45:16 UTC (rev 35372)
@@ -1059,6 +1059,70 @@
 	return key & 0xFF;
 }
 
+int16 Game_v6::checkMousePoint(int16 all, int16 *resId, int16 *resIndex) {
+	Collision *ptr;
+	int16 i;
+
+	if (resId != 0)
+		*resId = 0;
+
+	*resIndex = 0;
+
+	ptr = _collisionAreas;
+	for (i = 0; ptr->left != 0xFFFF; ptr++, i++) {
+		if (ptr->id & 0x4000)
+			continue;
+
+		if (all) {
+			if ((ptr->flags & 0xF) > 1)
+				continue;
+
+			if ((ptr->flags & 0xF00) != 0)
+				continue;
+
+			if ((_vm->_global->_inter_mouseX < ptr->left) ||
+			    (_vm->_global->_inter_mouseX > ptr->right) ||
+			    (_vm->_global->_inter_mouseY < ptr->top) ||
+			    (_vm->_global->_inter_mouseY > ptr->bottom))
+				continue;
+
+			if (resId != 0)
+				*resId = ptr->id;
+
+			*resIndex = i;
+			return ptr->key;
+		} else {
+			if ((ptr->flags & 0xF00) != 0)
+				continue;
+
+			if ((ptr->flags & 0xF) < 1)
+				continue;
+
+			if ((((ptr->flags & 0x70) >> 4) != (_mouseButtons - 1)) &&
+					(((ptr->flags & 0x70) >> 4) != 2))
+				continue;
+
+			if ((_vm->_global->_inter_mouseX < ptr->left) ||
+			    (_vm->_global->_inter_mouseX > ptr->right) ||
+			    (_vm->_global->_inter_mouseY < ptr->top) ||
+			    (_vm->_global->_inter_mouseY > ptr->bottom))
+				continue;
+
+			if (resId != 0)
+				*resId = ptr->id;
+			*resIndex = i;
+			if (((ptr->flags & 0xF) == 1) || ((ptr->flags & 0xF) == 2))
+				return ptr->key;
+			return 0;
+		}
+	}
+
+	if ((_mouseButtons != 1) && (all == 0))
+		return 0x11B;
+
+	return 0;
+}
+
 void Game_v6::sub_1BA78() {
 	int16 lastCollAreaIndex = _lastCollAreaIndex;
 	int16 lastCollId = _lastCollId;


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