aboutsummaryrefslogtreecommitdiff
path: root/scumm/smush
diff options
context:
space:
mode:
authorPaweł Kołodziejski2002-10-27 19:32:36 +0000
committerPaweł Kołodziejski2002-10-27 19:32:36 +0000
commitbf3505da5c161a448c0431c2ae0c81368a7ae673 (patch)
treec1421f7c6efb45277febcc1263ae1fa64a0cdb13 /scumm/smush
parentf9195c154c3631e1f9125496063f97c913aee737 (diff)
downloadscummvm-rg350-bf3505da5c161a448c0431c2ae0c81368a7ae673.tar.gz
scummvm-rg350-bf3505da5c161a448c0431c2ae0c81368a7ae673.tar.bz2
scummvm-rg350-bf3505da5c161a448c0431c2ae0c81368a7ae673.zip
don't put samples into stream SoundMixer if sound card is disabled
svn-id: r5338
Diffstat (limited to 'scumm/smush')
-rw-r--r--scumm/smush/scumm_renderer.cpp32
1 files changed, 19 insertions, 13 deletions
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);
}