From 4ecea7806d45ca40b370b13da6fe4781ef04367d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 1 May 2013 17:05:28 +0300 Subject: add option to override detected screen density. --- src/graphicsmanager.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/graphicsmanager.cpp') diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 8c2c9f9b2..f9df9570e 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -1030,8 +1030,13 @@ void GraphicsManager::detectPixelSize() #endif logger->log("screen size in pixels: %dx%d", mMaxWidth, mMaxHeight); logger->log("screen size in millimeters: %dx%d", mWidthMM, mHeightMM); - logger->log("screen density: \"%s\" = %d", - getDensityString().c_str(), mDensity); + logger->log("actual screen density: " + getDensityString()); + const int density = config.getIntValue("screenDensity"); + if (density > 0 && density <= densitySize) + { + mDensity = density - 1; + logger->log("selected screen density: " + getDensityString()); + } } std::string GraphicsManager::getDensityString() const -- cgit v1.2.3-70-g09d2