mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #15835 from Halo-Michael/betterGetProperty
[Apple] Better get property
This commit is contained in:
commit
a35d261908
1 changed files with 12 additions and 8 deletions
20
ios/main.mm
20
ios/main.mm
|
@ -92,16 +92,20 @@ static float g_safeInsetRight = 0.0;
|
|||
static float g_safeInsetTop = 0.0;
|
||||
static float g_safeInsetBottom = 0.0;
|
||||
|
||||
// We no longer need to judge if jit is usable or not by according to the ios version.
|
||||
/*
|
||||
static bool g_jitAvailable = false;
|
||||
static int g_iosVersionMajor;
|
||||
static int g_iosVersionMinor;
|
||||
*/
|
||||
static int g_iosVersionMajor;
|
||||
static std::string version;
|
||||
|
||||
std::string System_GetProperty(SystemProperty prop) {
|
||||
switch (prop) {
|
||||
case SYSPROP_NAME:
|
||||
return StringFromFormat("iOS %d.%d", g_iosVersionMajor, g_iosVersionMinor);
|
||||
return StringFromFormat("iOS %s", version.c_str());
|
||||
case SYSPROP_LANGREGION:
|
||||
return "en_US";
|
||||
return [[[NSLocale currentLocale] objectForKey:NSLocaleIdentifier] UTF8String];
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
@ -156,7 +160,7 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
|||
return false;
|
||||
#endif
|
||||
case SYSPROP_CAN_JIT:
|
||||
return g_jitAvailable;
|
||||
return get_debugged();
|
||||
|
||||
default:
|
||||
return false;
|
||||
|
@ -255,15 +259,15 @@ int main(int argc, char *argv[])
|
|||
|
||||
// So, we'll just resort to a version check.
|
||||
|
||||
std::string version = [[UIDevice currentDevice].systemVersion UTF8String];
|
||||
if (2 != sscanf(version.c_str(), "%d.%d", &g_iosVersionMajor, &g_iosVersionMinor)) {
|
||||
version = [[[UIDevice currentDevice] systemVersion] UTF8String];
|
||||
if (2 != sscanf(version.c_str(), "%d", &g_iosVersionMajor)) {
|
||||
// Just set it to 14.0 if the parsing fails for whatever reason.
|
||||
g_iosVersionMajor = 14;
|
||||
g_iosVersionMinor = 0;
|
||||
}
|
||||
|
||||
g_jitAvailable = get_debugged();
|
||||
/*
|
||||
g_jitAvailable = get_debugged();
|
||||
|
||||
if (g_iosVersionMajor > 14 || (g_iosVersionMajor == 14 && g_iosVersionMinor >= 4)) {
|
||||
g_jitAvailable = false;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue