aboutsummaryrefslogtreecommitdiff
path: root/engines/tucker
diff options
context:
space:
mode:
authorStrangerke2014-03-09 00:12:34 +0100
committerStrangerke2014-03-09 00:12:34 +0100
commit28ade2239a1da56327677744dd744630ab02b61b (patch)
tree56fc6113e40140b9b3c8ef35cbe4dcdd376088fa /engines/tucker
parent47f9a2dd10f8a724060ac720f47f2c18729805f8 (diff)
downloadscummvm-rg350-28ade2239a1da56327677744dd744630ab02b61b.tar.gz
scummvm-rg350-28ade2239a1da56327677744dd744630ab02b61b.tar.bz2
scummvm-rg350-28ade2239a1da56327677744dd744630ab02b61b.zip
TUCKER: make _panelLockedFlag a boolean instead of an integer
Diffstat (limited to 'engines/tucker')
-rw-r--r--engines/tucker/locations.cpp22
-rw-r--r--engines/tucker/tucker.cpp44
-rw-r--r--engines/tucker/tucker.h2
3 files changed, 34 insertions, 34 deletions
diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp
index 21628809b0..749a923215 100644
--- a/engines/tucker/locations.cpp
+++ b/engines/tucker/locations.cpp
@@ -1656,7 +1656,7 @@ void TuckerEngine::execData3PreUpdate_locationNum26() {
stopSound(6);
}
}
- if (_panelLockedFlag == 0) {
+ if (!_panelLockedFlag) {
if (_xPosCurrent > 207 && _xPosCurrent < 256) {
_objectKeysLocationTable[26] = 0;
_objectKeysPosXTable[26] = 260;
@@ -1746,7 +1746,7 @@ void TuckerEngine::updateSprite_locationNum28_2(int i) {
void TuckerEngine::execData3PreUpdate_locationNum28() {
if (_flagsTable[86] == 0 && _xPosCurrent > 265 && _nextAction == 0) {
- _panelLockedFlag = 0;
+ _panelLockedFlag = false;
_nextAction = 21;
_csDataLoaded = 0;
_pendingActionDelay = 0;
@@ -2040,8 +2040,8 @@ void TuckerEngine::execData3PreUpdate_locationNum41() {
}
}
}
- if (_panelLockedFlag == 1 && _yPosCurrent > 130 && _selectedObject._yPos > 135 && _nextAction == 0 && _flagsTable[223] == 0) {
- _panelLockedFlag = 0;
+ if (_panelLockedFlag && _yPosCurrent > 130 && _selectedObject._yPos > 135 && _nextAction == 0 && _flagsTable[223] == 0) {
+ _panelLockedFlag = false;
_csDataLoaded = false;
_nextLocationNum = 0;
_selectedObject._locationObjectLocationNum = 0;
@@ -2145,8 +2145,8 @@ void TuckerEngine::updateSprite_locationNum43_6(int i) {
}
void TuckerEngine::execData3PreUpdate_locationNum43() {
- if (_panelLockedFlag == 1 && _xPosCurrent > 67 && _selectedObject._xPos > 68 && _locationMaskType == 0) {
- _panelLockedFlag = 0;
+ if (_panelLockedFlag && _xPosCurrent > 67 && _selectedObject._xPos > 68 && _locationMaskType == 0) {
+ _panelLockedFlag = false;
_csDataLoaded = 0;
_nextAction = 5;
}
@@ -2301,7 +2301,7 @@ void TuckerEngine::updateSprite_locationNum51(int i) {
void TuckerEngine::execData3PreUpdate_locationNum52() {
- if (_selectedObject._xPos > 108 && _panelLockedFlag > 0 && _nextAction == 0 && _locationMaskType == 0) {
+ if (_selectedObject._xPos > 108 && _panelLockedFlag && _nextAction == 0 && _locationMaskType == 0) {
_nextAction = 1;
_csDataLoaded = 0;
}
@@ -2344,7 +2344,7 @@ void TuckerEngine::updateSprite_locationNum53_1(int i) {
void TuckerEngine::execData3PreUpdate_locationNum53() {
if (_flagsTable[192] == 0 && _xPosCurrent < 200 && _nextAction == 0) {
- _panelLockedFlag = 0;
+ _panelLockedFlag = false;
_nextAction = 14;
_csDataLoaded = 0;
_pendingActionDelay = 0;
@@ -2374,7 +2374,7 @@ void TuckerEngine::updateSprite_locationNum54(int i) {
_flagsTable[141] = 0;
_flagsTable[224] = 1;
_spritesTable[i]._counter = 0;
- if (_panelLockedFlag == 0 && _xPosCurrent > 130 && _inventoryItemsState[17] == 0) {
+ if (!_panelLockedFlag && _xPosCurrent > 130 && _inventoryItemsState[17] == 0) {
_nextAction = 18;
_csDataLoaded = false;
}
@@ -2477,7 +2477,7 @@ void TuckerEngine::execData3PreUpdate_locationNum58() {
// workaround original game glitch #2872348: do not change position on location change
if (_nextLocationNum == 0 && _flagsTable[190] < 3 && _xPosCurrent > 310) {
_xPosCurrent = 310;
- _panelLockedFlag = 0;
+ _panelLockedFlag = false;
}
if (_flagsTable[190] > 0 && _locationSoundsTable[0]._volume > 0) {
_locationSoundsTable[0]._volume = 0;
@@ -2889,7 +2889,7 @@ void TuckerEngine::execData3PreUpdate_locationNum66() {
// FIXME: shouldn't be executed after using the map
_flagsTable[137] = 0;
if (_xPosCurrent > 583 && _flagsTable[191] == 0 && _nextAction == 0 && _locationMaskType == 0) {
- _panelLockedFlag = 0;
+ _panelLockedFlag = false;
_csDataLoaded = 0;
_nextLocationNum = 0;
_selectedObject._locationObjectLocationNum = 0;
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index ad66f30ad9..5b8ea579c5 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -191,7 +191,7 @@ void TuckerEngine::resetVariables() {
_switchPanelCounter = 0;
_conversationOptionsCount = 0;
_fadedPanel = false;
- _panelLockedFlag = 0;
+ _panelLockedFlag = false;
_conversationOptionLinesCount = 0;
memset(_inventoryItemsState, 0, sizeof(_inventoryItemsState));
memset(_inventoryObjectsList, 0, sizeof(_inventoryObjectsList));
@@ -442,7 +442,7 @@ void TuckerEngine::mainLoop() {
updateGameHints();
}
if (_panelState == 0) {
- if (_panelLockedFlag == 1 || _pendingActionDelay > 0) {
+ if (_panelLockedFlag || _pendingActionDelay > 0) {
if (!_fadedPanel) {
updateItemsGfxColors(0x60, 0x80);
_fadedPanel = true;
@@ -698,7 +698,7 @@ void TuckerEngine::setupNewLocation() {
_backgroundSpriteCurrentAnimation = -1;
_backgroundSpriteCurrentFrame = 0;
}
- if (_panelLockedFlag == 0 || (_backgroundSpriteCurrentAnimation > 0 && _locationNum != 25)) {
+ if (!_panelLockedFlag || (_backgroundSpriteCurrentAnimation > 0 && _locationNum != 25)) {
_locationMaskType = 0;
} else {
_locationMaskType = 3;
@@ -982,7 +982,7 @@ void TuckerEngine::setBlackPalette() {
void TuckerEngine::updateCursor() {
setCursorNum(0);
- if (_backgroundSpriteCurrentAnimation == -1 && _panelLockedFlag == 0 && _selectedObject._locationObjectLocationNum > 0) {
+ if (_backgroundSpriteCurrentAnimation == -1 && !_panelLockedFlag && _selectedObject._locationObjectLocationNum > 0) {
_selectedObject._locationObjectLocationNum = 0;
}
if (_locationMaskType > 0 || _selectedObject._locationObjectLocationNum > 0 || _pendingActionDelay > 0) {
@@ -1107,13 +1107,13 @@ void TuckerEngine::playSounds() {
}
void TuckerEngine::updateCharactersPath() {
- if (_panelLockedFlag == 0) {
+ if (!_panelLockedFlag) {
return;
}
if (_backgroundSpriteCurrentAnimation != -1 && _locationNum != 25) {
if (_xPosCurrent == _selectedObject._xPos && _yPosCurrent == _selectedObject._yPos) {
_locationMaskCounter = 1;
- _panelLockedFlag = 0;
+ _panelLockedFlag = false;
}
return;
}
@@ -1157,7 +1157,7 @@ void TuckerEngine::updateCharactersPath() {
_selectedObject._xPos = _selectedObject._xDefaultPos;
_selectedObject._yPos = _selectedObject._yDefaultPos;
} else {
- _panelLockedFlag = 0;
+ _panelLockedFlag = false;
_characterFacingDirection = 0;
if (_xPosCurrent == _selectedObject._xPos && _yPosCurrent == _selectedObject._yPos) {
_locationMaskCounter = 1;
@@ -1178,7 +1178,7 @@ void TuckerEngine::updateCharactersPath() {
return;
}
_locationMaskCounter = 1;
- _panelLockedFlag = 0;
+ _panelLockedFlag = false;
_locationMaskIgnore = 0;
if (_characterPrevFacingDirection <= 0 || _characterPrevFacingDirection >= 5) {
return;
@@ -2056,7 +2056,7 @@ void TuckerEngine::updateCharacterAnimation() {
assert(_backgroundSpriteCurrentAnimation >= 0 && _backgroundSpriteCurrentAnimation < kSprA02TableSize);
_backgroundSpriteDataPtr = _sprA02Table[_backgroundSpriteCurrentAnimation];
_backgroundSpriteLastFrame = READ_LE_UINT16(_backgroundSpriteDataPtr);
- } else if (_locationNum == 25 && _panelLockedFlag != 1 && (_backgroundSpriteCurrentAnimation == 3 || _backgroundSpriteCurrentAnimation == 6)) {
+ } else if (_locationNum == 25 && !_panelLockedFlag && (_backgroundSpriteCurrentAnimation == 3 || _backgroundSpriteCurrentAnimation == 6)) {
_backgroundSpriteCurrentFrame = 0;
_backgroundSpriteCurrentAnimation = -1;
} else {
@@ -2072,8 +2072,8 @@ void TuckerEngine::updateCharacterAnimation() {
}
}
if (_locationNum == 24 && _flagsTable[103] == 0) {
- if (_panelLockedFlag == 1) {
- _panelLockedFlag = 0;
+ if (_panelLockedFlag) {
+ _panelLockedFlag = false;
_selectedObject._locationObjectLocationNum = 0;
if (_actionVerb != 2) {
_speechSoundNum = 2236;
@@ -2112,7 +2112,7 @@ void TuckerEngine::updateCharacterAnimation() {
if (_characterBackFrontFacing == 0) {
if (_characterBackFrontFacing != _characterPrevBackFrontFacing) {
_backgroundSpriteCurrentAnimation = 10;
- } else if (_panelLockedFlag == 1) {
+ } else if (_panelLockedFlag) {
_backgroundSpriteCurrentAnimation = 3;
} else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 99) {
_backgroundSpriteCurrentAnimation = 8;
@@ -2122,7 +2122,7 @@ void TuckerEngine::updateCharacterAnimation() {
} else {
if (_characterBackFrontFacing != _characterPrevBackFrontFacing) {
_backgroundSpriteCurrentAnimation = 2;
- } else if (_panelLockedFlag == 1) {
+ } else if (_panelLockedFlag) {
_backgroundSpriteCurrentAnimation = 6;
} else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 99) {
_backgroundSpriteCurrentAnimation = 9;
@@ -2147,7 +2147,7 @@ void TuckerEngine::updateCharacterAnimation() {
_backgroundSpriteLastFrame = READ_LE_UINT16(_backgroundSpriteDataPtr);
}
int frame = _spriteAnimationFramesTable[_spriteAnimationFrameIndex];
- if (_panelLockedFlag == 0 && _characterFacingDirection < 5 && _selectedObject._locationObjectLocationNum == 0) {
+ if (!_panelLockedFlag && _characterFacingDirection < 5 && _selectedObject._locationObjectLocationNum == 0) {
_characterFacingDirection = 0;
}
if (_charSpeechSoundCounter > 0 && _characterFacingDirection != 6 && _actionCharacterNum == 99) {
@@ -2291,10 +2291,10 @@ void TuckerEngine::handleMap() {
if (_handleMapCounter > 19) {
_handleMapCounter = 0;
_locationMaskCounter = 1;
- _panelLockedFlag = 0;
+ _panelLockedFlag = false;
}
}
- if (_panelLockedFlag == 0 && (_backgroundSpriteCurrentAnimation == -1 || _locationNum == 25) && _locationMaskType == 3) {
+ if (!_panelLockedFlag && (_backgroundSpriteCurrentAnimation == -1 || _locationNum == 25) && _locationMaskType == 3) {
setCursorType(0);
if (_locationMaskCounter == 1) {
_characterFacingDirection = 0;
@@ -2328,7 +2328,7 @@ void TuckerEngine::handleMap() {
_selectedObject._xPos = _selectedObject._locationObjectToWalkX2;
_selectedObject._yPos = _selectedObject._locationObjectToWalkY2;
_handleMapCounter = 1;
- _panelLockedFlag = 1;
+ _panelLockedFlag = true;
}
return;
}
@@ -2361,7 +2361,7 @@ void TuckerEngine::handleMap() {
} else {
_selectedObject._xPos = _selectedObject._locationObjectToX2;
_selectedObject._yPos = _selectedObject._locationObjectToY2;
- _panelLockedFlag = 1;
+ _panelLockedFlag = true;
}
_scrollOffset = 0;
_handleMapCounter = 0;
@@ -3166,7 +3166,7 @@ int TuckerEngine::executeTableInstruction() {
_selectedObject._xPos = readTableInstructionParam(3);
_selectedObject._yPos = readTableInstructionParam(3);
_locationMaskIgnore = 1;
- _panelLockedFlag = 1;
+ _panelLockedFlag = true;
return 0;
case kCode_bux:
_xPosCurrent = readTableInstructionParam(3);
@@ -3409,7 +3409,7 @@ void TuckerEngine::setSelectedObjectKey() {
if (_mousePosY > 139 && _nextAction == 0) {
return;
}
- _panelLockedFlag = 1;
+ _panelLockedFlag = true;
_locationMaskCounter = 0;
_actionRequiresTwoObjects = false;
_selectedObject._yPos = 0;
@@ -3663,11 +3663,11 @@ void TuckerEngine::setActionForInventoryObject() {
_currentActionObj2Num = _actionObj2Num;
_currentInfoString2SourceType = _actionObj2Type;
if (_actionVerb == 1 && _selectedObjectType == 3) {
- if (_panelLockedFlag == 1) {
+ if (_panelLockedFlag) {
if (_locationMaskType != 0) {
return;
}
- _panelLockedFlag = 0;
+ _panelLockedFlag = false;
}
if (handleSpecialObjectSelectionSequence() == 1) {
return;
diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h
index 33fbab2f01..5a6976b2fd 100644
--- a/engines/tucker/tucker.h
+++ b/engines/tucker/tucker.h
@@ -685,7 +685,7 @@ protected:
int _switchPanelCounter;
int _conversationOptionsCount;
bool _fadedPanel;
- int _panelLockedFlag;
+ bool _panelLockedFlag;
int _conversationOptionLinesCount;
int _inventoryItemsState[50];
int _inventoryObjectsList[40];