aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/imuse.cpp14
-rw-r--r--scumm/scumm.h1
-rw-r--r--scumm/scummvm.cpp2
-rw-r--r--scumm/smush/scumm_renderer.cpp32
-rw-r--r--scumm/sound.cpp4
-rw-r--r--sound/mixer.cpp3
6 files changed, 37 insertions, 19 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index b23472ead4..0c2949375e 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -5437,12 +5437,14 @@ void IMuseDigital::handler() {
}
}
- if (_channel[l]._initialized == false) {
- _scumm->_mixer->playStream(NULL, l, buf, mixer_size,
- _channel[l]._freq, _channel[l]._mixerFlags, 3, 2000000);
- _channel[l]._initialized = true;
- } else {
- _scumm->_mixer->append(l, buf, mixer_size, _channel[l]._freq, _channel[l]._mixerFlags);
+ if (_scumm->_silentDigitalImuse == false) {
+ if (_channel[l]._initialized == false) {
+ _scumm->_mixer->playStream(NULL, l, buf, mixer_size,
+ _channel[l]._freq, _channel[l]._mixerFlags, 3, 2000000);
+ _channel[l]._initialized = true;
+ } else {
+ _scumm->_mixer->append(l, buf, mixer_size, _channel[l]._freq, _channel[l]._mixerFlags);
+ }
}
}
}
diff --git a/scumm/scumm.h b/scumm/scumm.h
index d1ec8f5795..46485e3918 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -884,6 +884,7 @@ public:
uint16 _defaultTalkDelay;
bool _use_adlib;
int tempMusic;
+ bool _silentDigitalImuse;
int _saveSound;
uint16 _soundParam, _soundParam2, _soundParam3;
int current_cd_sound, _cd_loops, _cd_frame, _cd_track, _cd_end;
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 836c182ef7..8be21e8bf0 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -118,6 +118,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
/* Bind the mixer to the system => mixer will be invoked
* automatically when samples need to be generated */
+ _silentDigitalImuse = false;
if (!_mixer->bindToSystem(syst)) {
warning("Sound initialization failed");
if (detector->_use_adlib) {
@@ -126,6 +127,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
detector->_midi_driver = MD_NULL;
warning("Adlib music was selected, switching to midi null driver");
}
+ _silentDigitalImuse = true;
}
_mixer->setVolume(kDefaultSFXVolume);
_mixer->setMusicVolume(kDefaultMusicVolume);
diff --git a/scumm/smush/scumm_renderer.cpp b/scumm/smush/scumm_renderer.cpp
index f5e8dafd6d..0664a65e1f 100644
--- a/scumm/smush/scumm_renderer.cpp
+++ b/scumm/smush/scumm_renderer.cpp
@@ -49,6 +49,7 @@ public:
bool handleFrame();
bool stop();
bool update();
+ bool _silentMixer;
};
ScummMixer::ScummMixer(SoundMixer * m) : _mixer(m), _nextIndex(_mixer->_beginSlots) {
@@ -147,13 +148,15 @@ bool ScummMixer::handleFrame() {
if(_channels[i].chan->getRate() == 11025) size *= 2;
size *= stereo ? 4 : 2;
- // append to _sound
- if(_channels[i].first) {
- _channels[i].mixer_index = _mixer->playStream(NULL, -1, data, size, rate, flags | SoundMixer::FLAG_16BITS);
- debug(5, "channel %d bound to mixer_index %d", _channels[i].id, _channels[i].mixer_index);
- _channels[i].first = false;
- } else {
- _mixer->append(_channels[i].mixer_index, data, size, rate, flags | SoundMixer::FLAG_16BITS);
+ if(_silentMixer == false) {
+ // append to _sound
+ if(_channels[i].first) {
+ _channels[i].mixer_index = _mixer->playStream(NULL, -1, data, size, rate, flags | SoundMixer::FLAG_16BITS);
+ debug(5, "channel %d bound to mixer_index %d", _channels[i].id, _channels[i].mixer_index);
+ _channels[i].first = false;
+ } else {
+ _mixer->append(_channels[i].mixer_index, data, size, rate, flags | SoundMixer::FLAG_16BITS);
+ }
}
delete []data;
@@ -163,12 +166,14 @@ bool ScummMixer::handleFrame() {
if(_channels[i].chan->getRate() == 11025) size *= 2;
size *= stereo ? 2 : 1;
- // append to _sound
- if(_channels[i].first) {
- _channels[i].mixer_index = _mixer->playStream(NULL, -1, data, size, rate, flags | SoundMixer::FLAG_UNSIGNED);
- _channels[i].first = false;
- } else {
- _mixer->append(_channels[i].mixer_index, data, size, rate, flags | SoundMixer::FLAG_UNSIGNED);
+ if(_silentMixer == false) {
+ // append to _sound
+ if(_channels[i].first) {
+ _channels[i].mixer_index = _mixer->playStream(NULL, -1, data, size, rate, flags | SoundMixer::FLAG_UNSIGNED);
+ _channels[i].first = false;
+ } else {
+ _mixer->append(_channels[i].mixer_index, data, size, rate, flags | SoundMixer::FLAG_UNSIGNED);
+ }
}
delete []data;
@@ -207,6 +212,7 @@ Mixer * ScummRenderer::getMixer() {
if(_smixer == 0) {
_smixer = new ScummMixer(_scumm->_mixer);
if(!_smixer) error("unable to allocate a smush mixer");
+ _smixer->_silentMixer = _scumm->_silentDigitalImuse;
s_renderer = this;
_scumm->_timer->installProcedure(&smush_handler, _insaneSpeed);
}
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 49a5530930..acd7bf9165 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -925,6 +925,10 @@ static void music_handler (void * engine) {
#define OUTPUT_SIZE 66150 // ((22050 * 2 * 2) / 4) * 3
void Sound::playBundleMusic(char * song) {
+ if (_scumm->_silentDigitalImuse == true) {
+ return;
+ }
+
if (_nameBundleMusic == NULL) {
if (_scumm->_bundle->openMusicFile("digmusic.bun", _scumm->getGameDataPath()) == false) {
return;
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index 73aef6178f..6faaf22c67 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -28,6 +28,9 @@
SoundMixer::SoundMixer() {
_volumeTable = (int16 *)calloc(256 * sizeof(int16), 1);
_beginSlots = 0;
+ for (int i = 0; i != NUM_CHANNELS; i++) {
+ _channels[i] = NULL;
+ }
}
SoundMixer::~SoundMixer() {