[Scummvm-cvs-logs] CVS: scummvm/queen verb.h,1.6,1.7 logic.h,1.78,1.79 talk.cpp,1.53,1.54 cutaway.cpp,1.82,1.83 logic.cpp,1.119,1.120

Gregory Montoir cyx at users.sourceforge.net
Fri Dec 5 05:57:01 CET 2003


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv18754

Modified Files:
	verb.h logic.h talk.cpp cutaway.cpp logic.cpp 
Log Message:
cleanup, s/abs/ABS/g

Index: verb.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/verb.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- verb.h	7 Nov 2003 10:57:21 -0000	1.6
+++ verb.h	5 Dec 2003 13:56:06 -0000	1.7
@@ -100,12 +100,6 @@
 		return _verb == VERB_USE_JOURNAL;
 	}
 
-	bool isTwoLevelsCommand() const {
-		return 
-			 _verb == VERB_GIVE ||
-			 _verb == VERB_USE;
-	}
-
 	bool isDigit() const {
 		return
 			_verb >= VERB_DIGIT_FIRST && 

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- logic.h	4 Dec 2003 13:21:25 -0000	1.78
+++ logic.h	5 Dec 2003 13:56:06 -0000	1.79
@@ -41,6 +41,7 @@
 	Box box;
 };
 
+// FIXME: get rid of that and use ConfigurationManager
 struct GameConfig {
 	int musicVolume;
 	bool textToggle;
@@ -199,7 +200,7 @@
 	const char *objectName(uint16 objNum) const { return _objName[objNum]; }
 	const char *objectTextualDescription(uint16 objNum) const { return _objDescription[objNum]; }
 
-	uint16 numFrames() { return _numFrames; }
+	uint16 numFrames() const { return _numFrames; }
 
 	int talkSpeed() const { return _settings.talkSpeed; }
 
@@ -236,19 +237,14 @@
 
 	void joeSetupFromBanks(const char *animBank, const char *standBank);
 
-	//! SETUP_JOE(), loads the various bobs needed to animate Joe
+	//! Load the various bobs needed to animate Joe
 	void joeSetup();
 
-	//! SETUP_HERO(), places Joe at the right place when entering a room
+	//! Setup Joe at the right place when entering a room
 	ObjectData *joeSetupInRoom(bool autoPosition, uint16 scale);
 	
-	//! FACE_JOE()
 	uint16 joeFace();
-
-	//! GRAB_JOE()
 	void joeGrab(uint16 state, uint16 speed);
-
-	//! GRAB_DIR
 	void joeGrabDirection(StateGrab grab, uint16 speed);
 
 	void joeUseDress(bool showCut);
@@ -263,12 +259,6 @@
 
 	Verb findVerbUnderCursor(int16 cursorx, int16 cursory) const;
 	uint16 findObjectUnderCursor(int16 cursorx, int16 cursory) const;
-
-	Walk *walk() const { return _walk; }
-	Display *display() const { return _display; }
-	Command *command() const { return _cmd; }
-	Resource *resource() const { return _resource; }
-
 	uint16 findObjectRoomNumber(uint16 zoneNum) const;
 	uint16 findObjectGlobalNumber(uint16 zoneNum) const;
 
@@ -307,6 +297,11 @@
 
 	bool gameSave(uint16 slot, const char *desc);
 	bool gameLoad(uint16 slot);
+
+	Walk *walk() const { return _walk; }
+	Display *display() const { return _display; }
+	Command *command() const { return _cmd; }
+	Resource *resource() const { return _resource; }
 
 	enum {
 		MAX_ZONES_NUMBER   = 32,

Index: talk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- talk.cpp	4 Dec 2003 13:21:43 -0000	1.53
+++ talk.cpp	5 Dec 2003 13:56:06 -0000	1.54
@@ -188,7 +188,7 @@
 
 			int16 index = _dialogueTree[level][i].gameStateIndex;
 
-			if (index < 0 && _logic->gameState(abs(index)) != _dialogueTree[level][i].gameStateValue)
+			if (index < 0 && _logic->gameState(ABS(index)) != _dialogueTree[level][i].gameStateValue)
 				_talkString[i][0] = '\0';
 
 			sprintf(_joeVoiceFilePrefix[i], "%2d%4xJ", _talkKey, _dialogueTree[level][i].head);
@@ -313,7 +313,7 @@
 				if (_itemNumber[i] > 0)
 					_logic->inventoryInsertItem(_itemNumber[i]);
 				else
-					_logic->inventoryDeleteItem(abs(_itemNumber[i]));
+					_logic->inventoryDeleteItem(ABS(_itemNumber[i]));
 			}
 		}
 	}

Index: cutaway.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- cutaway.cpp	4 Dec 2003 10:54:42 -0000	1.82
+++ cutaway.cpp	5 Dec 2003 13:56:06 -0000	1.83
@@ -258,7 +258,7 @@
 			objectNumberStr = "Joe";      break;
 		default:
 			if (object.objectNumber > 0)
-				objectNumberStr = _logic->objectName(abs(_logic->objectData(object.objectNumber)->name));
+				objectNumberStr = _logic->objectName(ABS(_logic->objectData(object.objectNumber)->name));
 			else
 				objectNumberStr = "Unknown!";
 		  break;
@@ -958,11 +958,11 @@
 
 				if (on) {
 					// It is needed, so ensure it's ON
-					objectData->name = abs(objectData->name);
+					objectData->name = ABS(objectData->name);
 				}
 				else {
 					// Not needed, so switch off!
-					objectData->name = -abs(objectData->name);
+					objectData->name = -ABS(objectData->name);
 				}
 
 			}
@@ -1035,7 +1035,7 @@
 		else {
 			// Same object, so just turn it on!
 			ObjectData *objectData = _logic->objectData(object.objectNumber);
-			objectData->name = abs(objectData->name);
+			objectData->name = ABS(objectData->name);
 		}
 
 		_logic->roomRefreshObject(object.objectNumber);
@@ -1719,7 +1719,7 @@
 			if (fromIndex > 0) {
 				if (fromIndex == objectIndex) {
 					// Enable object
-					object->name = abs(object->name);
+					object->name = ABS(object->name);
 				}
 				else {
 					_logic->objectCopy(fromIndex, objectIndex);
@@ -1760,7 +1760,7 @@
 						_graphics->bobClear(bobIndex);
 					}
 					else if (objectFrame) {
-						_graphics->bankUnpack(abs(frame), objectFrame, bank);
+						_graphics->bankUnpack(ABS(frame), objectFrame, bank);
 						pbs->frameNum = objectFrame;
 						if (frame < 0)
 							pbs->xflip = true;
@@ -1813,7 +1813,7 @@
 				update = true;
 		}
 		else {
-			_logic->gameState(abs(stateIndex), stateValue);
+			_logic->gameState(ABS(stateIndex), stateValue);
 			update = true;
 		}
 
@@ -1823,7 +1823,7 @@
 
 			if (objectIndex > 0) {                    // Show the object
 				ObjectData *objectData  = _logic->objectData(objectIndex);
-				objectData->name        = abs(objectData->name);
+				objectData->name        = ABS(objectData->name);
 				if (fromObject > 0)
 					_logic->objectCopy(fromObject, objectIndex);
 				_logic->roomRefreshObject(objectIndex);
@@ -1831,7 +1831,7 @@
 			else if (objectIndex < 0) {               // Hide the object
 				objectIndex             = -objectIndex;
 				ObjectData *objectData  = _logic->objectData(objectIndex);
-				objectData->name        = -abs(objectData->name);
+				objectData->name        = -ABS(objectData->name);
 				_logic->roomRefreshObject(objectIndex);
 			}
 
@@ -1841,11 +1841,11 @@
 
 				if (areaSubIndex > 0) {
 					Area *area = _logic->area(areaIndex, areaSubIndex);
-					area->mapNeighbours = abs(area->mapNeighbours);
+					area->mapNeighbours = ABS(area->mapNeighbours);
 				}
 				else {
-					Area *area = _logic->area(areaIndex, abs(areaSubIndex));
-					area->mapNeighbours = -abs(area->mapNeighbours);
+					Area *area = _logic->area(areaIndex, ABS(areaSubIndex));
+					area->mapNeighbours = -ABS(area->mapNeighbours);
 				}
 			}
 
@@ -1951,7 +1951,7 @@
 	}
 
 	BobSlot *bob = 
-		_graphics->bob( _logic->findBob(abs(object.objectNumber)) );
+		_graphics->bob( _logic->findBob(ABS(object.objectNumber)) );
 
 	_graphics->bobSetText(bob, sentence, x, object.bobStartY, object.specialMove, flags);
 

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- logic.cpp	4 Dec 2003 13:21:26 -0000	1.119
+++ logic.cpp	5 Dec 2003 13:56:07 -0000	1.120
@@ -400,7 +400,7 @@
 
 
 ObjectData* Logic::objectData(int index) const {
-	index = abs(index); // cyx: is that really necessary ?
+	index = ABS(index); // cyx: is that really necessary ?
 	if (index <= _numObjects)
 		return &_objectData[index];
 	else
@@ -2062,7 +2062,7 @@
 
 void Logic::inventoryInsertItem(uint16 itemNum, bool refresh) {
 	int16 item = _inventoryItem[0] = (int16)itemNum; 
-	_itemData[itemNum].name = abs(_itemData[itemNum].name);	//set visible
+	_itemData[itemNum].name = ABS(_itemData[itemNum].name);	//set visible
 	for (int i = 1; i < 4; i++) {
 		item = nextInventoryItem(item);
 		_inventoryItem[i] = item;
@@ -2076,7 +2076,7 @@
 
 void Logic::inventoryDeleteItem(uint16 itemNum, bool refresh) {
 	int16 item = (int16)itemNum;
-	_itemData[itemNum].name = -abs(_itemData[itemNum].name);	//set invisible
+	_itemData[itemNum].name = -ABS(_itemData[itemNum].name);	//set invisible
 	for (int i = 0; i < 4; i++) {
 		item = nextInventoryItem(item);
 		_inventoryItem[i] = item;
@@ -2148,10 +2148,10 @@
 	if (frameCountDummy > frameCountReal)
 		*dummyObject = temp;
 
-	realObject->name = abs(realObject->name);
+	realObject->name = ABS(realObject->name);
 
 	if  (fromState == -1)
-		dummyObject->name = -abs(dummyObject->name);
+		dummyObject->name = -ABS(dummyObject->name);
 
 	//  Make sure that WALK_OFF_DATA is copied too!
 





More information about the Scummvm-git-logs mailing list