From 5968d511b27373a0f163b928f6c5def588b64a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20B=C3=A9trisey?= Date: Sat, 27 Dec 2014 02:42:14 +0100 Subject: [PATCH 1/2] Native resolution support added. --- .../ViewControllers/SettingsViewController.m | 22 +++++++++++++++++-- iPad.storyboard | 9 ++++---- iPhone.storyboard | 9 ++++---- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/Limelight/ViewControllers/SettingsViewController.m b/Limelight/ViewControllers/SettingsViewController.m index 0dbc7b2..0d9ebab 100644 --- a/Limelight/ViewControllers/SettingsViewController.m +++ b/Limelight/ViewControllers/SettingsViewController.m @@ -44,8 +44,26 @@ static NSString* bitrateFormat = @"Bitrate: %d kbps"; - (void) saveSettings { DataManager* dataMan = [[DataManager alloc] init]; NSInteger framerate = [self.framerateSelector selectedSegmentIndex] == 0 ? 30 : 60; - NSInteger height = [self.resolutionSelector selectedSegmentIndex] == 0 ? 720 : 1080; - NSInteger width = height == 720 ? 1280 : 1920; + NSInteger height; + NSInteger width; + if ([self.resolutionSelector selectedSegmentIndex] == 2) { + // Get screen native resolution + height = [UIScreen mainScreen].bounds.size.height; + width = [UIScreen mainScreen].bounds.size.width; + + UIAlertView *alertResolution = [[UIAlertView alloc] initWithTitle:@"Native resolution" + message:[NSString stringWithFormat:@"You must select the following resolution in the game settings : %lix%li", (long)width, (long)height] + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + [alertResolution show]; + } + else + { + height = [self.resolutionSelector selectedSegmentIndex] == 0 ? 720 : 1080; + width = height == 720 ? 1280 : 1920; + } + [dataMan saveSettingsWithBitrate:_bitrate framerate:framerate height:height width:width]; } diff --git a/iPad.storyboard b/iPad.storyboard index 6aeb903..65bf59a 100644 --- a/iPad.storyboard +++ b/iPad.storyboard @@ -1,7 +1,7 @@ - + - + @@ -60,15 +60,16 @@ - + + - + diff --git a/iPhone.storyboard b/iPhone.storyboard index 81d1251..060f264 100644 --- a/iPhone.storyboard +++ b/iPhone.storyboard @@ -1,7 +1,7 @@ - + - + @@ -67,7 +67,7 @@ - + @@ -89,11 +89,12 @@ - + + From 0ee9b877421271b59b899ea3dffef6e160841f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20B=C3=A9trisey?= Date: Sat, 27 Dec 2014 03:21:32 +0100 Subject: [PATCH 2/2] UIScreen.bounds.size doesn't give the real resolution We need to multiply it by the UIScreen.scale --- Limelight/ViewControllers/SettingsViewController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Limelight/ViewControllers/SettingsViewController.m b/Limelight/ViewControllers/SettingsViewController.m index 0d9ebab..7e6cea6 100644 --- a/Limelight/ViewControllers/SettingsViewController.m +++ b/Limelight/ViewControllers/SettingsViewController.m @@ -48,8 +48,8 @@ static NSString* bitrateFormat = @"Bitrate: %d kbps"; NSInteger width; if ([self.resolutionSelector selectedSegmentIndex] == 2) { // Get screen native resolution - height = [UIScreen mainScreen].bounds.size.height; - width = [UIScreen mainScreen].bounds.size.width; + height = [UIScreen mainScreen].bounds.size.height * [UIScreen mainScreen].scale; + width = [UIScreen mainScreen].bounds.size.width * [UIScreen mainScreen].scale; UIAlertView *alertResolution = [[UIAlertView alloc] initWithTitle:@"Native resolution" message:[NSString stringWithFormat:@"You must select the following resolution in the game settings : %lix%li", (long)width, (long)height]