From a8e88b624d048882a2959157618d5c4c99dd9a68 Mon Sep 17 00:00:00 2001 From: Louis Gombert Date: Sat, 26 Oct 2024 18:43:51 +0200 Subject: [PATCH] Do no try opening audio streams when the '-nosound' option is specified When the option was specified, many messages were spamming the console in debug mode "Error opening stream X.osf on channel Y." --- Descent3/init.cpp | 2 +- editor/gameeditor.cpp | 4 ++-- music/sequencer.cpp | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Descent3/init.cpp b/Descent3/init.cpp index fcec5fce..a6090ddb 100644 --- a/Descent3/init.cpp +++ b/Descent3/init.cpp @@ -1912,7 +1912,7 @@ void InitD3Systems2(bool editor) { // the remaining sound system InitVoices(); - InitD3Music(FindArg("-nomusic") ? false : true); + InitD3Music(FindArg("-nomusic") || FindArg("-nosound") ? false : true); InitAmbientSoundSystem(); InitGameSystems(editor); diff --git a/editor/gameeditor.cpp b/editor/gameeditor.cpp index efbb05ca..a4c09d24 100644 --- a/editor/gameeditor.cpp +++ b/editor/gameeditor.cpp @@ -886,7 +886,7 @@ void InitEditGameSystems() { ddio_MouseMode(MOUSE_EXCLUSIVE_MODE); // Sound initialization - InitD3Music(FindArg("-nomusic") ? false : true); + InitD3Music(FindArg("-nomusic") || FindArg("-nosound") ? false : true); Sound_system.InitSoundLib(Descent, Sound_mixer, Sound_quality, false); // UI init. @@ -925,7 +925,7 @@ void InitGameEditSystems() { ddio_MouseMode(MOUSE_STANDARD_MODE); // Sound initialization for editor - InitD3Music(FindArg("-nomusic") ? false : true); + InitD3Music(FindArg("-nomusic") || FindArg("-nosound") ? false : true); Sound_system.InitSoundLib(Descent, Sound_mixer, Sound_quality, false); NewUIClose(); diff --git a/music/sequencer.cpp b/music/sequencer.cpp index 6a2130aa..38521f0c 100644 --- a/music/sequencer.cpp +++ b/music/sequencer.cpp @@ -395,7 +395,6 @@ next_ins: // skip instructions until error is cleared. if (!err) { - // mprintf(0, "MUSIC: Error opening stream %s on channel %d.\n", name, m_dominant_strm); LOG_WARNING.printf("Error opening stream %s on channel %d.", name, m_dominant_strm); strm->error = true; }