From db7073b15a063c6e4f683076bb25d413e3cd3a28 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Sat, 21 Feb 2009 11:29:56 +0000 Subject: cleanup svn-id: r38685 --- engines/tucker/locations.cpp | 10 ++++---- engines/tucker/resource.cpp | 12 ++++----- engines/tucker/tucker.cpp | 60 ++++++++++++++++++++++---------------------- engines/tucker/tucker.h | 10 ++++---- 4 files changed, 46 insertions(+), 46 deletions(-) (limited to 'engines') diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp index 2d5d386298..8186905b5e 100644 --- a/engines/tucker/locations.cpp +++ b/engines/tucker/locations.cpp @@ -154,7 +154,7 @@ void TuckerEngine::updateSprite_locationNum2() { _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 @@ void TuckerEngine::updateSprite_locationNum3_1(int i) { } } else { _spritesTable[i].needUpdate = 0; - if (_csDataHandled != 0) { + if (_csDataHandled) { num = 6; if (getRandomNumber() < 32000) { _spritesTable[i].updateDelay = 5; @@ -1402,7 +1402,7 @@ void TuckerEngine::execData3PreUpdate_locationNum22() { _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 @@ void TuckerEngine::execData3PreUpdate_locationNum70() { _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); diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index 489eef666a..b80202f95b 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -960,12 +960,12 @@ void TuckerEngine::loadActionsTable() { 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 @@ void TuckerEngine::loadActionsTable() { --_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 @@ void TuckerEngine::loadActionsTable() { if (table == 2) { _nextAction = 0; _csDataLoaded = false; - _forceRedrawPanelItems = 1; + _forceRedrawPanelItems = true; _panelState = 0; setCursorType(0); - _csDataHandled = 0; + _csDataHandled = false; _skipPanelObjectUnderCursor = 0; _mouseClick = 1; } diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index abaec547e4..db77731fbc 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -181,11 +181,11 @@ void TuckerEngine::restart() { 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 @@ void TuckerEngine::restart() { _actionCharacterNum = 0; _csDataLoaded = false; - _csDataHandled = 0; - _stopActionOnSoundFlag = 0; + _csDataHandled = false; + _stopActionOnSoundFlag = false; _csDataTableFlag2 = 0; _stopActionOnPanelLock = 0; _csDataTableCount = 0; @@ -259,7 +259,7 @@ void TuckerEngine::restart() { _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 @@ void TuckerEngine::updateFlagsForCharPosition() { _flagsTable[_charPositionFlagNum] = _charPositionFlagValue; } else if (_updateCharPositionType == 6 && _charPositionFlagValue == 1) { addObjectToInventory(_charPositionFlagNum); - _forceRedrawPanelItems = 1; + _forceRedrawPanelItems = true; } if (_pendingActionIndex > 0) { _nextAction = _pendingActionIndex; @@ -982,17 +982,17 @@ void TuckerEngine::updateCursor() { 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 @@ void TuckerEngine::saveOrLoad() { 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 @@ void TuckerEngine::saveOrLoad() { } else if (_currentSaveLoadGameState > 0) { loadGameState(_currentSaveLoadGameState); } - _forceRedrawPanelItems = 1; + _forceRedrawPanelItems = true; _panelState = 0; setCursorType(0); return; @@ -1329,14 +1329,14 @@ void TuckerEngine::handleMouseOnPanel() { } 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 @@ void TuckerEngine::switchPanelType() { } _switchPanelFlag = 2; loadPanel(); - _forceRedrawPanelItems = 1; + _forceRedrawPanelItems = true; } else { ++_switchPanelCounter; } @@ -1435,7 +1435,7 @@ void TuckerEngine::updateScreenScrolling() { 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 @@ void TuckerEngine::redrawPanelItems() { 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 @@ void TuckerEngine::updateCharacterAnimation() { 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 @@ void TuckerEngine::updateCharacterAnimation() { _characterFacingDirection = 0; } if (_characterFacingDirection == 0) { - if (_csDataHandled != 0) { + if (_csDataHandled) { _mirroredDrawing = 0; switch (_selectedCharacterDirection) { case 1: @@ -2860,7 +2860,7 @@ void TuckerEngine::updateCharSpeechSound() { _characterSpriteAnimationFrameCounter = 0; } } - if (_charSpeechSoundCounter == 0 && _csDataHandled == 0) { + if (_charSpeechSoundCounter == 0 && !_csDataHandled) { setCursorType(0); return; } @@ -2949,7 +2949,7 @@ int TuckerEngine::parseTableInstruction() { if (_tableInstructionsPtr[1] == 'a') { // 0 _tableInstructionsPtr += 4; _panelState = parseInt(_tableInstructionsPtr, 0, 2); - _forceRedrawPanelItems = 1; + _forceRedrawPanelItems = true; _tableInstructionsPtr += 3; return 0; } @@ -3272,19 +3272,19 @@ int TuckerEngine::parseTableInstruction() { 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 @@ int TuckerEngine::parseTableInstruction() { 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 @@ void TuckerEngine::handleMouseClickOnInventoryObject() { _selectedObjectNum = 0; _actionVerb = 0; _skipPanelObjectUnderCursor = 0; - _forceRedrawPanelItems = 1; + _forceRedrawPanelItems = true; _panelState = 2; setCursorType(1); } diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 577b600952..3fbafcd74f 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -639,11 +639,11 @@ protected: 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 @@ protected: int _actionCharacterNum; bool _csDataLoaded; - int _csDataHandled; - int _stopActionOnSoundFlag; + bool _csDataHandled; + bool _stopActionOnSoundFlag; int _csDataTableFlag2; int _stopActionOnPanelLock; int _csDataTableCount; @@ -749,7 +749,7 @@ protected: int _tableInstructionFlag; int _tableInstructionItemNum1, _tableInstructionItemNum2; int _instructionsActionsTable[6]; - int _validInstructionId; + bool _validInstructionId; SpriteFrame _spriteFramesTable[kSpriteFramesTableSize]; SpriteAnimation _spriteAnimationsTable[200]; -- cgit v1.2.3