TUCKER: cleanup, removed unused variables

This commit is contained in:
Gregory Montoir 2011-02-19 15:52:03 +01:00
parent c53abb0aba
commit 855b676cd4
4 changed files with 9 additions and 13 deletions

View File

@ -383,12 +383,14 @@ void TuckerEngine::loadPanel() {
}
void TuckerEngine::loadBudSpr(int startOffset) {
int endOffset = loadCTable01(0, startOffset);
int framesCount[20];
memset(framesCount, 0, sizeof(framesCount));
int endOffset = loadCTable01(0, startOffset, framesCount);
loadCTable02(0);
int frame = 0;
int spriteOffset = 0;
for (int i = startOffset; i < endOffset; ++i) {
if (_ctable01Table_sprite[frame] == i) {
if (framesCount[frame] == i) {
char filename[40];
switch (_flagsTable[137]) {
case 0:
@ -414,7 +416,7 @@ void TuckerEngine::loadBudSpr(int startOffset) {
}
}
int TuckerEngine::loadCTable01(int index, int firstSpriteNum) {
int TuckerEngine::loadCTable01(int index, int firstSpriteNum, int *framesCount) {
loadFile("ctable01.c", _loadTempBuf);
DataTokenizer t(_loadTempBuf, _fileLoadSize);
int lastSpriteNum = firstSpriteNum;
@ -425,7 +427,7 @@ int TuckerEngine::loadCTable01(int index, int firstSpriteNum) {
if (x < 0) {
break;
} else if (x == 999) {
_ctable01Table_sprite[count] = lastSpriteNum;
framesCount[count] = lastSpriteNum;
++count;
continue;
}
@ -444,7 +446,7 @@ int TuckerEngine::loadCTable01(int index, int firstSpriteNum) {
}
}
}
_ctable01Table_sprite[count] = -1;
framesCount[count] = -1;
return lastSpriteNum;
}

View File

@ -110,7 +110,6 @@ void TuckerEngine::handleCreditsSequence() {
}
redrawScreen(0);
waitForTimer(3);
_timerCounter1 = 0;
counter4 = _timerCounter2 / 3;
if (counter4 == _creditsSequenceTimecounts[num]) {
_fadePaletteCounter = 0;

View File

@ -127,7 +127,7 @@ void TuckerEngine::restart() {
_syncCounter = 0;
_lastFrameTime = _system->getMillis();
_mainLoopCounter1 = _mainLoopCounter2 = 0;
_timerCounter1 = _timerCounter2 = 0;
_timerCounter2 = 0;
_partNum = _currentPartNum = 0;
_locationNum = 0;
_nextLocationNum = ConfMan.getInt("boot_param");
@ -273,7 +273,6 @@ void TuckerEngine::restart() {
_xPosCurrent = 160;
_characterSpeechDataPtr = 0;
_ptTextOffset = 0;
memset(_ctable01Table_sprite, 0, sizeof(_ctable01Table_sprite));
memset(_characterAnimationsTable, 0, sizeof(_characterAnimationsTable));
memset(_characterStateTable, 0, sizeof(_characterStateTable));
_backgroundSprOffset = 0;
@ -589,13 +588,11 @@ void TuckerEngine::mainLoop() {
void TuckerEngine::waitForTimer(int ticksCount) {
uint32 end = _lastFrameTime + ticksCount * 1000 / 46;
do {
++_timerCounter1;
parseEvents();
_system->delayMillis(10);
_lastFrameTime = _system->getMillis();
} while (!_fastMode && _lastFrameTime < end);
_timerCounter2 += ticksCount;
_timerCounter1 = 0;
}
void TuckerEngine::parseEvents() {

View File

@ -593,7 +593,7 @@ protected:
void loadCharSizeDta();
void loadPanel();
void loadBudSpr(int startOffset);
int loadCTable01(int index, int firstSpriteNum);
int loadCTable01(int index, int firstSpriteNum, int *framesCount);
void loadCTable02(int fl);
void loadLoc();
void loadObj();
@ -624,7 +624,6 @@ protected:
uint32 _lastFrameTime;
int _mainLoopCounter1;
int _mainLoopCounter2;
int _timerCounter1;
int _timerCounter2;
int _flagsTable[kFlagsTableSize];
int _partNum;
@ -803,7 +802,6 @@ protected:
int _yPosCurrent;
const uint8 *_characterSpeechDataPtr;
int _ptTextOffset;
int _ctable01Table_sprite[20];
int _characterAnimationsTable[200];
int _characterStateTable[200];
int _backgroundSprOffset;