From: Tobias Markus Date: Wed, 13 Aug 2014 12:29:13 +0000 (+0200) Subject: Fix for SDL double-reporting display modes X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4c1a64930e8915ef23c6d8025a1ecadf4826264d;p=supertux.git Fix for SDL double-reporting display modes --- diff --git a/src/supertux/menu/options_menu.cpp b/src/supertux/menu/options_menu.cpp index 58ebf40ff..c0991c2c1 100644 --- a/src/supertux/menu/options_menu.cpp +++ b/src/supertux/menu/options_menu.cpp @@ -103,6 +103,7 @@ OptionsMenu::OptionsMenu(bool complete) } int display_mode_count = SDL_GetNumDisplayModes(0); + std::string last_display_mode; for(int i = 0; i < display_mode_count; ++i) { SDL_DisplayMode mode; @@ -115,6 +116,9 @@ OptionsMenu::OptionsMenu(bool complete) { std::ostringstream out; out << mode.w << "x" << mode.h << "@" << mode.refresh_rate; + if(last_display_mode == out.str()) + continue; + last_display_mode = out.str(); fullscreen_res->list.push_back(out.str()); } }