diff --git a/HelloLua/proj.ios/HelloLua.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/HelloLua/proj.ios/HelloLua.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000000..54782e32fd --- /dev/null +++ b/HelloLua/proj.ios/HelloLua.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/cocos2dx/platform/CCEGLViewProtocol.cpp b/cocos2dx/platform/CCEGLViewProtocol.cpp index 8c1b3daf8b..8a7bcaf54d 100644 --- a/cocos2dx/platform/CCEGLViewProtocol.cpp +++ b/cocos2dx/platform/CCEGLViewProtocol.cpp @@ -195,9 +195,15 @@ void CCEGLViewProtocol::handleTouchesBegin(int num, int ids[], float xs[], float } CCTouch* pTouch = s_pTouches[nUnusedIndex] = new CCTouch(); - pTouch->SetTouchInfo(nUnusedIndex, (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor, - (y - m_rcViewPort.origin.y) / m_fScreenScaleFactor); - + if (m_bNeedScale) + { + pTouch->SetTouchInfo(nUnusedIndex, (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor, + (y - m_rcViewPort.origin.y) / m_fScreenScaleFactor); + } + else + { + pTouch->SetTouchInfo(nUnusedIndex, x, y); + } CCInteger* pInterObj = new CCInteger(nUnusedIndex); s_TouchesIntergerDict.setObject(pInterObj, id); set.addObject(pTouch); @@ -233,8 +239,15 @@ void CCEGLViewProtocol::handleTouchesMove(int num, int ids[], float xs[], float CCTouch* pTouch = s_pTouches[pIndex->getValue()]; if (pTouch) { - pTouch->SetTouchInfo(pIndex->getValue(), (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor, - (y - m_rcViewPort.origin.y) / m_fScreenScaleFactor); + if (m_bNeedScale) + { + pTouch->SetTouchInfo(pIndex->getValue(), (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor, + (y - m_rcViewPort.origin.y) / m_fScreenScaleFactor); + } + else + { + pTouch->SetTouchInfo(pIndex->getValue(), x, y); + } set.addObject(pTouch); } else @@ -274,8 +287,16 @@ void CCEGLViewProtocol::getSetOfTouchesEndOrCancel(CCSet& set, int num, int ids[ { CCLOG("Ending touches with id: %d, x=%f, y=%f", id, x, y); - pTouch->SetTouchInfo(pIndex->getValue(), (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor, - (y - m_rcViewPort.origin.y) / m_fScreenScaleFactor); + if (m_bNeedScale) + { + pTouch->SetTouchInfo(pIndex->getValue(), (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor, + (y - m_rcViewPort.origin.y) / m_fScreenScaleFactor); + } + else + { + pTouch->SetTouchInfo(pIndex->getValue(), x, y); + } + set.addObject(pTouch); // release the object diff --git a/cocos2dx/platform/ios/CCEGLView_ios.mm b/cocos2dx/platform/ios/CCEGLView_ios.mm index ee1ce01c2f..75806b8dcd 100644 --- a/cocos2dx/platform/ios/CCEGLView_ios.mm +++ b/cocos2dx/platform/ios/CCEGLView_ios.mm @@ -43,7 +43,7 @@ CCEGLView::~CCEGLView() CCSize CCEGLView::getSize() { cocos2d::CCSize size([[EAGLView sharedEGLView] getWidth], [[EAGLView sharedEGLView] getHeight]); - + return size; } @@ -57,17 +57,17 @@ bool CCEGLView::isOpenGLReady() return [EAGLView sharedEGLView] != NULL; } - bool CCEGLView::canSetContentScaleFactor() - { - return [[EAGLView sharedEGLView] respondsToSelector:@selector(setContentScaleFactor:)]; - } +bool CCEGLView::canSetContentScaleFactor() +{ + return [[EAGLView sharedEGLView] respondsToSelector:@selector(setContentScaleFactor:)]; +} - void CCEGLView::setContentScaleFactor(float contentScaleFactor) - { - UIView * view = [EAGLView sharedEGLView]; - view.contentScaleFactor = contentScaleFactor; - [view setNeedsLayout]; - } +void CCEGLView::setContentScaleFactor(float contentScaleFactor) +{ + UIView * view = [EAGLView sharedEGLView]; + view.contentScaleFactor = contentScaleFactor; + [view setNeedsLayout]; +} void CCEGLView::end() { diff --git a/cocos2dx/platform/ios/EAGLView.mm b/cocos2dx/platform/ios/EAGLView.mm index 4f302cd0b7..aa9411264a 100755 --- a/cocos2dx/platform/ios/EAGLView.mm +++ b/cocos2dx/platform/ios/EAGLView.mm @@ -229,7 +229,7 @@ static EAGLView *view = 0; //discardFramebufferSupported_ = [[CCConfiguration sharedConfiguration] supportsDiscardFramebuffer]; - CHECK_GL_ERROR_DEBUG(); + CHECK_GL_ERROR(); return YES; } diff --git a/tests/proj.ios/test.xcodeproj/project.pbxproj.REMOVED.git-id b/tests/proj.ios/test.xcodeproj/project.pbxproj.REMOVED.git-id index 046c4f3ad7..8e06cd3ff6 100644 --- a/tests/proj.ios/test.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/tests/proj.ios/test.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -f46f3ef49ab63a9336441503e20945a3e8a6d6f6 \ No newline at end of file +8b5c548106a7fde2f85a35a0b0ac330b836d21ad \ No newline at end of file