diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/core.cpp | 6 | ||||
-rw-r--r-- | engines/tsage/sound.cpp | 20 | ||||
-rw-r--r-- | engines/tsage/sound.h | 1 |
3 files changed, 17 insertions, 10 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 3021134b46..8021160514 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1619,7 +1619,8 @@ void SceneItem::display(int resNum, int lineNum, ...) { Common::String msg = (!resNum || (resNum == -1)) ? Common::String() : g_resourceManager->getMessage(resNum, lineNum); - if ((g_vm->getGameID() != GType_Ringworld) && T2_GLOBALS._uiElements._active) + if ((g_vm->getGameID() != GType_Ringworld) && (g_vm->getGameID() != GType_Ringworld2) + && T2_GLOBALS._uiElements._active) T2_GLOBALS._uiElements.hide(); if (g_globals->_sceneObjects->contains(&g_globals->_sceneText)) { @@ -1797,7 +1798,8 @@ void SceneItem::display(int resNum, int lineNum, ...) { g_globals->_sceneText.remove(); } - if ((g_vm->getGameID() != GType_Ringworld) && T2_GLOBALS._uiElements._active) { + if ((g_vm->getGameID() != GType_Ringworld) && (g_vm->getGameID() != GType_Ringworld2) + && T2_GLOBALS._uiElements._active) { // Show user interface T2_GLOBALS._uiElements.show(); diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index bb98d4dc03..844cfc1d4d 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -2539,6 +2539,7 @@ void PlayStream::ResFileData::load(Common::SeekableReadStream &stream) { PlayStream::PlayStream(): EventHandler() { _index = NULL; _endAction = NULL; + _audioStream = NULL; } PlayStream::~PlayStream() { @@ -2585,12 +2586,12 @@ bool PlayStream::play(int voiceNum, EventHandler *endAction) { _file.skip(4); // Create the stream - Audio::QueuingAudioStream *audioStream = Audio::makeQueuingAudioStream(rate, false); + _audioStream = Audio::makeQueuingAudioStream(rate, false); // Load in the first chunk byte *data = (byte *)malloc(chunkSize); _file.read(data, chunkSize); - audioStream->queueBuffer(data, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); + _audioStream->queueBuffer(data, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); // If necessary, load further chunks of the voice in while (chunkSize == (_resData._chunkSize - 16)) { @@ -2609,13 +2610,13 @@ bool PlayStream::play(int voiceNum, EventHandler *endAction) { // Read in the data for this next chunk and queue it data = (byte *)malloc(chunkSize); _file.read(data, chunkSize); - audioStream->queueBuffer(data, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); + _audioStream->queueBuffer(data, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); } - + g_vm->_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, - audioStream, DisposeAfterUse::YES); + _audioStream, DisposeAfterUse::YES); _voiceNum = voiceNum; - return true; + return true; } // If it reaches this point, no valid voice data found @@ -2623,14 +2624,17 @@ bool PlayStream::play(int voiceNum, EventHandler *endAction) { } void PlayStream::stop() { - g_vm->_mixer->stopHandle(_soundHandle); + if (_audioStream) { + g_vm->_mixer->stopHandle(_soundHandle); + } + _audioStream = NULL; _voiceNum = 0; _endAction = NULL; } bool PlayStream::isPlaying() const { - return _voiceNum != 0 && g_vm->_mixer->isSoundHandleActive(_soundHandle); + return _audioStream != NULL && !_audioStream->endOfData(); } void PlayStream::remove() { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 6778044d03..95d0337af3 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -427,6 +427,7 @@ class PlayStream: public EventHandler { private: Common::File _file; ResFileData _resData; + Audio::QueuingAudioStream *_audioStream; Audio::SoundHandle _soundHandle; uint16 *_index; EventHandler *_endAction; |