aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-06-30 16:00:14 +0200
committerThierry Crozat2018-01-22 23:42:08 +0000
commit11b62275179e6a7df5cece9581c62fb60ac81719 (patch)
treeac635a375759feee08ad8895c0017d2f0958f78d /engines
parent1b220e75e53c5dbd09842ba918b8cb05b542604f (diff)
downloadscummvm-rg350-11b62275179e6a7df5cece9581c62fb60ac81719.tar.gz
scummvm-rg350-11b62275179e6a7df5cece9581c62fb60ac81719.tar.bz2
scummvm-rg350-11b62275179e6a7df5cece9581c62fb60ac81719.zip
SUPERNOVA: Buffer Music files
Diffstat (limited to 'engines')
-rw-r--r--engines/supernova/supernova.cpp18
-rw-r--r--engines/supernova/supernova.h1
2 files changed, 11 insertions, 8 deletions
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index 0929f6c19d..8086753e13 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -121,6 +121,8 @@ SupernovaEngine::~SupernovaEngine() {
for (int i = 0; i < kAudioNumSamples; ++i) {
delete[] _soundSamples[i]._buffer;
}
+ delete _soundMusic[0];
+ delete _soundMusic[1];
}
Common::Error SupernovaEngine::run() {
@@ -217,6 +219,9 @@ void SupernovaEngine::initData() {
file.close();
}
+ _soundMusic[0] = convertToMod("msn_data.049");
+ _soundMusic[1] = convertToMod("msn_data.052");
+
// Cursor
const uint16 *bufferNormal = reinterpret_cast<const uint16 *>(mouseNormal);
const uint16 *bufferWait = reinterpret_cast<const uint16 *>(mouseWait);
@@ -261,14 +266,11 @@ void SupernovaEngine::playSoundMod(int filenumber)
return;
}
- Common::MemoryReadStream *modBuffer;
- modBuffer = convertToMod(Common::String::format("msn_data.%03d", filenumber).c_str());
-
- if (modBuffer) {
- Audio::AudioStream *audioStream = Audio::makeProtrackerStream(modBuffer);
- stopSound();
- _mixer->playStream(Audio::Mixer::kMusicSoundType, &_soundHandle, audioStream);
- }
+ int index = filenumber == 49 ? 0 : 1;
+ Audio::AudioStream *audioStream = Audio::makeProtrackerStream(_soundMusic[index]);
+ stopSound();
+ _mixer->playStream(Audio::Mixer::kMusicSoundType, &_soundHandle, audioStream,
+ -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO);
}
void SupernovaEngine::renderImage(MSNImageDecoder &image, int section, bool fullscreen) {
diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h
index 53fd796bd7..7362438a69 100644
--- a/engines/supernova/supernova.h
+++ b/engines/supernova/supernova.h
@@ -90,6 +90,7 @@ public:
byte *_buffer;
int _length;
} _soundSamples[kAudioNumSamples];
+ Common::MemoryReadStream *_soundMusic[2];
Common::Event _event;
bool _gameRunning;
int _screenWidth;