From 293be0bfa4101c40ac8530e5937593e6df73ad59 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Mon, 9 Apr 2007 15:40:10 +0000 Subject: Small glitch/different goblin handling fix for Gob3 svn-id: r26436 --- engines/gob/goblin.h | 3 +++ engines/gob/goblin_v2.cpp | 3 --- engines/gob/goblin_v3.cpp | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/gob/goblin.h b/engines/gob/goblin.h index 7a698ced20..f8bddff332 100644 --- a/engines/gob/goblin.h +++ b/engines/gob/goblin.h @@ -302,6 +302,9 @@ protected: class Goblin_v3 : public Goblin_v2 { public: + virtual void placeObject(Gob_Object * objDesc, char animated, + int16 index, int16 x, int16 y, int16 state); + Goblin_v3(GobEngine *vm); virtual ~Goblin_v3() {}; diff --git a/engines/gob/goblin_v2.cpp b/engines/gob/goblin_v2.cpp index caa473464c..29401837a7 100644 --- a/engines/gob/goblin_v2.cpp +++ b/engines/gob/goblin_v2.cpp @@ -426,9 +426,6 @@ void Goblin_v2::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc, } if (animData->frame >= framesCount) { - if (animData->nextState == -1) // TODO: This should never happen - return; - state = animData->nextState; animation = obj->goblinStates[state][0].animation; layer = obj->goblinStates[state][0].layer; diff --git a/engines/gob/goblin_v3.cpp b/engines/gob/goblin_v3.cpp index 6c250ef396..1a3a34fcec 100644 --- a/engines/gob/goblin_v3.cpp +++ b/engines/gob/goblin_v3.cpp @@ -107,4 +107,25 @@ void Goblin_v3::advMovement(Mult::Mult_Object *obj, int8 state) { } } +void Goblin_v3::placeObject(Gob_Object *objDesc, char animated, + int16 index, int16 x, int16 y, int16 state) { + + Mult::Mult_Object &obj = _vm->_mult->_objects[index]; + Mult::Mult_AnimData &objAnim = *(obj.pAnimData); + + if ((state != -1) && (obj.goblinStates[state] != 0)) { + if (state == 8) + objAnim.curLookDir = 0; + else if (state == 9) + objAnim.curLookDir = 4; + else if (state == 28) + objAnim.curLookDir = 6; + else if (state == 29) + objAnim.curLookDir = 2; + } + + Goblin_v2::placeObject(objDesc, animated, index, x, y, state); + +} + } // End of namespace Gob -- cgit v1.2.3