More backwards compatible version of PR

This commit is contained in:
Twinaphex 2015-11-05 22:11:46 +01:00
parent be57dcb659
commit 22cae6189c

View File

@ -109,12 +109,26 @@ void *glkitview_init(void);
- (void)viewWillLayoutSubviews
{
float width = 0.0f, height = 0.0f, tenpctw, tenpcth;
RAScreen *screen = (RAScreen*)get_chosen_screen();
UIInterfaceOrientation orientation = self.interfaceOrientation;
CGRect screenSize = [[UIScreen mainScreen] bounds];
float width = ((int)orientation < 3) ? CGRectGetWidth(screenSize) : CGRectGetHeight(screenSize);
float height = ((int)orientation < 3) ? CGRectGetHeight(screenSize) : CGRectGetWidth(screenSize);
float tenpctw = width / 10.0f;
float tenpcth = height / 10.0f;
SEL selector = NSSelectorFromString(BOXSTRING("coordinateSpace"));
if ([screen respondsToSelector:selector])
{
screenSize = [[screen coordinateSpace] bounds];
width = CGRectGetWidth(screenSize);
height = CGRectGetHeight(screenSize);
}
else
{
width = ((int)orientation < 3) ? CGRectGetWidth(screenSize) : CGRectGetHeight(screenSize);
height = ((int)orientation < 3) ? CGRectGetHeight(screenSize) : CGRectGetWidth(screenSize);
}
tenpctw = width / 10.0f;
tenpcth = height / 10.0f;
g_pause_indicator_view.frame = CGRectMake(tenpctw * 4.0f, 0.0f, tenpctw * 2.0f, tenpcth);
[g_pause_indicator_view viewWithTag:1].frame = CGRectMake(0, 0, tenpctw * 2.0f, tenpcth);