diff options
author | Robert Špalek | 2009-11-28 00:07:22 +0000 |
---|---|---|
committer | Robert Špalek | 2009-11-28 00:07:22 +0000 |
commit | 87c26fe54b5f17e610a95c8fec9f10e0f1bef316 (patch) | |
tree | 6b61b6858890e7120c2a319ee092ee0bcb0b337d /engines/draci/animation.cpp | |
parent | 447711b597f2fc410b0efdbb9d09a4713930dcdc (diff) | |
download | scummvm-rg350-87c26fe54b5f17e610a95c8fec9f10e0f1bef316.tar.gz scummvm-rg350-87c26fe54b5f17e610a95c8fec9f10e0f1bef316.tar.bz2 scummvm-rg350-87c26fe54b5f17e610a95c8fec9f10e0f1bef316.zip |
Fixed bug with exhausting sound handles
It was caused by forever re-starting the same sample when the animation was
stopped and the same frame got displayed over and over, each time triggering
playing the same sample.
svn-id: r46168
Diffstat (limited to 'engines/draci/animation.cpp')
-rw-r--r-- | engines/draci/animation.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp index 48d3246a8e..b93c417602 100644 --- a/engines/draci/animation.cpp +++ b/engines/draci/animation.cpp @@ -116,7 +116,15 @@ void Animation::nextFrame(bool force) { // Fetch new frame and mark it dirty markDirtyRect(surface); - _hasChangedFrame = true; + // If the animation is paused, then nextFrameNum() + // returns the same frame number even though the time + // has elapsed to switch to another frame. We must not + // flip _hasChangedFrame to true, otherwise the sample + // assigned to this frame will be re-started over and + // over until all sound handles are exhausted (happens, + // e.g., when switching to the inventory which pauses + // all animations). + _hasChangedFrame = !_paused; } } |