mirror of https://github.com/axmolengine/axmol.git
* remove needless code
This commit is contained in:
parent
f1351610d8
commit
31b47c3fc6
|
@ -288,7 +288,8 @@ void CCDirector::setOpenGLView(CC_GLVIEW *pobOpenGLView)
|
||||||
|
|
||||||
// set size
|
// set size
|
||||||
m_obWinSizeInPoints = m_pobOpenGLView->getSize();
|
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();
|
setGLDefaultValues();
|
||||||
|
|
||||||
if (m_fContentScaleFactor != 1)
|
if (m_fContentScaleFactor != 1)
|
||||||
|
@ -789,7 +790,8 @@ void CCDirector::setContentScaleFactor(CGFloat scaleFactor)
|
||||||
if (scaleFactor != m_fContentScaleFactor)
|
if (scaleFactor != m_fContentScaleFactor)
|
||||||
{
|
{
|
||||||
m_fContentScaleFactor = scaleFactor;
|
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)
|
if (m_pobOpenGLView)
|
||||||
{
|
{
|
||||||
|
@ -863,7 +865,8 @@ void CCDirector::setDeviceOrientation(ccDeviceOrientation kDeviceOrientation)
|
||||||
// On win32,the return value of CCApplication::setDeviceOrientation is always kCCDeviceOrientationPortrait
|
// On win32,the return value of CCApplication::setDeviceOrientation is always kCCDeviceOrientationPortrait
|
||||||
// So,we should calculate the Projection and window size again.
|
// So,we should calculate the Projection and window size again.
|
||||||
m_obWinSizeInPoints = m_pobOpenGLView->getSize();
|
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);
|
setProjection(m_eProjection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,11 +94,7 @@ public:
|
||||||
/**
|
/**
|
||||||
@brief Run the message loop.
|
@brief Run the message loop.
|
||||||
*/
|
*/
|
||||||
int run(int initOrientation);
|
int run();
|
||||||
|
|
||||||
int getInitOrientation() {
|
|
||||||
return m_initOrientation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Get current applicaiton instance.
|
@brief Get current applicaiton instance.
|
||||||
|
@ -114,8 +110,6 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static CCApplication * sm_pSharedApplication;
|
static CCApplication * sm_pSharedApplication;
|
||||||
|
|
||||||
int m_initOrientation;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_CC_END;
|
NS_CC_END;
|
||||||
|
|
|
@ -34,7 +34,6 @@ NS_CC_BEGIN;
|
||||||
CCApplication* CCApplication::sm_pSharedApplication = 0;
|
CCApplication* CCApplication::sm_pSharedApplication = 0;
|
||||||
|
|
||||||
CCApplication::CCApplication()
|
CCApplication::CCApplication()
|
||||||
: m_initOrientation(0)
|
|
||||||
{
|
{
|
||||||
CC_ASSERT(! sm_pSharedApplication);
|
CC_ASSERT(! sm_pSharedApplication);
|
||||||
sm_pSharedApplication = this;
|
sm_pSharedApplication = this;
|
||||||
|
@ -46,9 +45,8 @@ CCApplication::~CCApplication()
|
||||||
sm_pSharedApplication = 0;
|
sm_pSharedApplication = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CCApplication::run(int initOrientation)
|
int CCApplication::run()
|
||||||
{
|
{
|
||||||
m_initOrientation = initOrientation;
|
|
||||||
if (initInstance() && applicationDidFinishLaunching())
|
if (initInstance() && applicationDidFinishLaunching())
|
||||||
{
|
{
|
||||||
[[CCDirectorCaller sharedDirectorCaller] startMainLoop];
|
[[CCDirectorCaller sharedDirectorCaller] startMainLoop];
|
||||||
|
|
Loading…
Reference in New Issue