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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Mar 18 18:12:49 CET 2007


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

Log Message:
-----------
converted input and labels to Common::Point

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

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-03-18 17:03:07 UTC (rev 26213)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-03-18 17:12:48 UTC (rev 26214)
@@ -50,7 +50,6 @@
 };
 
 bool		Gfx::_proportionalFont = false;
-Point		Gfx::_labelPosition[2] = { { 0, 0 }, { 0, 0 } };
 byte *		Gfx::_buffers[];
 
 #define PALETTE_BACKUP	PALETTE_SIZE
@@ -417,7 +416,7 @@
 
 	if (label->_cnv._width == 0)
 		return;
-	_vm->_gfx->flatBlitCnv(&label->_cnv, Gfx::_labelPosition[0]._x, Gfx::_labelPosition[0]._y, Gfx::kBitBack);
+	_vm->_gfx->flatBlitCnv(&label->_cnv, _vm->_gfx->_labelPosition[0].x, _vm->_gfx->_labelPosition[0].y, Gfx::kBitBack);
 
 	return;
 }
@@ -444,13 +443,12 @@
 		_si = SCREEN_WIDTH - label->_cnv._width;
 
 	Common::Rect r(label->_cnv._width, label->_cnv._height);
-	r.moveTo(Gfx::_labelPosition[1]._x, Gfx::_labelPosition[1]._y);
+	r.moveTo(_vm->_gfx->_labelPosition[1]);
 	_vm->_gfx->restoreBackground(r);
 
-	Gfx::_labelPosition[1]._x = Gfx::_labelPosition[0]._x;
-	Gfx::_labelPosition[1]._y = Gfx::_labelPosition[0]._y;
-	Gfx::_labelPosition[0]._x = _si;
-	Gfx::_labelPosition[0]._y = _di;
+	_vm->_gfx->_labelPosition[1] = _vm->_gfx->_labelPosition[0];
+	_vm->_gfx->_labelPosition[0].x = _si;
+	_vm->_gfx->_labelPosition[0].y = _di;
 
 	return;
 }

Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h	2007-03-18 17:03:07 UTC (rev 26213)
+++ scummvm/trunk/engines/parallaction/graphics.h	2007-03-18 17:12:48 UTC (rev 26214)
@@ -136,7 +136,7 @@
 	void setFont(const char* name);
 
 public:
-	static Point		_labelPosition[2];
+	Common::Point		_labelPosition[2];
 	static bool 		_proportionalFont;
 
 	uint16				_bgLayers[4];

Modified: scummvm/trunk/engines/parallaction/inventory.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/inventory.cpp	2007-03-18 17:03:07 UTC (rev 26213)
+++ scummvm/trunk/engines/parallaction/inventory.cpp	2007-03-18 17:12:48 UTC (rev 26214)
@@ -52,7 +52,7 @@
 
 static byte		*_buffer;
 uint16			 _numInvLines = 0;
-static Point	 _invPosition = { 0, 0 };
+static Common::Point	 _invPosition;
 
 InventoryItem _inventory[INVENTORY_MAX_ITEMS] = {
 	{ kZoneDoor,		1 },		// open/close icon
@@ -104,13 +104,13 @@
 
 	_si = (_si + 4) / INVENTORY_ITEMS_PER_LINE;
 
-	if (_invPosition._x >= _di) return -1;
-	if ((_invPosition._x + INVENTORY_WIDTH) <= _di) return -1;
+	if (_invPosition.x >= _di) return -1;
+	if ((_invPosition.x + INVENTORY_WIDTH) <= _di) return -1;
 
-	if (_invPosition._y >= y) return -1;
-	if ((_si * INVENTORYITEM_HEIGHT + _invPosition._y) <= y) return -1;
+	if (_invPosition.y >= y) return -1;
+	if ((_si * INVENTORYITEM_HEIGHT + _invPosition.y) <= y) return -1;
 
-	return ((_di - _invPosition._x) / INVENTORYITEM_WIDTH) + (INVENTORY_ITEMS_PER_LINE * ((y - _invPosition._y) / INVENTORYITEM_HEIGHT));
+	return ((_di - _invPosition.x) / INVENTORYITEM_WIDTH) + (INVENTORY_ITEMS_PER_LINE * ((y - _invPosition.y) / INVENTORYITEM_HEIGHT));
 
 }
 
@@ -268,7 +268,7 @@
 	_numInvLines = (_numInvLines + 4) / INVENTORY_ITEMS_PER_LINE;
 
 	Common::Rect r(INVENTORY_WIDTH, _numInvLines * INVENTORYITEM_HEIGHT);
-	r.moveTo(_invPosition._x, _invPosition._y);
+	r.moveTo(_invPosition);
 
 	_vm->_gfx->copyRect(
 		Gfx::kBitBack,
@@ -297,7 +297,7 @@
 	}
 
 	Common::Rect r(INVENTORY_WIDTH, _numInvLines * INVENTORYITEM_HEIGHT);
-	r.moveTo(_invPosition._x, _invPosition._y);
+	r.moveTo(_invPosition);
 
 	_vm->_gfx->restoreBackground(r);
 
@@ -316,19 +316,19 @@
 
 	uint16 _LOCALinventory_lines = (_si + 4) / INVENTORY_ITEMS_PER_LINE;
 
-	_invPosition._x = _mousePos._x - (INVENTORY_WIDTH / 2);
-	if (_invPosition._x < 0)
-		_invPosition._x = 0;
+	_invPosition.x = _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;
+	if ((_invPosition.x + INVENTORY_WIDTH) > SCREEN_WIDTH)
+		_invPosition.x = SCREEN_WIDTH - INVENTORY_WIDTH;
 
-	_invPosition._y = _mousePos._y - 2 - (_LOCALinventory_lines * INVENTORYITEM_HEIGHT);
-	if (_invPosition._y < 0)
-		_invPosition._y = 0;
+	_invPosition.y = _mousePos._y - 2 - (_LOCALinventory_lines * INVENTORYITEM_HEIGHT);
+	if (_invPosition.y < 0)
+		_invPosition.y = 0;
 
-	if (_invPosition._y > SCREEN_HEIGHT - _LOCALinventory_lines * INVENTORYITEM_HEIGHT)
-		_invPosition._y = SCREEN_HEIGHT - _LOCALinventory_lines * INVENTORYITEM_HEIGHT;
+	if (_invPosition.y > SCREEN_HEIGHT - _LOCALinventory_lines * INVENTORYITEM_HEIGHT)
+		_invPosition.y = SCREEN_HEIGHT - _LOCALinventory_lines * INVENTORYITEM_HEIGHT;
 
 	return;
 

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-18 17:03:07 UTC (rev 26213)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-18 17:12:48 UTC (rev 26214)
@@ -442,10 +442,10 @@
 	switch (data->_event) {
 	case kEvEnterZone:
 		debugC(2, kDebugInput, "processInput: kEvEnterZone");
-		_gfx->_labelPosition[1]._x = -1000;
-		_gfx->_labelPosition[1]._y = -1000;
-		_gfx->_labelPosition[0]._x = -1000;
-		_gfx->_labelPosition[0]._y = -1000;
+		_gfx->_labelPosition[1].x = -1000;
+		_gfx->_labelPosition[1].y = -1000;
+		_gfx->_labelPosition[0].x = -1000;
+		_gfx->_labelPosition[0].y = -1000;
 		_jDrawLabel = addJob(&jobDisplayLabel, (void*)data->_label, kPriority0);
 		_jEraseLabel = addJob(&jobEraseLabel, (void*)data->_label, kPriority20);
 		break;
@@ -507,7 +507,7 @@
 		changeCursor(kCursorArrow);
 		if (_vm->_char._ani._zone._flags & kFlagsRemove) break;
 		if ((_vm->_char._ani._zone._flags & kFlagsActive) == 0) break;
-		v4 = buildWalkPath(data->_mousePos._x, data->_mousePos._y);
+		v4 = buildWalkPath(data->_mousePos.x, data->_mousePos.y);
 		addJob(&jobWalk, v4, kPriority19);
 		_engineFlags |= kEngineWalking; 								   // inhibits processing of input until walking is over
 		break;
@@ -552,8 +552,8 @@
 		return &_input;
 	}
 
-	_input._mousePos._x = _mousePos._x;
-	_input._mousePos._y = _mousePos._y;
+	_input._mousePos.x = _mousePos._x;
+	_input._mousePos.y = _mousePos._y;
 
 	if (((_engineFlags & kEnginePauseJobs) == 0) && ((_engineFlags & kEngineInventory) == 0)) {
 
@@ -615,8 +615,8 @@
 				_input._event = kEvWalk;
 				_actionAfterWalk = true;
 				if (z->_moveTo._y != 0) {
-					_input._mousePos._x = z->_moveTo._x;
-					_input._mousePos._y = z->_moveTo._y;
+					_input._mousePos.x = z->_moveTo._x;
+					_input._mousePos.y = z->_moveTo._y;
 				}
 			}
 

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-03-18 17:03:07 UTC (rev 26213)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-03-18 17:12:48 UTC (rev 26214)
@@ -342,7 +342,7 @@
 
 	struct InputData {
 		uint16		_event;
-		Point		_mousePos;
+		Common::Point		_mousePos;
 
 		int16       _inventoryIndex;
 		Zone*       _zone;


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