fix checking for if display changed

This commit is contained in:
Alug committed 2025-11-09 18:53:26 +01:00
1 parent 799ae9962f
commit c348d3212f
1 file changed
+6 -7
+6 -7
View File
@@ -1591,8 +1591,13 @@ static void I_FillScreenResolutionsList(void)
int count = 0;
char desired_resolution[256];
currentDisplayIndex = SDL_GetWindowDisplayIndex(window);
// No valid index
if (currentDisplayIndex < 0)
currentDisplayIndex = SDL_GetWindowDisplayIndex(window);
{
return;
}
// didnt change screen, no need to redo the list
if (currentDisplayIndex == oldDisplayIndex)
@@ -1602,12 +1607,6 @@ static void I_FillScreenResolutionsList(void)
oldDisplayIndex = currentDisplayIndex;
// No valid index
if (currentDisplayIndex < 0)
{
return;
}
// Don't call SDL_ListModes if SDL has not been initialized
count = SDL_GetNumDisplayModes(currentDisplayIndex);