Detect screen size and choose resolution defaults accordingly.

Also prevent recreate on older Android versions where it doesn't seem reliable.
This commit is contained in:
Henrik Rydgard committed 2014-07-21 00:35:36 +02:00
1 parent b03460c169
commit 0986f27f33
4 files changed
+42 -7

No files matched your search

+23 -1
View File
@@ -360,6 +360,28 @@ static bool DefaultTimerHack() {
#endif
}
static int DefaultAndroidHwScale() {
#ifdef ANDROID
// Get the real resolution as passed in during startup, not dp_xres and stuff
int xres = System_GetPropertyInt(SYSPROP_DISPLAY_XRES);
int yres = System_GetPropertyInt(SYSPROP_DISPLAY_YRES);
if (xres < 960) {
// Smaller than the PSP*2, let's go native.
return 0;
} else if (xres <= 480 * 3) { // 720p xres
// Small-ish screen, we should default to 2x
return 2 + 1;
} else {
// Large or very large screen. Default to 3x psp resolution.
return 3 + 1;
}
return 0;
#else
return 1;
#endif
}
static ConfigSetting graphicsSettings[] = {
ConfigSetting("ShowFPSCounter", &g_Config.iShowFPSCounter, 0),
ReportedConfigSetting("RenderingMode", &g_Config.iRenderingMode, &DefaultRenderingMode),
@@ -368,7 +390,7 @@ static ConfigSetting graphicsSettings[] = {
ReportedConfigSetting("SoftwareSkinning", &g_Config.bSoftwareSkinning, true),
ReportedConfigSetting("TextureFiltering", &g_Config.iTexFiltering, 1),
ReportedConfigSetting("InternalResolution", &g_Config.iInternalResolution, &DefaultInternalResolution),
ReportedConfigSetting("AndroidHwScale", &g_Config.iAndroidHwScale, 1),
ReportedConfigSetting("AndroidHwScale", &g_Config.iAndroidHwScale, &DefaultAndroidHwScale),
ReportedConfigSetting("FrameSkip", &g_Config.iFrameSkip, 0),
ReportedConfigSetting("AutoFrameSkip", &g_Config.bAutoFrameSkip, false),
ReportedConfigSetting("FrameRate", &g_Config.iFpsLimit, 0),