diff options
author | Max Horn | 2003-03-07 02:43:21 +0000 |
---|---|---|
committer | Max Horn | 2003-03-07 02:43:21 +0000 |
commit | 5944944f78f01757d1dc70ef189d569cceabd7bb (patch) | |
tree | bd30e9c4b6e0d2621e7b329717e3a7dd55f2ae4a /scumm/actor.cpp | |
parent | 5537fc3df3b78f68e0b5923f9d4628350f9771c2 (diff) | |
download | scummvm-rg350-5944944f78f01757d1dc70ef189d569cceabd7bb.tar.gz scummvm-rg350-5944944f78f01757d1dc70ef189d569cceabd7bb.tar.bz2 scummvm-rg350-5944944f78f01757d1dc70ef189d569cceabd7bb.zip |
properly init Actor objects instead of one big evil hackish memset...
svn-id: r6733
Diffstat (limited to 'scumm/actor.cpp')
-rw-r--r-- | scumm/actor.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 734b61111d..382edd37bf 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -53,14 +53,7 @@ void Actor::initActor(int mode) { talkPosY = 0; scaley = scalex = 0xFF; charset = 0; - sound[0] = 0; - sound[1] = 0; - sound[2] = 0; - sound[3] = 0; - sound[4] = 0; - sound[5] = 0; - sound[6] = 0; - sound[7] = 0; + memset(sound, 0, sizeof(sound)); newDirection = 0; stopActorMoving(); @@ -74,6 +67,7 @@ void Actor::initActor(int mode) { ignoreBoxes = 0; forceClip = 0; ignoreTurns = false; + initFrame = 1; walkFrame = 2; standFrame = 3; @@ -83,15 +77,14 @@ void Actor::initActor(int mode) { walk_script = 0; talk_script = 0; - if (_vm->_features & GF_AFTER_V7) { - _vm->_classData[number] = _vm->_classData[0]; - } else { - _vm->_classData[number] = 0; + if (_vm) { + _vm->_classData[number] = (_vm->_features & GF_AFTER_V7) ? _vm->_classData[0] : 0; } } void Actor::stopActorMoving() { - _vm->stopScriptNr(walk_script); + if (_vm) + _vm->stopScriptNr(walk_script); moving = 0; } |