Modify the test code for the right device orientation.

This commit is contained in:
natural-law 2011-05-12 10:11:58 +08:00
parent 78d49e9806
commit a7db186d06
1 changed files with 4 additions and 4 deletions

View File

@ -19,9 +19,6 @@ static TestScene* CreateTestScene(int nIdx)
{ {
CCDirector::sharedDirector()->purgeCachedData(); CCDirector::sharedDirector()->purgeCachedData();
// change to default orientation
ChangeOrientation(CCDeviceOrientationPortrait);
TestScene* pScene = NULL; TestScene* pScene = NULL;
switch (nIdx) switch (nIdx)
@ -49,7 +46,7 @@ static TestScene* CreateTestScene(int nIdx)
case TEST_COCOSNODE: case TEST_COCOSNODE:
pScene = new CocosNodeTestScene(); break; pScene = new CocosNodeTestScene(); break;
case TEST_TOUCHES: case TEST_TOUCHES:
ChangeOrientation(CCDeviceOrientationLandscapeLeft); ChangeOrientation(CCDeviceOrientationLandscapeRight);
pScene = new PongScene(); break; pScene = new PongScene(); break;
case TEST_MENU: case TEST_MENU:
pScene = new MenuTestScene(); break; pScene = new MenuTestScene(); break;
@ -123,6 +120,9 @@ static TestScene* CreateTestScene(int nIdx)
TestController::TestController() TestController::TestController()
: m_tBeginPos(CCPointZero) : m_tBeginPos(CCPointZero)
{ {
// change to default orientation
ChangeOrientation(CCDeviceOrientationPortrait);
// add close menu // add close menu
CCMenuItemImage *pCloseItem = CCMenuItemImage::itemFromNormalImage(s_pPathClose, s_pPathClose, this, menu_selector(TestController::closeCallback) ); CCMenuItemImage *pCloseItem = CCMenuItemImage::itemFromNormalImage(s_pPathClose, s_pPathClose, this, menu_selector(TestController::closeCallback) );
CCMenu* pMenu =CCMenu::menuWithItems(pCloseItem, NULL); CCMenu* pMenu =CCMenu::menuWithItems(pCloseItem, NULL);