diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/defaults.cpp | 20 | ||||
-rw-r--r-- | src/graphicsmanager.h | 14 |
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; |