[Scummvm-cvs-logs] SF.net SVN: scummvm: [28924] scummvm/trunk/engines/saga

sev at users.sourceforge.net sev at users.sourceforge.net
Sun Sep 16 13:37:14 CEST 2007


Revision: 28924
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28924&view=rev
Author:   sev
Date:     2007-09-16 04:37:14 -0700 (Sun, 16 Sep 2007)

Log Message:
-----------
Fix bug when some animations were playing too fast.

Modified Paths:
--------------
    scummvm/trunk/engines/saga/animation.cpp
    scummvm/trunk/engines/saga/animation.h
    scummvm/trunk/engines/saga/sfuncs.cpp

Modified: scummvm/trunk/engines/saga/animation.cpp
===================================================================
--- scummvm/trunk/engines/saga/animation.cpp	2007-09-16 11:08:52 UTC (rev 28923)
+++ scummvm/trunk/engines/saga/animation.cpp	2007-09-16 11:37:14 UTC (rev 28924)
@@ -668,6 +668,14 @@
 	return anim->frameTime;
 }
 
+bool Anim::isPlaying(uint16 animId) {
+	AnimationData *anim;
+
+	anim = getAnimation(animId);
+
+	return (anim->state == ANIM_PLAYING);
+}
+
 int16 Anim::getCurrentFrame(uint16 animId) {
 	AnimationData *anim;
 

Modified: scummvm/trunk/engines/saga/animation.h
===================================================================
--- scummvm/trunk/engines/saga/animation.h	2007-09-16 11:08:52 UTC (rev 28923)
+++ scummvm/trunk/engines/saga/animation.h	2007-09-16 11:37:14 UTC (rev 28924)
@@ -143,6 +143,7 @@
 	int16 getCurrentFrame(uint16 animId);
 	int getFrameTime(uint16 animId);
 	int getCycles(uint16 animId);
+	bool isPlaying(uint16 animId);
 
 	bool hasAnimation(uint16 animId) {
 		if (animId >= MAX_ANIMATIONS) {

Modified: scummvm/trunk/engines/saga/sfuncs.cpp
===================================================================
--- scummvm/trunk/engines/saga/sfuncs.cpp	2007-09-16 11:08:52 UTC (rev 28923)
+++ scummvm/trunk/engines/saga/sfuncs.cpp	2007-09-16 11:37:14 UTC (rev 28924)
@@ -452,8 +452,10 @@
 
 	_vm->_anim->setCycles(animId, cycles);
 	_vm->_anim->setFrameTime(animId, _vm->ticksToMSec(kRepeatSpeedTicks));
-	_vm->_anim->play(animId, 0);
 
+	if (!_vm->_anim->isPlaying(animId))
+		_vm->_anim->play(animId, 0);
+
 	debug(1, "sfStartBgdAnim(%d, %d)", animId, cycles);
 }
 
@@ -699,8 +701,10 @@
 
 	_vm->_anim->setCycles(animId, cycles);
 	_vm->_anim->setFrameTime(animId, _vm->ticksToMSec(speed));
-	_vm->_anim->play(animId, 0);
 
+	if (!_vm->_anim->isPlaying(animId))
+		_vm->_anim->play(animId, 0);
+
 	debug(1, "sfStartBgdAnimSpeed(%d, %d, %d)", animId, cycles, speed);
 }
 


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