From 1dcfb2929ee59a40adb4466caaa5e94a3206f895 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 8 Aug 2025 00:48:41 +0200 Subject: [PATCH] "reenable" midi support well it was never really disabled, but like this we can atleast change its volume lel menu entry is still disabled, i dont think theres a single map with midi music, so this would just clutter the menu --- src/doomdef.h | 3 ++- src/m_menudefs.c | 6 ++++-- src/s_sound.c | 11 ++++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index c540ee1e4..8e6ebabe3 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -650,7 +650,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; #define NOCLIPCAM /// SRB2Kart: MIDI support is shitty and busted and we don't want it, lets throw it behind a define -#define NO_MIDI +// yall didnt properly disable it so it always worked lol (: +//#define NO_MIDI /// Sprite rotation #define ROTSPRITE diff --git a/src/m_menudefs.c b/src/m_menudefs.c index 998c457ae..28b8b94bf 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -1075,7 +1075,8 @@ static menuitem_t OP_SoundOptionsMenu[] = {IT_STRING|IT_CVAR|IT_CV_NOPRINT, NULL, "Music", &cv_gamedigimusic, 30}, {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "Music Volume", &cv_digmusicvolume, 38}, -#ifndef NO_MIDI +//#ifndef NO_MIDI +#if 0 {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "MIDI Volume", &cv_midimusicvolume, 46}, {IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 60}, @@ -1110,7 +1111,8 @@ static const char* OP_SoundTooltips[] = "Volume of Sound effects.", "Turn Music on or off.", "Volume of Music.", -#ifndef NO_MIDI +//#ifndef NO_MIDI +#if 0 "Volume of Midi Music.", #endif "Reverse left and right channels of audio.", diff --git a/src/s_sound.c b/src/s_sound.c index 93ea805d7..8c647a798 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1633,10 +1633,20 @@ static lumpnum_t S_GetMusicLumpNum(const char *mname) if (S_MusicExists(mname, false, true)) // check non midis first return W_GetNumForName(va("o_%s", mname)); else if (S_MusicExists(mname, true, false)) + { +#ifdef NO_MIDI + CONS_Alert(CONS_ERROR, "A MIDI music lump %.6s was found,\nbut SRB2Kart does not support MIDI output.\nWe apologise for the inconvenience.\n", mname); + return LUMPERROR; +#else return W_GetNumForName(va("d_%s", mname)); +#endif + } + + CONS_Alert(CONS_ERROR, "Music %.6s could not be loaded: lump not found!\n", mname); return LUMPERROR; } + static boolean S_LoadMusic(const char *mname) { lumpnum_t mlumpnum; @@ -1649,7 +1659,6 @@ static boolean S_LoadMusic(const char *mname) if (mlumpnum == LUMPERROR) { - CONS_Alert(CONS_ERROR, "Music %.6s could not be loaded: lump not found!\n", mname); return false; }