- fixed: The display mode enumeration code could add a screen size multiple times if later ones had lower refresh rates.

This commit is contained in:
Christoph Oelckers 2015-04-27 11:00:50 +02:00
parent 8b3045e255
commit 0132c639b1

View file

@ -259,6 +259,7 @@ void Win32GLVideo::AddMode(int x, int y, int bits, int baseHeight, int refreshHz
// not present, add it to the right spot in the list; otherwise, do nothing.
// Modes are sorted first by width, then by height, then by depth. In each
// case the order is ascending.
if (bits < 32) return;
for (; probe != 0; probep = &probe->next, probe = probe->next)
{
if (probe->width != x) continue;
@ -269,7 +270,7 @@ void Win32GLVideo::AddMode(int x, int y, int bits, int baseHeight, int refreshHz
// Height is equal
if (probe->bits != bits) continue;
// Bits is equal
if (probe->refreshHz > refreshHz) continue;
if (probe->refreshHz > refreshHz) return;
probe->refreshHz = refreshHz;
return;
}