minor backend update.

This commit is contained in:
Christoph Oelckers 2023-12-28 21:12:24 +01:00
parent 542997a967
commit d352f564db
7 changed files with 8 additions and 6 deletions

View file

@ -1033,6 +1033,7 @@ set (PCH_SOURCES
common/2d/v_drawtext.cpp common/2d/v_drawtext.cpp
common/2d/v_draw.cpp common/2d/v_draw.cpp
common/2d/wipe.cpp common/2d/wipe.cpp
common/thirdparty/animlib.cpp
common/thirdparty/gain_analysis.cpp common/thirdparty/gain_analysis.cpp
common/thirdparty/sfmt/SFMT.cpp common/thirdparty/sfmt/SFMT.cpp
common/startscreen/startscreen.cpp common/startscreen/startscreen.cpp
@ -1061,7 +1062,6 @@ set (PCH_SOURCES
common/textures/skyboxtexture.cpp common/textures/skyboxtexture.cpp
common/textures/animtexture.cpp common/textures/animtexture.cpp
common/textures/v_collection.cpp common/textures/v_collection.cpp
common/textures/animlib.cpp
common/textures/formats/automaptexture.cpp common/textures/formats/automaptexture.cpp
common/textures/formats/brightmaptexture.cpp common/textures/formats/brightmaptexture.cpp
common/textures/formats/buildtexture.cpp common/textures/formats/buildtexture.cpp

View file

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

View file

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

View file

@ -103,8 +103,9 @@ CUSTOM_CVAR(Int, vid_preferbackend, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_N
{ {
#ifdef HAVE_GLES2 #ifdef HAVE_GLES2
case 3: case 3:
case 2:
self = 2; self = 2;
return; // beware of recursions here. Assigning to 'self' will recursively call this handler again.
case 2:
Printf("Selecting OpenGLES 2.0 backend...\n"); Printf("Selecting OpenGLES 2.0 backend...\n");
break; break;
#endif #endif

View file

@ -277,7 +277,7 @@ static void S_AddSNDINFO (int lump)
case SI_MidiDevice: { case SI_MidiDevice: {
sc.MustGetString(); sc.MustGetString();
FName nm = sc.String; int lumpnum = mus_cb.FindMusic(sc.String);
FScanner::SavedPos save = sc.SavePos(); FScanner::SavedPos save = sc.SavePos();
sc.SetCMode(true); sc.SetCMode(true);
@ -310,7 +310,7 @@ static void S_AddSNDINFO (int lump)
sc.RestorePos(save); sc.RestorePos(save);
sc.MustGetString(); sc.MustGetString();
} }
MidiDevices[nm] = devset; if (lumpnum >= 0) MidiDevices[lumpnum] = devset;
} }
break; break;