diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-04-05 12:39:30 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-04-05 12:39:30 -0300 |
commit | 9f33134c93ecbadda70e8eefc50563e29b2eb7f2 (patch) | |
tree | 299ded94fe74a61bf8094935d0f3283f6f30e435 /platform/iphone | |
parent | 35b84d2c85fd152bee05d7d5a05e20a5f602a285 (diff) |
-Support for changing fonts
-Detect when free() might crash the project and throw error
-fixed 2D Bounce in physics (3d still broken)
-renamed “on_top” property to “behind_parent”, which makes more sense, old on_top remains there for compatibility but is invisible.
-large amount of fixes
Diffstat (limited to 'platform/iphone')
-rw-r--r-- | platform/iphone/app_delegate.mm | 11 | ||||
-rw-r--r-- | platform/iphone/detect.py | 1 | ||||
-rwxr-xr-x | platform/iphone/gl_view.mm | 25 | ||||
-rw-r--r-- | platform/iphone/in_app_store.mm | 25 |
4 files changed, 47 insertions, 15 deletions
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index c5889174cd..93b9563988 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -108,8 +108,15 @@ static int frame_count = 0; if ([[UIDevice currentDevice]respondsToSelector:@selector(identifierForVendor)]) { uuid = [UIDevice currentDevice].identifierForVendor.UUIDString; }else{ - // return [UIDevice currentDevice]. uniqueIdentifier - uuid = [[UIDevice currentDevice] performSelector:@selector(uniqueIdentifier)]; + + // before iOS 6, so just generate an identifier and store it + uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"identiferForVendor"]; + if( !uuid ) { + CFUUIDRef cfuuid = CFUUIDCreate(NULL); + uuid = (__bridge_transfer NSString*)CFUUIDCreateString(NULL, cfuuid); + CFRelease(cfuuid); + [[NSUserDefaults standardUserDefaults] setObject:uuid forKey:@"identifierForVendor"]; + } } OSIPhone::get_singleton()->set_unique_ID(String::utf8([uuid UTF8String])); diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 61ec87ccc1..4b95ef2bea 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -37,7 +37,6 @@ def get_flags(): ('tools', 'yes'), ('nedmalloc', 'no'), ('webp', 'yes'), - ('module_FacebookScorer_ios_enabled', 'no'), ] diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index a603e8dbf3..4570342613 100755 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -64,25 +64,22 @@ bool _play_video(String p_path) { p_path = Globals::get_singleton()->globalize_path(p_path); - // NSString *file_path = [NSString stringWithCString:p_path.utf8().get_data() encoding:NSASCIIStringEncoding]; NSString* file_path = [[[NSString alloc] initWithUTF8String:p_path.utf8().get_data()] autorelease]; NSURL *file_url = [NSURL fileURLWithPath:file_path]; _instance.moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:file_url]; _instance.moviePlayerController.controlStyle = MPMovieControlStyleNone; - [_instance.moviePlayerController setScalingMode:MPMovieScalingModeAspectFit]; - // [_instance.moviePlayerController setScalingMode:MPMovieScalingModeAspectFill]; + // [_instance.moviePlayerController setScalingMode:MPMovieScalingModeAspectFit]; + [_instance.moviePlayerController setScalingMode:MPMovieScalingModeAspectFill]; [[NSNotificationCenter defaultCenter] addObserver:_instance selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:_instance.moviePlayerController]; - - [[_instance window] makeKeyAndVisible]; - _instance.backgroundWindow = [[UIApplication sharedApplication] keyWindow]; - [_instance.moviePlayerController.view setFrame:_instance.backgroundWindow.frame]; + + [_instance.moviePlayerController.view setFrame:_instance.bounds]; _instance.moviePlayerController.view.userInteractionEnabled = NO; - [_instance.backgroundWindow addSubview:_instance.moviePlayerController.view]; + [_instance addSubview:_instance.moviePlayerController.view]; [_instance.moviePlayerController play]; return true; @@ -484,6 +481,14 @@ static void clear_touches() { return self; } +// -(BOOL)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers { +// return YES; +// } + +// - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{ +// return YES; +// } + // Stop animating and release resources when they are no longer needed. - (void)dealloc { @@ -510,8 +515,4 @@ static void clear_touches() { _stop_video(); } -- (void)handleTap:(UITapGestureRecognizer *)gesture { - NSLog(@"Gesture\n"); -} - @end diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm index 316e619e11..71e95666af 100644 --- a/platform/iphone/in_app_store.mm +++ b/platform/iphone/in_app_store.mm @@ -167,6 +167,31 @@ Error InAppStore::request_product_info(Variant p_params) { ret["type"] = "purchase"; ret["result"] = "ok"; ret["product_id"] = pid; + + if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){ + + NSURL *receiptFileURL = nil; + NSBundle *bundle = [NSBundle mainBundle]; + if ([bundle respondsToSelector:@selector(appStoreReceiptURL)]) { + + // Get the transaction receipt file path location in the app bundle. + receiptFileURL = [bundle appStoreReceiptURL]; + + // Read in the contents of the transaction file. + ret["receipt"] = receiptFileURL; + + } else { + // Fall back to deprecated transaction receipt, + // which is still available in iOS 7. + + // Use SKPaymentTransaction's transactionReceipt. + ret["receipt"] = transaction.transactionReceipt; + } + + }else{ + ret["receipt"] = transaction.transactionReceipt; + } + InAppStore::get_singleton()->_post_event(ret); [[SKPaymentQueue defaultQueue] finishTransaction:transaction]; } break; |