[Scummvm-cvs-logs] SF.net SVN: scummvm:[35890] scummvm/trunk/engines/tucker
cyx at users.sourceforge.net
cyx at users.sourceforge.net
Sun Jan 18 04:07:20 CET 2009
Revision: 35890
http://scummvm.svn.sourceforge.net/scummvm/?rev=35890&view=rev
Author: cyx
Date: 2009-01-18 03:07:20 +0000 (Sun, 18 Jan 2009)
Log Message:
-----------
get rid of AnimationSequencePlayer::_currentSeqNum
Modified Paths:
--------------
scummvm/trunk/engines/tucker/sequences.cpp
scummvm/trunk/engines/tucker/tucker.h
Modified: scummvm/trunk/engines/tucker/sequences.cpp
===================================================================
--- scummvm/trunk/engines/tucker/sequences.cpp 2009-01-18 02:46:25 UTC (rev 35889)
+++ scummvm/trunk/engines/tucker/sequences.cpp 2009-01-18 03:07:20 UTC (rev 35890)
@@ -494,7 +494,7 @@
}
AnimationSequencePlayer::AnimationSequencePlayer(OSystem *system, Audio::Mixer *mixer, Common::EventManager *event, int num)
- : _system(system), _mixer(mixer), _event(event), _seqNum(num), _currentSeqNum(0) {
+ : _system(system), _mixer(mixer), _event(event), _seqNum(num), _changeToNextSequence(false) {
memset(_animationPalette, 0, sizeof(_animationPalette));
memset(_paletteBuffer, 0, sizeof(_paletteBuffer));
_soundSeqDataOffset = 0;
@@ -525,7 +525,7 @@
{ 13, &AnimationSequencePlayer::loadIntroSeq13_14, &AnimationSequencePlayer::playIntroSeq13_14 },
{ 15, &AnimationSequencePlayer::loadIntroSeq15_16, &AnimationSequencePlayer::playIntroSeq15_16 },
{ 27, &AnimationSequencePlayer::loadIntroSeq27_28, &AnimationSequencePlayer::playIntroSeq27_28 },
- { 0, 0, 0 }
+ { 1, 0, 0 }
};
static const SequenceUpdateFunc _gameSeqUpdateFuncs[] = {
{ 17, &AnimationSequencePlayer::loadIntroSeq17_18, &AnimationSequencePlayer::playIntroSeq17_18 },
@@ -533,7 +533,7 @@
{ 3, &AnimationSequencePlayer::loadIntroSeq3_4, &AnimationSequencePlayer::playIntroSeq3_4 },
{ 9, &AnimationSequencePlayer::loadIntroSeq9_10, &AnimationSequencePlayer::playIntroSeq9_10 },
{ 21, &AnimationSequencePlayer::loadIntroSeq21_22, &AnimationSequencePlayer::playIntroSeq21_22 },
- { 0, 0, 0 }
+ { 1, 0, 0 }
};
switch (_seqNum) {
case kFirstAnimationSequenceDemo:
@@ -544,9 +544,10 @@
break;
}
_updateFuncIndex = 0;
+ _changeToNextSequence = true;
do {
- if (_seqNum != _currentSeqNum) {
- _currentSeqNum = _seqNum;
+ if (_changeToNextSequence) {
+ _changeToNextSequence = false;
_frameCounter = 0;
_lastFrameTime = _system->getMillis();
(this->*(_updateFunc[_updateFuncIndex].load))();
@@ -555,12 +556,10 @@
}
}
(this->*(_updateFunc[_updateFuncIndex].play))();
- if (_seqNum != _currentSeqNum) {
+ if (_changeToNextSequence) {
unloadAnimation();
++_updateFuncIndex;
- if (this->_updateFunc[_updateFuncIndex].num == 0) {
- break;
- }
+ _seqNum = this->_updateFunc[_updateFuncIndex].num;
}
_system->copyRectToScreen(_offscreenBuffer, 320, 0, 0, kScreenWidth, kScreenHeight);
_system->setPalette(_animationPalette, 0, 256);
@@ -931,7 +930,7 @@
void AnimationSequencePlayer::playIntroSeq17_18() {
decodeNextAnimationFrame(0);
if (_flicPlayer[0].isLastFrame()) {
- _seqNum = 19;
+ _changeToNextSequence = true;
}
updateSounds();
}
@@ -959,7 +958,7 @@
}
updateSounds();
if (_flicPlayer[0].isLastFrame()) {
- _seqNum = 3;
+ _changeToNextSequence = true;
}
}
@@ -1019,7 +1018,7 @@
initPicPart4();
}
if (_flicPlayer[0].isLastFrame()) {
- _seqNum = 9;
+ _changeToNextSequence = true;
}
} else {
drawPicPart4();
@@ -1091,7 +1090,7 @@
}
}
if (_flicPlayer[0].isLastFrame()) {
- _seqNum = 21;
+ _changeToNextSequence = true;
}
updateSounds();
}
@@ -1105,7 +1104,7 @@
void AnimationSequencePlayer::playIntroSeq21_22() {
decodeNextAnimationFrame(0);
if (_flicPlayer[0].isLastFrame()) {
- _seqNum = 1;
+ _changeToNextSequence = true;
}
updateSounds();
}
@@ -1119,7 +1118,7 @@
void AnimationSequencePlayer::playIntroSeq13_14() {
decodeNextAnimationFrame(0);
if (_flicPlayer[0].isLastFrame()) {
- _seqNum = 15;
+ _changeToNextSequence = true;
}
updateSounds();
}
@@ -1133,7 +1132,7 @@
void AnimationSequencePlayer::playIntroSeq15_16() {
decodeNextAnimationFrame(0);
if (_flicPlayer[0].isLastFrame()) {
- _seqNum = 27;
+ _changeToNextSequence = true;
}
updateSounds();
}
@@ -1147,7 +1146,7 @@
void AnimationSequencePlayer::playIntroSeq27_28() {
decodeNextAnimationFrame(0);
if (_flicPlayer[0].isLastFrame()) {
- _seqNum = 1;
+ _changeToNextSequence = true;
}
updateSounds();
}
Modified: scummvm/trunk/engines/tucker/tucker.h
===================================================================
--- scummvm/trunk/engines/tucker/tucker.h 2009-01-18 02:46:25 UTC (rev 35889)
+++ scummvm/trunk/engines/tucker/tucker.h 2009-01-18 03:07:20 UTC (rev 35890)
@@ -904,7 +904,8 @@
Audio::Mixer *_mixer;
Common::EventManager *_event;
- int _seqNum, _currentSeqNum;
+ int _seqNum;
+ bool _changeToNextSequence;
const SequenceUpdateFunc *_updateFunc;
int _updateFuncIndex;
::Graphics::FlicPlayer _flicPlayer[2];
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