From 2136ef2abafff34142a52f2a13a5c04ad95fdf79 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 19 Aug 2010 15:51:07 +0000 Subject: [PATCH] - Also check for CT2MGM.SF2 if CT4MGM.SF2 is not found. SVN r2556 (trunk) --- src/sound/music_fluidsynth_mididevice.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/sound/music_fluidsynth_mididevice.cpp b/src/sound/music_fluidsynth_mididevice.cpp index fba167b710..d151cd86f0 100644 --- a/src/sound/music_fluidsynth_mididevice.cpp +++ b/src/sound/music_fluidsynth_mididevice.cpp @@ -153,16 +153,22 @@ FluidSynthMIDIDevice::FluidSynthMIDIDevice() #ifdef _WIN32 // On Windows, look for the 4 megabyte patch set installed by Creative's drivers as a default. char sysdir[MAX_PATH+sizeof("\\CT4MGM.SF2")]; - if (0 != GetSystemDirectoryA(sysdir, MAX_PATH)) + UINT filepart; + if (0 != (filepart = GetSystemDirectoryA(sysdir, MAX_PATH))) { strcat(sysdir, "\\CT4MGM.SF2"); if (0 == LoadPatchSets(sysdir)) { + // Try again with CT2MGM.SF2 + sysdir[filepart + 3] = '2'; + if (0 == LoadPatchSets(sysdir)) + { #endif - Printf("Failed to load any MIDI patches.\n"); - delete_fluid_synth(FluidSynth); - FluidSynth = NULL; + Printf("Failed to load any MIDI patches.\n"); + delete_fluid_synth(FluidSynth); + FluidSynth = NULL; #ifdef _WIN32 + } } } #endif