From 8ea8966c02d6d62bac7af6e3b48e6acc7857353d Mon Sep 17 00:00:00 2001 From: Gregory Montoir <cyx@scummvm.org> Date: Sun, 18 Jan 2009 03:22:33 +0000 Subject: [PATCH] cleanup svn-id: r35891 --- engines/tucker/resource.cpp | 10 +--------- engines/tucker/sequences.cpp | 34 ++++++++++++---------------------- engines/tucker/tucker.h | 1 + 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index 44da244abef..3521a4690f0 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -269,14 +269,7 @@ void TuckerEngine::loadImage(const char *fname, uint8 *dst, int type) { } if (type != 0) { f.seek(-768, SEEK_END); - for (int i = 0; i < 256; ++i) { - if (type == 2) { - isSpeechSoundPlaying(); - } - for (int c = 0; c < 3; ++c) { - _currentPalette[3 * i + c] = f.readByte(); - } - } + f.read(_currentPalette, 768); setBlackPalette(); } } @@ -487,7 +480,6 @@ void TuckerEngine::loadObj() { handleNewPartSequence(); _currentPartNum = _partNum; - char filename[40]; sprintf(filename, "objtxt%d.c", _partNum); free(_objTxtBuf); diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index 173d4b8450d..e946d586fbd 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -494,7 +494,7 @@ int TuckerEngine::handleSpecialObjectSelectionSequence() { } AnimationSequencePlayer::AnimationSequencePlayer(OSystem *system, Audio::Mixer *mixer, Common::EventManager *event, int num) - : _system(system), _mixer(mixer), _event(event), _seqNum(num), _changeToNextSequence(false) { + : _system(system), _mixer(mixer), _event(event), _seqNum(num) { memset(_animationPalette, 0, sizeof(_animationPalette)); memset(_paletteBuffer, 0, sizeof(_paletteBuffer)); _soundSeqDataOffset = 0; @@ -509,9 +509,6 @@ AnimationSequencePlayer::AnimationSequencePlayer(OSystem *system, Audio::Mixer * _updateScreenWidth = 0; _updateScreenPicture = 0; _updateScreenOffset = 0; - _frameCounter = 0; - _frameTime = 1; - _lastFrameTime = 0; _picBufPtr = _pic2BufPtr = 0; } @@ -522,18 +519,18 @@ AnimationSequencePlayer::~AnimationSequencePlayer() { void AnimationSequencePlayer::mainLoop() { static const SequenceUpdateFunc _demoSeqUpdateFuncs[] = { - { 13, &AnimationSequencePlayer::loadIntroSeq13_14, &AnimationSequencePlayer::playIntroSeq13_14 }, - { 15, &AnimationSequencePlayer::loadIntroSeq15_16, &AnimationSequencePlayer::playIntroSeq15_16 }, - { 27, &AnimationSequencePlayer::loadIntroSeq27_28, &AnimationSequencePlayer::playIntroSeq27_28 }, - { 1, 0, 0 } + { 13, 2, &AnimationSequencePlayer::loadIntroSeq13_14, &AnimationSequencePlayer::playIntroSeq13_14 }, + { 15, 2, &AnimationSequencePlayer::loadIntroSeq15_16, &AnimationSequencePlayer::playIntroSeq15_16 }, + { 27, 2, &AnimationSequencePlayer::loadIntroSeq27_28, &AnimationSequencePlayer::playIntroSeq27_28 }, + { 1, 0, 0, 0 } }; static const SequenceUpdateFunc _gameSeqUpdateFuncs[] = { - { 17, &AnimationSequencePlayer::loadIntroSeq17_18, &AnimationSequencePlayer::playIntroSeq17_18 }, - { 19, &AnimationSequencePlayer::loadIntroSeq19_20, &AnimationSequencePlayer::playIntroSeq19_20 }, - { 3, &AnimationSequencePlayer::loadIntroSeq3_4, &AnimationSequencePlayer::playIntroSeq3_4 }, - { 9, &AnimationSequencePlayer::loadIntroSeq9_10, &AnimationSequencePlayer::playIntroSeq9_10 }, - { 21, &AnimationSequencePlayer::loadIntroSeq21_22, &AnimationSequencePlayer::playIntroSeq21_22 }, - { 1, 0, 0 } + { 17, 1, &AnimationSequencePlayer::loadIntroSeq17_18, &AnimationSequencePlayer::playIntroSeq17_18 }, + { 19, 1, &AnimationSequencePlayer::loadIntroSeq19_20, &AnimationSequencePlayer::playIntroSeq19_20 }, + { 3, 2, &AnimationSequencePlayer::loadIntroSeq3_4, &AnimationSequencePlayer::playIntroSeq3_4 }, + { 9, 2, &AnimationSequencePlayer::loadIntroSeq9_10, &AnimationSequencePlayer::playIntroSeq9_10 }, + { 21, 2, &AnimationSequencePlayer::loadIntroSeq21_22, &AnimationSequencePlayer::playIntroSeq21_22 }, + { 1, 0, 0, 0 } }; switch (_seqNum) { case kFirstAnimationSequenceDemo: @@ -550,6 +547,7 @@ void AnimationSequencePlayer::mainLoop() { _changeToNextSequence = false; _frameCounter = 0; _lastFrameTime = _system->getMillis(); + _frameTime = this->_updateFunc[_updateFuncIndex].frameTime; (this->*(_updateFunc[_updateFuncIndex].load))(); if (_seqNum == 1) { break; @@ -924,7 +922,6 @@ void AnimationSequencePlayer::decodeNextAnimationFrame(int index) { void AnimationSequencePlayer::loadIntroSeq17_18() { loadSounds(9, 0); openAnimation(0, "graphics/merit.flc"); - _frameTime = 1; } void AnimationSequencePlayer::playIntroSeq17_18() { @@ -940,7 +937,6 @@ void AnimationSequencePlayer::loadIntroSeq19_20() { loadSounds(10, 1); openAnimation(0, "graphics/budttle2.flc"); openAnimation(1, "graphics/machine.flc"); - _frameTime = 1; } void AnimationSequencePlayer::playIntroSeq19_20() { @@ -1008,7 +1004,6 @@ void AnimationSequencePlayer::loadIntroSeq3_4() { _system->copyRectToScreen(_offscreenBuffer, 320, 0, 0, kScreenWidth, kScreenHeight); fadeInPalette(); _updateScreenPicture = false; - _frameTime = 2; } void AnimationSequencePlayer::playIntroSeq3_4() { @@ -1071,7 +1066,6 @@ void AnimationSequencePlayer::loadIntroSeq9_10() { _picBufPtr = loadPicture("graphics/lab.pic"); openAnimation(0, "graphics/intro2.flc"); _updateScreenWidth = 0; - _frameTime = 2; } void AnimationSequencePlayer::playIntroSeq9_10() { @@ -1098,7 +1092,6 @@ void AnimationSequencePlayer::playIntroSeq9_10() { void AnimationSequencePlayer::loadIntroSeq21_22() { loadSounds(1, 2); openAnimation(0, "graphics/intro3.flc"); - _frameTime = 2; } void AnimationSequencePlayer::playIntroSeq21_22() { @@ -1112,7 +1105,6 @@ void AnimationSequencePlayer::playIntroSeq21_22() { void AnimationSequencePlayer::loadIntroSeq13_14() { loadSounds(3, 1); openAnimation(0, "graphics/allseg02.flc"); - _frameTime = 2; } void AnimationSequencePlayer::playIntroSeq13_14() { @@ -1126,7 +1118,6 @@ void AnimationSequencePlayer::playIntroSeq13_14() { void AnimationSequencePlayer::loadIntroSeq15_16() { loadSounds(3, 2); openAnimation(0, "graphics/allseg03.flc"); - _frameTime = 2; } void AnimationSequencePlayer::playIntroSeq15_16() { @@ -1140,7 +1131,6 @@ void AnimationSequencePlayer::playIntroSeq15_16() { void AnimationSequencePlayer::loadIntroSeq27_28() { loadSounds(3, 3); openAnimation(0, "graphics/allseg04.flc"); - _frameTime = 2; } void AnimationSequencePlayer::playIntroSeq27_28() { diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index b443043f88d..0050961827f 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -857,6 +857,7 @@ public: struct SequenceUpdateFunc { int num; + int frameTime; void (AnimationSequencePlayer::*load)(); void (AnimationSequencePlayer::*play)(); };