From 5838ef6719f5658dfcb381fbec1ddb7625db58cc Mon Sep 17 00:00:00 2001 From: md5 Date: Fri, 13 May 2011 21:09:31 +0300 Subject: [PATCH] SWORD25: Fix compilation when libvorbis is not present (cherry picked from commit 2d3ad096ab92a6ddcd2b14436937649bbabcd12f) --- audio/decoders/vorbis.h | 1 + engines/sword25/sfx/soundengine.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/audio/decoders/vorbis.h b/audio/decoders/vorbis.h index 51d0b82d5fa..8f02b6e43a1 100644 --- a/audio/decoders/vorbis.h +++ b/audio/decoders/vorbis.h @@ -36,6 +36,7 @@ * - scumm * - sword1 * - sword2 + * - sword25 * - touche * - tucker */ diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index 08f0f5b4ae5..80bc5bce3bc 100644 --- a/engines/sword25/sfx/soundengine.cpp +++ b/engines/sword25/sfx/soundengine.cpp @@ -154,13 +154,17 @@ bool SoundEngine::playSound(const Common::String &fileName, SOUND_TYPES type, fl uint SoundEngine::playSoundEx(const Common::String &fileName, SOUND_TYPES type, float volume, float pan, bool loop, int loopStart, int loopEnd, uint layer) { Common::SeekableReadStream *in = Kernel::getInstance()->getPackage()->getStream(fileName); +#ifdef USE_VORBIS Audio::SeekableAudioStream *stream = Audio::makeVorbisStream(in, DisposeAfterUse::YES); +#endif uint id; SndHandle *handle = getHandle(&id); debugC(1, kDebugSound, "SoundEngine::playSoundEx(%s, %d, %f, %f, %d, %d, %d, %d)", fileName.c_str(), type, volume, pan, loop, loopStart, loopEnd, layer); +#ifdef USE_VORBIS _mixer->playStream(getType(type), &(handle->handle), stream, -1, (byte)(volume * 255), (int8)(pan * 127)); +#endif return id; }