Skip to content

Commit

Permalink
fixed scaling issue with iPhone 6 plus
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Nov 22, 2014
1 parent 3b2748d commit 5bd2506
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions platforms/ios/Gearsystem/Emulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
GLuint GBTexture;
}

@property (nonatomic) int multiplier;
@property (nonatomic) float multiplier;
@property (nonatomic) BOOL retina;
@property (nonatomic) BOOL iPad;

Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion platforms/ios/Gearsystem/Emulator.mm
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ -(void)setupTextureWithData: (GLvoid*) data
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();
Expand Down
14 changes: 7 additions & 7 deletions platforms/ios/Gearsystem/GLViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ - (void)viewDidLoad
{
[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)
{
Expand All @@ -62,25 +62,25 @@ - (void)viewDidLoad

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);
}

}
else
{
iPad = YES;
multiplier = 4;
multiplier = 4.0;
view.frame = CGRectMake(128, 28, 128 * multiplier, 112 * multiplier);
}

Expand Down

0 comments on commit 5bd2506

Please sign in to comment.