From 8145b52037ab3b877aac56d9cab3630bd1bc752b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 3 Mar 2018 15:17:30 +0200 Subject: [PATCH] Added explicit fallback to default soundfont With no soundfonts found the game crashed on startup Local UNIX build had the same issue because $PROGDIR/soundfonts is not in search path --- src/sound/i_soundfont.cpp | 5 +++++ src/sound/mididevices/music_fluidsynth_mididevice.cpp | 5 +---- src/version.h | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sound/i_soundfont.cpp b/src/sound/i_soundfont.cpp index ab7e31907..4bb6eeeef 100644 --- a/src/sound/i_soundfont.cpp +++ b/src/sound/i_soundfont.cpp @@ -372,6 +372,11 @@ void FSoundFontManager::CollectSoundfonts() } } } + + if (soundfonts.Size() == 0) + { + ProcessOneFile(NicePath("$PROGDIR/soundfonts/gzdoom.sf2")); + } } //========================================================================== diff --git a/src/sound/mididevices/music_fluidsynth_mididevice.cpp b/src/sound/mididevices/music_fluidsynth_mididevice.cpp index 3f87c8107..a00fb01e6 100644 --- a/src/sound/mididevices/music_fluidsynth_mididevice.cpp +++ b/src/sound/mididevices/music_fluidsynth_mididevice.cpp @@ -324,10 +324,7 @@ FluidSynthMIDIDevice::FluidSynthMIDIDevice(const char *args) { return; } - if (LoadPatchSets(nullptr)) - { - return; - } + // The following will only be used if no soundfont at all is provided, i.e. even the standard one coming with GZDoom is missing. #ifdef __unix__ // This is the standard location on Ubuntu. diff --git a/src/version.h b/src/version.h index a4328141d..afda99a21 100644 --- a/src/version.h +++ b/src/version.h @@ -97,7 +97,6 @@ const char *GetVersionString(); #define GAMESIG "GZDOOM" #define BASEWAD "gzdoom.pk3" #define OPTIONALWAD "zd_extra.pk3" -#define BASESF "gzdoom.sf2" // More stuff that needs to be different for derivatives. #define GAMENAME "GZDoom"