diff --git a/src/sound/i_music.cpp b/src/sound/i_music.cpp index ead98b35e..f69116a15 100644 --- a/src/sound/i_music.cpp +++ b/src/sound/i_music.cpp @@ -73,6 +73,7 @@ enum EMIDIType extern int MUSHeaderSearch(const uint8_t *head, int len); void I_InitSoundFonts(); +extern "C" void dumb_exit(); EXTERN_CVAR (Int, snd_samplerate) EXTERN_CVAR (Int, snd_mididevice) @@ -127,8 +128,6 @@ CUSTOM_CVAR (Float, snd_musicvolume, 0.5f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) void I_InitMusic (void) { - static bool setatterm = false; - I_InitSoundFonts(); snd_musicvolume.Callback (); @@ -139,12 +138,6 @@ void I_InitMusic (void) I_InitMusicWin32 (); #endif // _WIN32 - if (!setatterm) - { - setatterm = true; - atterm (I_ShutdownMusicExit); - - } MusicDown = false; } @@ -170,15 +163,10 @@ void I_ShutdownMusic(bool onexit) { WildMidi_Shutdown(); TimidityPP_Shutdown(); + dumb_exit(); } } -void I_ShutdownMusicExit() -{ - I_ShutdownMusic(true); -} - - //========================================================================== // // diff --git a/src/sound/i_music.h b/src/sound/i_music.h index be910bf9b..421bf1355 100644 --- a/src/sound/i_music.h +++ b/src/sound/i_music.h @@ -45,7 +45,6 @@ struct FOptionValues; // void I_InitMusic (); void I_ShutdownMusic (bool onexit = false); -void I_ShutdownMusicExit (); void I_BuildMIDIMenuList (FOptionValues *); void I_UpdateMusic (); diff --git a/src/sound/i_sound.cpp b/src/sound/i_sound.cpp index 1772d0c0d..a3587e3a5 100644 --- a/src/sound/i_sound.cpp +++ b/src/sound/i_sound.cpp @@ -287,6 +287,7 @@ void I_CloseSound () void I_ShutdownSound() { + I_ShutdownMusic(true); if (GSnd != NULL) { S_StopAllChannels(); diff --git a/src/sound/musicformats/music_dumb.cpp b/src/sound/musicformats/music_dumb.cpp index 99974a106..94c7199c6 100644 --- a/src/sound/musicformats/music_dumb.cpp +++ b/src/sound/musicformats/music_dumb.cpp @@ -774,8 +774,6 @@ MusInfo *MOD_OpenSong(FileReader &reader) bool is_it = false; bool is_dos = true; - atterm(dumb_exit); - int size = (int)reader.GetLength(); auto fpos = reader.Tell(); diff --git a/src/sound/timiditypp/resample.cpp b/src/sound/timiditypp/resample.cpp index 3c6f96867..06b531fc9 100644 --- a/src/sound/timiditypp/resample.cpp +++ b/src/sound/timiditypp/resample.cpp @@ -247,7 +247,6 @@ void initialize_resampler_coeffs(void) static bool done = false; if (done) return; done = true; - // atterm(free_gauss_table); initialize_newton_coeffs(); initialize_gauss_table(gauss_n);