From 110dd5d0eeb5db4ca295bd2ff2a0e4a50f6d56e0 Mon Sep 17 00:00:00 2001 From: pvdk Date: Fri, 15 Mar 2013 01:56:39 +0100 Subject: [PATCH 1/3] Possible fix for the resolutions not appearing with Direct3D Renderer --- apps/launcher/graphicspage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 8d09cf3c03..19de88b67b 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -259,7 +259,7 @@ QStringList GraphicsPage::getAvailableResolutions(Ogre::RenderSystem *renderer) for (opt_it = i->second.possibleValues.begin (); opt_it != i->second.possibleValues.end (); opt_it++, idx++) { - QRegExp resolutionRe(QString("(\\d+) x (\\d+)")); + QRegExp resolutionRe(QString("(\\d+) x (\\d+).*")); QString resolution = QString::fromStdString(*opt_it).simplified(); if (resolutionRe.exactMatch(resolution)) { From d1860f2d6c2c455b605180576e22efdbb759209d Mon Sep 17 00:00:00 2001 From: pvdk Date: Sat, 16 Mar 2013 13:40:29 +0100 Subject: [PATCH 2/3] Removed color information from Direct3D resolutions --- apps/launcher/graphicspage.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 19de88b67b..4fde1aab05 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -268,16 +268,17 @@ QStringList GraphicsPage::getAvailableResolutions(Ogre::RenderSystem *renderer) int height = resolutionRe.cap(2).toInt(); QString aspect = getAspect(width, height); + QString cleanRes = QString::number(width) + QString(" x ") + QString::number(height); if (aspect == QLatin1String("16:9") || aspect == QLatin1String("16:10")) { - resolution.append(tr("\t(Wide ") + aspect + ")"); + cleanRes.append(tr("\t(Wide ") + aspect + ")"); } else if (aspect == QLatin1String("4:3")) { - resolution.append(tr("\t(Standard 4:3)")); + cleanRes.append(tr("\t(Standard 4:3)")); } // do not add duplicate resolutions - if (!result.contains(resolution)) - result.append(resolution); + if (!result.contains(cleanRes)) + result.append(cleanRes); } } } From 75be47400573fda26ea5cf089960842861b6341e Mon Sep 17 00:00:00 2001 From: pvdk Date: Sat, 16 Mar 2013 13:45:23 +0100 Subject: [PATCH 3/3] Use the resolution QRegExp cap() instead of converting ints back and forth --- apps/launcher/graphicspage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 4fde1aab05..700ba3db9c 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -268,7 +268,7 @@ QStringList GraphicsPage::getAvailableResolutions(Ogre::RenderSystem *renderer) int height = resolutionRe.cap(2).toInt(); QString aspect = getAspect(width, height); - QString cleanRes = QString::number(width) + QString(" x ") + QString::number(height); + QString cleanRes = resolutionRe.cap(1) + QString(" x ") + resolutionRe.cap(2); if (aspect == QLatin1String("16:9") || aspect == QLatin1String("16:10")) { cleanRes.append(tr("\t(Wide ") + aspect + ")");