1
0
forked from pool/dsda-doom
dsda-doom/fluidsynth1.diff

56 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Wed, 30 Mar 2022 21:13:50 +0200
Subject: [PATCH] Continue supporting fluidsynth1 API
Upstream: probably not worth, given Leap 15.4 (FL2) is around the corner
Platforms such as openSUSE Leap 15.3 still only have FL1, owing
to the branch having set off in 2017.
---
prboom2/src/MUSIC/flplayer.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/prboom2/src/MUSIC/flplayer.c b/prboom2/src/MUSIC/flplayer.c
index 27cd31aa..282714e8 100644
--- prboom2/src/MUSIC/flplayer.c
+++ prboom2/src/MUSIC/flplayer.c
@@ -231,17 +231,19 @@ static int fl_init (int samplerate)
}
{
- int lumpnum;
+ int lumpnum = -1;
int checked_file = false;
dboolean replaced_soundfont = false;
const char *checked_f_font = NULL;
+#if FLUIDSYNTH_VERSION_MAJOR >= 2
lumpnum = W_CheckNumForName("SNDFONT");
if (lumpnum >= 0)
{
replaced_soundfont = !W_LumpNumInPortWad(lumpnum);
}
+#endif
if (!replaced_soundfont && snd_soundfont && snd_soundfont[0])
{
@@ -251,6 +253,7 @@ static int fl_init (int samplerate)
f_font = fluid_synth_sfload (f_syn, filename, 1);
}
+#if FLUIDSYNTH_VERSION_MAJOR >= 2
if ((!checked_file || f_font == FLUID_FAILED) && lumpnum >= 0)
{
fluid_sfloader_t *sfloader;
@@ -262,6 +265,7 @@ static int fl_init (int samplerate)
fluid_synth_add_sfloader(f_syn, sfloader);
f_font = fluid_synth_sfload(f_syn, "SNDFONT", 1);
}
+#endif
if (!checked_f_font)
{
--
2.35.1