Skip to content

Commit

Permalink
GOB: Play the shooting sound in the Diving minigame
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Sep 14, 2011
1 parent 6c259c5 commit c6bb055
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
14 changes: 14 additions & 0 deletions engines/gob/minigames/geisha/diving.cpp
Expand Up @@ -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"

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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() {
Expand Down
8 changes: 8 additions & 0 deletions engines/gob/minigames/geisha/diving.h
Expand Up @@ -25,6 +25,8 @@

#include "common/system.h"

#include "gob/sound/sounddesc.h"

namespace Gob {

class GobEngine;
Expand Down Expand Up @@ -77,6 +79,12 @@ class Diving {

uint8 _currentShot;

SoundDesc _soundShoot;
SoundDesc _soundBreathe;
SoundDesc _soundWhitePearl;
SoundDesc _soundBlackPearl;


void init();
void deinit();

Expand Down

0 comments on commit c6bb055

Please sign in to comment.