aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/sndres.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-01-02 19:10:51 +0000
committerFilippos Karapetis2009-01-02 19:10:51 +0000
commit90d762c2612028892133d4aaf616b9eede9e397f (patch)
treee0c71e2f47c73475e0d769e62a9aa7c27368b053 /engines/saga/sndres.cpp
parent7c629b5f6a0daf5c9c62708774eefdbebc6dece9 (diff)
downloadscummvm-rg350-90d762c2612028892133d4aaf616b9eede9e397f.tar.gz
scummvm-rg350-90d762c2612028892133d4aaf616b9eede9e397f.tar.bz2
scummvm-rg350-90d762c2612028892133d4aaf616b9eede9e397f.zip
Wrapped more engine-specific code around appropriate ifdefs
svn-id: r35679
Diffstat (limited to 'engines/saga/sndres.cpp')
-rw-r--r--engines/saga/sndres.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp
index 4b11a8612c..f7c3b07beb 100644
--- a/engines/saga/sndres.cpp
+++ b/engines/saga/sndres.cpp
@@ -38,7 +38,9 @@
#include "sound/wave.h"
#include "sound/adpcm.h"
#include "sound/aiff.h"
+#ifdef ENABLE_SAGA2
#include "sound/shorten.h"
+#endif
#include "sound/audiostream.h"
namespace Saga {
@@ -96,24 +98,29 @@ SndRes::SndRes(SagaEngine *vm) : _vm(vm) {
_fxTable = 0;
_fxTableLen = 0;
#endif
+#ifdef ENABLE_SAGA2
} else if (_vm->getGameId() == GID_DINO) {
// TODO
} else if (_vm->getGameId() == GID_FTA2) {
// TODO
+#endif
}
}
SndRes::~SndRes() {
+#ifdef ENABLE_IHNM
if (_vm->getGameId() == GID_IHNM) {
free(_fxTable);
free(_fxTableIDs);
}
+#endif
}
void SndRes::setVoiceBank(int serial) {
if (_voiceSerial == serial)
return;
+#ifdef ENABLE_IHNM
// If we got the Macintosh version of IHNM, just set the voice bank
// so that we know which voices* subfolder to look for later
if (_vm->getGameId() == GID_IHNM && _vm->isMacResources()) {
@@ -125,6 +132,7 @@ void SndRes::setVoiceBank(int serial) {
_voiceContext->serial = 0;
return;
}
+#endif
// If there are no voice files present, don't set the voice bank
if (!_vm->_voiceFilesExist)
@@ -192,6 +200,7 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
return false;
}
+#ifdef ENABLE_IHNM
if (_vm->getGameId() == GID_IHNM && _vm->isMacResources()) {
char soundFileName[40];
int dirIndex = resourceId / 64;
@@ -210,14 +219,14 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
file->open(soundFileName);
soundResourceLength = file->size();
- } else {
-
+ } else
+#endif
+ {
ResourceData* resourceData = context->getResourceData(resourceId);
file = context->getFile(resourceData);
file->seek(resourceData->offset);
soundResourceLength = resourceData->size;
-
}
Common::SeekableReadStream& readS = *file;
@@ -314,13 +323,15 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
result = Audio::loadWAVFromStream(readS, size, rate, flags);
} else if (resourceType == kSoundAIFF) {
result = Audio::loadAIFFFromStream(readS, size, rate, flags);
- } else if (resourceType == kSoundShorten) {
- result = Audio::loadShortenFromStream(readS, size, rate, flags);
} else if (resourceType == kSoundVOC) {
data = Audio::loadVOCFromStream(readS, size, rate);
result = (data != 0);
if (onlyHeader)
free(data);
+#ifdef ENABLE_SAGA2
+ } else if (resourceType == kSoundShorten) {
+ result = Audio::loadShortenFromStream(readS, size, rate, flags);
+#endif
}
if (result) {