do MIDI device lookup by lump index as well, for the same reasons as doing it for the volume.

This commit is contained in:
Professor Hastig 2023-12-28 11:45:08 +01:00 committed by Christoph Oelckers
commit 51e014c858
3 changed files with 5 additions and 4 deletions

View file

@ -716,7 +716,6 @@ bool S_ChangeMusic(const char* musicname, int order, bool looping, bool force)
}
ZMusic_MusicStream handle = nullptr;
MidiDeviceSetting* devp = MidiDevices.CheckKey(musicname);
// Strip off any leading file:// component.
if (strncmp(musicname, "file://", 7) == 0)
@ -751,6 +750,8 @@ bool S_ChangeMusic(const char* musicname, int order, bool looping, bool force)
else
{
int lumpnum = mus_cb.FindMusic(musicname);
MidiDeviceSetting* devp = MidiDevices.CheckKey(lumpnum);
auto volp = MusicVolumes.CheckKey(lumpnum);
if (volp)
{

View file

@ -68,7 +68,7 @@ struct MidiDeviceSetting
FString args;
};
typedef TMap<FName, MidiDeviceSetting> MidiDeviceMap;
typedef TMap<int, MidiDeviceSetting> MidiDeviceMap;
typedef TMap<int, float> MusicVolumeMap;
extern MidiDeviceMap MidiDevices;