iOS: scaling improvements
This commit is contained in:
parent
c31191d4aa
commit
0a39d4aa0c
@ -1912,7 +1912,7 @@
|
|||||||
"\"${PODS_ROOT}/Headers/Public/SDVersion\"",
|
"\"${PODS_ROOT}/Headers/Public/SDVersion\"",
|
||||||
"-isystem",
|
"-isystem",
|
||||||
"\"${PODS_ROOT}/Headers/Public/SSZipArchive\"",
|
"\"${PODS_ROOT}/Headers/Public/SSZipArchive\"",
|
||||||
"-flto=thin",
|
"-flto",
|
||||||
"-fvisibility=hidden",
|
"-fvisibility=hidden",
|
||||||
"-fdata-sections",
|
"-fdata-sections",
|
||||||
"-ffunction-sections",
|
"-ffunction-sections",
|
||||||
@ -1995,7 +1995,7 @@
|
|||||||
"\"${PODS_ROOT}/Headers/Public/SDVersion\"",
|
"\"${PODS_ROOT}/Headers/Public/SDVersion\"",
|
||||||
"-isystem",
|
"-isystem",
|
||||||
"\"${PODS_ROOT}/Headers/Public/SSZipArchive\"",
|
"\"${PODS_ROOT}/Headers/Public/SSZipArchive\"",
|
||||||
"-flto=thin",
|
"-flto",
|
||||||
"-fvisibility=hidden",
|
"-fvisibility=hidden",
|
||||||
"-fdata-sections",
|
"-fdata-sections",
|
||||||
"-ffunction-sections",
|
"-ffunction-sections",
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.2.10</string>
|
<string>1.2.0</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>44</string>
|
<string>44</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
@ -6,30 +6,14 @@
|
|||||||
// returns the app version as an integer
|
// returns the app version as an integer
|
||||||
static uint32_t parse_version()
|
static uint32_t parse_version()
|
||||||
{
|
{
|
||||||
struct {
|
|
||||||
uint8_t major, minor, patch, revision;
|
|
||||||
} version;
|
|
||||||
NSString *fullver = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
|
||||||
NSString *revstr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
|
NSString *revstr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
|
||||||
|
uint8_t revision = [revstr intValue];
|
||||||
|
|
||||||
if([fullver length] != 3 + 2 + 1)
|
// compatibility with old versions, DON'T CHANGE
|
||||||
goto err;
|
uint32_t ret = revision | (2 << 24);
|
||||||
version.major = [fullver characterAtIndex:0] - '0';
|
|
||||||
if([fullver characterAtIndex:1] != '.')
|
|
||||||
goto err;
|
|
||||||
version.minor = [fullver characterAtIndex:2] - '0';
|
|
||||||
if([fullver characterAtIndex:3] != '.')
|
|
||||||
goto err;
|
|
||||||
version.patch = [fullver characterAtIndex:4] - '0';
|
|
||||||
version.revision = [revstr intValue];
|
|
||||||
|
|
||||||
uint32_t ret = version.revision | (version.patch << 8) | (version.minor << 16) | (version.major << 24);
|
NSLog(@"App revision %@ -> %u", revstr, ret);
|
||||||
NSLog(@"App version %@-%@ -> %u", fullver, revstr, ret);
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
err:
|
|
||||||
NSLog(@"VERSION PARSING ERROR: Only versions in the format x.x.x can be used");
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t read_version(NSString *path)
|
static uint32_t read_version(NSString *path)
|
||||||
|
@ -388,7 +388,7 @@ void set_default_settings(Settings *settings)
|
|||||||
settings->setDefault("abm_interval", "2.0");
|
settings->setDefault("abm_interval", "2.0");
|
||||||
settings->setDefault("client_unload_unused_data_timeout", "60");
|
settings->setDefault("client_unload_unused_data_timeout", "60");
|
||||||
settings->setDefault("curl_verify_cert", "false");
|
settings->setDefault("curl_verify_cert", "false");
|
||||||
settings->setDefault("mapgens_available", "v6, v7p, flat");
|
settings->setDefault("mapgens_available", "v7p, v6, flat");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Android Settings
|
// Android Settings
|
||||||
@ -440,9 +440,9 @@ void set_default_settings(Settings *settings)
|
|||||||
|
|
||||||
// iOS Settings
|
// iOS Settings
|
||||||
#ifdef __IOS__
|
#ifdef __IOS__
|
||||||
settings->setDefault("mg_name", "v7p");
|
|
||||||
settings->setDefault("emergequeue_limit_diskonly", "16");
|
settings->setDefault("emergequeue_limit_diskonly", "16");
|
||||||
settings->setDefault("emergequeue_limit_generate", "16");
|
settings->setDefault("emergequeue_limit_generate", "16");
|
||||||
|
settings->setDefault("gui_scaling_filter_txr2img", "false");
|
||||||
// set font_path
|
// set font_path
|
||||||
settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "retrovillenc.ttf"));
|
settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "retrovillenc.ttf"));
|
||||||
settings->setDefault("fallback_font_path", porting::getDataPath("fonts" DIR_DELIM "retrovillenc.ttf"));
|
settings->setDefault("fallback_font_path", porting::getDataPath("fonts" DIR_DELIM "retrovillenc.ttf"));
|
||||||
@ -451,26 +451,21 @@ void set_default_settings(Settings *settings)
|
|||||||
if ([SDVersion deviceSize] == Screen3Dot5inch) {
|
if ([SDVersion deviceSize] == Screen3Dot5inch) {
|
||||||
// 3.5" (old iPhone's)
|
// 3.5" (old iPhone's)
|
||||||
settings->setDefault("hud_scaling", "0.5");
|
settings->setDefault("hud_scaling", "0.5");
|
||||||
settings->setDefault("gui_scaling", "1.0");
|
|
||||||
} else if ([SDVersion deviceSize] == Screen4inch) {
|
} else if ([SDVersion deviceSize] == Screen4inch) {
|
||||||
// 4" (iPhone 5)
|
// 4" (iPhone 5)
|
||||||
settings->setDefault("hud_scaling", "0.5");
|
settings->setDefault("hud_scaling", "0.5");
|
||||||
settings->setDefault("gui_scaling", "1.1");
|
settings->setDefault("mouse_sensitivity", "0.25");
|
||||||
settings->setDefault("mouse_sensitivity", "0.24");
|
|
||||||
} else if ([SDVersion deviceSize] == Screen4Dot7inch) {
|
} else if ([SDVersion deviceSize] == Screen4Dot7inch) {
|
||||||
// 4.7" (iPhone)
|
// 4.7" (iPhone)
|
||||||
settings->setDefault("hud_scaling", "0.6");
|
settings->setDefault("hud_scaling", "0.6");
|
||||||
settings->setDefault("gui_scaling", "1.1");
|
|
||||||
settings->setDefault("mouse_sensitivity", "0.25");
|
settings->setDefault("mouse_sensitivity", "0.25");
|
||||||
} else if ([SDVersion deviceSize] == Screen5Dot5inch) {
|
} else if ([SDVersion deviceSize] == Screen5Dot5inch) {
|
||||||
// 5.5" (iPhone Plus)
|
// 5.5" (iPhone Plus)
|
||||||
settings->setDefault("hud_scaling", "0.7");
|
settings->setDefault("hud_scaling", "0.7");
|
||||||
settings->setDefault("gui_scaling", "1.2");
|
|
||||||
settings->setDefault("mouse_sensitivity", "0.3");
|
settings->setDefault("mouse_sensitivity", "0.3");
|
||||||
} else if (([SDVersion deviceSize] == Screen5Dot8inch) || ([SDVersion deviceSize] == Screen6Dot1inch) || ([SDVersion deviceSize] == Screen6Dot5inch)) {
|
} else if (([SDVersion deviceSize] == Screen5Dot8inch) || ([SDVersion deviceSize] == Screen6Dot1inch) || ([SDVersion deviceSize] == Screen6Dot5inch)) {
|
||||||
// 5.8+" (iPhone X-series)
|
// 5.8+" (iPhone X-series)
|
||||||
settings->setDefault("hud_scaling", "0.8");
|
settings->setDefault("hud_scaling", "0.8");
|
||||||
settings->setDefault("gui_scaling", "1.3");
|
|
||||||
settings->setDefault("mouse_sensitivity", "0.35");
|
settings->setDefault("mouse_sensitivity", "0.35");
|
||||||
} else {
|
} else {
|
||||||
// iPad
|
// iPad
|
||||||
|
14
src/game.cpp
14
src/game.cpp
@ -548,7 +548,7 @@ public:
|
|||||||
static void playerDamage(MtEvent *e, void *data)
|
static void playerDamage(MtEvent *e, void *data)
|
||||||
{
|
{
|
||||||
SoundMaker *sm = (SoundMaker *)data;
|
SoundMaker *sm = (SoundMaker *)data;
|
||||||
sm->m_sound->playSound(SimpleSoundSpec("player_damage", 0.5), false);
|
sm->m_sound->playSound(SimpleSoundSpec("player_damage", 1.0), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void playerFallingDamage(MtEvent *e, void *data)
|
static void playerFallingDamage(MtEvent *e, void *data)
|
||||||
@ -965,11 +965,7 @@ static inline void create_formspec_menu(GUIFormSpecMenu **cur_formspec,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__ANDROID__) || defined(__IOS__)
|
#define SIZE_TAG "size[11,5.5,true]"
|
||||||
#define SIZE_TAG "size[11,5.5]"
|
|
||||||
#else
|
|
||||||
#define SIZE_TAG "size[11,5.5,true]" // Fixed size on desktop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
static void updateChat(Client &client, f32 dtime, bool show_debug,
|
static void updateChat(Client &client, f32 dtime, bool show_debug,
|
||||||
@ -4759,12 +4755,12 @@ void Game::showPauseMenu()
|
|||||||
<< strgettext("Change Keys") << "]";
|
<< strgettext("Change Keys") << "]";
|
||||||
#endif
|
#endif
|
||||||
os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_exit_menu;"
|
os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_exit_menu;"
|
||||||
<< strgettext("Save and Exit") << "]"
|
<< strgettext("Save and Exit") << "]";
|
||||||
#ifndef __IOS__
|
#ifndef __IOS__
|
||||||
; // LoL
|
|
||||||
os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_exit_os;"
|
os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_exit_os;"
|
||||||
<< strgettext("Close game") << "]"
|
<< strgettext("Close game") << "]";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* << "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]
|
/* << "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]
|
||||||
<< "textarea[0.4,0.25;3.9,6.25;;" << PROJECT_NAME_C " " VERSION_STRING "\n"
|
<< "textarea[0.4,0.25;3.9,6.25;;" << PROJECT_NAME_C " " VERSION_STRING "\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
|
@ -2126,10 +2126,10 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
|
|||||||
// different and forms should always use the
|
// different and forms should always use the
|
||||||
// maximum screen space available.
|
// maximum screen space available.
|
||||||
double prefer_imgsize = mydata.screensize.Y / 10 * gui_scaling;
|
double prefer_imgsize = mydata.screensize.Y / 10 * gui_scaling;
|
||||||
double fitx_imgsize = mydata.screensize.X /
|
double fitx_imgsize = floor(mydata.screensize.X /
|
||||||
((12.0 / 8.0) * (0.5 + mydata.invsize.X));
|
(1.5 * (0.5 + mydata.invsize.X)));
|
||||||
double fity_imgsize = mydata.screensize.Y /
|
double fity_imgsize = floor(mydata.screensize.Y /
|
||||||
((15.0 / 11.0) * (0.85 + mydata.invsize.Y));
|
(1.15 * (0.85 + mydata.invsize.Y)));
|
||||||
use_imgsize = MYMIN(prefer_imgsize,
|
use_imgsize = MYMIN(prefer_imgsize,
|
||||||
MYMIN(fitx_imgsize, fity_imgsize));
|
MYMIN(fitx_imgsize, fity_imgsize));
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user