Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Use Objective-C construct for..in instead of oldfashioned C (uikit)

  • Loading branch information
keestux committed Sep 28, 2011
1 parent 898a298 commit 876488895458faa0317c893fdc3814fb1ebbbefd

File 1 of 1 in 8764888

@@ -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;
@@ -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);

0 comments on commit 8764888

Please sign in to comment.