[Scummvm-cvs-logs] SF.net SVN: scummvm: [26216] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Mar 18 18:22:07 CET 2007


Revision: 26216
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26216&view=rev
Author:   peres001
Date:     2007-03-18 10:22:07 -0700 (Sun, 18 Mar 2007)

Log Message:
-----------
changed remaining stuff to Common::Point and got rid of custom Point and Rect

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/defs.h
    scummvm/trunk/engines/parallaction/dialogue.cpp
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/inventory.cpp
    scummvm/trunk/engines/parallaction/menu.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h

Modified: scummvm/trunk/engines/parallaction/defs.h
===================================================================
--- scummvm/trunk/engines/parallaction/defs.h	2007-03-18 17:17:21 UTC (rev 26215)
+++ scummvm/trunk/engines/parallaction/defs.h	2007-03-18 17:22:07 UTC (rev 26216)
@@ -55,18 +55,6 @@
 	}
 };
 
-struct Point {
-	int16	_x;
-	int16	_y;
-};
-
-struct Rect {
-	int16	_left;
-	int16	_top;
-	int16	_right;
-	int16	_bottom;
-};
-
 struct SpeakData;
 struct Question;
 typedef Question Dialogue;

Modified: scummvm/trunk/engines/parallaction/dialogue.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/dialogue.cpp	2007-03-18 17:17:21 UTC (rev 26215)
+++ scummvm/trunk/engines/parallaction/dialogue.cpp	2007-03-18 17:22:07 UTC (rev 26216)
@@ -486,7 +486,7 @@
 	while (_mouseButtons != kMouseLeftUp) {
 
 		_vm->updateInput();
-		_si = getHoverAnswer(_mousePos._x, _mousePos._y, q);
+		_si = getHoverAnswer(_vm->_mousePos.x, _vm->_mousePos.y, q);
 
 		if (_si != v2) {
 			if (v2 != -1)

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-03-18 17:17:21 UTC (rev 26215)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-03-18 17:22:07 UTC (rev 26216)
@@ -429,11 +429,11 @@
 	int16 _si, _di;
 
 	if (_vm->_activeItem._id != 0) {
-		_si = _mousePos._x + 16 - label->_cnv._width/2;
-		_di = _mousePos._y + 34;
+		_si = _vm->_mousePos.x + 16 - label->_cnv._width/2;
+		_di = _vm->_mousePos.y + 34;
 	} else {
-		_si = _mousePos._x + 8 - label->_cnv._width/2;
-		_di = _mousePos._y + 21;
+		_si = _vm->_mousePos.x + 8 - label->_cnv._width/2;
+		_di = _vm->_mousePos.y + 21;
 	}
 
 	if (_si < 0) _si = 0;

Modified: scummvm/trunk/engines/parallaction/inventory.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/inventory.cpp	2007-03-18 17:17:21 UTC (rev 26215)
+++ scummvm/trunk/engines/parallaction/inventory.cpp	2007-03-18 17:22:07 UTC (rev 26216)
@@ -316,14 +316,14 @@
 
 	uint16 _LOCALinventory_lines = (_si + 4) / INVENTORY_ITEMS_PER_LINE;
 
-	_invPosition.x = _mousePos._x - (INVENTORY_WIDTH / 2);
+	_invPosition.x = _vm->_mousePos.x - (INVENTORY_WIDTH / 2);
 	if (_invPosition.x < 0)
 		_invPosition.x = 0;
 
 	if ((_invPosition.x + INVENTORY_WIDTH) > SCREEN_WIDTH)
 		_invPosition.x = SCREEN_WIDTH - INVENTORY_WIDTH;
 
-	_invPosition.y = _mousePos._y - 2 - (_LOCALinventory_lines * INVENTORYITEM_HEIGHT);
+	_invPosition.y = _vm->_mousePos.y - 2 - (_LOCALinventory_lines * INVENTORYITEM_HEIGHT);
 	if (_invPosition.y < 0)
 		_invPosition.y = 0;
 

Modified: scummvm/trunk/engines/parallaction/menu.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/menu.cpp	2007-03-18 17:17:21 UTC (rev 26215)
+++ scummvm/trunk/engines/parallaction/menu.cpp	2007-03-18 17:22:07 UTC (rev 26216)
@@ -191,17 +191,14 @@
 		_engine->updateInput();
 		_vm->_gfx->swapBuffers();
 
-		uint16 _di = _mousePos._x;
-		uint16 v2 = _mousePos._y;
-
 		if (_mouseButtons == kMouseLeftUp) {
 			for (uint16 _si = 0; _si < 4; _si++) {
 
-				if (80 + _si*49 >= _di) continue;
-				if (110 - _si*25 >= v2) continue;
+				if (80 + _si*49 >= _vm->_mousePos.x) continue;
+				if (110 - _si*25 >= _vm->_mousePos.y) continue;
 
-				if (128 + _si*49 <= _di) continue;
-				if (180 - _si*25 <= v2) continue;
+				if (128 + _si*49 <= _vm->_mousePos.x) continue;
+				if (180 - _si*25 <=_vm->_mousePos.y) continue;
 
 				beep();
 				return _si;
@@ -232,7 +229,7 @@
 		_engine->waitTime( 1 );
 
 		_si = 0;
-		if (_mousePos._x > 160)
+		if (_vm->_mousePos.x > 160)
 			_si = 1;
 
 		if (_si == _di) continue;
@@ -313,9 +310,6 @@
 				_engine->waitTime(1);
 			} while (_mouseButtons != kMouseLeftUp);	// waits for left click
 
-			uint16 x = _mousePos._x;
-			uint16 y = _mousePos._y;
-
 			for (uint16 _si = 0; _si < 9; _si++) {
 
 				Common::Rect r(
@@ -325,7 +319,7 @@
 					BLOCK_SELECTION_Y + BLOCK_HEIGHT - _si * BLOCK_Y_OFFSET
 				);
 
-				if (!r.contains(x, y)) continue;
+				if (!r.contains(_vm->_mousePos)) continue;
 
 				r.setWidth(BLOCK_WIDTH);
 				r.setHeight(BLOCK_HEIGHT);

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-18 17:17:21 UTC (rev 26215)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-18 17:22:07 UTC (rev 26216)
@@ -47,7 +47,7 @@
 Parallaction *_vm = NULL;
 
 // public stuff
-Point	_mousePos = { 0, 0 };
+
 uint16	_mouseButtons = 0;
 
 
@@ -314,8 +314,7 @@
 			break;
 
 		case Common::EVENT_MOUSEMOVE:
-			_mousePos._x = e.mouse.x;
-			_mousePos._y = e.mouse.y;
+			_mousePos = e.mouse;
 			break;
 
 		case Common::EVENT_QUIT:
@@ -477,7 +476,7 @@
 			_jDrawLabel = NULL;
 			addJob(&jobWaitRemoveJob, _jEraseLabel, kPriority2);
 		}
-		if (hitZone(kZoneYou, _mousePos._x, _mousePos._y) == 0)
+		if (hitZone(kZoneYou, _mousePos.x, _mousePos.y) == 0)
 		changeCursor(kCursorArrow);
 		removeJob(_jRunScripts);
 		_jDrawInventory = addJob(&jobShowInventory, 0, kPriority2);
@@ -552,8 +551,7 @@
 		return &_input;
 	}
 
-	_input._mousePos.x = _mousePos._x;
-	_input._mousePos.y = _mousePos._y;
+	_input._mousePos = _mousePos;
 
 	if (((_engineFlags & kEnginePauseJobs) == 0) && ((_engineFlags & kEngineInventory) == 0)) {
 
@@ -564,12 +562,12 @@
 			return &_input;
 		}
 
-		Zone *z = hitZone(_activeItem._id, _mousePos._x, _mousePos._y);
+		Zone *z = hitZone(_activeItem._id, _mousePos.x, _mousePos.y);
 
 		if (_mouseButtons == kMouseRightDown) {
 			// right button down shows inventory
 
-			if (hitZone(kZoneYou, _mousePos._x, _mousePos._y) && (_activeItem._id != 0)) {
+			if (hitZone(kZoneYou, _mousePos.x, _mousePos.y) && (_activeItem._id != 0)) {
 				_activeItem._index = (_activeItem._id >> 16) & 0xFFFF;
 				_engineFlags |= kEngineDragging;
 			}
@@ -629,13 +627,13 @@
 	if ((_engineFlags & kEngineInventory) == 0) return NULL;
 
 	// in inventory
-	int16 _si = getHoverInventoryItem(_mousePos._x, _mousePos._y);
+	int16 _si = getHoverInventoryItem(_mousePos.x, _mousePos.y);
 
 	if (_mouseButtons == kMouseRightUp) {
 		// right up hides inventory
 
 		_input._event = kEvCloseInventory;
-		_input._inventoryIndex = getHoverInventoryItem(_mousePos._x, _mousePos._y);
+		_input._inventoryIndex = getHoverInventoryItem(_mousePos.x, _mousePos.y);
 		highlightInventoryItem(_transCurrentHoverItem, 12); 		// disable
 
 		if ((_engineFlags & kEngineDragging) == 0) return &_input;

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-03-18 17:17:21 UTC (rev 26215)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-03-18 17:22:07 UTC (rev 26216)
@@ -99,7 +99,6 @@
 	}
 };
 
-extern Point _mousePos;
 extern uint16 _mouseButtons;
 
 extern uint16 _score;
@@ -338,6 +337,8 @@
 
 	Script	*_locationScript;
 
+	Common::Point	_mousePos;
+
 protected:		// data
 
 	struct InputData {


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