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

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Wed Jul 29 02:46:37 CEST 2009


Revision: 42873
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42873&view=rev
Author:   dkasak13
Date:     2009-07-29 00:46:36 +0000 (Wed, 29 Jul 2009)

Log Message:
-----------
* Added method Animation::currentFrameNum()
* Renamed Animation::getFramesNum() to Animation::getFrameCount() for clarity.

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

Modified: scummvm/branches/gsoc2009-draci/engines/draci/animation.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/animation.cpp	2009-07-29 00:12:32 UTC (rev 42872)
+++ scummvm/branches/gsoc2009-draci/engines/draci/animation.cpp	2009-07-29 00:46:36 UTC (rev 42873)
@@ -85,7 +85,7 @@
 void Animation::nextFrame(bool force) {
 
 	// If there's only one or no frames, or if the animation is not playing, return
-	if (getFramesNum() < 2 || !_playing)
+	if (getFrameCount() < 2 || !_playing)
 		return;
 
 	Drawable *frame = _frames[_currentFrame];
@@ -94,7 +94,7 @@
 	if (force || (_tick + frame->getDelay() <= _vm->_system->getMillis())) {
 		// 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) {
+		if ((_currentFrame == getFrameCount() - 1) && !_looping) {
 			// When the animation reaches its end, stop it
 			_vm->_anims->stop(_id);
 
@@ -120,7 +120,7 @@
 
 uint Animation::nextFrameNum() {
 
-	if ((_currentFrame == getFramesNum() - 1) && _looping)
+	if ((_currentFrame == getFrameCount() - 1) && _looping)
 		return 0;
 	else
 		return _currentFrame + 1;
@@ -249,10 +249,14 @@
 	}
 }
 
-uint Animation::getFramesNum() {
+uint Animation::getFrameCount() {
 	return _frames.size();
 }
 
+uint Animation::currentFrameNum() {
+	return _currentFrame;
+}
+
 void Animation::deleteFrames() {
 	
 	// If there are no frames to delete, return
@@ -262,7 +266,7 @@
 
 	markDirtyRect(_vm->_screen->getSurface());
 
-	for (int i = getFramesNum() - 1; i >= 0; --i) {		
+	for (int i = getFrameCount() - 1; i >= 0; --i) {		
 		delete _frames[i];
 		_frames.pop_back();	
 	}

Modified: scummvm/branches/gsoc2009-draci/engines/draci/animation.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/animation.h	2009-07-29 00:12:32 UTC (rev 42872)
+++ scummvm/branches/gsoc2009-draci/engines/draci/animation.h	2009-07-29 00:46:36 UTC (rev 42873)
@@ -67,7 +67,8 @@
 
 	void addFrame(Drawable *frame);
 	Drawable *getFrame(int frameNum = kCurrentFrame);
-	uint getFramesNum();
+	uint currentFrameNum();
+	uint getFrameCount();
 	void deleteFrames();
 
 	bool isPlaying();


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