[Scummvm-cvs-logs] SF.net SVN: scummvm:[42485] scummvm/branches/gsoc2009-draci/engines/draci/ animation.cpp

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Tue Jul 14 20:11:34 CEST 2009


Revision: 42485
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42485&view=rev
Author:   dkasak13
Date:     2009-07-14 18:11:33 +0000 (Tue, 14 Jul 2009)

Log Message:
-----------
* Fixed bug in Animation which made the first frame of an animation being drawn after it's stopped
* Fixed debugging info when starting and stopping animations

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/animation.cpp

Modified: scummvm/branches/gsoc2009-draci/engines/draci/animation.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/animation.cpp	2009-07-14 16:45:18 UTC (rev 42484)
+++ scummvm/branches/gsoc2009-draci/engines/draci/animation.cpp	2009-07-14 18:11:33 UTC (rev 42485)
@@ -53,8 +53,8 @@
 
 void Animation::nextFrame(bool force) {
 
-	// If there's only one or no frames, return
-	if (getFramesNum() < 2)
+	// If there's only one or no frames, or if the animation is not playing, return
+	if (getFramesNum() < 2 || !_playing)
 		return;
 
 	Common::Rect frameRect = _frames[_currentFrame]->getRect();
@@ -89,7 +89,8 @@
 
 void Animation::drawFrame(Surface *surface) {
 	
-	if (_frames.size() == 0)
+	// If there are no frames or the animation is not playing, return
+	if (_frames.size() == 0 || !_playing)
 		return;
 
 	if (_id == kOverlayImage) {			
@@ -157,19 +158,21 @@
 void AnimationManager::play(int id) {
 	Animation *anim = getAnimation(id);
 
-	if (anim) 
+	if (anim) {
 		anim->setPlaying(true);
 
-	debugC(5, kDraciAnimationDebugLevel, "Playing animation %d...", id);
+		debugC(5, kDraciAnimationDebugLevel, "Playing animation %d...", id);
+	}
 }
 
 void AnimationManager::stop(int id) {
 	Animation *anim = getAnimation(id);
 	
-	if (anim) 
+	if (anim) {
 		anim->setPlaying(false);
-
-	debugC(5, kDraciAnimationDebugLevel, "Stopping animation %d...", id);
+	
+		debugC(5, kDraciAnimationDebugLevel, "Stopping animation %d...", id);
+	}
 }
 
 Animation *AnimationManager::getAnimation(int id) {
@@ -212,7 +215,6 @@
 	// Fill the screen with colour zero since some rooms may rely on the screen being black	
 	_vm->_screen->getSurface()->fill(0);
 
-
 	Common::List<Animation *>::iterator it;
 
 	for (it = _animations.begin(); it != _animations.end(); ++it) {


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