Commit 5bd25060 authored by Ignacio Sanchez Gines's avatar Ignacio Sanchez Gines
Browse files

fixed scaling issue with iPhone 6 plus

parent 3b2748d8
......@@ -37,7 +37,7 @@
GLuint GBTexture;
}
@property (nonatomic) int multiplier;
@property (nonatomic) float multiplier;
@property (nonatomic) BOOL retina;
@property (nonatomic) BOOL iPad;
......@@ -55,7 +55,7 @@
- (void)shutdownGL;
- (void)renderFrame;
- (void)setupTextureWithData: (GLvoid*) data;
- (void)renderQuadWithViewportWidth: (int)viewportWidth andHeight: (int)viewportHeight andMirrorY: (BOOL)mirrorY;
- (void)renderQuadWithViewportWidth: (float)viewportWidth andHeight: (float)viewportHeight andMirrorY: (BOOL)mirrorY;
- (void)setAudio: (BOOL)enabled;
- (void)resetAudio;
......
......@@ -141,7 +141,7 @@ const GLfloat tex[] = {0.0f, kGB_TexHeight, kGB_TexWidth, kGB_TexHeight, 0.0f, 0
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
}
-(void)renderQuadWithViewportWidth: (int)viewportWidth andHeight: (int)viewportHeight andMirrorY: (BOOL) mirrorY
-(void)renderQuadWithViewportWidth: (float)viewportWidth andHeight: (float)viewportHeight andMirrorY: (BOOL) mirrorY
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
......
......@@ -45,13 +45,13 @@
{
[super viewDidLoad];
int scale =[[UIScreen mainScreen] nativeScale];
float scale =[[UIScreen mainScreen] nativeScale];
GLKView *view = (GLKView *)self.view;
BOOL retina, iPad;
retina = (scale != 1);
retina = (scale != 1.0);
int multiplier = 0;
float multiplier = 0;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
{
......@@ -62,17 +62,17 @@
if (h == 667)
{
multiplier = 2;
multiplier = 2.0;
view.frame = CGRectMake(59, 27, 128 * multiplier, 112 * multiplier);
}
else if (h == 736)
{
multiplier = 3;
multiplier = 3.0;
view.frame = CGRectMake(16, 8, 128 * multiplier, 112 * multiplier);
}
else
{
multiplier = 2;
multiplier = 2.0;
view.frame = CGRectMake(31, 15, 128 * multiplier, 112 * multiplier);
}
......@@ -80,7 +80,7 @@
else
{
iPad = YES;
multiplier = 4;
multiplier = 4.0;
view.frame = CGRectMake(128, 28, 128 * multiplier, 112 * multiplier);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment