Mercurial > sdl-ios-xcode
comparison 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 |
comparison
equal
deleted
inserted
replaced
3524:5668e43c256b | 3525:455a6c47d2c6 |
---|---|
382 NSRect rect; | 382 NSRect rect; |
383 unsigned int style; | 383 unsigned int style; |
384 NSString *title; | 384 NSString *title; |
385 int status; | 385 int status; |
386 | 386 |
387 rect = CGDisplayBounds(displaydata->display); | 387 rect = Cocoa_DisplayBounds(displaydata->display); |
388 if ((window->flags & SDL_WINDOW_FULLSCREEN) | 388 if ((window->flags & SDL_WINDOW_FULLSCREEN) |
389 || window->x == SDL_WINDOWPOS_CENTERED) { | 389 || window->x == SDL_WINDOWPOS_CENTERED) { |
390 rect.origin.x += (rect.size.width - window->w) / 2; | 390 rect.origin.x += (rect.size.width - window->w) / 2; |
391 } else if (window->x != SDL_WINDOWPOS_UNDEFINED) { | 391 } else if (window->x != SDL_WINDOWPOS_UNDEFINED) { |
392 rect.origin.x = window->x; | 392 rect.origin.x = window->x; |
412 | 412 |
413 /* Figure out which screen to place this window */ | 413 /* Figure out which screen to place this window */ |
414 NSArray *screens = [NSScreen screens]; | 414 NSArray *screens = [NSScreen screens]; |
415 NSScreen *screen = nil; | 415 NSScreen *screen = nil; |
416 NSScreen *candidate; | 416 NSScreen *candidate; |
417 for (candidate in screens) { | 417 int i, count = [screens count]; |
418 for (i = 0; i < count; ++i) { | |
419 screen = [screens objectAtIndex:i]; | |
418 NSRect screenRect = [candidate frame]; | 420 NSRect screenRect = [candidate frame]; |
419 if (rect.origin.x >= screenRect.origin.x && | 421 if (rect.origin.x >= screenRect.origin.x && |
420 rect.origin.x < screenRect.origin.x + screenRect.size.width && | 422 rect.origin.x < screenRect.origin.x + screenRect.size.width && |
421 rect.origin.y >= screenRect.origin.y && | 423 rect.origin.y >= screenRect.origin.y && |
422 rect.origin.y < screenRect.origin.y + screenRect.size.height) { | 424 rect.origin.y < screenRect.origin.y + screenRect.size.height) { |
481 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | 483 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
482 NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->window; | 484 NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->window; |
483 SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayFromWindow(window)->driverdata; | 485 SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayFromWindow(window)->driverdata; |
484 NSRect rect; | 486 NSRect rect; |
485 | 487 |
486 rect = CGDisplayBounds(displaydata->display); | 488 rect = Cocoa_DisplayBounds(displaydata->display); |
487 if ((window->flags & SDL_WINDOW_FULLSCREEN) | 489 if ((window->flags & SDL_WINDOW_FULLSCREEN) |
488 || window->x == SDL_WINDOWPOS_CENTERED) { | 490 || window->x == SDL_WINDOWPOS_CENTERED) { |
489 rect.origin.x += (rect.size.width - window->w) / 2; | 491 rect.origin.x += (rect.size.width - window->w) / 2; |
490 } else { | 492 } else { |
491 rect.origin.x = window->x; | 493 rect.origin.x = window->x; |