From c6bb05594122e58ab92fc04544e1fbebfe48580f Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Wed, 14 Sep 2011 20:43:06 +0200 Subject: [PATCH] GOB: Play the shooting sound in the Diving minigame --- engines/gob/minigames/geisha/diving.cpp | 14 ++++++++++++++ engines/gob/minigames/geisha/diving.h | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp index ae041b77f962..38a62ccc88c8 100644 --- a/engines/gob/minigames/geisha/diving.cpp +++ b/engines/gob/minigames/geisha/diving.cpp @@ -29,6 +29,8 @@ #include "gob/decfile.h" #include "gob/anifile.h" +#include "gob/sound/sound.h" + #include "gob/minigames/geisha/evilfish.h" #include "gob/minigames/geisha/diving.h" @@ -149,12 +151,22 @@ void Diving::init() { _anims.push_back(_evilFish[i]); _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() { _vm->_draw->_cursorHotspotX = -1; _vm->_draw->_cursorHotspotY = -1; + _soundShoot.free(); + _soundBreathe.free(); + _soundWhitePearl.free(); + _soundBlackPearl.free(); + _anims.clear(); _activeShots.clear(); @@ -308,6 +320,8 @@ void Diving::shoot(int16 mouseX, int16 mouseY) { _activeShots.push_back(_currentShot); _currentShot = (_currentShot + 1) % kMaxShotCount; + + _vm->_sound->blasterPlay(&_soundShoot, 1, 0); } void Diving::checkShots() { diff --git a/engines/gob/minigames/geisha/diving.h b/engines/gob/minigames/geisha/diving.h index dd0773a9c422..e2f5dd428f9a 100644 --- a/engines/gob/minigames/geisha/diving.h +++ b/engines/gob/minigames/geisha/diving.h @@ -25,6 +25,8 @@ #include "common/system.h" +#include "gob/sound/sounddesc.h" + namespace Gob { class GobEngine; @@ -77,6 +79,12 @@ class Diving { uint8 _currentShot; + SoundDesc _soundShoot; + SoundDesc _soundBreathe; + SoundDesc _soundWhitePearl; + SoundDesc _soundBlackPearl; + + void init(); void deinit();