From 95047562d743b1c1fdc007432c8a0c145a455c5d Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 29 Jun 2015 00:29:49 -0300 Subject: Several performance improvements, mainly in loading and instancing scenes and resources. A general speedup should be apparent, with even more peformance increase when compiling optimized. WARNING: Tested and it seems to work, but if something breaks, please report. --- platform/android/export/export.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'platform') diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index d169ec51d5..0f9ce8081f 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -317,7 +317,7 @@ bool EditorExportPlatformAndroid::_set(const StringName& p_name, const Variant& apk_expansion_pkey=p_value; else if (n.begins_with("permissions/")) { - String what = n.get_slice("/",1).to_upper(); + String what = n.get_slicec('/',1).to_upper(); bool state = p_value; if (state) perms.insert(what); @@ -325,7 +325,7 @@ bool EditorExportPlatformAndroid::_set(const StringName& p_name, const Variant& perms.erase(what); } else if (n.begins_with("user_permissions/")) { - int which = n.get_slice("/",1).to_int(); + int which = n.get_slicec('/',1).to_int(); ERR_FAIL_INDEX_V(which,MAX_USER_PERMISSIONS,false); user_perms[which]=p_value; @@ -390,11 +390,11 @@ bool EditorExportPlatformAndroid::_get(const StringName& p_name,Variant &r_ret) r_ret=apk_expansion_pkey; else if (n.begins_with("permissions/")) { - String what = n.get_slice("/",1).to_upper(); + String what = n.get_slicec('/',1).to_upper(); r_ret = perms.has(what); } else if (n.begins_with("user_permissions/")) { - int which = n.get_slice("/",1).to_int(); + int which = n.get_slicec('/',1).to_int(); ERR_FAIL_INDEX_V(which,MAX_USER_PERMISSIONS,false); r_ret=user_perms[which]; } else -- cgit v1.2.3 From 55b34e05b3d735a84e1af9833e19c0b816c18252 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 30 Jun 2015 11:28:43 -0300 Subject: -some changes by okam --- platform/iphone/app_delegate.mm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'platform') diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 2c7a0a0790..dba37ab1b8 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -138,6 +138,29 @@ static int frame_count = 0; Main::setup2(); ++frame_count; + // this might be necessary before here + for (NSString* key in [[NSBundle mainBundle] infoDictionary]) { + NSObject* value = [xyz objectForKey:key]; + String ukey = String::utf8([key UTF8String]); + + // we need a NSObject to Variant conversor + + if ([value isKindOfClass:[NSString class]]) { + NSString* str = (NSString*)value; + String uval = String::utf8([str UTF8String]); + + Globals::get_singleton()->set("Info.plist/"+ukey, uval); + + } else if ([value isKindOfClass:[NSNumber class]]) { + + NSNumber* n = (NSNumber*)value; + double dval = [n doubleValue]; + + Globals::get_singleton()->set("Info.plist/"+ukey, dval); + }; + // do stuff + } + } break; /* case 3: { -- cgit v1.2.3