From: grumbel Date: Sun, 22 Nov 2009 01:11:42 +0000 (+0000) Subject: Use StringUtil::numeric_less to sort list of resolutions X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ce24c632b6d492898e972292e97e32c9e422dfbb;p=supertux.git Use StringUtil::numeric_less to sort list of resolutions git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6083 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- diff --git a/src/supertux/menu/options_menu.cpp b/src/supertux/menu/options_menu.cpp index 894854500..66893cc70 100644 --- a/src/supertux/menu/options_menu.cpp +++ b/src/supertux/menu/options_menu.cpp @@ -17,6 +17,8 @@ #include "supertux/menu/options_menu.hpp" +#include + #include "audio/sound_manager.hpp" #include "gui/menu_manager.hpp" #include "supertux/gameconfig.hpp" @@ -25,6 +27,7 @@ #include "supertux/menu/language_menu.hpp" #include "supertux/menu/menu_storage.hpp" #include "supertux/menu/profile_menu.hpp" +#include "util/string_util.hpp" #include "video/renderer.hpp" enum OptionsMenuIDs { @@ -106,6 +109,10 @@ OptionsMenu::OptionsMenu() : out << modes[i]->w << "x" << modes[i]->h; fullscreen_res->list.push_back(out.str()); } + + // On Ubuntu/Linux resolutions are returned from highest to + // lowest, so reverse them + std::sort(fullscreen_res->list.begin(), fullscreen_res->list.end(), StringUtil::numeric_less); } MenuItem* aspect = add_string_select(MNID_ASPECTRATIO, _("Aspect Ratio"));