[Scummvm-cvs-logs] SF.net SVN: scummvm:[45750] scummvm/trunk/engines/teenagent

megath at users.sourceforge.net megath at users.sourceforge.net
Sun Nov 8 12:04:23 CET 2009


Revision: 45750
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45750&view=rev
Author:   megath
Date:     2009-11-08 11:04:22 +0000 (Sun, 08 Nov 2009)

Log Message:
-----------
restart default animation in the slot after custom animation has ended.

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/animation.cpp
    scummvm/trunk/engines/teenagent/animation.h
    scummvm/trunk/engines/teenagent/scene.cpp

Modified: scummvm/trunk/engines/teenagent/animation.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/animation.cpp	2009-11-08 06:56:30 UTC (rev 45749)
+++ scummvm/trunk/engines/teenagent/animation.cpp	2009-11-08 11:04:22 UTC (rev 45750)
@@ -84,6 +84,10 @@
 	return r;
 }
 
+void Animation::restart() {
+	paused = false;
+	index = 0;
+}
 
 void Animation::free() {
 	id = 0;

Modified: scummvm/trunk/engines/teenagent/animation.h
===================================================================
--- scummvm/trunk/engines/teenagent/animation.h	2009-11-08 06:56:30 UTC (rev 45749)
+++ scummvm/trunk/engines/teenagent/animation.h	2009-11-08 11:04:22 UTC (rev 45750)
@@ -48,6 +48,7 @@
 	~Animation();
 
 	bool empty() const { return frames == NULL; }
+	void restart();
 
 	//uint16 width() const { return frames? frames[0].w: 0; }
 	//uint16 height() const { return frames? frames[0].h: 0; }

Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp	2009-11-08 06:56:30 UTC (rev 45749)
+++ scummvm/trunk/engines/teenagent/scene.cpp	2009-11-08 11:04:22 UTC (rev 45750)
@@ -392,6 +392,11 @@
 					got_any_animation = true;
 			} else {
 				a = animation + i;
+				if (!custom_animation[i].empty()) {
+					debug(0, "custom animation ended, restart animation in the same slot.");
+					custom_animation[i].free();
+					a->restart();
+				}
 				s = a->currentFrame();
 			}
 			


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