From 73776406686709bc79ff9c6423937dce0e43c5d6 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Tue, 5 Jun 2012 16:21:36 +0200 Subject: GOB: Play sounds for mouths and shields in Penetration --- engines/gob/minigames/geisha/penetration.cpp | 20 ++++++++++++++++++++ engines/gob/minigames/geisha/penetration.h | 6 ++++++ 2 files changed, 26 insertions(+) (limited to 'engines/gob/minigames') diff --git a/engines/gob/minigames/geisha/penetration.cpp b/engines/gob/minigames/geisha/penetration.cpp index c8f96f825a..1321842d07 100644 --- a/engines/gob/minigames/geisha/penetration.cpp +++ b/engines/gob/minigames/geisha/penetration.cpp @@ -29,6 +29,8 @@ #include "gob/anifile.h" #include "gob/aniobject.h" +#include "gob/sound/sound.h" + #include "gob/minigames/geisha/penetration.h" #include "gob/minigames/geisha/meter.h" #include "gob/minigames/geisha/mouth.h" @@ -280,6 +282,11 @@ bool Penetration::play(bool hasAccessPass, bool hasMaxEnergy, bool testMode) { } void Penetration::init() { + // Load sounds + _vm->_sound->sampleLoad(&_soundShield, SOUND_SND, "boucl.snd"); + _vm->_sound->sampleLoad(&_soundBite , SOUND_SND, "pervet.snd"); + _vm->_sound->sampleLoad(&_soundKiss , SOUND_SND, "baise.snd"); + _background->clear(); _vm->_video->drawPackedSprite("hyprmef2.cmp", *_background); @@ -313,6 +320,10 @@ void Penetration::init() { } void Penetration::deinit() { + _soundShield.free(); + _soundBite.free(); + _soundKiss.free(); + _mapAnims.clear(); _anims.clear(); @@ -528,6 +539,9 @@ void Penetration::checkShields() { // Charge shields _shieldMeter->setMaxValue(); + // Play the shield sound + _vm->_sound->blasterPlay(&_soundShield, 1, 0); + // Erase the shield from the map const int mapX = kPlayAreaBorderWidth + pos->x * kMapTileWidth; const int mapY = kPlayAreaBorderHeight + pos->y * kMapTileHeight; @@ -548,6 +562,12 @@ void Penetration::checkMouths() { (((m->x + 1) == _subTileX) && (m->y == _subTileY))) { m->mouth->activate(); + + // Play the mouth sound + if (m->type == kMouthTypeBite) + _vm->_sound->blasterPlay(&_soundBite, 1, 0); + else if (m->type == kMouthTypeKiss) + _vm->_sound->blasterPlay(&_soundKiss, 1, 0); } } } diff --git a/engines/gob/minigames/geisha/penetration.h b/engines/gob/minigames/geisha/penetration.h index ef0e3b10f0..00ddb4bdba 100644 --- a/engines/gob/minigames/geisha/penetration.h +++ b/engines/gob/minigames/geisha/penetration.h @@ -26,6 +26,8 @@ #include "common/system.h" #include "common/list.h" +#include "gob/sound/sounddesc.h" + namespace Gob { class GobEngine; @@ -107,6 +109,10 @@ private: Common::List _shields; Common::List _mouths; + SoundDesc _soundShield; + SoundDesc _soundBite; + SoundDesc _soundKiss; + void init(); void deinit(); -- cgit v1.2.3