summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-01 21:46:34 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-01 21:46:34 +0300
commitf466978d005e3a0e3148f304b075c6a9d9a2760b (patch)
tree00638e7409909197ffecabff9972f01ca5bee5d0
parent1fc47e1877e156fa101ac80edc701d3a90059916 (diff)
downloadmanaplus-f466978d005e3a0e3148f304b075c6a9d9a2760b.tar.gz
manaplus-f466978d005e3a0e3148f304b075c6a9d9a2760b.tar.bz2
manaplus-f466978d005e3a0e3148f304b075c6a9d9a2760b.tar.xz
manaplus-f466978d005e3a0e3148f304b075c6a9d9a2760b.zip
use different default font sizes depend on screen density.
-rw-r--r--src/defaults.cpp20
-rw-r--r--src/graphicsmanager.h14
2 files changed, 32 insertions, 2 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 1995d1ee6..6105e81d2 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -157,7 +157,6 @@ DefaultsData* getConfigDefaults()
AddDEF("showownname", true);
AddDEF("showpickupparticle", true);
AddDEF("showpickupchat", true);
- AddDEF("fontSize", 12);
AddDEF("ReturnToggles", false);
AddDEF("ScrollLaziness", 16);
AddDEF("ScrollRadius", 0);
@@ -282,7 +281,6 @@ DefaultsData* getConfigDefaults()
AddDEF("hideErased", false);
AddDEF("enableDelayedAnimations", true);
AddDEF("enableCompoundSpriteDelay", true);
- AddDEF("npcfontSize", 13);
AddDEF("useAtlases", true);
AddDEF("useTextureSampler", false);
AddDEF("ministatussaved", 0);
@@ -333,6 +331,24 @@ void getConfigDefaults2(DefaultsData *const configData)
AddDEF("screenButtonsSize", 1);
AddDEF("screenJoystickSize", 1);
}
+ const int density = graphicsManager.getDensity();
+ int size = 12;
+ switch (density)
+ {
+ case DENSITY_HIGH:
+ size = 13;
+ break;
+ case DENSITY_XHIGH:
+ size = 15;
+ break;
+ case DENSITY_XXHIGH:
+ size = 17;
+ break;
+ default:
+ break;
+ }
+ AddDEF("fontSize", size);
+ AddDEF("npcfontSize", size + 1);
}
DefaultsData* getBrandingDefaults()
diff --git a/src/graphicsmanager.h b/src/graphicsmanager.h
index 8e2e5170d..68ea8af13 100644
--- a/src/graphicsmanager.h
+++ b/src/graphicsmanager.h
@@ -51,6 +51,17 @@ class TestMain;
struct FBOInfo;
+enum ScreenDensity
+{
+ DENSITY_UNKNOWN = -1,
+ DENSITY_LOW = 0,
+ DENSITY_MEDIUM = 1,
+ DENSITY_TV = 2,
+ DENSITY_HIGH = 3,
+ DENSITY_XHIGH = 4,
+ DENSITY_XXHIGH = 5
+};
+
class GraphicsManager final
{
public:
@@ -70,6 +81,9 @@ class GraphicsManager final
std::string getDensityString() const;
+ int getDensity()
+ { return mDensity; }
+
#ifdef USE_OPENGL
TestMain *startDetection() A_WARN_UNUSED;