[Scummvm-git-logs] scummvm master -> 3a4ae7bbc724641e5f11ba7294321c1829086f99

neuromancer noreply at scummvm.org
Thu Feb 3 15:48:03 UTC 2022


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:
3a4ae7bbc7 HYPNO: better sound handling


Commit: 3a4ae7bbc724641e5f11ba7294321c1829086f99
    https://github.com/scummvm/scummvm/commit/3a4ae7bbc724641e5f11ba7294321c1829086f99
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-02-03T16:48:07+01:00

Commit Message:
HYPNO: better sound handling

Changed paths:
    engines/hypno/arcade.cpp
    engines/hypno/hypno.cpp
    engines/hypno/wet/wet.cpp


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 48f2bf3b277..26f967d0dd4 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -404,6 +404,8 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 	if (background.decoder)
 		skipVideo(background);
 
+	stopSound();
+	_music.clear();
 }
 
 int HypnoEngine::detectTarget(const Common::Point &mousePos) {
diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index 6e23ef90b16..a2b7a745f8f 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -517,16 +517,21 @@ void HypnoEngine::skipVideo(MVideo &video) {
 void HypnoEngine::playSound(const Common::String &filename, uint32 loops) {
 	debugC(1, kHypnoDebugMedia, "%s(%s, %d)", __FUNCTION__, filename.c_str(), loops);
 	Common::String name = convertPath(filename);
-	if (!_prefixDir.empty())
-		name = _prefixDir + "/" + name;
 
 	Audio::LoopingAudioStream *stream = nullptr;
 	Common::File *file = new Common::File();
 	if (file->open(name)) {
 		stream = new Audio::LoopingAudioStream(Audio::makeRawStream(file, 22050, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES), loops);
 		_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, stream, -1, Audio::Mixer::kMaxChannelVolume);
-	} else
-		debugC(1, kHypnoDebugMedia, "%s not found!", name.c_str());
+	} else {
+		if (!_prefixDir.empty())
+			name = _prefixDir + "/" + name;
+		if (file->open(name)) {
+			stream = new Audio::LoopingAudioStream(Audio::makeRawStream(file, 22050, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES), loops);
+			_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, stream, -1, Audio::Mixer::kMaxChannelVolume);
+		} else 
+			debugC(1, kHypnoDebugMedia, "%s not found!", name.c_str());
+	}
 }
 
 void HypnoEngine::stopSound() {
diff --git a/engines/hypno/wet/wet.cpp b/engines/hypno/wet/wet.cpp
index 236cb3483c1..9b09f64a205 100644
--- a/engines/hypno/wet/wet.cpp
+++ b/engines/hypno/wet/wet.cpp
@@ -198,7 +198,7 @@ void WetEngine::loadAssetsPCG() {
 	over->intros.push_back("g.s");
 	_levels["<gameover>"] = over;
 
-	loadLib("", "sound.lib", false);
+	loadLib("sound/", "sound.lib", false);
 	_nextLevel = "<start>";
 }
 




More information about the Scummvm-git-logs mailing list