Minor objective-c code style improvements iOS-improvements
authorAlex Szpakowski <slime73@gmail.com>
Thu, 20 Nov 2014 18:45:04 -0400
branchiOS-improvements
changeset 95249de159f9cefd
parent 9523 9cbd69cac7ed
child 9525 64e3f446d6d7
Minor objective-c code style improvements
src/video/uikit/SDL_uikitappdelegate.m
src/video/uikit/SDL_uikitopengles.m
src/video/uikit/SDL_uikitopenglview.m
src/video/uikit/SDL_uikitview.m
     1.1 --- a/src/video/uikit/SDL_uikitappdelegate.m	Thu Nov 20 17:19:26 2014 -0400
     1.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m	Thu Nov 20 18:45:04 2014 -0400
     1.3 @@ -113,7 +113,7 @@
     1.4  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
     1.5  {
     1.6      /* Set working directory to resource path */
     1.7 -    [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]];
     1.8 +    [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]];
     1.9  
    1.10      /* register a callback for the idletimer hint */
    1.11      SDL_AddHintCallback(SDL_HINT_IDLE_TIMER_DISABLED,
     2.1 --- a/src/video/uikit/SDL_uikitopengles.m	Thu Nov 20 17:19:26 2014 -0400
     2.2 +++ b/src/video/uikit/SDL_uikitopengles.m	Thu Nov 20 18:45:04 2014 -0400
     2.3 @@ -141,18 +141,18 @@
     2.4          }
     2.5  
     2.6          /* construct our view, passing in SDL's OpenGL configuration data */
     2.7 -        view = [[SDL_uikitopenglview alloc] initWithFrame: frame
     2.8 -                                                    scale: scale
     2.9 -                                            retainBacking: _this->gl_config.retained_backing
    2.10 -                                                    rBits: _this->gl_config.red_size
    2.11 -                                                    gBits: _this->gl_config.green_size
    2.12 -                                                    bBits: _this->gl_config.blue_size
    2.13 -                                                    aBits: _this->gl_config.alpha_size
    2.14 -                                                depthBits: _this->gl_config.depth_size
    2.15 -                                              stencilBits: _this->gl_config.stencil_size
    2.16 -                                                     sRGB: _this->gl_config.framebuffer_srgb_capable
    2.17 -                                             majorVersion: _this->gl_config.major_version
    2.18 -                                               shareGroup: share_group];
    2.19 +        view = [[SDL_uikitopenglview alloc] initWithFrame:frame
    2.20 +                                                    scale:scale
    2.21 +                                            retainBacking:_this->gl_config.retained_backing
    2.22 +                                                    rBits:_this->gl_config.red_size
    2.23 +                                                    gBits:_this->gl_config.green_size
    2.24 +                                                    bBits:_this->gl_config.blue_size
    2.25 +                                                    aBits:_this->gl_config.alpha_size
    2.26 +                                                depthBits:_this->gl_config.depth_size
    2.27 +                                              stencilBits:_this->gl_config.stencil_size
    2.28 +                                                     sRGB:_this->gl_config.framebuffer_srgb_capable
    2.29 +                                             majorVersion:_this->gl_config.major_version
    2.30 +                                               shareGroup:share_group];
    2.31          if (!view) {
    2.32              return NULL;
    2.33          }
    2.34 @@ -162,7 +162,7 @@
    2.35          if (view.viewcontroller != nil) {
    2.36              view.viewcontroller.view = view;
    2.37          }
    2.38 -        [uiwindow addSubview: view];
    2.39 +        [uiwindow addSubview:view];
    2.40  
    2.41          /* The view controller needs to be the root in order to control rotation on iOS 6.0 */
    2.42          if (uiwindow.rootViewController == nil) {
     3.1 --- a/src/video/uikit/SDL_uikitopenglview.m	Thu Nov 20 17:19:26 2014 -0400
     3.2 +++ b/src/video/uikit/SDL_uikitopenglview.m	Thu Nov 20 18:45:04 2014 -0400
     3.3 @@ -112,8 +112,8 @@
     3.4  
     3.5          eaglLayer.opaque = YES;
     3.6          eaglLayer.drawableProperties = @{
     3.7 -            kEAGLDrawablePropertyRetainedBacking: @(retained),
     3.8 -            kEAGLDrawablePropertyColorFormat: colorFormat
     3.9 +            kEAGLDrawablePropertyRetainedBacking:@(retained),
    3.10 +            kEAGLDrawablePropertyColorFormat:colorFormat
    3.11          };
    3.12  
    3.13          /* Set the appropriate scale (for retina display support) */
     4.1 --- a/src/video/uikit/SDL_uikitview.m	Thu Nov 20 17:19:26 2014 -0400
     4.2 +++ b/src/video/uikit/SDL_uikitview.m	Thu Nov 20 18:45:04 2014 -0400
     4.3 @@ -52,7 +52,7 @@
     4.4  
     4.5  - (id)initWithFrame:(CGRect)frame
     4.6  {
     4.7 -    if (self = [super initWithFrame: frame]) {
     4.8 +    if (self = [super initWithFrame:frame]) {
     4.9  #if SDL_IPHONE_KEYBOARD
    4.10          [self initializeKeyboard];
    4.11  #endif
    4.12 @@ -69,7 +69,7 @@
    4.13  
    4.14  - (CGPoint)touchLocation:(UITouch *)touch shouldNormalize:(BOOL)normalize
    4.15  {
    4.16 -    CGPoint point = [touch locationInView: self];
    4.17 +    CGPoint point = [touch locationInView:self];
    4.18  
    4.19      if (normalize) {
    4.20          CGRect bounds = self.bounds;
    4.21 @@ -123,7 +123,7 @@
    4.22          at once, or perhaps in other circumstances.  Usually (it seems)
    4.23          all active touches are canceled.
    4.24      */
    4.25 -    [self touchesEnded: touches withEvent: event];
    4.26 +    [self touchesEnded:touches withEvent:event];
    4.27  }
    4.28  
    4.29  - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
    4.30 @@ -154,7 +154,7 @@
    4.31  /* Set ourselves up as a UITextFieldDelegate */
    4.32  - (void)initializeKeyboard
    4.33  {
    4.34 -    textField = [[UITextField alloc] initWithFrame: CGRectZero];
    4.35 +    textField = [[UITextField alloc] initWithFrame:CGRectZero];
    4.36      textField.delegate = self;
    4.37      /* placeholder so there is something to delete! */
    4.38      textField.text = @" ";
    4.39 @@ -171,7 +171,7 @@
    4.40      textField.hidden = YES;
    4.41      keyboardVisible = NO;
    4.42      /* add the UITextField (hidden) to our view */
    4.43 -    [self addSubview: textField];
    4.44 +    [self addSubview:textField];
    4.45      
    4.46      _uikit_keyboard_init();
    4.47  }
    4.48 @@ -204,7 +204,7 @@
    4.49          int i;
    4.50          for (i = 0; i < [string length]; i++) {
    4.51  
    4.52 -            unichar c = [string characterAtIndex: i];
    4.53 +            unichar c = [string characterAtIndex:i];
    4.54  
    4.55              Uint16 mod = 0;
    4.56              SDL_Scancode code;