diff options
author | Sven Hesse | 2012-01-27 14:45:41 +0100 |
---|---|---|
committer | Sven Hesse | 2012-01-27 14:45:41 +0100 |
commit | 841462721686488a41588410418f4e5ff46dac76 (patch) | |
tree | 9e185c5ba2bc53705a77a1ced38b2b2c3f31e7e7 /engines/gob/minigames/geisha | |
parent | 9d348f46ad1a7729661867564d4e8ed254244710 (diff) | |
download | scummvm-rg350-841462721686488a41588410418f4e5ff46dac76.tar.gz scummvm-rg350-841462721686488a41588410418f4e5ff46dac76.tar.bz2 scummvm-rg350-841462721686488a41588410418f4e5ff46dac76.zip |
GOB: Play Oko's breathing sound
Diffstat (limited to 'engines/gob/minigames/geisha')
-rw-r--r-- | engines/gob/minigames/geisha/diving.cpp | 12 | ||||
-rw-r--r-- | engines/gob/minigames/geisha/oko.cpp | 10 | ||||
-rw-r--r-- | engines/gob/minigames/geisha/oko.h | 8 |
3 files changed, 21 insertions, 9 deletions
diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp index 1f5c025f2d..e08902ac95 100644 --- a/engines/gob/minigames/geisha/diving.cpp +++ b/engines/gob/minigames/geisha/diving.cpp @@ -134,6 +134,11 @@ bool Diving::play(uint16 playerCount, bool hasPearlLocation) { } void Diving::init() { + _vm->_sound->sampleLoad(&_soundShoot , SOUND_SND, "tirgim.snd"); + _vm->_sound->sampleLoad(&_soundBreathe , SOUND_SND, "respir.snd"); + _vm->_sound->sampleLoad(&_soundWhitePearl, SOUND_SND, "virtou.snd"); + _vm->_sound->sampleLoad(&_soundBlackPearl, SOUND_SND, "trouve.snd"); + _background = new DECFile(_vm, "tperle.dec" , 320, 200); _objects = new ANIFile(_vm, "tperle.ani" , 320); _gui = new ANIFile(_vm, "tperlcpt.ani", 320); @@ -201,7 +206,7 @@ void Diving::init() { _shot[i]->setMode(ANIObject::kModeOnce); } - _oko = new Oko(*_okoAnim); + _oko = new Oko(*_okoAnim, *_vm->_sound, _soundBreathe); Surface tmp(320, 103, 1); @@ -226,11 +231,6 @@ void Diving::init() { _anims.push_back(_oko); _anims.push_back(_lungs); _anims.push_back(_heart); - - _vm->_sound->sampleLoad(&_soundShoot , SOUND_SND, "tirgim.snd"); - _vm->_sound->sampleLoad(&_soundBreathe , SOUND_SND, "respir.snd"); - _vm->_sound->sampleLoad(&_soundWhitePearl, SOUND_SND, "virtou.snd"); - _vm->_sound->sampleLoad(&_soundBlackPearl, SOUND_SND, "trouve.snd"); } void Diving::deinit() { diff --git a/engines/gob/minigames/geisha/oko.cpp b/engines/gob/minigames/geisha/oko.cpp index 24a6c8053e..f8536eab3f 100644 --- a/engines/gob/minigames/geisha/oko.cpp +++ b/engines/gob/minigames/geisha/oko.cpp @@ -20,6 +20,8 @@ * */ +#include "gob/sound/sound.h" + #include "gob/minigames/geisha/oko.h" namespace Gob { @@ -40,7 +42,9 @@ static const uint kLevelCount = 3; static const int16 kLevelPositionX[kLevelCount] = { 44, 84, 124 }; -Oko::Oko(const ANIFile &ani) : ANIObject(ani), _state(kStateEnter), _level(0) { +Oko::Oko(const ANIFile &ani, Sound &sound, SoundDesc &breathe) : + ANIObject(ani), _sound(&sound), _breathe(&breathe), _state(kStateEnter), _level(0) { + setAnimation(kOkoAnimationEnter); setVisible(true); } @@ -62,9 +66,11 @@ void Oko::advance() { } break; + case kStateBreathe: + if ((getFrame() == 6) || (getFrame() == 23)) + _sound->blasterPlay(_breathe, 1, 0); case kStateSink: case kStateRaise: - case kStateBreathe: if (wasLastFrame) { setAnimation(kOkoAnimationSwim); setPosition(kOkoPositionX, kLevelPositionX[_level]); diff --git a/engines/gob/minigames/geisha/oko.h b/engines/gob/minigames/geisha/oko.h index 7e56315c9c..e44d273a73 100644 --- a/engines/gob/minigames/geisha/oko.h +++ b/engines/gob/minigames/geisha/oko.h @@ -27,6 +27,9 @@ namespace Gob { +class Sound; +class SoundDesc; + namespace Geisha { /** Oko, the person you control, in Geisha's "Diving" minigame. */ @@ -40,7 +43,7 @@ public: kStateBreathe }; - Oko(const ANIFile &ani); + Oko(const ANIFile &ani, Sound &sound, SoundDesc &breathe); ~Oko(); /** Advance the animation to the next frame. */ @@ -54,6 +57,9 @@ public: State getState() const; private: + Sound *_sound; + SoundDesc *_breathe; + State _state; uint8 _level; |