Reduced huge code duplication by introducing Game::stopObjectAnimations()
svn-id: r44961
This commit is contained in:
parent
6aaf99ec67
commit
3ef5145b41
3 changed files with 12 additions and 22 deletions
|
@ -411,12 +411,7 @@ void Script::start(Common::Queue<int> ¶ms) {
|
|||
int animID = params.pop() - 1;
|
||||
|
||||
GameObject *obj = _vm->_game->getObject(objID);
|
||||
|
||||
// Stop all animation that the object owns
|
||||
|
||||
for (uint i = 0; i < obj->_anim.size(); ++i) {
|
||||
_vm->_anims->stop(obj->_anim[i]);
|
||||
}
|
||||
_vm->_game->stopObjectAnimations(obj);
|
||||
|
||||
Animation *anim = _vm->_anims->getAnimation(animID);
|
||||
if (!anim) {
|
||||
|
@ -463,12 +458,7 @@ void Script::startPlay(Common::Queue<int> ¶ms) {
|
|||
int animID = params.pop() - 1;
|
||||
|
||||
GameObject *obj = _vm->_game->getObject(objID);
|
||||
|
||||
// Stop all animation that the object owns
|
||||
|
||||
for (uint i = 0; i < obj->_anim.size(); ++i) {
|
||||
_vm->_anims->stop(obj->_anim[i]);
|
||||
}
|
||||
_vm->_game->stopObjectAnimations(obj);
|
||||
|
||||
Animation *anim = _vm->_anims->getAnimation(animID);
|
||||
if (!anim) {
|
||||
|
@ -599,9 +589,7 @@ void Script::objStat(Common::Queue<int> ¶ms) {
|
|||
obj->_location = -1;
|
||||
}
|
||||
|
||||
for (uint i = 0; i < obj->_anim.size(); ++i) {
|
||||
_vm->_anims->stop(obj->_anim[i]);
|
||||
}
|
||||
_vm->_game->stopObjectAnimations(obj);
|
||||
}
|
||||
|
||||
void Script::execInit(Common::Queue<int> ¶ms) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue