Skip to content

Commit

Permalink
TUCKER: make _panelLockedFlag a boolean instead of an integer
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Mar 8, 2014
1 parent 47f9a2d commit 28ade22
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
22 changes: 11 additions & 11 deletions engines/tucker/locations.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
44 changes: 22 additions & 22 deletions engines/tucker/tucker.cpp
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -1178,7 +1178,7 @@ void TuckerEngine::updateCharactersPath() {
return;
}
_locationMaskCounter = 1;
_panelLockedFlag = 0;
_panelLockedFlag = false;
_locationMaskIgnore = 0;
if (_characterPrevFacingDirection <= 0 || _characterPrevFacingDirection >= 5) {
return;
Expand Down Expand Up @@ -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 {
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -2328,7 +2328,7 @@ void TuckerEngine::handleMap() {
_selectedObject._xPos = _selectedObject._locationObjectToWalkX2;
_selectedObject._yPos = _selectedObject._locationObjectToWalkY2;
_handleMapCounter = 1;
_panelLockedFlag = 1;
_panelLockedFlag = true;
}
return;
}
Expand Down Expand Up @@ -2361,7 +2361,7 @@ void TuckerEngine::handleMap() {
} else {
_selectedObject._xPos = _selectedObject._locationObjectToX2;
_selectedObject._yPos = _selectedObject._locationObjectToY2;
_panelLockedFlag = 1;
_panelLockedFlag = true;
}
_scrollOffset = 0;
_handleMapCounter = 0;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -3409,7 +3409,7 @@ void TuckerEngine::setSelectedObjectKey() {
if (_mousePosY > 139 && _nextAction == 0) {
return;
}
_panelLockedFlag = 1;
_panelLockedFlag = true;
_locationMaskCounter = 0;
_actionRequiresTwoObjects = false;
_selectedObject._yPos = 0;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion engines/tucker/tucker.h
Expand Up @@ -685,7 +685,7 @@ class TuckerEngine: public Engine {
int _switchPanelCounter;
int _conversationOptionsCount;
bool _fadedPanel;
int _panelLockedFlag;
bool _panelLockedFlag;
int _conversationOptionLinesCount;
int _inventoryItemsState[50];
int _inventoryObjectsList[40];
Expand Down

0 comments on commit 28ade22

Please sign in to comment.