[Scummvm-cvs-logs] SF.net SVN: scummvm:[44962] scummvm/trunk/engines/draci

spalek at users.sourceforge.net spalek at users.sourceforge.net
Mon Oct 12 02:32:51 CEST 2009


Revision: 44962
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44962&view=rev
Author:   spalek
Date:     2009-10-12 00:32:51 +0000 (Mon, 12 Oct 2009)

Log Message:
-----------
Fix indexing of the dragon's animations.

After inspection, I assert that it isn't true that the _anim array needs to
be sorted.  In fact, sorting ruins the ordering of the dragon's animations,
which corresponds to enum Movement.

After fixing this, let the dragon have a rest instead of constantly walking
down.

Modified Paths:
--------------
    scummvm/trunk/engines/draci/game.cpp
    scummvm/trunk/engines/draci/script.cpp

Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp	2009-10-12 00:15:34 UTC (rev 44961)
+++ scummvm/trunk/engines/draci/game.cpp	2009-10-12 00:32:51 UTC (rev 44962)
@@ -958,7 +958,7 @@
 
 	// Fetch dragon's animation ID
 	// FIXME: Need to add proper walking (this only warps the dragon to position)
-	int animID = dragon->_anim[0];
+	int animID = dragon->_anim[kStopRight];
 
 	Animation *anim = _vm->_anims->getAnimation(animID);
 	positionAnimAsHero(anim);

Modified: scummvm/trunk/engines/draci/script.cpp
===================================================================
--- scummvm/trunk/engines/draci/script.cpp	2009-10-12 00:15:34 UTC (rev 44961)
+++ scummvm/trunk/engines/draci/script.cpp	2009-10-12 00:32:51 UTC (rev 44962)
@@ -338,6 +338,10 @@
 	bool visible = (obj->_location == _vm->_game->getRoomNum() && obj->_visible);
 
 	if (objID == kDragonObject || visible) {
+		// FIXME: we should check which animation is active and return
+		// the phase of it, instead of the first one.  this function
+		// is only used at 3 places of the game, hence possible
+		// breakage may not show easily.
 		int animID = obj->_anim[0];
 		Animation *anim = _vm->_anims->getAnimation(animID);
 		ret = anim->currentFrameNum();
@@ -361,23 +365,8 @@
 }
 
 Animation *Script::loadObjectAnimation(GameObject *obj, int animID) {
-	// Load the animation into memory
-
 	_vm->_game->loadAnimation(animID, obj->_z);
-
-	// We insert the ID of the loaded animation into the object's internal array
-	// of owned animation IDs.
-	// Care must be taken to store them sorted (increasing order) as some things
-	// depend on this.
-
-	uint i;
-	for (i = 0; i < obj->_anim.size(); ++i) {
-		if (obj->_anim[i] > animID) {
-			break;
-		}
-	}
-
-	obj->_anim.insert_at(i, animID);
+	obj->_anim.push_back(animID);
 	return _vm->_anims->getAnimation(animID);
 }
 


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