Native resolution support added.

This commit is contained in:
Samuel Bétrisey
2014-12-27 02:42:14 +01:00
parent 20561ae64f
commit 5968d511b2
3 changed files with 30 additions and 10 deletions

View File

@@ -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];
}