Skip to content

Commit

Permalink
Revert "Added aspect ratio info to the list of resolutions"
Browse files Browse the repository at this point in the history
This reverts commit be5e047.
  • Loading branch information
zinnschlag committed Jun 29, 2012
1 parent e5cdc98 commit fc06347
Showing 1 changed file with 5 additions and 28 deletions.
33 changes: 5 additions & 28 deletions apps/launcher/graphicspage.cpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
#include <QtGui>

#include <boost/math/common_factor.hpp>

#include <components/files/configurationmanager.hpp>
#include <components/settings/settings.hpp>

#include "graphicspage.hpp"
#include "naturalsort.hpp"

QString getAspect(int x, int y)
{
int gcd = boost::math::gcd (x, y);
int xaspect = x / gcd;
int yaspect = y / gcd;
// special case: 8 : 5 is usually referred to as 16:10
if (xaspect == 8 && yaspect == 5)
return QString("16:10");

return QString(QString::number(xaspect) + ":" + QString::number(yaspect));
}

GraphicsPage::GraphicsPage(Files::ConfigurationManager &cfg, QWidget *parent)
: QWidget(parent)
, mCfgMgr(cfg)
Expand Down Expand Up @@ -257,21 +243,12 @@ QStringList GraphicsPage::getAvailableResolutions(Ogre::RenderSystem *renderer)
QStringList tokens = qval.split(" ", QString::SkipEmptyParts);
assert (tokens.size() >= 3);
QString resolutionStr = tokens.at(0) + QString(" x ") + tokens.at(2);
{

// do not add duplicate resolutions
if (!result.contains(resolutionStr)) {
// Add the aspect ratio
QString aspect = getAspect(tokens.at(0).toInt(),tokens.at(2).toInt());

if (aspect == QLatin1String("16:9") || aspect == QLatin1String("16:10")) {
resolutionStr.append(tr("\t(Widescreen ") + aspect + ")");

} else if (aspect == QLatin1String("4:3")) {
resolutionStr.append(tr("\t(Standard 4:3)"));
}

result << resolutionStr;
}
// do not add duplicate resolutions
if (!result.contains(resolutionStr))
result << resolutionStr;
}
}

}
Expand Down

0 comments on commit fc06347

Please sign in to comment.