From 2edfb693bedbd578c6019970ae66b2d6384509ca Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Wed, 14 Sep 2011 20:07:17 +0200 Subject: GOB: Add EvilFish::mutate() Changing a fish into a different fish type --- engines/gob/minigames/geisha/evilfish.cpp | 23 +++++++++++++++++++++++ engines/gob/minigames/geisha/evilfish.h | 4 ++++ 2 files changed, 27 insertions(+) (limited to 'engines/gob') diff --git a/engines/gob/minigames/geisha/evilfish.cpp b/engines/gob/minigames/geisha/evilfish.cpp index e2672d75c8..592e84a32c 100644 --- a/engines/gob/minigames/geisha/evilfish.cpp +++ b/engines/gob/minigames/geisha/evilfish.cpp @@ -158,6 +158,29 @@ void EvilFish::advance() { } } +void EvilFish::mutate(uint16 animSwimLeft, uint16 animSwimRight, + uint16 animTurnLeft, uint16 animTurnRight, uint16 animDie) { + + _animSwimLeft = animSwimLeft; + _animSwimRight = animSwimRight; + _animTurnLeft = animTurnLeft; + _animTurnRight = animTurnRight; + _animDie = animDie; + + switch (_state) { + case kStateSwimLeft: + setAnimation(_animSwimLeft); + break; + + case kStateSwimRight: + setAnimation(_animSwimRight); + break; + + default: + break; + } +} + } // End of namespace Geisha } // End of namespace Gob diff --git a/engines/gob/minigames/geisha/evilfish.h b/engines/gob/minigames/geisha/evilfish.h index 1801ad9b16..223645f47f 100644 --- a/engines/gob/minigames/geisha/evilfish.h +++ b/engines/gob/minigames/geisha/evilfish.h @@ -56,6 +56,10 @@ public: /** Advance the animation to the next frame. */ void advance(); + /** Change the fish's animations, effectively making it a different fish type. */ + void mutate(uint16 animSwimLeft, uint16 animSwimRight, + uint16 animTurnLeft, uint16 animTurnRight, uint16 animDie); + private: enum State { kStateNone, -- cgit v1.2.3