[Scummvm-cvs-logs] SF.net SVN: scummvm:[55373] scummvm/trunk/engines/mohawk

fuzzie at users.sourceforge.net fuzzie at users.sourceforge.net
Fri Jan 21 13:24:19 CET 2011


Revision: 55373
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55373&view=rev
Author:   fuzzie
Date:     2011-01-21 12:24:18 +0000 (Fri, 21 Jan 2011)

Log Message:
-----------
MOHAWK: Remove non-state uses of ~0 from CSTime.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/cstime.cpp
    scummvm/trunk/engines/mohawk/cstime_game.cpp
    scummvm/trunk/engines/mohawk/cstime_game.h
    scummvm/trunk/engines/mohawk/cstime_ui.cpp
    scummvm/trunk/engines/mohawk/cstime_ui.h

Modified: scummvm/trunk/engines/mohawk/cstime.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/cstime.cpp	2011-01-21 11:53:44 UTC (rev 55372)
+++ scummvm/trunk/engines/mohawk/cstime.cpp	2011-01-21 12:24:18 UTC (rev 55373)
@@ -249,7 +249,7 @@
 void MohawkEngine_CSTime::eventIdle() {
 	bool done = false;
 	while (_events.size() && !done && true /* TODO: !_options->getState() */) {
-		_lastTimeout = ~0;
+		_lastTimeout = 0xffffffff;
 
 		bool advanceQueue = true;
 		bool processEvent = true;
@@ -346,7 +346,7 @@
 
 void MohawkEngine_CSTime::reset() {
 	_NISRunning = false;
-	_lastTimeout = ~0;
+	_lastTimeout = 0xffffffff;
 	_processingEvent = false;
 }
 

Modified: scummvm/trunk/engines/mohawk/cstime_game.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/cstime_game.cpp	2011-01-21 11:53:44 UTC (rev 55372)
+++ scummvm/trunk/engines/mohawk/cstime_game.cpp	2011-01-21 12:24:18 UTC (rev 55373)
@@ -478,7 +478,7 @@
 	}
 
 	setState(~0);
-	_currHover = ~0;
+	_currHover = 0xffff;
 
 	interface->clearTextLine();
 	interface->clearDialogArea();
@@ -555,13 +555,13 @@
 		return;
 	}
 
-	if (_currHover != (uint)~0) {
+	if (_currHover != 0xffff) {
 		if (_vm->getInterface()->cursorGetShape() != 3) {
 			_vm->getInterface()->cursorSetShape(1, true);
 			if (_vm->getInterface()->getInventoryDisplay()->getState() != 4)
 				unhighlightLine(_currHover);
 		}
-		_currHover = ~0;
+		_currHover = 0xffff;
 	}
 }
 
@@ -569,7 +569,7 @@
 	if (_vm->getInterface()->getInventoryDisplay()->getState() == 4)
 		return;
 
-	if (_currEntry == (uint)~0)
+	if (_currEntry == 0xffff)
 		return;
 
 	// TODO: case 20 rect check
@@ -610,8 +610,8 @@
 	_state = ~0;
 	_talkCount = 0;
 	_sourceChar = 0xffff;
-	_currHover = ~0;
-	_currEntry = ~0;
+	_currHover = 0xffff;
+	_currEntry = 0xffff;
 	_nextToProcess = 0xffff;
 	for (uint i = 0; i < 8; i++)
 		for (uint j = 0; j < 5; j++)
@@ -678,7 +678,7 @@
 	assert(!_conversations.empty());
 	_currConv = _conversations[0];
 
-	_currScene = ~0;
+	_currScene = 0xffff;
 }
 
 CSTimeCase::~CSTimeCase() {
@@ -750,8 +750,8 @@
 
 CSTimeScene::CSTimeScene(MohawkEngine_CSTime *vm, CSTimeCase *case_, uint id) : _vm(vm), _case(case_), _id(id) {
 	_activeChar = NULL;
-	_currHotspot = ~0;
-	_hoverHotspot = ~0;
+	_currHotspot = 0xffff;
+	_hoverHotspot = 0xffff;
 	load();
 }
 
@@ -901,7 +901,7 @@
 				// In help mode, we ignore clicks on any help hotspot.
 				if (!hotspotContainsEvent(i, kCSTimeEventStartHelp))
 					break;
-				_currHotspot = ~0;
+				_currHotspot = 0xffff;
 				return;
 			}
 
@@ -910,7 +910,7 @@
 				if (hotspot.events[j].type != kCSTimeEventStartConversation)
 					continue;
 				// FIXME: check that the conversation *is* the current one
-				_currHotspot = ~0;
+				_currHotspot = 0xffff;
 				return;
 			}
 
@@ -931,7 +931,7 @@
 
 	// FIXME: return if sailing puzzle
 
-	_currHotspot = ~0;
+	_currHotspot = 0xffff;
 	for (uint i = 0; i < _hotspots.size(); i++) {
 		CSTimeHotspot &hotspot = _hotspots[i];
 		if (!hotspot.region.containsPoint(pos))
@@ -942,7 +942,7 @@
 		break;
 	}
 
-	if (_currHotspot == (uint)~0)
+	if (_currHotspot == 0xffff)
 		_vm->getInterface()->cursorSetShape(4, false);
 }
 
@@ -1026,7 +1026,7 @@
 		}
 	}
 
-	if (_hoverHotspot == (uint)~0)
+	if (_hoverHotspot == 0xffff)
 		return;
 
 	CSTimeConversation *conv = _case->getCurrConversation();
@@ -1046,13 +1046,13 @@
 		_vm->getInterface()->clearTextLine();
 	}
 
-	_hoverHotspot = (uint)~0;
+	_hoverHotspot = 0xffff;
 }
 
 void CSTimeScene::mouseUp(Common::Point &pos) {
 	// TODO: if sailing puzzle is active, return
 
-	if (_currHotspot == (uint)~0) {
+	if (_currHotspot == 0xffff) {
 		if (_vm->getInterface()->cursorGetShape() == 4)
 			_vm->getInterface()->cursorChangeShape(1);
 		return;

Modified: scummvm/trunk/engines/mohawk/cstime_game.h
===================================================================
--- scummvm/trunk/engines/mohawk/cstime_game.h	2011-01-21 11:53:44 UTC (rev 55372)
+++ scummvm/trunk/engines/mohawk/cstime_game.h	2011-01-21 12:24:18 UTC (rev 55373)
@@ -176,7 +176,7 @@
 	uint _talkCount;
 	uint16 _sourceChar;
 
-	uint _currEntry, _currHover;
+	uint16 _currEntry, _currHover;
 	uint16 _nextToProcess;
 
 	bool _asked[8][5];
@@ -228,8 +228,8 @@
 	CSTimeCase *_case;
 	uint _id;
 
-	uint _currHotspot;
-	uint _hoverHotspot;
+	uint16 _currHotspot;
+	uint16 _hoverHotspot;
 
 	void load();
 	void cursorOverHotspot(uint id);
@@ -253,7 +253,7 @@
 	uint getId() { return _id; }
 	Common::String &getRolloverText(uint id) { return _rolloverText[id]; }
 	CSTimeScene *getCurrScene();
-	void setCurrScene(uint id) { _currScene = id; }
+	void setCurrScene(uint16 id) { _currScene = id; }
 	void setConversation(uint id) { _currConv = _conversations[id]; }
 	CSTimeConversation *getCurrConversation() { return _currConv; }
 	uint16 getNoteFeatureId(uint16 id) { return _noteFeatureId[id]; }
@@ -271,7 +271,7 @@
 	MohawkEngine_CSTime *_vm;
 	uint _id;
 
-	uint _currScene;
+	uint16 _currScene;
 	uint16 _noteFeatureId[3];
 	Common::Array<Common::String> _rolloverText;
 	Common::Array<CSTimeScene *> _scenes;

Modified: scummvm/trunk/engines/mohawk/cstime_ui.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/cstime_ui.cpp	2011-01-21 11:53:44 UTC (rev 55372)
+++ scummvm/trunk/engines/mohawk/cstime_ui.cpp	2011-01-21 12:24:18 UTC (rev 55373)
@@ -654,7 +654,7 @@
 		setCursorForCurrentPoint();
 
 	// Find the inventory object hotspot which is topmost for this drop, if any.
-	uint foundInvObjHotspot = ~0;
+	uint16 foundInvObjHotspot = 0xffff;
 	const Common::Array<CSTimeHotspot> &hotspots = scene->getHotspots();
 	for (uint i = 0; i < hotspots.size(); i++) {
 		if (hotspots[i].state != 1)
@@ -666,7 +666,7 @@
 				continue;
 			if (invObj->hotspots[j].hotspotId != i)
 				continue;
-			if (foundInvObjHotspot != (uint)~0 && invObj->hotspots[foundInvObjHotspot].hotspotId < invObj->hotspots[j].hotspotId)
+			if (foundInvObjHotspot != 0xffff && invObj->hotspots[foundInvObjHotspot].hotspotId < invObj->hotspots[j].hotspotId)
 				continue;
 			foundInvObjHotspot = j;
 		}
@@ -675,7 +675,7 @@
 	// Work out if we're going to consume (nom-nom) the object after the drop.
 	bool consumeObj = false;
 	bool runConsumeEvents = false;
-	if (foundInvObjHotspot != (uint)~0) {
+	if (foundInvObjHotspot != 0xffff) {
 		CSTimeInventoryHotspot &hotspot = invObj->hotspots[foundInvObjHotspot];
 
 		clearTextLine();
@@ -783,7 +783,7 @@
 
 	if (_vm->getCase()->getId() == 1 && _vm->getCase()->getCurrScene()->getId() == 4) {
 		// Hardcoded behaviour for torches in the dark tomb, in the first case.
-		if (_draggedItem == 1 && foundInvObjHotspot == (uint)~0) {
+		if (_draggedItem == 1 && foundInvObjHotspot == 0xffff) {
 			// Trying to drag an unlit torch around?
 			_vm->addEvent(CSTimeEvent(kCSTimeEventCharStartFlapping, 0, 16352));
 		} else if (_draggedItem == 2 && _vm->_caseVariable[2] == 1) {
@@ -868,7 +868,7 @@
 
 void CSTimeInventoryDisplay::draw() {
 	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++) {
-		if (_displayedItems[i] == (uint)~0)
+		if (_displayedItems[i] == 0xffff)
 			continue;
 		CSTimeInventoryObject *invObj = _vm->getCase()->_inventoryObjs[_displayedItems[i]];
 
@@ -900,7 +900,7 @@
 
 void CSTimeInventoryDisplay::show() {
 	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++) {
-		if (_displayedItems[i] == (uint)~0)
+		if (_displayedItems[i] == 0xffff)
 			continue;
 		CSTimeInventoryObject *invObj = _vm->getCase()->_inventoryObjs[_displayedItems[i]];
 		if (!invObj->feature)
@@ -911,7 +911,7 @@
 
 void CSTimeInventoryDisplay::hide() {
 	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++) {
-		if (_displayedItems[i] == (uint)~0)
+		if (_displayedItems[i] == 0xffff)
 			continue;
 		CSTimeInventoryObject *invObj = _vm->getCase()->_inventoryObjs[_displayedItems[i]];
 		if (!invObj->feature)
@@ -941,7 +941,7 @@
 
 void CSTimeInventoryDisplay::clearDisplay() {
 	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++)
-		_displayedItems[i] = ~0;
+		_displayedItems[i] = 0xffff;
 
 	// We always start out with the Time Cuffs.
 	_vm->_haveInvItem[TIME_CUFFS_ID] = 1;
@@ -950,13 +950,13 @@
 	_cuffsState = false;
 }
 
-void CSTimeInventoryDisplay::insertItemInDisplay(uint id) {
+void CSTimeInventoryDisplay::insertItemInDisplay(uint16 id) {
 	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++)
 		if (_displayedItems[i] == id)
 			return;
 
 	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++)
-		if (_displayedItems[i] == (uint)~0) {
+		if (_displayedItems[i] == 0xffff) {
 			_displayedItems[i] = id;
 			return;
 		}
@@ -964,7 +964,7 @@
 	error("couldn't insert item into display");
 }
 
-void CSTimeInventoryDisplay::removeItem(uint id) {
+void CSTimeInventoryDisplay::removeItem(uint16 id) {
 	CSTimeInventoryObject *invObj = _vm->getCase()->_inventoryObjs[id];
 	if (invObj->feature) {
 		_vm->getView()->removeFeature(invObj->feature, true);
@@ -972,12 +972,12 @@
 	}
 	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++)
 		if (_displayedItems[i] == id)
-			_displayedItems[i] = ~0;
+			_displayedItems[i] = 0xffff;
 }
 
 void CSTimeInventoryDisplay::mouseDown(Common::Point &pos) {
 	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++) {
-		if (_displayedItems[i] == (uint)~0)
+		if (_displayedItems[i] == 0xffff)
 			continue;
 		if (!_itemRect[i].contains(pos))
 			continue;
@@ -1003,7 +1003,7 @@
 	}
 
 	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++) {
-		if (_displayedItems[i] == (uint)~0)
+		if (_displayedItems[i] == 0xffff)
 			continue;
 		if (!_itemRect[i].contains(pos))
 			continue;
@@ -1029,7 +1029,7 @@
 
 void CSTimeInventoryDisplay::mouseUp(Common::Point &pos) {
 	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++) {
-		if (_displayedItems[i] == (uint)~0)
+		if (_displayedItems[i] == 0xffff)
 			continue;
 		if (!_itemRect[i].contains(pos))
 			continue;

Modified: scummvm/trunk/engines/mohawk/cstime_ui.h
===================================================================
--- scummvm/trunk/engines/mohawk/cstime_ui.h	2011-01-21 11:53:44 UTC (rev 55372)
+++ scummvm/trunk/engines/mohawk/cstime_ui.h	2011-01-21 12:24:18 UTC (rev 55373)
@@ -71,8 +71,8 @@
 	void hide();
 	void idle();
 	void clearDisplay();
-	void insertItemInDisplay(uint id);
-	void removeItem(uint id);
+	void insertItemInDisplay(uint16 id);
+	void removeItem(uint16 id);
 
 	void mouseDown(Common::Point &pos);
 	void mouseMove(Common::Point &pos);
@@ -99,7 +99,7 @@
 	bool _cuffsState;
 	uint16 _cuffsShape;
 	uint16 _draggedItem;
-	uint _displayedItems[MAX_DISPLAYED_ITEMS];
+	uint16 _displayedItems[MAX_DISPLAYED_ITEMS];
 };
 
 class CSTimeBook {


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