aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorGregory Montoir2009-05-17 13:25:08 +0000
committerGregory Montoir2009-05-17 13:25:08 +0000
commit0ceb92871b404ff598fdb10a0612c9524387fe08 (patch)
tree8a8b20f4d2862f0b70565abdce979c14aad77897 /engines
parent883e567f5e99e99b73db4dde793eaf37c86e6718 (diff)
downloadscummvm-rg350-0ceb92871b404ff598fdb10a0612c9524387fe08.tar.gz
scummvm-rg350-0ceb92871b404ff598fdb10a0612c9524387fe08.tar.bz2
scummvm-rg350-0ceb92871b404ff598fdb10a0612c9524387fe08.zip
cleanup
svn-id: r40646
Diffstat (limited to 'engines')
-rw-r--r--engines/tucker/resource.cpp34
-rw-r--r--engines/tucker/tucker.cpp10
-rw-r--r--engines/tucker/tucker.h4
3 files changed, 17 insertions, 31 deletions
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp
index 3c6a9aaac2..1195fe4894 100644
--- a/engines/tucker/resource.cpp
+++ b/engines/tucker/resource.cpp
@@ -504,27 +504,17 @@ void TuckerEngine::loadObj() {
}
void TuckerEngine::loadData() {
- int flag = 0;
int objNum = _partNum * 10;
loadFile("data.c", _loadTempBuf);
DataTokenizer t(_loadTempBuf, _fileLoadSize);
_dataCount = 0;
int count = 0;
int maxCount = 0;
- while (flag < 2) {
- flag = 0;
- if (!t.findIndex(objNum)) {
- flag = 2;
- }
- while (flag == 0) {
- if (!t.findNextToken(kDataTokenDw)) {
- flag = 1;
- continue;
- }
+ while (t.findIndex(objNum)) {
+ while (t.findNextToken(kDataTokenDw)) {
_dataCount = t.getNextInteger();
if (_dataCount < 0) {
- flag = 1;
- continue;
+ break;
}
if (_dataCount > maxCount) {
maxCount = _dataCount;
@@ -539,10 +529,8 @@ void TuckerEngine::loadData() {
d->yDest = t.getNextInteger();
d->index = count;
}
- if (flag < 2) {
- ++objNum;
- ++count;
- }
+ ++objNum;
+ ++count;
}
_dataCount = maxCount;
int offset = 0;
@@ -967,15 +955,15 @@ void TuckerEngine::loadActionsTable() {
_csDataHandled = true;
debug(2, "loadActionsTable() _nextAction %d", _nextAction);
}
- if (_csDataTableFlag2 == 1 && _charSpeechSoundCounter > 0) {
+ if (_stopActionOnSpeechFlag && _charSpeechSoundCounter > 0) {
break;
}
- _csDataTableFlag2 = 0;
- if (_stopActionOnPanelLock == 1) {
+ _stopActionOnSpeechFlag = false;
+ if (_stopActionOnPanelLock) {
if (_panelLockedFlag) {
break;
}
- _stopActionOnPanelLock = 0;
+ _stopActionOnPanelLock = false;
}
if (_stopActionCounter > 0) {
--_stopActionCounter;
@@ -993,19 +981,17 @@ void TuckerEngine::loadActionsTable() {
if (_backgroundSpriteCurrentFrame != _backgroundSpriteLastFrame) {
break;
}
- _csDataTableCount = 0;
} else {
if (_spriteAnimationFramesTable[_spriteAnimationFrameIndex] != 999) {
break;
}
- _csDataTableCount = 0;
}
} else {
if (_spritesTable[_csDataTableCount - 1].firstFrame - 1 != _spritesTable[_csDataTableCount - 1].animationFrame) {
break;
}
- _csDataTableCount = 0;
}
+ _csDataTableCount = 0;
}
if (_conversationOptionsCount != 0) {
if (_leftMouseButtonPressed && _nextTableToLoadIndex != -1) {
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index 86caa7e251..1e4878291b 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -242,8 +242,8 @@ void TuckerEngine::restart() {
_csDataLoaded = false;
_csDataHandled = false;
_stopActionOnSoundFlag = false;
- _csDataTableFlag2 = 0;
- _stopActionOnPanelLock = 0;
+ _stopActionOnSpeechFlag = false;
+ _stopActionOnPanelLock = false;
_csDataTableCount = 0;
_stopActionCounter = 0;
_actionTextColor = 0;
@@ -3270,17 +3270,17 @@ int TuckerEngine::executeTableInstruction() {
_characterSpeechDataPtr = _ptTextBuf + getPositionForLine(_ptTextOffset, _ptTextBuf);
return 0;
case kCode_wa_:
- _csDataTableFlag2 = 1;
+ _stopActionOnSpeechFlag = true;
_stopActionCounter = 20;
return 1;
case kCode_wsm:
- _stopActionOnPanelLock = 1;
+ _stopActionOnPanelLock = true;
return 1;
case kCode_wat:
_stopActionCounter = readTableInstructionParam(3);
return 1;
case kCode_was:
- _csDataTableFlag2 = 1;
+ _stopActionOnSpeechFlag = true;
return 1;
case kCode_wfx:
_stopActionOnSoundFlag = true;
diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h
index 651b0b0ab5..b4103fbca4 100644
--- a/engines/tucker/tucker.h
+++ b/engines/tucker/tucker.h
@@ -736,8 +736,8 @@ protected:
bool _csDataLoaded;
bool _csDataHandled;
bool _stopActionOnSoundFlag;
- int _csDataTableFlag2;
- int _stopActionOnPanelLock;
+ bool _stopActionOnSpeechFlag;
+ bool _stopActionOnPanelLock;
int _csDataTableCount;
int _stopActionCounter;
int _actionTextColor;