diff options
author | Andrew Kurushin | 2004-12-24 12:47:16 +0000 |
---|---|---|
committer | Andrew Kurushin | 2004-12-24 12:47:16 +0000 |
commit | 241155c882248b50e7feda208d6ac7787eb7c70a (patch) | |
tree | 092a55e96beea297861e753c66ee5e6d19a7ca2a /saga/actor.cpp | |
parent | 573da1e79cca48c0140e0b1a6e6463373a481715 (diff) | |
download | scummvm-rg350-241155c882248b50e7feda208d6ac7787eb7c70a.tar.gz scummvm-rg350-241155c882248b50e7feda208d6ac7787eb7c70a.tar.bz2 scummvm-rg350-241155c882248b50e7feda208d6ac7787eb7c70a.zip |
- aninamation cycle now approach to original
svn-id: r16290
Diffstat (limited to 'saga/actor.cpp')
-rw-r--r-- | saga/actor.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp index c4c1b2af3b..a095d64ce8 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -77,7 +77,7 @@ Actor::Actor(SagaEngine *vm) : _vm(vm) { debug(9, "Actor::Actor()"); _centerActor = _protagonist = NULL; - + _lastTickMsec = 0; // Get actor resource file context _actorContext = _vm->getFileContext(GAME_RESOURCEFILE, 0); if (_actorContext == NULL) { @@ -297,7 +297,7 @@ void Actor::handleSpeech(int msec) { actor = getActor(_activeSpeech.actorIds[0]); if (!(_activeSpeech.speechFlags & kSpeakNoAnimate)) { actor->currentAction = kActionSpeak; - //a->actionCycle = rand() % 64; todo + actor->actionCycle = rand() % 64; } } _activeSpeech.playing = true; @@ -357,7 +357,8 @@ void Actor::handleActions(int msec, bool setup) { if (actor->flags & kCycle) { frameRange = getActorFrameRange( actor->actorId, kFrameStand); if (frameRange->frameCount > 0) { - actor->actionCycle = (++actor->actionCycle) % frameRange->frameCount; + actor->actionCycle++; + actor->actionCycle = (actor->actionCycle) % frameRange->frameCount; } else { actor->actionCycle = 0; } @@ -397,6 +398,7 @@ void Actor::handleActions(int msec, bool setup) { if (actor->actionCycle >= frameRange->frameCount) { if (actor->actionCycle & 1) break; frameRange = getActorFrameRange( actor->actorId, kFrameSpeak); + state = (uint16)rand() % (frameRange->frameCount + 1); if (state == 0) { @@ -546,9 +548,14 @@ int Actor::direct(int msec) { } } } -*/ -//process actions - handleActions(msec, false); +*/ + _lastTickMsec += msec; + + if (_lastTickMsec > ticksToMSec(6)) { // fixme + _lastTickMsec = 0; + //process actions + handleActions(msec, false); + } //process speech handleSpeech(msec); |