(OSX) get_chosen_screen - make it backwards compatible with Xcode 3.2/

Snow Leopard - meancoot - please code review
This commit is contained in:
Daniel De Matteis 2013-11-08 23:57:57 +01:00
parent 323d35584f
commit fad421e381

View File

@ -238,18 +238,19 @@ static bool g_is_syncing = true;
static RAScreen* get_chosen_screen()
{
unsigned monitor = g_settings.video.monitor_index;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@autoreleasepool
{
if (monitor >= RAScreen.screens.count)
if (g_settings.video.monitor_index >= RAScreen.screens.count)
{
RARCH_WARN("video_monitor_index is greater than the number of connected monitors; using main screen instead.\n");
[pool drain];
return RAScreen.mainScreen;
}
return RAScreen.screens[monitor];
}
NSArray *screens = [RAScreen screens];
RAScreen *s = (RAScreen*)[screens objectAtIndex:g_settings.video.monitor_index];
[pool drain];
return s;
}
bool apple_gfx_ctx_init()