From 1b310c5c5b935e2bd143e3f055f19ce19a6cb728 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Mon, 29 Jul 2013 13:34:56 +0200 Subject: [PATCH] use SDL resolutions in the ingame settings --- apps/openmw/mwgui/settingswindow.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index eada151a4..4ce6ac0bf 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -7,6 +7,8 @@ #include #include +#include + #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "../mwbase/soundmanager.hpp" @@ -172,16 +174,14 @@ namespace MWGui mResetControlsButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onResetDefaultBindings); // fill resolution list - Ogre::RenderSystem* rs = Ogre::Root::getSingleton().getRenderSystem(); - Ogre::StringVector videoModes = rs->getConfigOptions()["Video Mode"].possibleValues; + int screen = Settings::Manager::getInt("screen", "Video"); + int numDisplayModes = SDL_GetNumDisplayModes(screen); std::vector < std::pair > resolutions; - for (Ogre::StringVector::const_iterator it=videoModes.begin(); - it!=videoModes.end(); ++it) + for (int i = 0; i < numDisplayModes; i++) { - - int resX, resY; - parseResolution (resX, resY, *it); - resolutions.push_back(std::make_pair(resX, resY)); + SDL_DisplayMode mode; + SDL_GetDisplayMode(screen, i, &mode); + resolutions.push_back(std::make_pair(mode.w, mode.h)); } std::sort(resolutions.begin(), resolutions.end(), sortResolutions); for (std::vector < std::pair >::const_iterator it=resolutions.begin();