aboutsummaryrefslogtreecommitdiff
path: root/engines/sludge/sound.cpp
diff options
context:
space:
mode:
authoryinsimei2017-06-09 07:32:00 +0200
committerEugene Sandulenko2017-07-13 18:27:45 +0200
commit51a20af06427e1e40facf0dd0bd9cb614ccfffca (patch)
treeb95bd3b0184aac9f3ec57f8ffe579a873acf01e4 /engines/sludge/sound.cpp
parentef9438065fea8c1a58b6ebb2a8f1ecc72b2037f7 (diff)
downloadscummvm-rg350-51a20af06427e1e40facf0dd0bd9cb614ccfffca.tar.gz
scummvm-rg350-51a20af06427e1e40facf0dd0bd9cb614ccfffca.tar.bz2
scummvm-rg350-51a20af06427e1e40facf0dd0bd9cb614ccfffca.zip
SLUDGE: leave MOD sound loading aside
Diffstat (limited to 'engines/sludge/sound.cpp')
-rw-r--r--engines/sludge/sound.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/engines/sludge/sound.cpp b/engines/sludge/sound.cpp
index 26bf17635e..0aa9d57c86 100644
--- a/engines/sludge/sound.cpp
+++ b/engines/sludge/sound.cpp
@@ -31,6 +31,7 @@
#include "audio/mixer.h"
#include "audio/decoders/wave.h"
#include "audio/decoders/vorbis.h"
+#include "audio/mods/protracker.h"
#include "sludge/allfiles.h"
#include "sludge/debug.h"
@@ -390,6 +391,30 @@ char *loadEntireFileToMemory(Common::SeekableReadStream *inputFile,
}
bool playMOD(int f, int a, int fromTrack) {
+#if 0
+ // load sound
+ setResourceForFatal(f);
+ uint32 length = openFileFromNum(f);
+ if (length == 0) {
+ finishAccess();
+ setResourceForFatal(-1);
+ return false;
+ }
+
+ Common::SeekableReadStream *memImage = bigDataFile->readStream(length);
+ if (memImage->size() != length || bigDataFile->err())
+ debug("Sound reading failed");
+ Audio::AudioStream *stream = Audio::makeProtrackerStream(memImage);
+ //TODO: replace by xm file decoders
+ if (!stream)
+ return false;
+
+ // play sound
+ Audio::SoundHandle soundHandle;
+ g_sludge->_mixer->playStream(Audio::Mixer::kSFXSoundType, &soundHandle,
+ stream, -1, Audio::Mixer::kMaxChannelVolume);
+#endif
+#if 0
if (!soundOK)
return true;
stopMOD(a);
@@ -401,7 +426,7 @@ bool playMOD(int f, int a, int fromTrack) {
setResourceForFatal(-1);
return false;
}
-#if 0
+
unsigned char *memImage;
memImage = (unsigned char *) loadEntireFileToMemory(bigDataFile, length);
if (! memImage) return fatal(ERROR_MUSIC_MEMORY_LOW);