summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/openttd.cpp2
-rw-r--r--src/sound/null_s.h1
-rw-r--r--src/sound/sound_driver.hpp11
3 files changed, 13 insertions, 1 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 337bcda4d..d20e88cd8 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1111,7 +1111,7 @@ void SwitchToMode(SwitchMode new_mode)
case SM_MENU: // Switch to game intro menu
LoadIntroGame();
- if (BaseSounds::ini_set.empty() && BaseSounds::GetUsedSet()->fallback) {
+ if (BaseSounds::ini_set.empty() && BaseSounds::GetUsedSet()->fallback && SoundDriver::GetInstance()->HasOutput()) {
ShowErrorMessage(STR_WARNING_FALLBACK_SOUNDSET, INVALID_STRING_ID, WL_CRITICAL);
BaseSounds::ini_set = BaseSounds::GetUsedSet()->name;
}
diff --git a/src/sound/null_s.h b/src/sound/null_s.h
index c01eae32a..9bc660b92 100644
--- a/src/sound/null_s.h
+++ b/src/sound/null_s.h
@@ -19,6 +19,7 @@ public:
void Stop() override { }
const char *GetName() const override { return "null"; }
+ bool HasOutput() const override { return false; }
};
/** Factory for the null sound driver. */
diff --git a/src/sound/sound_driver.hpp b/src/sound/sound_driver.hpp
index 6de66d74e..062e7704d 100644
--- a/src/sound/sound_driver.hpp
+++ b/src/sound/sound_driver.hpp
@@ -19,6 +19,17 @@ public:
virtual void MainLoop() {}
/**
+ * Whether the driver has an output from which the user can hear sound.
+ * Or in other words, whether we should warn the user if no soundset is
+ * loaded and that loading one would fix the sound problems.
+ * @return True for all drivers except null.
+ */
+ virtual bool HasOutput() const
+ {
+ return true;
+ }
+
+ /**
* Get the currently active instance of the sound driver.
*/
static SoundDriver *GetInstance() {