Fixed frustrating MIDI stuff

Until we use something besides Native MIDI to play
back MIDI music, MIDI volume changing is disabled
since it causes way too much of a damn headache.
(It's not even our fault, it's fucking MS.)
This commit is contained in:
Inuyasha 2016-04-06 08:16:13 -07:00
parent 69a58d8369
commit e91cfa7110
2 changed files with 13 additions and 17 deletions

View file

@ -1310,8 +1310,7 @@ void S_SetDigMusicVolume(INT32 volume)
#ifdef DJGPPDOS
I_SetDigMusicVolume(31); // Trick for buggy dos drivers. Win32 doesn't need this.
#endif
if (!nodigimusic)
I_SetDigMusicVolume(volume&31);
I_SetDigMusicVolume(volume&31);
}
void S_SetMIDIMusicVolume(INT32 volume)

View file

@ -529,14 +529,8 @@ boolean I_StartDigSong(const char *musicname, boolean looping)
#endif
if (lumpnum == LUMPERROR)
{
lumpnum = W_CheckNumForName(va("D_%s",musicname));
if (lumpnum == LUMPERROR)
return false;
midimode = true;
}
else
midimode = false;
return false;
midimode = false;
data = (char *)W_CacheLumpNum(lumpnum, PU_MUSIC);
len = W_LumpLength(lumpnum);
@ -686,10 +680,7 @@ boolean I_StartDigSong(const char *musicname, boolean looping)
CONS_Alert(CONS_ERROR, "Mix_PlayMusic: %s\n", Mix_GetError());
return true;
}
if (midimode)
Mix_VolumeMusic((UINT32)midi_volume*128/31);
else
Mix_VolumeMusic((UINT32)music_volume*128/31);
Mix_VolumeMusic((UINT32)music_volume*128/31);
if (loop_point != 0.0f)
Mix_HookMusicFinished(music_loop);
@ -792,10 +783,15 @@ void I_ShutdownMIDIMusic(void)
void I_SetMIDIMusicVolume(UINT8 volume)
{
midi_volume = volume;
// HACK: Until we stop using native MIDI,
// disable volume changes
(void)volume;
midi_volume = 31;
//midi_volume = volume;
if (!midimode || !music)
return;
Mix_VolumeMusic((UINT32)volume*128/31);
Mix_VolumeMusic((UINT32)midi_volume*128/31);
}
INT32 I_RegisterSong(void *data, size_t len)
@ -820,7 +816,8 @@ boolean I_PlaySong(INT32 handle, boolean looping)
CONS_Alert(CONS_ERROR, "Mix_PlayMusic: %s\n", Mix_GetError());
return false;
}
Mix_VolumeMusic((UINT32)music_volume*128/31);
Mix_VolumeMusic((UINT32)midi_volume*128/31);
return true;
}