aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/supernova/supernova.cpp22
-rw-r--r--engines/supernova/supernova.h3
2 files changed, 14 insertions, 11 deletions
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index 1f0eb9b917..3fe07dc0d0 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -101,6 +101,8 @@ SupernovaEngine::SupernovaEngine(OSystem *syst)
, _console(NULL)
, _gm(NULL)
, _currentImage(NULL)
+ , _soundMusicIntro(NULL)
+ , _soundMusicOutro(NULL)
, _brightness(255)
, _menuBrightness(255)
, _delay(33)
@@ -121,8 +123,6 @@ SupernovaEngine::SupernovaEngine(OSystem *syst)
DebugMan.addDebugChannel(kDebugGeneral, "general", "Supernova general debug channel");
_rnd = new Common::RandomSource("supernova");
- _soundMusic[0] = NULL;
- _soundMusic[1] = NULL;
}
SupernovaEngine::~SupernovaEngine() {
@@ -132,8 +132,8 @@ SupernovaEngine::~SupernovaEngine() {
delete _rnd;
delete _console;
delete _gm;
- delete _soundMusic[0];
- delete _soundMusic[1];
+ delete _soundMusicIntro;
+ delete _soundMusicOutro;
}
Common::Error SupernovaEngine::run() {
@@ -360,8 +360,8 @@ void SupernovaEngine::initData() {
file.close();
}
- _soundMusic[0] = convertToMod("msn_data.049");
- _soundMusic[1] = convertToMod("msn_data.052");
+ _soundMusicIntro = convertToMod("msn_data.049");
+ _soundMusicOutro = convertToMod("msn_data.052");
// Cursor
const uint16 *bufferNormal = reinterpret_cast<const uint16 *>(mouseNormal);
@@ -403,12 +403,14 @@ void SupernovaEngine::stopSound() {
void SupernovaEngine::playSoundMod(int filenumber)
{
- if (filenumber != 49 && filenumber != 52) {
+ Audio::AudioStream *audioStream;
+ if (filenumber == 49)
+ audioStream = Audio::makeProtrackerStream(_soundMusicIntro);
+ else if (filenumber == 52)
+ audioStream = Audio::makeProtrackerStream(_soundMusicOutro);
+ else
return;
- }
- 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);
diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h
index 8b1fe40dad..29d7dd678b 100644
--- a/engines/supernova/supernova.h
+++ b/engines/supernova/supernova.h
@@ -106,7 +106,8 @@ public:
byte _mouseWait[256];
MSNImageDecoder *_currentImage;
SoundSample _soundSamples[kAudioNumSamples];
- Common::MemoryReadStream *_soundMusic[2];
+ Common::MemoryReadStream *_soundMusicIntro;
+ Common::MemoryReadStream *_soundMusicOutro;
Common::Event _event;
int _screenWidth;
int _screenHeight;