diff options
author | James Brown | 2003-01-24 06:41:10 +0000 |
---|---|---|
committer | James Brown | 2003-01-24 06:41:10 +0000 |
commit | 5f7cd1c93d0d1cc600e634173610fbdc8ab82d69 (patch) | |
tree | d6ff54e45963d70b88c7e1a5c266e68196e707d2 | |
parent | c1930e0ff52af45366060881edb085cc3b9fdb4c (diff) | |
download | scummvm-rg350-5f7cd1c93d0d1cc600e634173610fbdc8ab82d69.tar.gz scummvm-rg350-5f7cd1c93d0d1cc600e634173610fbdc8ab82d69.tar.bz2 scummvm-rg350-5f7cd1c93d0d1cc600e634173610fbdc8ab82d69.zip |
LCA'03 commit: Fix talking where no sound hardware is present
svn-id: r6536
-rw-r--r-- | scumm/scumm.h | 2 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 1 | ||||
-rw-r--r-- | scumm/sound.cpp | 16 |
3 files changed, 13 insertions, 6 deletions
diff --git a/scumm/scumm.h b/scumm/scumm.h index 490785f708..46cebc6979 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -852,7 +852,7 @@ public: uint16 _defaultTalkDelay; bool _use_adlib; int tempMusic; - bool _silentDigitalImuse; + bool _silentDigitalImuse, _noDigitalSamples; int _saveSound; int current_cd_sound; diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index d3cf752a7f..f5dae0b3ff 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -156,6 +156,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) warning("Adlib music was selected, switching to midi null driver"); } _silentDigitalImuse = true; + _noDigitalSamples = true; } _mixer->setVolume(kDefaultSFXVolume * kDefaultMasterVolume / 255); _mixer->setMusicVolume(kDefaultMusicVolume); diff --git a/scumm/sound.cpp b/scumm/sound.cpp index bc72f183a5..9a7b6b941c 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -416,8 +416,8 @@ void Sound::processSfxQueues() { if (_scumm->_vars[_scumm->VAR_TALK_ACTOR]) { //_sfxMode & 2) { act = _scumm->_vars[_scumm->VAR_TALK_ACTOR]; - if (_talkChannel < 0) - finished = false; + if (_talkChannel < 1) + finished = true; else if (_scumm->_mixer->_channels[_talkChannel] == NULL) { finished = true; } else @@ -772,6 +772,9 @@ int Sound::startSfxSound(File *file, int file_size) { int rate, comp; byte *data; + if (_scumm->_noDigitalSamples) + return -1; + if (file_size > 0) { int alloc_size = file_size; #ifdef USE_MAD @@ -1136,7 +1139,10 @@ void Sound::bundleMusicHandler(Scumm * scumm) { int Sound::playBundleSound(char *sound) { byte * ptr; bool result; - + + if (_scumm->_noDigitalSamples) + return -1; + if (_scumm->_gameId == GID_CMI) { char voxfile[20]; sprintf(voxfile, "voxdisk%d.bun", _scumm->_vars[_scumm->VAR_CURRENTDISK]); @@ -1238,7 +1244,7 @@ int Sound::playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned) { int Sound::playSfxSound_MP3(void *sound, uint32 size) { #ifdef USE_MAD - if (_soundsPaused) + if (_soundsPaused || _scumm->_noDigitalSamples) return -1; return _scumm->_mixer->playMP3(NULL, sound, size, SoundMixer::FLAG_AUTOFREE); #endif @@ -1309,7 +1315,7 @@ static ov_callbacks data_wrap = { int Sound::playSfxSound_Vorbis(void *sound, uint32 size) { #ifdef USE_VORBIS - if (_soundsPaused) + if (_soundsPaused || _scumm->_noDigitalSamples) return -1; OggVorbis_File *ov_file = new OggVorbis_File; |