aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kasak2009-07-22 11:30:57 +0000
committerDenis Kasak2009-07-22 11:30:57 +0000
commit1726cc8d247f2ad8ac5b4136b866055d3e30155b (patch)
tree25970644799eb2c2422a32c5a5398a80b87184b4
parent1c86a986d971aaa7ef77e4251b7069fe3ee33b88 (diff)
downloadscummvm-rg350-1726cc8d247f2ad8ac5b4136b866055d3e30155b.tar.gz
scummvm-rg350-1726cc8d247f2ad8ac5b4136b866055d3e30155b.tar.bz2
scummvm-rg350-1726cc8d247f2ad8ac5b4136b866055d3e30155b.zip
* Disabled unconditional execution of gates' scripts
* Fixed bug in Animation::nextFrame() which caused non-looping animations to linger on forever * Stopped setting looping to false explicitly in AnimationManager::addAnimation() since the Animation constructor already does that svn-id: r42657
-rw-r--r--engines/draci/animation.cpp8
-rw-r--r--engines/draci/game.cpp8
2 files changed, 9 insertions, 7 deletions
diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp
index 9cf8f35a8d..adcb8e2d82 100644
--- a/engines/draci/animation.cpp
+++ b/engines/draci/animation.cpp
@@ -33,7 +33,7 @@ Animation::Animation(DraciEngine *vm) : _vm(vm) {
_z = 0;
_relX = 0;
_relY = 0;
- setPlaying(false);
+ _playing = false;
_looping = false;
_tick = _vm->_system->getMillis();
_currentFrame = 0;
@@ -87,8 +87,11 @@ void Animation::nextFrame(bool force) {
// If we are at the last frame and not looping, stop the animation
// The animation is also restarted to frame zero
if ((_currentFrame == getFramesNum() - 1) && !_looping) {
+ // When the animation reaches its end, stop it
+ _vm->_anims->stop(_id);
+
+ // Reset the frame to 0
_currentFrame = 0;
- setPlaying(false);
} else {
// Mark old frame dirty so it gets deleted
markDirtyRect(surface);
@@ -213,7 +216,6 @@ Animation *AnimationManager::addAnimation(int id, uint z, bool playing) {
anim->setID(id);
anim->setZ(z);
anim->setPlaying(playing);
- anim->setLooping(false);
insertAnimation(anim);
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 39e4c39f71..2a0e5dca6f 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -321,10 +321,10 @@ void Game::loadRoom(int roomNum) {
// HACK: Gates' scripts shouldn't be run unconditionally
// This is for testing
- for (uint i = 0; i < _currentRoom._numGates; ++i) {
- debugC(6, kDraciLogicDebugLevel, "Running program for gate %d", i);
- _vm->_script->run(_currentRoom._program, gates[i]);
- }
+ //for (uint i = 0; i < _currentRoom._numGates; ++i) {
+ // debugC(6, kDraciLogicDebugLevel, "Running program for gate %d", i);
+ // _vm->_script->run(_currentRoom._program, gates[i]);
+ //}
// Set room palette
f = _vm->_paletteArchive->getFile(_currentRoom._palette);