diff --git a/cocos2dx/CCDirector.cpp b/cocos2dx/CCDirector.cpp index 04c46df86f..030b3a765f 100644 --- a/cocos2dx/CCDirector.cpp +++ b/cocos2dx/CCDirector.cpp @@ -288,7 +288,8 @@ void CCDirector::setOpenGLView(CC_GLVIEW *pobOpenGLView) // set size m_obWinSizeInPoints = m_pobOpenGLView->getSize(); - m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, m_obWinSizeInPoints.height * m_fContentScaleFactor); + m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, + m_obWinSizeInPoints.height * m_fContentScaleFactor); setGLDefaultValues(); if (m_fContentScaleFactor != 1) @@ -789,7 +790,8 @@ void CCDirector::setContentScaleFactor(CGFloat scaleFactor) if (scaleFactor != m_fContentScaleFactor) { m_fContentScaleFactor = scaleFactor; - m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * scaleFactor, m_obWinSizeInPoints.height * scaleFactor); + m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * scaleFactor, + m_obWinSizeInPoints.height * scaleFactor); if (m_pobOpenGLView) { @@ -863,7 +865,8 @@ void CCDirector::setDeviceOrientation(ccDeviceOrientation kDeviceOrientation) // On win32,the return value of CCApplication::setDeviceOrientation is always kCCDeviceOrientationPortrait // So,we should calculate the Projection and window size again. m_obWinSizeInPoints = m_pobOpenGLView->getSize(); - m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, m_obWinSizeInPoints.height * m_fContentScaleFactor); + m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, + m_obWinSizeInPoints.height * m_fContentScaleFactor); setProjection(m_eProjection); } } diff --git a/cocos2dx/platform/ios/CCApplication_ios.h b/cocos2dx/platform/ios/CCApplication_ios.h index 680ddbd556..de74a98e8c 100644 --- a/cocos2dx/platform/ios/CCApplication_ios.h +++ b/cocos2dx/platform/ios/CCApplication_ios.h @@ -94,11 +94,7 @@ public: /** @brief Run the message loop. */ - int run(int initOrientation); - - int getInitOrientation() { - return m_initOrientation; - } + int run(); /** @brief Get current applicaiton instance. @@ -114,8 +110,6 @@ public: protected: static CCApplication * sm_pSharedApplication; - - int m_initOrientation; }; NS_CC_END; diff --git a/cocos2dx/platform/ios/CCApplication_ios.mm b/cocos2dx/platform/ios/CCApplication_ios.mm index 5bf7ed9e4f..01bb7b4063 100644 --- a/cocos2dx/platform/ios/CCApplication_ios.mm +++ b/cocos2dx/platform/ios/CCApplication_ios.mm @@ -34,7 +34,6 @@ NS_CC_BEGIN; CCApplication* CCApplication::sm_pSharedApplication = 0; CCApplication::CCApplication() -: m_initOrientation(0) { CC_ASSERT(! sm_pSharedApplication); sm_pSharedApplication = this; @@ -46,9 +45,8 @@ CCApplication::~CCApplication() sm_pSharedApplication = 0; } -int CCApplication::run(int initOrientation) +int CCApplication::run() { - m_initOrientation = initOrientation; if (initInstance() && applicationDidFinishLaunching()) { [[CCDirectorCaller sharedDirectorCaller] startMainLoop];