diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-04-09 14:04:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-09 14:04:51 +0200 |
commit | a1a0f021eacf4a1449d0e02778019e20a65690a8 (patch) | |
tree | 217b35aad58f0909e9915ba9fcdaf0ea6be5694d /platform/iphone/view_controller.mm | |
parent | 21727657ff6df8ebbf5860547ecd3c48f22eefe5 (diff) | |
parent | 5c2ddb299ba1385bae19e16590bd6207e493ace6 (diff) |
Merge pull request #8332 from BastiaanOlij/format-mm
Formatting of mm files
Diffstat (limited to 'platform/iphone/view_controller.mm')
-rw-r--r-- | platform/iphone/view_controller.mm | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm index 773ca62d2e..2b9027e042 100644 --- a/platform/iphone/view_controller.mm +++ b/platform/iphone/view_controller.mm @@ -33,42 +33,42 @@ extern "C" { -int add_path(int, char**); -int add_cmdline(int, char**); + int add_path(int, char**); + int add_cmdline(int, char**); -int add_path(int p_argc, char** p_args) { + int add_path(int p_argc, char** p_args) { - NSString* str = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_path"]; - if (!str) - return p_argc; + NSString* str = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_path"]; + if (!str) + return p_argc; - p_args[p_argc++] = "-path"; - [str retain]; // memory leak lol (maybe make it static here and delete it in ViewController destructor? @todo - p_args[p_argc++] = (char*)[str cString]; - p_args[p_argc] = NULL; + p_args[p_argc++] = "-path"; + [str retain]; // memory leak lol (maybe make it static here and delete it in ViewController destructor? @todo + p_args[p_argc++] = (char*)[str cString]; + p_args[p_argc] = NULL; - return p_argc; -}; + return p_argc; + }; -int add_cmdline(int p_argc, char** p_args) { + int add_cmdline(int p_argc, char** p_args) { - NSArray* arr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_cmdline"]; - if (!arr) - return p_argc; + NSArray* arr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_cmdline"]; + if (!arr) + return p_argc; - for (int i=0; i < [arr count]; i++) { + for (int i=0; i < [arr count]; i++) { - NSString* str = [arr objectAtIndex:i]; - if (!str) - continue; - [str retain]; // @todo delete these at some point - p_args[p_argc++] = (char*)[str cString]; - }; + NSString* str = [arr objectAtIndex:i]; + if (!str) + continue; + [str retain]; // @todo delete these at some point + p_args[p_argc++] = (char*)[str cString]; + }; - p_args[p_argc] = NULL; + p_args[p_argc] = NULL; - return p_argc; -}; + return p_argc; + }; }; @@ -91,20 +91,20 @@ int add_cmdline(int p_argc, char** p_args) { NSArray* arr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"]; switch(p_orientation) { - case UIInterfaceOrientationLandscapeLeft: - return [arr indexOfObject:@"UIInterfaceOrientationLandscapeLeft"] != NSNotFound ? YES : NO; + case UIInterfaceOrientationLandscapeLeft: + return [arr indexOfObject:@"UIInterfaceOrientationLandscapeLeft"] != NSNotFound ? YES : NO; - case UIInterfaceOrientationLandscapeRight: - return [arr indexOfObject:@"UIInterfaceOrientationLandscapeRight"] != NSNotFound ? YES : NO; + case UIInterfaceOrientationLandscapeRight: + return [arr indexOfObject:@"UIInterfaceOrientationLandscapeRight"] != NSNotFound ? YES : NO; - case UIInterfaceOrientationPortrait: - return [arr indexOfObject:@"UIInterfaceOrientationPortrait"] != NSNotFound ? YES : NO; + case UIInterfaceOrientationPortrait: + return [arr indexOfObject:@"UIInterfaceOrientationPortrait"] != NSNotFound ? YES : NO; - case UIInterfaceOrientationPortraitUpsideDown: - return [arr indexOfObject:@"UIInterfaceOrientationPortraitUpsideDown"] != NSNotFound ? YES : NO; + case UIInterfaceOrientationPortraitUpsideDown: + return [arr indexOfObject:@"UIInterfaceOrientationPortraitUpsideDown"] != NSNotFound ? YES : NO; - default: - return NO; + default: + return NO; } }; @@ -128,16 +128,15 @@ int add_cmdline(int p_argc, char** p_args) { } }; -- (BOOL)prefersStatusBarHidden -{ +- (BOOL)prefersStatusBarHidden { return YES; } #ifdef GAME_CENTER_ENABLED - (void) gameCenterViewControllerDidFinish:(GKGameCenterViewController*) gameCenterViewController { - //[gameCenterViewController dismissViewControllerAnimated:YES completion:^{GameCenter::get_singleton()->game_center_closed();}];//version for signaling when overlay is completely gone - GameCenter::get_singleton()->game_center_closed(); - [gameCenterViewController dismissViewControllerAnimated:YES completion:nil]; + //[gameCenterViewController dismissViewControllerAnimated:YES completion:^{GameCenter::get_singleton()->game_center_closed();}];//version for signaling when overlay is completely gone + GameCenter::get_singleton()->game_center_closed(); + [gameCenterViewController dismissViewControllerAnimated:YES completion:nil]; } #endif |