Kill MIDI

This commit is contained in:
James R 2020-08-07 12:38:55 -07:00
parent 374d032a6b
commit 9077a4ff03
7 changed files with 8 additions and 160 deletions

View file

@ -126,15 +126,9 @@ INT32 postimgparam[MAXSPLITSCREENPLAYERS];
// whether the respective sound system is disabled
// or they're init'ed, but the player just toggled them
#ifdef _XBOX
#ifndef NO_MIDI
boolean midi_disabled = true;
#endif
boolean sound_disabled = true;
boolean digital_disabled = true;
#else
#ifndef NO_MIDI
boolean midi_disabled = false;
#endif
boolean sound_disabled = false;
boolean digital_disabled = false;
#endif
@ -1350,17 +1344,11 @@ void D_SRB2Main(void)
{
sound_disabled = true;
digital_disabled = true;
#ifndef NO_MIDI
midi_disabled = true;
#endif
}
if (M_CheckParm("-noaudio")) // combines -nosound and -nomusic
{
sound_disabled = true;
digital_disabled = true;
#ifndef NO_MIDI
midi_disabled = true;
#endif
}
else
{
@ -1369,25 +1357,14 @@ void D_SRB2Main(void)
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
{
digital_disabled = true;
#ifndef NO_MIDI
midi_disabled = true;
#endif
}
else
{
#ifndef NO_MIDI
if (M_CheckParm("-nomidimusic"))
midi_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
#endif
if (M_CheckParm("-nodigmusic"))
digital_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
}
}
if (!( sound_disabled && digital_disabled
#ifndef NO_MIDI
&& midi_disabled
#endif
))
if (!( sound_disabled && digital_disabled ))
{
CONS_Printf("S_InitSfxChannels(): Setting up sound channels.\n");
I_StartupSound();

View file

@ -1098,9 +1098,6 @@ void D_RegisterClientCommands(void)
// s_sound.c
CV_RegisterVar(&cv_soundvolume);
CV_RegisterVar(&cv_digmusicvolume);
#ifndef NO_MIDI
CV_RegisterVar(&cv_midimusicvolume);
#endif
CV_RegisterVar(&cv_numChannels);
// i_cdmus.c

View file

@ -663,9 +663,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// SRB2Kart: Camera always has noclip.
#define NOCLIPCAM
/// SRB2Kart: MIDI support is shitty and busted and we don't want it, lets throw it behind a define
#define NO_MIDI
/// FINALLY some real clipping that doesn't make walls dissappear AND speeds the game up
/// (that was the original comment from SRB2CB, sadly it is a lie and actually slows game down)
/// on the bright side it fixes some weird issues with translucent walls

View file

@ -110,11 +110,6 @@ extern boolean forceresetplayers, deferencoremode;
// Internal parameters for sound rendering.
// ========================================
#ifdef NO_MIDI
#define midi_disabled true
#else
extern boolean midi_disabled;
#endif
extern boolean sound_disabled;
extern boolean digital_disabled;

View file

@ -55,9 +55,6 @@ static void Command_Tunes_f(void);
static void Command_RestartAudio_f(void);
// Sound system toggles
#ifndef NO_MIDI
static void GameMIDIMusic_OnChange(void);
#endif
static void GameSounds_OnChange(void);
static void GameDigiMusic_OnChange(void);
@ -97,9 +94,6 @@ static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NUL
// actual general (maximum) sound & music volume, saved into the config
consvar_t cv_soundvolume = {"soundvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
#ifndef NO_MIDI
consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif
// number of channels available
#if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X)
consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL};
@ -112,9 +106,6 @@ consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL,
// Sound system toggles, saved into the config
consvar_t cv_gamedigimusic = {"digimusic", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameDigiMusic_OnChange, 0, NULL, NULL, 0, 0, NULL};
#ifndef NO_MIDI
consvar_t cv_gamemidimusic = {"midimusic", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameMIDIMusic_OnChange, 0, NULL, NULL, 0, 0, NULL};
#endif
consvar_t cv_gamesounds = {"sounds", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameSounds_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_playmusicifunfocused = {"playmusicifunfocused", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, PlayMusicIfUnfocused_OnChange, 0, NULL, NULL, 0, 0, NULL};
@ -286,9 +277,6 @@ void S_RegisterSoundStuff(void)
//CV_RegisterVar(&cv_resetmusic);
CV_RegisterVar(&cv_gamesounds);
CV_RegisterVar(&cv_gamedigimusic);
#ifndef NO_MIDI
CV_RegisterVar(&cv_gamemidimusic);
#endif
CV_RegisterVar(&cv_playmusicifunfocused);
CV_RegisterVar(&cv_playsoundifunfocused);
@ -902,9 +890,6 @@ void S_StopSound(void *origin)
//
static INT32 actualsfxvolume; // check for change through console
static INT32 actualdigmusicvolume;
#ifndef NO_MIDI
static INT32 actualmidimusicvolume;
#endif
void S_UpdateSounds(void)
{
@ -931,10 +916,6 @@ void S_UpdateSounds(void)
S_SetSfxVolume (cv_soundvolume.value);
if (actualdigmusicvolume != cv_digmusicvolume.value)
S_SetDigMusicVolume (cv_digmusicvolume.value);
#ifndef NO_MIDI
if (actualmidimusicvolume != cv_midimusicvolume.value)
S_SetMIDIMusicVolume (cv_midimusicvolume.value);
#endif
// We're done now, if we're not in a level.
if (gamestate != GS_LEVEL)
@ -1790,11 +1771,6 @@ boolean S_DigMusicDisabled(void)
return digital_disabled;
}
boolean S_MIDIMusicDisabled(void)
{
return midi_disabled; // SRB2Kart: defined as "true" w/ NO_MIDI
}
boolean S_MusicDisabled(void)
{
return (midi_disabled && digital_disabled);
@ -1900,15 +1876,6 @@ static boolean S_LoadMusic(const char *mname)
CONS_Alert(CONS_NOTICE, "Digital music is disabled!\n");
return false;
}
else if (S_MIDIMusicDisabled() && S_MIDIExists(mname))
{
#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);
#else
CONS_Alert(CONS_NOTICE, "MIDI music is disabled!\n");
#endif
return false;
}
else
{
CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), mname);
@ -2158,50 +2125,19 @@ void S_EnableSound(void)
}
}
void S_SetMusicVolume(INT32 digvolume, INT32 seqvolume)
void S_SetMusicVolume(INT32 digvolume)
{
if (digvolume < 0)
digvolume = cv_digmusicvolume.value;
#ifdef NO_MIDI
(void)seqvolume;
#else
if (seqvolume < 0)
seqvolume = cv_midimusicvolume.value;
#endif
if (digvolume < 0 || digvolume > 31)
CONS_Alert(CONS_WARNING, "digmusicvolume should be between 0-31\n");
CV_SetValue(&cv_digmusicvolume, digvolume&31);
CV_SetValue(&cv_digmusicvolume, digvolume);
actualdigmusicvolume = cv_digmusicvolume.value; //check for change of var
#ifndef NO_MIDI
if (seqvolume < 0 || seqvolume > 31)
CONS_Alert(CONS_WARNING, "midimusicvolume should be between 0-31\n");
CV_SetValue(&cv_midimusicvolume, seqvolume&31);
actualmidimusicvolume = cv_midimusicvolume.value; //check for change of var
#endif
#ifdef DJGPPDOS
digvolume = 31;
#ifndef NO_MIDI
seqvolume = 31;
#endif
#endif
switch(I_SongType())
{
#ifndef NO_MIDI
case MU_MID:
//case MU_MOD:
//case MU_GME:
I_SetMusicVolume(seqvolume&31);
break;
#endif
default:
I_SetMusicVolume(digvolume&31);
break;
}
I_SetMusicVolume(digvolume);
}
void
@ -2378,11 +2314,7 @@ static void Command_RestartAudio_f(void)
// These must be called or no sound and music until manually set.
I_SetSfxVolume(cv_soundvolume.value);
#ifdef NO_MIDI
S_SetMusicVolume(cv_digmusicvolume.value, -1);
#else
S_SetMusicVolume(cv_digmusicvolume.value, cv_midimusicvolume.value);
#endif
S_SetMusicVolume(cv_digmusicvolume.value);
S_StartSound(NULL, sfx_strpst);
@ -2448,49 +2380,6 @@ void GameDigiMusic_OnChange(void)
}
}
#ifndef NO_MIDI
void GameMIDIMusic_OnChange(void)
{
if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio"))
return;
else if (M_CheckParm("-nomidimusic"))
return;
if (midi_disabled)
{
midi_disabled = false;
I_InitMusic();
if (Playing())
P_RestoreMusic(&players[consoleplayer]);
else
S_ChangeMusicInternal("titles", looptitle);
}
else
{
midi_disabled = true;
if (S_MusicType() == MU_MID)
{
if (digital_disabled)
S_StopMusic();
else
{
char mmusic[7];
UINT16 mflags;
boolean looping;
if (S_MusicInfo(mmusic, &mflags, &looping) && S_DigExists(mmusic))
{
S_StopMusic();
S_ChangeMusic(mmusic, mflags, looping);
}
else
S_StopMusic();
}
}
}
}
#endif
static void PlayMusicIfUnfocused_OnChange(void)
{
if (window_notinfocus)

View file

@ -35,9 +35,6 @@ extern consvar_t cv_numChannels;
extern consvar_t surround;
//extern consvar_t cv_resetmusic;
extern consvar_t cv_gamedigimusic;
#ifndef NO_MIDI
extern consvar_t cv_gamemidimusic;
#endif
extern consvar_t cv_gamesounds;
extern consvar_t cv_playmusicifunfocused;
extern consvar_t cv_playsoundifunfocused;
@ -240,10 +237,9 @@ void S_UpdateSounds(void);
FUNCMATH fixed_t S_CalculateSoundDistance(fixed_t px1, fixed_t py1, fixed_t pz1, fixed_t px2, fixed_t py2, fixed_t pz2);
void S_SetSfxVolume(INT32 volume);
void S_SetMusicVolume(INT32 digvolume, INT32 seqvolume);
#define S_SetDigMusicVolume(a) S_SetMusicVolume(a,-1)
#define S_SetMIDIMusicVolume(a) S_SetMusicVolume(-1,a)
#define S_InitMusicVolume() S_SetMusicVolume(-1,-1)
void S_SetMusicVolume(INT32 digvolume);
#define S_SetDigMusicVolume S_SetMusicVolume
#define S_InitMusicVolume() S_SetMusicVolume(-1)
INT32 S_OriginPlaying(void *origin);
INT32 S_IdPlaying(sfxenum_t id);

View file

@ -1173,9 +1173,6 @@ void I_StartupSound(void)
const char *sdrv_name = NULL;
#endif
#ifndef HAVE_MIXER
#ifndef NO_MIDI
midi_disabled =
#endif
digital_disabled = true;
#endif