fix checking for if display changed

This commit is contained in:
Alug committed 2025-11-09 19:13:35 +01:00
1 parent 3058d365f3
commit a730dfd212
1 file changed
+6 -7
+6 -7
View File
@@ -1501,8 +1501,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)
@@ -1512,12 +1517,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);