Skip to content

Commit

Permalink
PEGASUS: Add DVD raise/lower sounds for the inventory/biochip panels
Browse files Browse the repository at this point in the history
Thanks to Keith Kaisershot (blitter)
  • Loading branch information
Matthew Hoops committed Apr 17, 2013
1 parent c99f321 commit 918920b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
30 changes: 30 additions & 0 deletions engines/pegasus/interface.cpp
Expand Up @@ -186,6 +186,11 @@ void Interface::validateInventoryPanel() {
_inventoryLid.setDisplayOrder(kInventoryLidOrder);
_inventoryLid.startDisplaying();

if (((PegasusEngine *)g_engine)->isDVD()) {
_inventoryOpenSound.initFromAIFFFile("Sounds/Items/Inventory Panel Open.aif");
_inventoryCloseSound.initFromAIFFFile("Sounds/Items/Inventory Panel Close.aif");
}

_inventoryPushCallBack.initCallBack(&_inventoryPush, kCallBackAtExtremes);
_inventoryLidCallBack.initCallBack(&_inventoryLid, kCallBackAtExtremes);

Expand Down Expand Up @@ -231,6 +236,11 @@ void Interface::validateBiochipPanel() {
_biochipLid.setDisplayOrder(kBiochipLidOrder);
_biochipLid.startDisplaying();

if (((PegasusEngine *)g_engine)->isDVD()) {
_biochipOpenSound.initFromAIFFFile("Sounds/Items/Biochip Panel Open.aif");
_biochipCloseSound.initFromAIFFFile("Sounds/Items/Biochip Panel Close.aif");
}

_biochipPushCallBack.initCallBack(&_biochipPush, kCallBackAtExtremes);
_biochipLidCallBack.initCallBack(&_biochipLid, kCallBackAtExtremes);

Expand Down Expand Up @@ -385,6 +395,11 @@ void Interface::raiseInventoryDrawer(const bool doCallBacks) {
_inventoryLid.show();
_inventoryPush.show();
_inventoryLid.start();

if (((PegasusEngine *)g_engine)->isDVD()) {
_inventoryCloseSound.stopSound();
_inventoryOpenSound.playSound();
}
}

void Interface::playEndMessage() {
Expand Down Expand Up @@ -446,6 +461,11 @@ void Interface::lowerInventoryDrawer(const bool doCallBacks) {
FaderMoveSpec moveSpec;
moveSpec.makeTwoKnotFaderSpec(60, 0, 1000, 15, 0);
_inventoryPush.startFader(moveSpec);

if (((PegasusEngine *)g_engine)->isDVD()) {
_inventoryOpenSound.stopSound();
_inventoryCloseSound.playSound();
}
}
}

Expand Down Expand Up @@ -487,6 +507,11 @@ void Interface::raiseBiochipDrawer(const bool doCallBacks) {
_biochipLid.show();
_biochipPush.show();
_biochipLid.start();

if (((PegasusEngine *)g_engine)->isDVD()) {
_biochipCloseSound.stopSound();
_biochipOpenSound.playSound();
}
}

void Interface::biochipLidOpen(const bool doCallBacks) {
Expand Down Expand Up @@ -521,6 +546,11 @@ void Interface::lowerBiochipDrawer(const bool doCallBacks) {
FaderMoveSpec moveSpec;
moveSpec.makeTwoKnotFaderSpec(60, 0, 1000, 9, 0);
_biochipPush.startFader(moveSpec);

if (((PegasusEngine *)g_engine)->isDVD()) {
_biochipOpenSound.stopSound();
_biochipCloseSound.playSound();
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions engines/pegasus/interface.h
Expand Up @@ -29,6 +29,7 @@
#include "pegasus/hotspot.h"
#include "pegasus/input.h"
#include "pegasus/notification.h"
#include "pegasus/sound.h"
#include "pegasus/surface.h"
#include "pegasus/transition.h"
#include "pegasus/items/inventorypicture.h"
Expand Down Expand Up @@ -125,13 +126,15 @@ class Interface : public InputHandler, public NotificationReceiver {
NotificationCallBack _inventoryLidCallBack;
InventoryItemsPicture _inventoryPanel;
bool _inventoryUp, _inventoryRaised;
Sound _inventoryOpenSound, _inventoryCloseSound;

Push _biochipPush;
SpriteSequence _biochipLid;
NotificationCallBack _biochipPushCallBack;
NotificationCallBack _biochipLidCallBack;
BiochipPicture _biochipPanel;
bool _biochipUp, _biochipRaised;
Sound _biochipOpenSound, _biochipCloseSound;

Hotspot _currentItemSpot;
Hotspot _currentBiochipSpot;
Expand Down

0 comments on commit 918920b

Please sign in to comment.