diff --git a/cocos2dx/platform/CCEGLViewProtocol.cpp b/cocos2dx/platform/CCEGLViewProtocol.cpp index 709f7d8ecb..96313bd1e9 100644 --- a/cocos2dx/platform/CCEGLViewProtocol.cpp +++ b/cocos2dx/platform/CCEGLViewProtocol.cpp @@ -90,11 +90,12 @@ void CCEGLViewProtocol::setDesignResolutionSize(float width, float height, Resol m_eResolutionPolicy = resolutionPolicy; - setViewPortInPoints(0, 0, m_obScreenSize.width, m_obScreenSize.height); + //setViewPortInPoints(0, 0,m_obScreenSize.width, m_obScreenSize.height); // reset director's member vaviables to fit visible rect CCDirector::sharedDirector()->createStatsLabel(); CCDirector::sharedDirector()->m_obWinSizeInPoints = CCDirector::sharedDirector()->m_obWinSizeInPixels = getSize(); + CCDirector::sharedDirector()->setGLDefaultValues(); } bool CCEGLViewProtocol::enableRetina() @@ -205,7 +206,7 @@ void CCEGLViewProtocol::handleTouchesBegin(int num, int ids[], float xs[], float (y - m_obViewPortRect.origin.y) / m_fYScale); } - CCLog("x = %f y = %f", pTouch->getLocationInView().x, pTouch->getLocationInView().y); + CCLOG("x = %f y = %f", pTouch->getLocationInView().x, pTouch->getLocationInView().y); CCInteger* pInterObj = new CCInteger(nUnusedIndex); s_TouchesIntergerDict.setObject(pInterObj, id); diff --git a/samples/HelloCpp/Classes/AppDelegate.cpp b/samples/HelloCpp/Classes/AppDelegate.cpp index b7c67a5ca5..7e234fb32f 100644 --- a/samples/HelloCpp/Classes/AppDelegate.cpp +++ b/samples/HelloCpp/Classes/AppDelegate.cpp @@ -18,10 +18,10 @@ bool AppDelegate::applicationDidFinishLaunching() { pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); // can not enable retina if invoke - CCEGLView::sharedOpenGLView().setDesignResolutionSize(480, 320, kResolutionScaleFullScreen); + CCEGLView::sharedOpenGLView().setDesignResolutionSize(960, 640, kResolutionScaleFullScreen); // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. - pDirector->enableRetinaDisplay(true); + //pDirector->enableRetinaDisplay(true); // turn on display FPS pDirector->setDisplayStats(true); diff --git a/samples/HelloCpp/Classes/HelloWorldScene.cpp b/samples/HelloCpp/Classes/HelloWorldScene.cpp index 8f4485e300..ceea885ef0 100644 --- a/samples/HelloCpp/Classes/HelloWorldScene.cpp +++ b/samples/HelloCpp/Classes/HelloWorldScene.cpp @@ -39,12 +39,12 @@ bool HelloWorld::init() "CloseNormal.png", "CloseSelected.png", this, - menu_selector(HelloWorld::menuCloseCallback) ); - pCloseItem->setPosition( ccp(visibleSize.width - 20, origin.y + 20) ); + menu_selector(HelloWorld::menuCloseCallback)); + pCloseItem->setPosition(ccp(visibleSize.width - 40 + origin.x, 40 + origin.y)); // create menu, it's an autorelease object CCMenu* pMenu = CCMenu::create(pCloseItem, NULL); - pMenu->setPosition(origin); + pMenu->setPosition(CCPointZero); this->addChild(pMenu, 1); ///////////////////////////// diff --git a/samples/HelloCpp/Resources/HelloWorld.png.REMOVED.git-id b/samples/HelloCpp/Resources/HelloWorld.png.REMOVED.git-id index e651580a74..d81514b887 100644 --- a/samples/HelloCpp/Resources/HelloWorld.png.REMOVED.git-id +++ b/samples/HelloCpp/Resources/HelloWorld.png.REMOVED.git-id @@ -1 +1 @@ -da525913fe81a82968c4ba9bce5170748f5b2cbe \ No newline at end of file +e35126a63c774b4967e6b0e31082d7a32f58ed02 \ No newline at end of file diff --git a/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp b/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp index 9417d7bd86..3af2b89f1f 100644 --- a/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp +++ b/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp @@ -25,9 +25,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi if (!CCDirector::sharedDirector()->getOpenGLView()) { CCEGLView *view = &CCEGLView::sharedOpenGLView(); - view->setFrameSize(w, h); - // set the design resolution screen size, if you want to use Design Resoulution scaled to current screen, please uncomment next line. - view->setDesignResolutionSize(480, 320, kResolutionScaleNotFullScreen); + view->setSize(w, h); AppDelegate *pAppDelegate = new AppDelegate(); CCApplication::sharedApplication().run();