mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-24 04:29:34 -04:00
fall back to Native/SDL on error (#443)
* fall back to Native/SDL on error * show message box on soundfont loading error
This commit is contained in:
parent
abcc96c905
commit
b755013f62
@ -23,6 +23,7 @@
|
|||||||
#include "doomtype.h"
|
#include "doomtype.h"
|
||||||
#include "i_system.h"
|
#include "i_system.h"
|
||||||
#include "i_sound.h"
|
#include "i_sound.h"
|
||||||
|
#include "m_misc2.h"
|
||||||
#include "memio.h"
|
#include "memio.h"
|
||||||
#include "mus2mid.h"
|
#include "mus2mid.h"
|
||||||
|
|
||||||
@ -77,9 +78,14 @@ static boolean I_FL_InitMusic(void)
|
|||||||
|
|
||||||
if (sf_id == FLUID_FAILED)
|
if (sf_id == FLUID_FAILED)
|
||||||
{
|
{
|
||||||
|
char *errmsg;
|
||||||
delete_fluid_synth(synth);
|
delete_fluid_synth(synth);
|
||||||
delete_fluid_settings(settings);
|
delete_fluid_settings(settings);
|
||||||
I_Error("Error loading FluidSynth soundfont: %s\n", soundfont_path);
|
errmsg = M_StringJoin("Error loading FluidSynth soundfont: ",
|
||||||
|
soundfont_path, NULL);
|
||||||
|
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING,
|
||||||
|
PROJECT_STRING, errmsg, NULL);
|
||||||
|
(free)(errmsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -760,8 +760,17 @@ void I_InitSound(void)
|
|||||||
if (midi_player_module)
|
if (midi_player_module)
|
||||||
{
|
{
|
||||||
active_module = midi_player_module;
|
active_module = midi_player_module;
|
||||||
active_module->I_InitMusic();
|
if (active_module->I_InitMusic())
|
||||||
I_AtExit(active_module->I_ShutdownMusic, true);
|
{
|
||||||
|
I_AtExit(active_module->I_ShutdownMusic, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// fall back to Native/SDL on error
|
||||||
|
midi_player = 0;
|
||||||
|
midi_player_module = NULL;
|
||||||
|
active_module = &music_sdl_module;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user