diff options
author | Paul Gilbert | 2013-12-02 08:29:51 -0500 |
---|---|---|
committer | Paul Gilbert | 2013-12-02 08:29:51 -0500 |
commit | 1fb422cde207b8b24ab9e8a545abb4c9204773c3 (patch) | |
tree | 2e7abe551c2d95314575d9f28cb810365f3f9f93 /engines | |
parent | 626c988841649f75c9c3dda46330f4b6805292a6 (diff) | |
download | scummvm-rg350-1fb422cde207b8b24ab9e8a545abb4c9204773c3.tar.gz scummvm-rg350-1fb422cde207b8b24ab9e8a545abb4c9204773c3.tar.bz2 scummvm-rg350-1fb422cde207b8b24ab9e8a545abb4c9204773c3.zip |
VOYEUR: Implemented sound effects for the lock screen
Diffstat (limited to 'engines')
-rw-r--r-- | engines/voyeur/sound.cpp | 15 | ||||
-rw-r--r-- | engines/voyeur/sound.h | 6 | ||||
-rw-r--r-- | engines/voyeur/voyeur.cpp | 2 |
3 files changed, 17 insertions, 6 deletions
diff --git a/engines/voyeur/sound.cpp b/engines/voyeur/sound.cpp index 628e6e27a9..baba45fb45 100644 --- a/engines/voyeur/sound.cpp +++ b/engines/voyeur/sound.cpp @@ -20,15 +20,22 @@ * */ +#include "audio/audiostream.h" +#include "audio/decoders/raw.h" +#include "common/memstream.h" #include "voyeur/sound.h" namespace Voyeur { -SoundManager::SoundManager() { +SoundManager::SoundManager(Audio::Mixer *mixer) { + _mixer = mixer; } void SoundManager::playVOCMap(byte *voc, int vocSize) { - // TODO + Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(voc, vocSize, DisposeAfterUse::NO); + Audio::AudioStream *audioStream = Audio::makeVOCStream(dataStream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES); + + _mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, audioStream); } bool SoundManager::vocMapStatus() { @@ -37,11 +44,11 @@ bool SoundManager::vocMapStatus() { } void SoundManager::continueVocMap() { - // TODO + // No implementation needed in ScummVM } void SoundManager::abortVOCMap() { - // TODO + _mixer->stopHandle(_soundHandle); } } // End of namespace Voyeur diff --git a/engines/voyeur/sound.h b/engines/voyeur/sound.h index 01d5dc20b9..0784b9274e 100644 --- a/engines/voyeur/sound.h +++ b/engines/voyeur/sound.h @@ -25,6 +25,8 @@ #include "common/scummsys.h" #include "common/str.h" +#include "audio/mixer.h" +#include "audio/decoders/voc.h" #include "voyeur/files.h" namespace Voyeur { @@ -32,8 +34,10 @@ namespace Voyeur { class SoundManager { private: VoyeurEngine *_vm; + Audio::Mixer *_mixer; + Audio::SoundHandle _soundHandle; public: - SoundManager(); + SoundManager(Audio::Mixer *mixer); void setVm(VoyeurEngine *vm) { _vm = vm; } void playVOCMap(byte *voc, int vocSize); diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index 871fc41d25..bafc360728 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -33,7 +33,7 @@ namespace Voyeur { VoyeurEngine *g_vm; VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc) : Engine(syst), - _gameDescription(gameDesc), _randomSource("Voyeur"), + _gameDescription(gameDesc), _randomSource("Voyeur"), _soundManager(_mixer), _defaultFontInfo(3, 0xff, 0xff, 0, 0, ALIGN_LEFT, 0, Common::Point(), 1, 1, Common::Point(1, 1), 1, 0, 0) { DebugMan.addDebugChannel(kDebugPath, "Path", "Pathfinding debug level"); |