mod: removed boolean globals for lazy init

The variables mod_mikModInitiated and mod_mikModInitError were used to
control lazy initialization, but they are superfluous now.
This commit is contained in:
Max Kellermann 2008-11-03 07:32:02 +01:00
parent bb15c3bd45
commit e6f334a088
1 changed files with 4 additions and 15 deletions

View File

@ -92,25 +92,15 @@ static MDRIVER drv_mpd = {
VC_VoiceRealVolume VC_VoiceRealVolume
}; };
static bool mod_mikModInitiated;
static bool mod_mikModInitError;
static bool mod_initMikMod(void) static bool mod_initMikMod(void)
{ {
static char params[] = ""; static char params[] = "";
if (mod_mikModInitError) md_device = 0;
return false; md_reverb = 0;
if (!mod_mikModInitiated) { MikMod_RegisterDriver(&drv_mpd);
mod_mikModInitiated = true; MikMod_RegisterAllLoaders();
md_device = 0;
md_reverb = 0;
MikMod_RegisterDriver(&drv_mpd);
MikMod_RegisterAllLoaders();
}
md_pansep = 64; md_pansep = 64;
md_mixfreq = 44100; md_mixfreq = 44100;
@ -120,7 +110,6 @@ static bool mod_initMikMod(void)
if (MikMod_Init(params)) { if (MikMod_Init(params)) {
ERROR("Could not init MikMod: %s\n", ERROR("Could not init MikMod: %s\n",
MikMod_strerror(MikMod_errno)); MikMod_strerror(MikMod_errno));
mod_mikModInitError = true;
return false; return false;
} }