summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-01 17:05:28 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-01 17:27:14 +0300
commit4ecea7806d45ca40b370b13da6fe4781ef04367d (patch)
tree22eef831511daf36cc0bd7e497fae972e0371735 /src/graphicsmanager.cpp
parent40efe9ac2ad7b080f3b817b7fc909fcc2b333093 (diff)
downloadmanaverse-4ecea7806d45ca40b370b13da6fe4781ef04367d.tar.gz
manaverse-4ecea7806d45ca40b370b13da6fe4781ef04367d.tar.bz2
manaverse-4ecea7806d45ca40b370b13da6fe4781ef04367d.tar.xz
manaverse-4ecea7806d45ca40b370b13da6fe4781ef04367d.zip
add option to override detected screen density.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp9
1 files changed, 7 insertions, 2 deletions
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