diff options
author | Filippos Karapetis | 2010-01-27 08:40:48 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-01-27 08:40:48 +0000 |
commit | 8606982590bb3c124cc4d17fbe15aa722803201e (patch) | |
tree | e2d16e15b45418b5c898ac586da9cac2e2f05f58 | |
parent | 812603e29eef2bd0c224a9b3b4c2bf29b2d3b653 (diff) | |
download | scummvm-rg350-8606982590bb3c124cc4d17fbe15aa722803201e.tar.gz scummvm-rg350-8606982590bb3c124cc4d17fbe15aa722803201e.tar.bz2 scummvm-rg350-8606982590bb3c124cc4d17fbe15aa722803201e.zip |
Moved the Shorten decoder inside the SAGA engine, as it's the only one using it (and it's still unfinished, too)
svn-id: r47592
-rw-r--r-- | engines/saga/module.mk | 1 | ||||
-rw-r--r-- | engines/saga/shorten.cpp (renamed from sound/decoders/shorten.cpp) | 10 | ||||
-rw-r--r-- | engines/saga/shorten.h (renamed from sound/decoders/shorten.h) | 15 | ||||
-rw-r--r-- | engines/saga/sndres.cpp | 8 | ||||
-rw-r--r-- | sound/module.mk | 1 |
5 files changed, 14 insertions, 21 deletions
diff --git a/engines/saga/module.mk b/engines/saga/module.mk index c1c29d2a79..9c10fa5bda 100644 --- a/engines/saga/module.mk +++ b/engines/saga/module.mk @@ -29,6 +29,7 @@ MODULE_OBJS := \ scene.o \ script.o \ sfuncs.o \ + shorten.o \ sndres.o \ sound.o \ sprite.o \ diff --git a/sound/decoders/shorten.cpp b/engines/saga/shorten.cpp index fc97f71b56..17f52fe924 100644 --- a/sound/decoders/shorten.cpp +++ b/engines/saga/shorten.cpp @@ -23,7 +23,7 @@ * */ -#include "sound/decoders/shorten.h" +#include "saga/shorten.h" #ifdef SOUND_SHORTEN_H @@ -34,13 +34,11 @@ #include "common/endian.h" #include "common/util.h" -#include "common/stream.h" -#include "sound/audiostream.h" #include "sound/mixer.h" #include "sound/decoders/raw.h" -namespace Audio { +namespace Saga { #define MASKTABSIZE 33 #define MAX_SUPPORTED_VERSION 3 @@ -515,7 +513,7 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by return unpackedBuffer; } -AudioStream *makeShortenStream(Common::SeekableReadStream &stream) { +Audio::AudioStream *makeShortenStream(Common::SeekableReadStream &stream) { int size, rate; byte *data, flags; data = loadShortenFromStream(stream, size, rate, flags); @@ -524,7 +522,7 @@ AudioStream *makeShortenStream(Common::SeekableReadStream &stream) { return 0; // Since we allocated our own buffer for the data, we must specify DisposeAfterUse::YES. - return makeRawMemoryStream(data, size, rate, flags); + return Audio::makeRawMemoryStream(data, size, rate, flags); } } // End of namespace Audio diff --git a/sound/decoders/shorten.h b/engines/saga/shorten.h index bc9f229687..368d2ac985 100644 --- a/sound/decoders/shorten.h +++ b/engines/saga/shorten.h @@ -25,11 +25,7 @@ // The code in this file is currently only used in SAGA2. // So when it is disabled, we will skip compiling it. -// We also enable this code for ScummVM builds including support -// for dynamic engine plugins. -// If you plan to use this code in another engine, you will have -// to add the proper define check here. -#if !(defined(ENABLE_SAGA2) || defined(DYNAMIC_MODULES)) +#if !(defined(ENABLE_SAGA2)) #else @@ -37,12 +33,11 @@ #define SOUND_SHORTEN_H #include "common/scummsys.h" +#include "common/stream.h" -namespace Common { class ReadStream; } +#include "sound/audiostream.h" -namespace Audio { - -class AudioStream; +namespace Saga { /** * Try to load a Shorten file from the given stream. Returns true if @@ -58,7 +53,7 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by * * This function uses loadShortenFromStream() internally. */ -AudioStream *makeShortenStream(Common::ReadStream &stream); +Audio::AudioStream *makeShortenStream(Common::ReadStream &stream); } // End of namespace Audio diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp index c4852f31c3..be65312963 100644 --- a/engines/saga/sndres.cpp +++ b/engines/saga/sndres.cpp @@ -37,12 +37,12 @@ #include "sound/audiostream.h" #include "sound/decoders/adpcm.h" #include "sound/decoders/aiff.h" -#ifdef ENABLE_SAGA2 -#include "sound/decoders/shorten.h" -#endif #include "sound/decoders/raw.h" #include "sound/decoders/voc.h" #include "sound/decoders/wave.h" +#ifdef ENABLE_SAGA2 +#include "saga/shorten.h" +#endif namespace Saga { @@ -323,7 +323,7 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff result = Audio::loadAIFFFromStream(readS, size, rate, buffer.flags); #ifdef ENABLE_SAGA2 } else if (resourceType == kSoundShorten) { - result = Audio::loadShortenFromStream(readS, size, rate, buffer.flags); + result = loadShortenFromStream(readS, size, rate, buffer.flags); #endif } else if (resourceType == kSoundVOC) { data = Audio::loadVOCFromStream(readS, size, rate); diff --git a/sound/module.mk b/sound/module.mk index 1506d46c80..10cf090325 100644 --- a/sound/module.mk +++ b/sound/module.mk @@ -19,7 +19,6 @@ MODULE_OBJS := \ decoders/iff_sound.o \ decoders/mp3.o \ decoders/raw.o \ - decoders/shorten.o \ decoders/vag.o \ decoders/voc.o \ decoders/vorbis.o \ |