aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/minigames/geisha/diving.cpp12
-rw-r--r--engines/gob/minigames/geisha/oko.cpp10
-rw-r--r--engines/gob/minigames/geisha/oko.h8
-rw-r--r--engines/gob/sound/bgatmosphere.h1
4 files changed, 22 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;
diff --git a/engines/gob/sound/bgatmosphere.h b/engines/gob/sound/bgatmosphere.h
index e88b91d540..23fcc8a71a 100644
--- a/engines/gob/sound/bgatmosphere.h
+++ b/engines/gob/sound/bgatmosphere.h
@@ -24,6 +24,7 @@
#define GOB_SOUND_BGATMOSPHERE_H
#include "audio/mixer.h"
+#include "common/array.h"
#include "common/mutex.h"
#include "common/random.h"