From a83be36a978d9225294079898e846cd7610ea20c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 31 Jan 2007 02:34:55 +0000 Subject: Expanded the chute animation to display the full sequence as the player leaves the dungeon svn-id: r25302 --- engines/lure/game.cpp | 70 +++++++++++++++++++++++++++++++++++++-------------- engines/lure/game.h | 2 ++ 2 files changed, 53 insertions(+), 19 deletions(-) (limited to 'engines') diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp index 3096c6182d..e436442776 100644 --- a/engines/lure/game.cpp +++ b/engines/lure/game.cpp @@ -251,11 +251,8 @@ void Game::handleMenuResponse(uint8 selection) { } void Game::playerChangeRoom() { - OSystem &system = System::getReference(); Resources &res = Resources::getReference(); - Screen &screen = Screen::getReference(); Room &room = Room::getReference(); - Mouse &mouse = Mouse::getReference(); ValueTableData &fields = res.fieldList(); SequenceDelayList &delayList = Resources::getReference().delayList(); @@ -272,22 +269,10 @@ void Game::playerChangeRoom() { int animFlag = fields.getField(ROOM_EXIT_ANIMATION); if (animFlag == 1) - { - Palette palette(CHUTE_PALETTE_ID); - AnimationSequence *anim = new AnimationSequence(screen, system, - CHUTE_ANIM_ID, palette, false); - mouse.cursorOff(); - anim->show(); - mouse.cursorOn(); - } else if (animFlag != 0) - { - Palette palette(BARREL_PALETTE_ID); - AnimationSequence *anim = new AnimationSequence(screen, system, - BARREL_ANIM_ID, palette, false); - mouse.cursorOff(); - anim->show(); - mouse.cursorOn(); - } + displayChuteAnimation(); + else if (animFlag != 0) + displayBarrelAnimation(); + fields.setField(ROOM_EXIT_ANIMATION, 0); // Change to the new room Hotspot *player = res.getActiveHotspot(PLAYER_ID); @@ -299,6 +284,53 @@ void Game::playerChangeRoom() { room.setRoomNumber(roomNum, false); } +void Game::displayChuteAnimation() +{ + OSystem &system = System::getReference(); + Resources &res = Resources::getReference(); + Screen &screen = Screen::getReference(); + Mouse &mouse = Mouse::getReference(); + + ValueTableData &fields = res.fieldList(); + Palette palette(CHUTE_PALETTE_ID); + + debugC(ERROR_INTERMEDIATE, kLureDebugAnimations, "Starting chute animation"); + mouse.cursorOff(); + + AnimationSequence *anim = new AnimationSequence(screen, system, + CHUTE_ANIM_ID, palette, false); + anim->show(); + delete anim; + + anim = new AnimationSequence(screen, system, CHUTE2_ANIM_ID, + palette, false); + anim->show(); + delete anim; + + anim = new AnimationSequence(screen, system, CHUTE3_ANIM_ID, + palette, false); + anim->show(); + delete anim; + + mouse.cursorOn(); + fields.setField(82, 1); +} + +void Game::displayBarrelAnimation() +{ + OSystem &system = System::getReference(); + Screen &screen = Screen::getReference(); + Mouse &mouse = Mouse::getReference(); + + debugC(ERROR_INTERMEDIATE, kLureDebugAnimations, "Starting barrel animation"); + Palette palette(BARREL_PALETTE_ID); + AnimationSequence *anim = new AnimationSequence(screen, system, + BARREL_ANIM_ID, palette, false); + mouse.cursorOff(); + anim->show(); + mouse.cursorOn(); +} + void Game::handleClick() { Resources &res = Resources::getReference(); Room &room = Room::getReference(); diff --git a/engines/lure/game.h b/engines/lure/game.h index a8960ee580..8858b3a70b 100644 --- a/engines/lure/game.h +++ b/engines/lure/game.h @@ -52,6 +52,8 @@ private: void doAction(Action action, uint16 hotspotId, uint16 usedId); void playerChangeRoom(); + void displayChuteAnimation(); + void displayBarrelAnimation(); void handleBootParam(int value); public: Game(); -- cgit v1.2.3