summaryrefslogtreecommitdiff
path: root/src/defaults.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-06 20:04:45 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-06 20:05:33 +0300
commit50692ac56d46a4767ef55a8272a2ccda32da7535 (patch)
treec0d6f9c94ee7d77d9d46f5007cb4dd1f30794580 /src/defaults.cpp
parent4c5623a691280e68401c4072aaa511065ca89648 (diff)
downloadmanaplus-50692ac56d46a4767ef55a8272a2ccda32da7535.tar.gz
manaplus-50692ac56d46a4767ef55a8272a2ccda32da7535.tar.bz2
manaplus-50692ac56d46a4767ef55a8272a2ccda32da7535.tar.xz
manaplus-50692ac56d46a4767ef55a8272a2ccda32da7535.zip
set default onscreen buttons and joystick size depend on screen density.
change config version to 2.
Diffstat (limited to 'src/defaults.cpp')
-rw-r--r--src/defaults.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index bee70d570..92ef24627 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -324,37 +324,46 @@ void getConfigDefaults2(DefaultsData *const configData)
{
if (!configData)
return;
- if (mainGraphics->getHeight() < 480)
- {
- AddDEF("screenButtonsSize", 0);
- AddDEF("screenJoystickSize", 0);
- }
- else
- {
- AddDEF("screenButtonsSize", 1);
- AddDEF("screenJoystickSize", 1);
- }
const int density = graphicsManager.getDensity();
int size = 12;
+ int buttonSize = 1;
switch (density)
{
+ case DENSITY_LOW:
+ case DENSITY_MEDIUM:
+ buttonSize = 1;
+ break;
case DENSITY_TV:
size = 14;
+ buttonSize = 1;
break;
case DENSITY_HIGH:
size = 16;
+ buttonSize = 2;
break;
case DENSITY_XHIGH:
size = 18;
+ buttonSize = 3;
break;
case DENSITY_XXHIGH:
size = 20;
+ buttonSize = 3;
break;
default:
break;
}
AddDEF("fontSize", size);
AddDEF("npcfontSize", size + 1);
+ if (mainGraphics->getHeight() < 480)
+ {
+ AddDEF("screenButtonsSize", 0);
+ AddDEF("screenJoystickSize", 0);
+ }
+ else
+ {
+ AddDEF("screenButtonsSize", buttonSize);
+ AddDEF("screenJoystickSize", buttonSize);
+ }
}
DefaultsData* getBrandingDefaults()