[Scummvm-git-logs] scummvm master -> f08eb99259bae665c969c17c4744693c8d3dda1d

bluegr noreply at scummvm.org
Fri Dec 31 12:13:15 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f08eb99259 BURIED: Stop async comments from Arthur with the space key - FR #13188


Commit: f08eb99259bae665c969c17c4744693c8d3dda1d
    https://github.com/scummvm/scummvm/commit/f08eb99259bae665c969c17c4744693c8d3dda1d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2021-12-31T14:12:34+02:00

Commit Message:
BURIED: Stop async comments from Arthur with the space key - FR #13188

Changed paths:
    engines/buried/scene_view.cpp
    engines/buried/sound.cpp
    engines/buried/sound.h


diff --git a/engines/buried/scene_view.cpp b/engines/buried/scene_view.cpp
index 484cbbfa23f..c88ac3c9cce 100644
--- a/engines/buried/scene_view.cpp
+++ b/engines/buried/scene_view.cpp
@@ -2477,10 +2477,15 @@ void SceneViewWindow::onKeyUp(const Common::KeyState &key, uint flags) {
 		break;
 	case Common::KEYCODE_SPACE:
 		if (((GameUIWindow *)_parent)->_inventoryWindow->isItemInInventory(kItemBioChipAI) && _globalFlags.bcCloakingEnabled != 1) {
-			if (!_lastAICommentFileName.empty() && !_vm->_sound->isAsynchronousAICommentPlaying()) {
-				TempCursorChange cursorChange(kCursorWait);
-				_vm->_sound->playAsynchronousAIComment(_lastAICommentFileName);
+			if (!_lastAICommentFileName.empty()) {
+				if (!_vm->_sound->isAsynchronousAICommentPlaying()) {
+					TempCursorChange cursorChange(kCursorWait);
+					_vm->_sound->playAsynchronousAIComment(_lastAICommentFileName);
+				} else {
+					_vm->_sound->stopAsynchronousAIComment();
+				}
 			}
+
 			return;
 		}
 		break;
diff --git a/engines/buried/sound.cpp b/engines/buried/sound.cpp
index f7b2e15f5b1..834e7bc5eac 100644
--- a/engines/buried/sound.cpp
+++ b/engines/buried/sound.cpp
@@ -387,6 +387,12 @@ bool SoundManager::isAsynchronousAICommentPlaying() {
 	return _soundData[kAIVoiceIndex]->isPlaying();
 }
 
+void SoundManager::stopAsynchronousAIComment() {
+	if (isAsynchronousAICommentPlaying()) {
+		_soundData[kAIVoiceIndex]->stop();
+	}
+}
+
 int SoundManager::playSoundEffect(const Common::String &fileName, int volume, bool loop, bool oneShot) {
 	if (fileName.empty())
 		return -1;
diff --git a/engines/buried/sound.h b/engines/buried/sound.h
index ea106325612..bfcd6d1d86b 100644
--- a/engines/buried/sound.h
+++ b/engines/buried/sound.h
@@ -60,6 +60,7 @@ public:
 	bool playSynchronousAIComment(const Common::String &fileName);
 	bool playAsynchronousAIComment(const Common::String &fileName);
 	bool isAsynchronousAICommentPlaying();
+	void stopAsynchronousAIComment();
 
 	// SOUND EFFECTS FUNCTIONS
 	int playSoundEffect(const Common::String &fileName, int volume = 127, bool loop = false, bool oneShot = true);




More information about the Scummvm-git-logs mailing list