Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Use Objective-C construct for..in instead of oldfashioned C (uikit)
Browse files Browse the repository at this point in the history
  • Loading branch information
keestux committed Sep 28, 2011
1 parent 898a298 commit 8764888
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/video/uikit/SDL_uikitvideo.m
Expand Up @@ -167,12 +167,9 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device)
return;
}

const int ismain = (uiscreen == [UIScreen mainScreen]);
const BOOL ismain = (uiscreen == [UIScreen mainScreen]);
const NSArray *modes = [uiscreen availableModes];
const NSUInteger mode_count = [modes count];
NSUInteger i;
for (i = 0; i < mode_count; i++) {
UIScreenMode *uimode = (UIScreenMode *) [modes objectAtIndex:i];
for (UIScreenMode *uimode in [uiscreen availableModes]) {
CGSize size = [uimode size];
mode.format = SDL_PIXELFORMAT_ABGR8888;
mode.refresh_rate = 0;
Expand Down Expand Up @@ -245,12 +242,8 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device)
const CGRect rect = [uiscreen bounds];
UIKit_AddDisplay(uiscreen, uiscreenmode, (int)rect.size.width, (int)rect.size.height);
} else {
const NSArray *screens = [UIScreen screens];
const NSUInteger screen_count = [screens count];
NSUInteger i;
for (i = 0; i < screen_count; i++) {
for (UIScreen *uiscreen in [UIScreen screens]) {
// the main screen is the first element in the array.
UIScreen *uiscreen = (UIScreen *) [screens objectAtIndex:i];
UIScreenMode *uiscreenmode = [uiscreen currentMode];
const CGSize size = [[uiscreen currentMode] size];
UIKit_AddDisplay(uiscreen, uiscreenmode, (int)size.width, (int)size.height);
Expand Down

0 comments on commit 8764888

Please sign in to comment.