diff options
| author | Robert Špalek | 2009-10-11 23:54:44 +0000 | 
|---|---|---|
| committer | Robert Špalek | 2009-10-11 23:54:44 +0000 | 
| commit | 6768065f142b4fe87ac4786d23023806022f3b7c (patch) | |
| tree | d294f9309d8e163ae4b9504287a2a908bb92c11c | |
| parent | 62cebbb51ee74ca5341d2dd35af79b723d738222 (diff) | |
| download | scummvm-rg350-6768065f142b4fe87ac4786d23023806022f3b7c.tar.gz scummvm-rg350-6768065f142b4fe87ac4786d23023806022f3b7c.tar.bz2 scummvm-rg350-6768065f142b4fe87ac4786d23023806022f3b7c.zip | |
Reduced code duplication and fixed one deletion bug.
svn-id: r44959
| -rw-r--r-- | engines/draci/game.h | 4 | ||||
| -rw-r--r-- | engines/draci/script.cpp | 16 | 
2 files changed, 3 insertions, 17 deletions
| diff --git a/engines/draci/game.h b/engines/draci/game.h index 54d4a6844c..4c521a028b 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -214,7 +214,7 @@ enum LoopSubstatus {    * Enumerates the animations for the dragon's movement.    */  enum Movement { -	kMoveUndefined, +	kMoveUndefined = -1,  	kMoveDown, kMoveUp, kMoveRight, kMoveLeft,  	kMoveRightDown, kMoveRightUp, kMoveLeftDown, kMoveLeftUp,  	kMoveDownRight, kMoveUpRight, kMoveDownLeft, kMoveUpLeft, @@ -270,6 +270,7 @@ public:  	GameObject *getObject(uint objNum);  	int getObjectWithAnimation(int animID) const;  	void deleteObjectAnimations(); +	void deleteAnimationsAfterIndex(int lastAnimIndex);  	int getVariable(int varNum) const;  	void setVariable(int varNum, int value); @@ -346,7 +347,6 @@ public:  	void DoSync(Common::Serializer &s);  private: -	void deleteAnimationsAfterIndex(int lastAnimIndex);  	void enterNewRoom(bool force_reload);  	void loadRoom(int roomNum);  	void runGateProgram(int gate); diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index 1650e2b72f..da53fad979 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -526,21 +526,7 @@ void Script::mark(Common::Queue<int> ¶ms) {  void Script::release(Common::Queue<int> ¶ms) {  	int markedIndex = _vm->_game->getMarkedAnimationIndex(); -	// Also delete those animations from the game's objects -	for (uint i = 0; i < _vm->_game->getNumObjects(); ++i) { -		GameObject *obj = _vm->_game->getObject(i); - -		for (uint j = 0; j < obj->_anims.size(); ++j) { -			Animation *anim; - -			anim = _vm->_anims->getAnimation(obj->_anims[j]); -			if (anim != NULL && anim->getIndex() > markedIndex) -				obj->_anims.remove_at(j); -		} -	} - -	// Delete animations which have an index greater than the marked index -	_vm->_anims->deleteAfterIndex(markedIndex); +	_vm->_game->deleteAnimationsAfterIndex(markedIndex);  }  void Script::icoStat(Common::Queue<int> ¶ms) { | 
