[Scummvm-cvs-logs] SF.net SVN: scummvm:[40646] scummvm/trunk/engines/tucker

cyx at users.sourceforge.net cyx at users.sourceforge.net
Sun May 17 15:25:11 CEST 2009


Revision: 40646
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40646&view=rev
Author:   cyx
Date:     2009-05-17 13:25:08 +0000 (Sun, 17 May 2009)

Log Message:
-----------
cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/tucker/resource.cpp
    scummvm/trunk/engines/tucker/tucker.cpp
    scummvm/trunk/engines/tucker/tucker.h

Modified: scummvm/trunk/engines/tucker/resource.cpp
===================================================================
--- scummvm/trunk/engines/tucker/resource.cpp	2009-05-17 13:22:33 UTC (rev 40645)
+++ scummvm/trunk/engines/tucker/resource.cpp	2009-05-17 13:25:08 UTC (rev 40646)
@@ -504,27 +504,17 @@
 }
 
 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 @@
 			d->yDest = t.getNextInteger();
 			d->index = count;
 		}
-		if (flag < 2) {
-			++objNum;
-			++count;
-		}
+		++objNum;
+		++count;
 	}
 	_dataCount = maxCount;
 	int offset = 0;
@@ -967,15 +955,15 @@
 			_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 @@
 					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) {

Modified: scummvm/trunk/engines/tucker/tucker.cpp
===================================================================
--- scummvm/trunk/engines/tucker/tucker.cpp	2009-05-17 13:22:33 UTC (rev 40645)
+++ scummvm/trunk/engines/tucker/tucker.cpp	2009-05-17 13:25:08 UTC (rev 40646)
@@ -242,8 +242,8 @@
 	_csDataLoaded = false;
 	_csDataHandled = false;
 	_stopActionOnSoundFlag = false;
-	_csDataTableFlag2 = 0;
-	_stopActionOnPanelLock = 0;
+	_stopActionOnSpeechFlag = false;
+	_stopActionOnPanelLock = false;
 	_csDataTableCount = 0;
 	_stopActionCounter = 0;
 	_actionTextColor = 0;
@@ -3270,17 +3270,17 @@
 		_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;

Modified: scummvm/trunk/engines/tucker/tucker.h
===================================================================
--- scummvm/trunk/engines/tucker/tucker.h	2009-05-17 13:22:33 UTC (rev 40645)
+++ scummvm/trunk/engines/tucker/tucker.h	2009-05-17 13:25:08 UTC (rev 40646)
@@ -736,8 +736,8 @@
 	bool _csDataLoaded;
 	bool _csDataHandled;
 	bool _stopActionOnSoundFlag;
-	int _csDataTableFlag2;
-	int _stopActionOnPanelLock;
+	bool _stopActionOnSpeechFlag;
+	bool _stopActionOnPanelLock;
 	int _csDataTableCount;
 	int _stopActionCounter;
 	int _actionTextColor;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list