Merge pull request #6324 from kicktheken/develop

Fix lua project template crash on iOS5.1 device
This commit is contained in:
minggo 2014-04-21 11:07:59 +08:00
commit 65ffb5bb65
2 changed files with 18 additions and 6 deletions

View File

@ -73,11 +73,17 @@
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView();
CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView();
CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
if (glview)
{
CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView();
cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
if (eaglview)
{
CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
}
}
}
//fix not hide status on ios7

View File

@ -73,11 +73,17 @@
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView();
CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView();
CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
if (glview)
{
CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView();
cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
if (eaglview)
{
CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
}
}
}
//fix not hide status on ios7