[Scummvm-cvs-logs] SF.net SVN: scummvm:[38685] scummvm/trunk/engines/tucker

cyx at users.sourceforge.net cyx at users.sourceforge.net
Sat Feb 21 12:29:56 CET 2009


Revision: 38685
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38685&view=rev
Author:   cyx
Date:     2009-02-21 11:29:56 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/tucker/locations.cpp
    scummvm/trunk/engines/tucker/resource.cpp
    scummvm/trunk/engines/tucker/tucker.cpp
    scummvm/trunk/engines/tucker/tucker.h

Modified: scummvm/trunk/engines/tucker/locations.cpp
===================================================================
--- scummvm/trunk/engines/tucker/locations.cpp	2009-02-21 11:27:04 UTC (rev 38684)
+++ scummvm/trunk/engines/tucker/locations.cpp	2009-02-21 11:29:56 UTC (rev 38685)
@@ -154,7 +154,7 @@
 		_spritesTable[0].needUpdate = 1;
 		return;
 	}
-	if (_csDataHandled != 0) {
+	if (_csDataHandled) {
 		_spritesTable[0].needUpdate = 0;
 		if (_flagsTable[199] == 0) {
 			_flagsTable[199] = 1;
@@ -288,7 +288,7 @@
 		}
 	} else {
 		_spritesTable[i].needUpdate = 0;
-		if (_csDataHandled != 0) {
+		if (_csDataHandled) {
 			num = 6;
 			if (getRandomNumber() < 32000) {
 				_spritesTable[i].updateDelay = 5;
@@ -1402,7 +1402,7 @@
 			_flagsTable[53] = 5;
 		}
 	}
-	if (_flagsTable[210] < 2 && _csDataHandled == 0 && _flagsTable[54] == 1) {
+	if (_flagsTable[210] < 2 && !_csDataHandled && _flagsTable[54] == 1) {
 		_nextAction = 25;
 		_csDataLoaded = 0;
 		_flagsTable[210] = 2;
@@ -3029,11 +3029,11 @@
 		_execData3Counter = 1;
 		_flagsTable[143] = 0;
 		_updateLocation70StringLen = 0;
-		_forceRedrawPanelItems = 1;
+		_forceRedrawPanelItems = true;
 		_panelState = 1;
 		setCursorType(2);
 	}
-	_forceRedrawPanelItems = 1;
+	_forceRedrawPanelItems = true;
 	_panelState = 1;
 	setCursorType(2);
 	int pos = getPositionForLine(22, _infoBarBuf);

Modified: scummvm/trunk/engines/tucker/resource.cpp
===================================================================
--- scummvm/trunk/engines/tucker/resource.cpp	2009-02-21 11:27:04 UTC (rev 38684)
+++ scummvm/trunk/engines/tucker/resource.cpp	2009-02-21 11:29:56 UTC (rev 38685)
@@ -960,12 +960,12 @@
 				found = t.findNextToken(kDataTokenDw);
 				assert(found);
 			}
-			_forceRedrawPanelItems = 1;
+			_forceRedrawPanelItems = true;
 			_panelState = 1;
 			setCursorType(2);
 			_tableInstructionsPtr = _csDataBuf + t._pos + 1;
 			_csDataLoaded = true;
-			_csDataHandled = 1;
+			_csDataHandled = true;
 			debug(2, "loadActionsTable() _nextAction %d", _nextAction);
 		}
 		if (_csDataTableFlag2 == 1 && _charSpeechSoundCounter > 0) {
@@ -982,11 +982,11 @@
 			--_stopActionCounter;
 			break;
 		}
-		if (_stopActionOnSoundFlag != 0) {
+		if (_stopActionOnSoundFlag) {
 			if (isSoundPlaying(_soundInstructionIndex)) {
 				break;
 			}
-			_stopActionOnSoundFlag = 0;
+			_stopActionOnSoundFlag = false;
 		}
 		if (_csDataTableCount != 0) {
 			if (_csDataTableCount == 99) {
@@ -1025,10 +1025,10 @@
 	if (table == 2) {
 		_nextAction = 0;
 		_csDataLoaded = false;
-		_forceRedrawPanelItems = 1;
+		_forceRedrawPanelItems = true;
 		_panelState = 0;
 		setCursorType(0);
-		_csDataHandled = 0;
+		_csDataHandled = false;
 		_skipPanelObjectUnderCursor = 0;
 		_mouseClick = 1;
 	}

Modified: scummvm/trunk/engines/tucker/tucker.cpp
===================================================================
--- scummvm/trunk/engines/tucker/tucker.cpp	2009-02-21 11:27:04 UTC (rev 38684)
+++ scummvm/trunk/engines/tucker/tucker.cpp	2009-02-21 11:29:56 UTC (rev 38685)
@@ -181,11 +181,11 @@
 	memset(_inputKeys, 0, sizeof(_inputKeys));
 	_cursorNum = 0;
 	_cursorType = 0;
-	_updateCursorFlag = 0;
+	_updateCursorFlag = false;
 
 	_panelNum = 1;
 	_panelState = 0;
-	_forceRedrawPanelItems = 1;
+	_forceRedrawPanelItems = true;
 	_redrawPanelItemsCounter = 0;
 	_switchPanelFlag = 0;
 	memset(_panelObjectsOffsetTable, 0, sizeof(_panelObjectsOffsetTable));
@@ -243,8 +243,8 @@
 	_actionCharacterNum = 0;
 
 	_csDataLoaded = false;
-	_csDataHandled = 0;
-	_stopActionOnSoundFlag = 0;
+	_csDataHandled = false;
+	_stopActionOnSoundFlag = false;
 	_csDataTableFlag2 = 0;
 	_stopActionOnPanelLock = 0;
 	_csDataTableCount = 0;
@@ -259,7 +259,7 @@
 	_tableInstructionFlag = 0;
 	_tableInstructionItemNum1 = _tableInstructionItemNum2 = 0;
 	memset(_instructionsActionsTable, 0, sizeof(_instructionsActionsTable));
-	_validInstructionId = 0;
+	_validInstructionId = false;
 
 	memset(_spriteFramesTable, 0, sizeof(_spriteFramesTable));
 	memset(_spriteAnimationsTable, 0, sizeof(_spriteAnimationsTable));
@@ -921,7 +921,7 @@
 			_flagsTable[_charPositionFlagNum] = _charPositionFlagValue;
 		} else if (_updateCharPositionType == 6 && _charPositionFlagValue == 1) {
 			addObjectToInventory(_charPositionFlagNum);
-			_forceRedrawPanelItems = 1;
+			_forceRedrawPanelItems = true;
 		}
 		if (_pendingActionIndex > 0) {
 			_nextAction = _pendingActionIndex;
@@ -982,17 +982,17 @@
 		return;
 	}
 	if (_rightMouseButtonPressed) {
-		if (_updateCursorFlag == 0) {
+		if (!_updateCursorFlag) {
 			++_actionVerb;
 			if (_actionVerb > 8) {
 				_actionVerb = 0;
 			}
-			_updateCursorFlag = 1;
+			_updateCursorFlag = true;
 			_skipPanelObjectUnderCursor = 1;
 			_actionRequiresTwoObjects = false;
 		}
 	} else {
-		_updateCursorFlag = 0;
+		_updateCursorFlag = false;
 	}
 	if (_skipPanelObjectUnderCursor == 0) {
 		setActionVerbUnderCursor();
@@ -1285,19 +1285,19 @@
 		if (_mousePosX > 228 && _mousePosX < 240 && _mousePosY > 154 && _mousePosY < 170) {
 			if (_currentSaveLoadGameState < 99) {
 				++_currentSaveLoadGameState;
-				_forceRedrawPanelItems = 1;
+				_forceRedrawPanelItems = true;
 			}
 			return;
 		}
 		if (_mousePosX > 228 && _mousePosX < 240 && _mousePosY > 170 && _mousePosY < 188) {
 			if (_currentSaveLoadGameState > 1) {
 				--_currentSaveLoadGameState;
-				_forceRedrawPanelItems = 1;
+				_forceRedrawPanelItems = true;
 			}
 			return;
 		}
 		if (_mousePosX > 244 && _mousePosX < 310 && _mousePosY > 170 && _mousePosY < 188) {
-			_forceRedrawPanelItems = 1;
+			_forceRedrawPanelItems = true;
 			_panelState = 2;
 			return;
 		}
@@ -1307,7 +1307,7 @@
 			} else if (_currentSaveLoadGameState > 0) {
 				loadGameState(_currentSaveLoadGameState);
 			}
-			_forceRedrawPanelItems = 1;
+			_forceRedrawPanelItems = true;
 			_panelState = 0;
 			setCursorType(0);
 			return;
@@ -1329,14 +1329,14 @@
 		}
 		if (_mousePosX < 96) {
 			_saveOrLoadGamePanel = 0;
-			_forceRedrawPanelItems = 1;
+			_forceRedrawPanelItems = true;
 			_panelState = 3;
 		} else if (_mousePosX < 158) {
 			_saveOrLoadGamePanel = 1;
-			_forceRedrawPanelItems = 1;
+			_forceRedrawPanelItems = true;
 			_panelState = 3;
 		} else if (_mousePosX < 218) {
-			_forceRedrawPanelItems = 1;
+			_forceRedrawPanelItems = true;
 			_panelState = 0;
 			setCursorType(0);
 		} else {
@@ -1366,7 +1366,7 @@
 			}
 			_switchPanelFlag = 2;
 			loadPanel();
-			_forceRedrawPanelItems = 1;
+			_forceRedrawPanelItems = true;
 		} else {
 			++_switchPanelCounter;
 		}
@@ -1435,7 +1435,7 @@
 	int scrollPrevOffset = _scrollOffset;
 	if (_locationWidthTable[_locationNum] != 2) {
 		_scrollOffset = 0;
-	} else if (_validInstructionId == 1) {
+	} else if (_validInstructionId) {
 		_scrollOffset = _xPosCurrent - 200;
 	} else if (_locationNum == 16 && _backgroundSpriteCurrentAnimation == 6 && _scrollOffset + 200 < _xPosCurrent) {
 		++_scrollOffset;
@@ -1810,8 +1810,8 @@
 	const uint8 *src = 0;
 	uint8 *dst = 0;
 	int sz = 0;
-	if (_forceRedrawPanelItems != 0 || (_redrawPanelItemsCounter != 0 && _panelState == 0)) {
-		_forceRedrawPanelItems = 0;
+	if (_forceRedrawPanelItems || (_redrawPanelItemsCounter != 0 && _panelState == 0)) {
+		_forceRedrawPanelItems = false;
 		if (_redrawPanelItemsCounter > 0) {
 			--_redrawPanelItemsCounter;
 		}
@@ -2133,7 +2133,7 @@
 	if (frame == 999 || (_characterFacingDirection != _characterPrevFacingDirection && _characterFacingDirection < 5)) {
 		_mirroredDrawing = 0;
 		if (_characterFacingDirection == 6) {
-			if (_csDataHandled != 0) {
+			if (_csDataHandled) {
 				switch (_selectedCharacterDirection) {
 				case 1:
 					num = 17;
@@ -2157,7 +2157,7 @@
 			_characterFacingDirection = 0;
 		}
 		if (_characterFacingDirection == 0) {
-			if (_csDataHandled != 0) {
+			if (_csDataHandled) {
 				_mirroredDrawing = 0;
 				switch (_selectedCharacterDirection) {
 				case 1:
@@ -2860,7 +2860,7 @@
 			_characterSpriteAnimationFrameCounter = 0;
 		}
 	}
-	if (_charSpeechSoundCounter == 0 && _csDataHandled == 0) {
+	if (_charSpeechSoundCounter == 0 && !_csDataHandled) {
 		setCursorType(0);
 		return;
 	}
@@ -2949,7 +2949,7 @@
 		if (_tableInstructionsPtr[1] == 'a') { // 0
 			_tableInstructionsPtr += 4;
 			_panelState = parseInt(_tableInstructionsPtr, 0, 2);
-			_forceRedrawPanelItems = 1;
+			_forceRedrawPanelItems = true;
 			_tableInstructionsPtr += 3;
 			return 0;
 		}
@@ -3272,19 +3272,19 @@
 			return 1;
 		}
 		if (_tableInstructionsPtr[2] == 'x') { // 18
-			_stopActionOnSoundFlag = 1;
+			_stopActionOnSoundFlag = true;
 			_tableInstructionsPtr += 4;
 			return 1;
 		}
 		break;
 	case 'x': // 18
 		if (_tableInstructionsPtr[2] == 'r') { // 13
-			_validInstructionId = 1;
+			_validInstructionId = true;
 			_tableInstructionsPtr += 4;
 			return 0;
 		}
 		if (_tableInstructionsPtr[2] == 'm') { // 9
-			_validInstructionId = 0;
+			_validInstructionId = false;
 			_tableInstructionsPtr += 4;
 			return 0;
 		}
@@ -3297,14 +3297,14 @@
 void TuckerEngine::moveUpInventoryObjects() {
 	if (_inventoryObjectsOffset + 6 < _inventoryObjectsCount) {
 		_inventoryObjectsOffset += 3;
-		_forceRedrawPanelItems = 1;
+		_forceRedrawPanelItems = true;
 	}
 }
 
 void TuckerEngine::moveDownInventoryObjects() {
 	if (_inventoryObjectsOffset > 2) {
 		_inventoryObjectsOffset -= 3;
-		_forceRedrawPanelItems = 1;
+		_forceRedrawPanelItems = true;
 	}
 }
 
@@ -3518,7 +3518,7 @@
 			_selectedObjectNum = 0;
 			_actionVerb = 0;
 			_skipPanelObjectUnderCursor = 0;
-			_forceRedrawPanelItems = 1;
+			_forceRedrawPanelItems = true;
 			_panelState = 2;
 			setCursorType(1);
 		}

Modified: scummvm/trunk/engines/tucker/tucker.h
===================================================================
--- scummvm/trunk/engines/tucker/tucker.h	2009-02-21 11:27:04 UTC (rev 38684)
+++ scummvm/trunk/engines/tucker/tucker.h	2009-02-21 11:29:56 UTC (rev 38685)
@@ -639,11 +639,11 @@
 	bool _inputKeys[kInputKeyCount];
 	int _cursorNum;
 	int _cursorType;
-	int _updateCursorFlag;
+	bool _updateCursorFlag;
 
 	int _panelNum;
 	int _panelState;
-	int _forceRedrawPanelItems;
+	bool _forceRedrawPanelItems;
 	int _redrawPanelItemsCounter;
 	int _switchPanelFlag;
 	int _panelObjectsOffsetTable[50];
@@ -733,8 +733,8 @@
 	int _actionCharacterNum;
 
 	bool _csDataLoaded;
-	int _csDataHandled;
-	int _stopActionOnSoundFlag;
+	bool _csDataHandled;
+	bool _stopActionOnSoundFlag;
 	int _csDataTableFlag2;
 	int _stopActionOnPanelLock;
 	int _csDataTableCount;
@@ -749,7 +749,7 @@
 	int _tableInstructionFlag;
 	int _tableInstructionItemNum1, _tableInstructionItemNum2;
 	int _instructionsActionsTable[6];
-	int _validInstructionId;
+	bool _validInstructionId;
 
 	SpriteFrame _spriteFramesTable[kSpriteFramesTableSize];
 	SpriteAnimation _spriteAnimationsTable[200];


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