From 0132c639b106574efcd01bd073e1bf83d429cd82 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 27 Apr 2015 11:00:50 +0200 Subject: [PATCH] - fixed: The display mode enumeration code could add a screen size multiple times if later ones had lower refresh rates. --- src/win32/win32gliface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/win32/win32gliface.cpp b/src/win32/win32gliface.cpp index 2787d91282..c6715b0a73 100644 --- a/src/win32/win32gliface.cpp +++ b/src/win32/win32gliface.cpp @@ -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; }