Mercurial > sdl-ios-xcode
diff src/video/cocoa/SDL_cocoawindow.m @ 3525:455a6c47d2c6
Fixed compilation on Mac OS X 10.4
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 05 Dec 2009 19:57:49 +0000 |
parents | e7eec78e4b92 |
children | 59ff7a2beb57 |
line wrap: on
line diff
--- a/src/video/cocoa/SDL_cocoawindow.m Sat Dec 05 19:46:24 2009 +0000 +++ b/src/video/cocoa/SDL_cocoawindow.m Sat Dec 05 19:57:49 2009 +0000 @@ -384,7 +384,7 @@ NSString *title; int status; - rect = CGDisplayBounds(displaydata->display); + rect = Cocoa_DisplayBounds(displaydata->display); if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) { rect.origin.x += (rect.size.width - window->w) / 2; @@ -414,7 +414,9 @@ NSArray *screens = [NSScreen screens]; NSScreen *screen = nil; NSScreen *candidate; - for (candidate in screens) { + int i, count = [screens count]; + for (i = 0; i < count; ++i) { + screen = [screens objectAtIndex:i]; NSRect screenRect = [candidate frame]; if (rect.origin.x >= screenRect.origin.x && rect.origin.x < screenRect.origin.x + screenRect.size.width && @@ -483,7 +485,7 @@ SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayFromWindow(window)->driverdata; NSRect rect; - rect = CGDisplayBounds(displaydata->display); + rect = Cocoa_DisplayBounds(displaydata->display); if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) { rect.origin.x += (rect.size.width - window->w) / 2;