diff options
author | Strangerke | 2014-03-07 19:20:41 +0100 |
---|---|---|
committer | Strangerke | 2014-03-07 19:21:13 +0100 |
commit | 9ce5f1c90cf885a35758a804f5e6795058166211 (patch) | |
tree | 1e2d92d417ca77a5be1c8aad18a93bdedd3f81eb | |
parent | d0b9a52f64d6a933e3ea21960e2e98e4ae4d655c (diff) | |
download | scummvm-rg350-9ce5f1c90cf885a35758a804f5e6795058166211.tar.gz scummvm-rg350-9ce5f1c90cf885a35758a804f5e6795058166211.tar.bz2 scummvm-rg350-9ce5f1c90cf885a35758a804f5e6795058166211.zip |
TUCKER: Use a boolean for drawFlag instead of an integer
-rw-r--r-- | engines/tucker/resource.cpp | 2 | ||||
-rw-r--r-- | engines/tucker/tucker.cpp | 16 | ||||
-rw-r--r-- | engines/tucker/tucker.h | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index 00ce00b30b..af69651b9f 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -651,7 +651,7 @@ void TuckerEngine::loadData3() { d->_selectable = t.getNextInteger(); d->_standX = t.getNextInteger(); d->_standY = t.getNextInteger(); - d->_drawFlag = 0; + d->_drawFlag = false; } } } diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index 4d4663e766..130c41724d 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -1201,11 +1201,11 @@ void TuckerEngine::updateData3DrawFlag() { for (int i = 0; i < _locationAnimationsCount; ++i) { LocationAnimation *a = &_locationAnimationsTable[i]; if (a->_flagNum > 0 && a->_flagValue != _flagsTable[a->_flagNum]) { - a->_drawFlag = 0; + a->_drawFlag = false; } else if (a->_getFlag == 0) { - a->_drawFlag = 1; + a->_drawFlag = true; } else { - a->_drawFlag = (_inventoryItemsState[a->_inventoryNum] == 0) ? 1 : 0; + a->_drawFlag = (_inventoryItemsState[a->_inventoryNum] == 0); } } } @@ -1214,7 +1214,7 @@ void TuckerEngine::updateData3() { updateData3DrawFlag(); for (int i = 0; i < _locationAnimationsCount; ++i) { LocationAnimation *a = &_locationAnimationsTable[i]; - if (a->_animLastCounter != 0 && a->_drawFlag != 0) { + if (a->_animLastCounter != 0 && a->_drawFlag) { if (a->_animLastCounter == a->_animCurrentCounter) { a->_animCurrentCounter = a->_animInitCounter; } else { @@ -1224,7 +1224,7 @@ void TuckerEngine::updateData3() { if (_staticData3Table[index] == 998) { _flagsTable[_staticData3Table[index + 1]] = _staticData3Table[index + 2]; a->_animCurrentCounter = a->_animInitCounter; - a->_drawFlag = 0; + a->_drawFlag = false; } if (_locationNum == 24 && i == 0) { // workaround bug #2872385: update fish animation sequence for correct @@ -1532,7 +1532,7 @@ void TuckerEngine::updateSoundsTypes3_4() { void TuckerEngine::drawData3() { for (int i = 0; i < _locationAnimationsCount; ++i) { - if (_locationAnimationsTable[i]._drawFlag != 0) { + if (_locationAnimationsTable[i]._drawFlag) { int num = _locationAnimationsTable[i]._graphicNum; const Data *d = &_dataTable[num]; Graphics::decodeRLE(_locationBackgroundGfxBuf + d->_yDest * 640 + d->_xDest, _data3GfxBuf + d->_sourceOffset, d->_xSize, d->_ySize); @@ -3614,9 +3614,9 @@ int TuckerEngine::setLocationAnimationUnderCursor() { return -1; } for (int i = _locationAnimationsCount - 1; i >= 0; --i) { - if (_locationAnimationsTable[i]._drawFlag == 0) { + if (!_locationAnimationsTable[i]._drawFlag) continue; - } + int num = _locationAnimationsTable[i]._graphicNum; if (_mousePosX + _scrollOffset + 1 <= _dataTable[num]._xDest) { continue; diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 6618b0875a..dc2e785bce 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -139,7 +139,7 @@ struct LocationAnimation { int _selectable; int _standX; int _standY; - int _drawFlag; + bool _drawFlag; }; struct LocationObject { |