Changed GetDisplayResolutions on Windows to ignore modes with less than 32bpp and not test modes that have already been tested. Changed ScreenOptionsMasterPrefs to cache the resolutions list once when the screen starts instead of fetching it multiple times.

This commit is contained in:
Kyzentun Keeslala
2016-01-14 16:33:19 -07:00
parent 31688cc804
commit 79f4037088
2 changed files with 30 additions and 14 deletions
+13 -3
View File
@@ -519,10 +519,20 @@ void GraphicsWindow::GetDisplayResolutions( DisplayResolutions &out )
int i=0;
while(EnumDisplaySettings(NULL, i++, &dm))
{
if(ChangeDisplaySettings(&dm, CDS_TEST)==DISP_CHANGE_SUCCESSFUL)
// Windows 8 and later don't support less than 32bpp, so don't even test
// for them. GetDisplayResolutions is only for resolutions anyway. -Kyz
if(dm.dmBitsPerPel < 32)
{
DisplayResolution res = { dm.dmPelsWidth, dm.dmPelsHeight };
out.insert( res );
continue;
}
DisplayResolution res = { dm.dmPelsWidth, dm.dmPelsHeight };
std::set<DisplayResolution>::iterator entry= out.find(res);
if(entry == out.end())
{
if(ChangeDisplaySettings(&dm, CDS_TEST)==DISP_CHANGE_SUCCESSFUL)
{
out.insert(res);
}
}
}
}