From a5a4ca9868a5a9dd5c3abe47f212ff49a0169c18 Mon Sep 17 00:00:00 2001 From: mustime Date: Thu, 16 Aug 2012 11:39:47 +0800 Subject: [PATCH 01/53] issue #1425: add matrix.pkg --- tools/tolua++/Cocos2d.pkg | 1 + tools/tolua++/matrix.pkg | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tools/tolua++/matrix.pkg diff --git a/tools/tolua++/Cocos2d.pkg b/tools/tolua++/Cocos2d.pkg index 47aa1deb0f..ca4c798f14 100644 --- a/tools/tolua++/Cocos2d.pkg +++ b/tools/tolua++/Cocos2d.pkg @@ -59,5 +59,6 @@ $pfile "CCTouch.pkg" $pfile "CCTransition.pkg" $pfile "ccTypes.pkg" $pfile "CCUserDefault.pkg" +$pfile "matrix.pkg" $pfile "SimpleAudioEngine.pkg" diff --git a/tools/tolua++/matrix.pkg b/tools/tolua++/matrix.pkg new file mode 100644 index 0000000000..736816c381 --- /dev/null +++ b/tools/tolua++/matrix.pkg @@ -0,0 +1,17 @@ +typedef unsigned int kmGLEnum; + +typedef struct kmMat4 { + float mat[16]; +} kmMat4; + +void kmGLFreeAll(void); +void kmGLPushMatrix(void); +void kmGLPopMatrix(void); +void kmGLMatrixMode(kmGLEnum mode); +void kmGLLoadIdentity(void); +void kmGLLoadMatrix(const kmMat4* pIn); +void kmGLMultMatrix(const kmMat4* pIn); +void kmGLTranslatef(float x, float y, float z); +void kmGLRotatef(float angle, float x, float y, float z); +void kmGLScalef(float x, float y, float z); +void kmGLGetMatrix(kmGLEnum mode, kmMat4* pOut); From 4db53b2f9173d77badd60d9c8e15e098d0bdc551 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 20 Aug 2012 15:54:53 +0800 Subject: [PATCH 02/53] fixed #1382:safe return mOwner to avoid crash caused by null pointer --- extensions/CCBReader/CCBReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/CCBReader/CCBReader.cpp b/extensions/CCBReader/CCBReader.cpp index 129faad147..af9f24f659 100644 --- a/extensions/CCBReader/CCBReader.cpp +++ b/extensions/CCBReader/CCBReader.cpp @@ -111,7 +111,7 @@ CCNode * CCBReader::readNodeGraphFromFile(CCString * pCCBRootPath, CCString * pC this->mCurrentBit = 0; this->mOwner = pOwner; - this->mOwner->retain(); + CC_SAFE_RETAIN(this->mOwner); this->mRootContainerSize = pRootContainerSize; CCNode * node = NULL; From 84a946f676672029c6a4128201b15ab199a9f0d1 Mon Sep 17 00:00:00 2001 From: ningxu Date: Mon, 20 Aug 2012 23:07:43 +0800 Subject: [PATCH 03/53] Update cocos2dx/platform/mac/CCGL.h add VAO support --- cocos2dx/platform/mac/CCGL.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cocos2dx/platform/mac/CCGL.h b/cocos2dx/platform/mac/CCGL.h index 29d1d03eb9..45e839e4bc 100644 --- a/cocos2dx/platform/mac/CCGL.h +++ b/cocos2dx/platform/mac/CCGL.h @@ -30,4 +30,10 @@ THE SOFTWARE. #define CC_GL_DEPTH24_STENCIL8 -1 + +#define glDeleteVertexArrays glDeleteVertexArraysAPPLE +#define glGenVertexArrays glGenVertexArraysAPPLE +#define glBindVertexArray glBindVertexArrayAPPLE + + #endif // __CCGL_H__ From 5baa19992d6fd17a42190decfebebfb69ad4d496 Mon Sep 17 00:00:00 2001 From: ningxu Date: Tue, 21 Aug 2012 10:56:12 +0800 Subject: [PATCH 04/53] Update cocos2dx/include/ccConfig.h --- cocos2dx/include/ccConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2dx/include/ccConfig.h b/cocos2dx/include/ccConfig.h index 8e40900378..4b3c3ba753 100755 --- a/cocos2dx/include/ccConfig.h +++ b/cocos2dx/include/ccConfig.h @@ -165,7 +165,7 @@ Only valid for cocos2d-mac. Not supported on cocos2d-ios. */ #ifndef CC_TEXTURE_ATLAS_USE_VAO - #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) + #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) #define CC_TEXTURE_ATLAS_USE_VAO 1 #else /* Some android devices cannot support VAO very well, so we disable it by default for android platform. */ From cfdc50fb609dade0f68e693a73c37fe9825f7d05 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 21 Aug 2012 14:58:31 +0800 Subject: [PATCH 05/53] issue #1437:make CCEGLView::sharedOpenGLView() return pointer --- cocos2dx/platform/android/CCEGLView.cpp | 4 ++-- cocos2dx/platform/android/CCEGLView.h | 2 +- .../platform/blackberry/CCApplication.cpp | 2 +- cocos2dx/platform/blackberry/CCEGLView.cpp | 4 ++-- cocos2dx/platform/blackberry/CCEGLView.h | 2 +- cocos2dx/platform/ios/CCEGLView.h | 2 +- cocos2dx/platform/ios/CCEGLView.mm | 4 ++-- cocos2dx/platform/ios/EAGLView.mm | 20 +++++++++---------- cocos2dx/platform/linux/CCEGLView.cpp | 10 +++++----- cocos2dx/platform/linux/CCEGLView.h | 2 +- cocos2dx/platform/mac/CCEGLView.h | 2 +- cocos2dx/platform/mac/CCEGLView.mm | 4 ++-- cocos2dx/platform/win32/CCApplication.cpp | 6 +++--- cocos2dx/platform/win32/CCEGLView.cpp | 4 ++-- cocos2dx/platform/win32/CCEGLView.h | 2 +- extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm | 14 ++++++------- samples/HelloCpp/Classes/AppDelegate.cpp | 6 +++--- .../proj.android/jni/hellocpp/main.cpp | 2 +- samples/HelloLua/Classes/AppDelegate.cpp | 2 +- .../proj.android/jni/hellolua/main.cpp | 2 +- .../HelloLua.xcodeproj/project.pbxproj | 12 ----------- samples/TestCpp/Classes/AppDelegate.cpp | 2 +- .../EditBoxTest/EditBoxTest.cpp | 4 ++-- .../TestCpp/proj.android/jni/testcpp/main.cpp | 2 +- .../TestJavascript/Classes/AppDelegate.cpp | 2 +- .../proj.android/jni/testjavascript/main.cpp | 2 +- .../lua/cocos2dx_support/CCLuaEngine.cpp | 4 ++-- 27 files changed, 56 insertions(+), 68 deletions(-) diff --git a/cocos2dx/platform/android/CCEGLView.cpp b/cocos2dx/platform/android/CCEGLView.cpp index 74bdc3ea81..2dadee2578 100644 --- a/cocos2dx/platform/android/CCEGLView.cpp +++ b/cocos2dx/platform/android/CCEGLView.cpp @@ -76,10 +76,10 @@ void CCEGLView::swapBuffers() { } -CCEGLView& CCEGLView::sharedOpenGLView() +CCEGLView* CCEGLView::sharedOpenGLView() { static CCEGLView instance; - return instance; + return &instance; } void CCEGLView::setIMEKeyboardState(bool bOpen) diff --git a/cocos2dx/platform/android/CCEGLView.h b/cocos2dx/platform/android/CCEGLView.h index 7a3b6360c7..a1ed6688d2 100644 --- a/cocos2dx/platform/android/CCEGLView.h +++ b/cocos2dx/platform/android/CCEGLView.h @@ -47,7 +47,7 @@ public: /** @brief get the shared main open gl window */ - static CCEGLView& sharedOpenGLView(); + static CCEGLView* sharedOpenGLView(); }; NS_CC_END diff --git a/cocos2dx/platform/blackberry/CCApplication.cpp b/cocos2dx/platform/blackberry/CCApplication.cpp index 8306f4524b..08a0b87925 100644 --- a/cocos2dx/platform/blackberry/CCApplication.cpp +++ b/cocos2dx/platform/blackberry/CCApplication.cpp @@ -51,7 +51,7 @@ int CCApplication::run() while (1) // or device wants to quit { - CCEGLView::sharedOpenGLView().handleEvents(); + CCEGLView::sharedOpenGLView()->handleEvents(); clock_gettime(CLOCK_REALTIME, &time_struct); current_time = time2millis(&time_struct); diff --git a/cocos2dx/platform/blackberry/CCEGLView.cpp b/cocos2dx/platform/blackberry/CCEGLView.cpp index d71fb25085..e784d4b519 100644 --- a/cocos2dx/platform/blackberry/CCEGLView.cpp +++ b/cocos2dx/platform/blackberry/CCEGLView.cpp @@ -189,7 +189,7 @@ void CCEGLView::swapBuffers() eglSwapBuffers(m_eglDisplay, m_eglSurface); } -CCEGLView& CCEGLView::sharedOpenGLView() +CCEGLView* CCEGLView::sharedOpenGLView() { if (!s_pInstance) { @@ -197,7 +197,7 @@ CCEGLView& CCEGLView::sharedOpenGLView() } CCAssert(s_pInstance != NULL, "CCEGLView wasn't constructed yet"); - return *s_pInstance; + return s_pInstance; } void CCEGLView::showKeyboard() diff --git a/cocos2dx/platform/blackberry/CCEGLView.h b/cocos2dx/platform/blackberry/CCEGLView.h index 26be27f2db..2580d61cfb 100644 --- a/cocos2dx/platform/blackberry/CCEGLView.h +++ b/cocos2dx/platform/blackberry/CCEGLView.h @@ -48,7 +48,7 @@ public: /** @brief get the shared main open gl window */ - static CCEGLView& sharedOpenGLView(); + static CCEGLView sharedOpenGLView(); bool handleEvents(); diff --git a/cocos2dx/platform/ios/CCEGLView.h b/cocos2dx/platform/ios/CCEGLView.h index c3be9fc76e..de0251c3ac 100644 --- a/cocos2dx/platform/ios/CCEGLView.h +++ b/cocos2dx/platform/ios/CCEGLView.h @@ -48,7 +48,7 @@ public: virtual void setIMEKeyboardState(bool bOpen); - static CCEGLView& sharedOpenGLView(); + static CCEGLView* sharedOpenGLView(); }; diff --git a/cocos2dx/platform/ios/CCEGLView.mm b/cocos2dx/platform/ios/CCEGLView.mm index 4a4f8c7539..c672ad8ff4 100644 --- a/cocos2dx/platform/ios/CCEGLView.mm +++ b/cocos2dx/platform/ios/CCEGLView.mm @@ -106,10 +106,10 @@ void CCEGLView::setIMEKeyboardState(bool bOpen) } } -CCEGLView& CCEGLView::sharedOpenGLView() +CCEGLView* CCEGLView::sharedOpenGLView() { static CCEGLView instance; - return instance; + return &instance; } NS_CC_END diff --git a/cocos2dx/platform/ios/EAGLView.mm b/cocos2dx/platform/ios/EAGLView.mm index 693ad31fdf..9c5d206d23 100755 --- a/cocos2dx/platform/ios/EAGLView.mm +++ b/cocos2dx/platform/ios/EAGLView.mm @@ -405,7 +405,7 @@ static EAGLView *view = 0; ys[i] = [touch locationInView: [touch view]].y; ++i; } - cocos2d::CCEGLView::sharedOpenGLView().handleTouchesBegin(i, ids, xs, ys); + cocos2d::CCEGLView::sharedOpenGLView()->handleTouchesBegin(i, ids, xs, ys); } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event @@ -425,7 +425,7 @@ static EAGLView *view = 0; ys[i] = [touch locationInView: [touch view]].y; ++i; } - cocos2d::CCEGLView::sharedOpenGLView().handleTouchesMove(i, ids, xs, ys); + cocos2d::CCEGLView::sharedOpenGLView()->handleTouchesMove(i, ids, xs, ys); } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event @@ -446,7 +446,7 @@ static EAGLView *view = 0; ys[i] = [touch locationInView: [touch view]].y; ++i; } - cocos2d::CCEGLView::sharedOpenGLView().handleTouchesEnd(i, ids, xs, ys); + cocos2d::CCEGLView::sharedOpenGLView()->handleTouchesEnd(i, ids, xs, ys); } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event @@ -467,7 +467,7 @@ static EAGLView *view = 0; ys[i] = [touch locationInView: [touch view]].y; ++i; } - cocos2d::CCEGLView::sharedOpenGLView().handleTouchesCancel(i, ids, xs, ys); + cocos2d::CCEGLView::sharedOpenGLView()->handleTouchesCancel(i, ids, xs, ys); } #pragma mark - @@ -797,7 +797,7 @@ static EAGLView *view = 0; end.size.height); notiInfo.duration = (float)aniDuration; - float offestY = cocos2d::CCEGLView::sharedOpenGLView().getViewPortRect().origin.y; + float offestY = cocos2d::CCEGLView::sharedOpenGLView()->getViewPortRect().origin.y; if (offestY > 0.0f) { @@ -806,10 +806,10 @@ static EAGLView *view = 0; notiInfo.end.size.height -= offestY; } - if (!cocos2d::CCEGLView::sharedOpenGLView().isRetinaEnabled()) + if (!cocos2d::CCEGLView::sharedOpenGLView()->isRetinaEnabled()) { - float scaleX = cocos2d::CCEGLView::sharedOpenGLView().getScaleX(); - float scaleY = cocos2d::CCEGLView::sharedOpenGLView().getScaleY(); + float scaleX = cocos2d::CCEGLView::sharedOpenGLView()->getScaleX(); + float scaleY = cocos2d::CCEGLView::sharedOpenGLView()->getScaleY(); notiInfo.begin.origin.x /= scaleX; notiInfo.begin.origin.y /= scaleY; @@ -860,9 +860,9 @@ static EAGLView *view = 0; if (dis < 0.0f) dis = 0.0f; - if (!cocos2d::CCEGLView::sharedOpenGLView().isRetinaEnabled()) + if (!cocos2d::CCEGLView::sharedOpenGLView()->isRetinaEnabled()) { - dis *= cocos2d::CCEGLView::sharedOpenGLView().getScaleY(); + dis *= cocos2d::CCEGLView::sharedOpenGLView()->getScaleY(); } switch ([[UIApplication sharedApplication] statusBarOrientation]) diff --git a/cocos2dx/platform/linux/CCEGLView.cpp b/cocos2dx/platform/linux/CCEGLView.cpp index d57d634279..ac2d390203 100644 --- a/cocos2dx/platform/linux/CCEGLView.cpp +++ b/cocos2dx/platform/linux/CCEGLView.cpp @@ -122,10 +122,10 @@ void mouseButtonEventHandle(int iMouseID,int iMouseState) { */ int id = 0; if (iMouseState == GLFW_PRESS) { - CCEGLView::sharedOpenGLView().handleTouchesBegin(1, &id, &oPoint.x, &oPoint.y); + CCEGLView::sharedOpenGLView()->handleTouchesBegin(1, &id, &oPoint.x, &oPoint.y); } else if (iMouseState == GLFW_RELEASE) { - CCEGLView::sharedOpenGLView().handleTouchesEnd(1, &id, &oPoint.x, &oPoint.y); + CCEGLView::sharedOpenGLView()->handleTouchesEnd(1, &id, &oPoint.x, &oPoint.y); } } } @@ -138,7 +138,7 @@ void mousePosEventHandle(int iPosX,int iPosY) { int id = 0; float x = (float)iPosX; float y = (float)iPosY; - CCEGLView::sharedOpenGLView().handleTouchesMove(1, &id, &x, &y); + CCEGLView::sharedOpenGLView()->handleTouchesMove(1, &id, &x, &y); } } @@ -292,14 +292,14 @@ void CCEGLView::destroyGL() */ } -CCEGLView& CCEGLView::sharedOpenGLView() +CCEGLView* CCEGLView::sharedOpenGLView() { static CCEGLView* s_pEglView = NULL; if (s_pEglView == NULL) { s_pEglView = new CCEGLView(); } - return *s_pEglView; + return s_pEglView; } NS_CC_END diff --git a/cocos2dx/platform/linux/CCEGLView.h b/cocos2dx/platform/linux/CCEGLView.h index e22b7c622d..19a4b4f1dc 100644 --- a/cocos2dx/platform/linux/CCEGLView.h +++ b/cocos2dx/platform/linux/CCEGLView.h @@ -40,7 +40,7 @@ public: /** @brief get the shared main open gl window */ - static CCEGLView& sharedOpenGLView(); + static CCEGLView* sharedOpenGLView(); private: bool initGL(); void destroyGL(); diff --git a/cocos2dx/platform/mac/CCEGLView.h b/cocos2dx/platform/mac/CCEGLView.h index 609247c6e8..b1a37d6088 100755 --- a/cocos2dx/platform/mac/CCEGLView.h +++ b/cocos2dx/platform/mac/CCEGLView.h @@ -48,7 +48,7 @@ public: void setMultiTouchMask(bool mask); - static CCEGLView& sharedOpenGLView(); + static CCEGLView* sharedOpenGLView(); }; diff --git a/cocos2dx/platform/mac/CCEGLView.mm b/cocos2dx/platform/mac/CCEGLView.mm index 52e3b896b1..0d1b96129e 100755 --- a/cocos2dx/platform/mac/CCEGLView.mm +++ b/cocos2dx/platform/mac/CCEGLView.mm @@ -83,10 +83,10 @@ void CCEGLView::setMultiTouchMask(bool mask) //glView.multipleTouchEnabled = mask ? YES : NO; } -CCEGLView& CCEGLView::sharedOpenGLView() +CCEGLView* CCEGLView::sharedOpenGLView() { static CCEGLView instance; - return instance; + return &instance; } } // end of namespace cocos2d; diff --git a/cocos2dx/platform/win32/CCApplication.cpp b/cocos2dx/platform/win32/CCApplication.cpp index 0ab04ba7dd..fda1ac7311 100644 --- a/cocos2dx/platform/win32/CCApplication.cpp +++ b/cocos2dx/platform/win32/CCApplication.cpp @@ -48,9 +48,9 @@ int CCApplication::run() return 0; } - CCEGLView& mainWnd = CCEGLView::sharedOpenGLView(); - mainWnd.centerWindow(); - ShowWindow(mainWnd.getHWnd(), SW_SHOW); + CCEGLView* pMainWnd = CCEGLView::sharedOpenGLView(); + pMainWnd->centerWindow(); + ShowWindow(pMainWnd->getHWnd(), SW_SHOW); while (1) { diff --git a/cocos2dx/platform/win32/CCEGLView.cpp b/cocos2dx/platform/win32/CCEGLView.cpp index 42e36f95ec..754bae910b 100644 --- a/cocos2dx/platform/win32/CCEGLView.cpp +++ b/cocos2dx/platform/win32/CCEGLView.cpp @@ -446,14 +446,14 @@ bool CCEGLView::setContentScaleFactor(float contentScaleFactor) return true; } -CCEGLView& CCEGLView::sharedOpenGLView() +CCEGLView* CCEGLView::sharedOpenGLView() { static CCEGLView* s_pEglView = NULL; if (s_pEglView == NULL) { s_pEglView = new CCEGLView(); } - return *s_pEglView; + return s_pEglView; } NS_CC_END diff --git a/cocos2dx/platform/win32/CCEGLView.h b/cocos2dx/platform/win32/CCEGLView.h index 552ba9c99d..aa2bbfb9f6 100644 --- a/cocos2dx/platform/win32/CCEGLView.h +++ b/cocos2dx/platform/win32/CCEGLView.h @@ -67,7 +67,7 @@ public: /** @brief get the shared main open gl window */ - static CCEGLView& sharedOpenGLView(); + static CCEGLView* sharedOpenGLView(); protected: diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm index 665b9a05fd..576fda9233 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm @@ -62,16 +62,16 @@ bool CCEditBoxImplIOS::initWithSize(const CCSize& size) { do { - CCEGLViewProtocol& eglView = CCEGLView::sharedOpenGLView(); + CCEGLViewProtocol* eglView = CCEGLView::sharedOpenGLView(); CGRect rect; - if (eglView.isRetinaEnabled()) + if (eglView->isRetinaEnabled()) { rect = CGRectMake(0, 0, size.width,size.height); } else { - rect = CGRectMake(0, 0, size.width * eglView.getScaleX(),size.height * eglView.getScaleY()); + rect = CGRectMake(0, 0, size.width * eglView->getScaleX(),size.height * eglView->getScaleY()); } m_pSysEdit = [[EditBoxImplIOS alloc] initWithFrame:rect editBox:this]; if (!m_pSysEdit) break; @@ -198,18 +198,18 @@ void CCEditBoxImplIOS::setPlaceHolder(const char* pText) static CGPoint convertDesignCoordToScreenCoord(const CCPoint& designCoord) { float viewH = (float)[[EAGLView sharedEGLView] getHeight]; - CCEGLViewProtocol& eglView = CCEGLView::sharedOpenGLView(); + CCEGLViewProtocol* eglView = CCEGLView::sharedOpenGLView(); CCPoint visiblePos; - if (eglView.isRetinaEnabled()) + if (eglView->isRetinaEnabled()) { visiblePos = ccp(designCoord.x, designCoord.y); } else { - visiblePos = ccp(designCoord.x * eglView.getScaleX(), designCoord.y * eglView.getScaleY()); + visiblePos = ccp(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY()); } - CCPoint screenGLPos = ccpAdd(visiblePos, eglView.getViewPortRect().origin); + CCPoint screenGLPos = ccpAdd(visiblePos, eglView->getViewPortRect().origin); CGPoint screenPos = CGPointMake(screenGLPos.x, viewH - screenGLPos.y); return screenPos; } diff --git a/samples/HelloCpp/Classes/AppDelegate.cpp b/samples/HelloCpp/Classes/AppDelegate.cpp index 22f09f4c60..b2c80149f5 100644 --- a/samples/HelloCpp/Classes/AppDelegate.cpp +++ b/samples/HelloCpp/Classes/AppDelegate.cpp @@ -15,7 +15,7 @@ bool AppDelegate::applicationDidFinishLaunching() { // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); - pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); + pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); TargetPlatform target = getTargetPlatform(); @@ -26,7 +26,7 @@ bool AppDelegate::applicationDidFinishLaunching() { CCFileUtils::sharedFileUtils()->setResourceDirectory("iphonehd"); // don't enable retina because we don't have ipad hd resource - CCEGLView::sharedOpenGLView().setDesignResolutionSize(960, 640, kResolutionNoBorder); + CCEGLView::sharedOpenGLView()->setDesignResolutionSize(960, 640, kResolutionNoBorder); } else if (target == kTargetIphone) { @@ -47,7 +47,7 @@ bool AppDelegate::applicationDidFinishLaunching() { // android, windows, blackberry, linux or mac // use 960*640 resources as design resolution size CCFileUtils::sharedFileUtils()->setResourceDirectory("iphonehd"); - CCEGLView::sharedOpenGLView().setDesignResolutionSize(960, 640, kResolutionNoBorder); + CCEGLView::sharedOpenGLView()->setDesignResolutionSize(960, 640, kResolutionNoBorder); } // turn on display FPS diff --git a/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp b/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp index 2c7455571d..18fa21da50 100644 --- a/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp +++ b/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp @@ -24,7 +24,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi { if (!CCDirector::sharedDirector()->getOpenGLView()) { - CCEGLView *view = &CCEGLView::sharedOpenGLView(); + CCEGLView *view = CCEGLView::sharedOpenGLView(); view->setFrameSize(w, h); AppDelegate *pAppDelegate = new AppDelegate(); diff --git a/samples/HelloLua/Classes/AppDelegate.cpp b/samples/HelloLua/Classes/AppDelegate.cpp index e992b52762..b5f2dedb63 100644 --- a/samples/HelloLua/Classes/AppDelegate.cpp +++ b/samples/HelloLua/Classes/AppDelegate.cpp @@ -24,7 +24,7 @@ bool AppDelegate::applicationDidFinishLaunching() { // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); - pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); + pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. // pDirector->enableRetinaDisplay(true); diff --git a/samples/HelloLua/proj.android/jni/hellolua/main.cpp b/samples/HelloLua/proj.android/jni/hellolua/main.cpp index 921d2d4e88..21ae99dba1 100644 --- a/samples/HelloLua/proj.android/jni/hellolua/main.cpp +++ b/samples/HelloLua/proj.android/jni/hellolua/main.cpp @@ -23,7 +23,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi { if (!CCDirector::sharedDirector()->getOpenGLView()) { - CCEGLView *view = &CCEGLView::sharedOpenGLView(); + CCEGLView *view = CCEGLView::sharedOpenGLView(); view->setFrameSize(w, h); AppDelegate *pAppDelegate = new AppDelegate(); diff --git a/samples/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj b/samples/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj index 4e1758263d..645ac8e7ea 100644 --- a/samples/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj +++ b/samples/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj @@ -13,9 +13,6 @@ 15426A5B15B5722100712A7F /* CocosDenshion.m in Sources */ = {isa = PBXBuildFile; fileRef = 15426A4815B5722100712A7F /* CocosDenshion.m */; }; 15426A5C15B5722100712A7F /* SimpleAudioEngine.mm in Sources */ = {isa = PBXBuildFile; fileRef = 15426A4915B5722100712A7F /* SimpleAudioEngine.mm */; }; 15426A5D15B5722100712A7F /* SimpleAudioEngine_objc.m in Sources */ = {isa = PBXBuildFile; fileRef = 15426A4B15B5722100712A7F /* SimpleAudioEngine_objc.m */; }; - 15DD6D83156DD1EF003E7567 /* fps_images.png in Resources */ = {isa = PBXBuildFile; fileRef = 15DD6D81156DD1EF003E7567 /* fps_images.png */; }; - 15F990C2159C0DED00848A44 /* fps_images-hd.png in Resources */ = {isa = PBXBuildFile; fileRef = 15F990C0159C0DED00848A44 /* fps_images-hd.png */; }; - 15F990C3159C0DED00848A44 /* fps_images-ipadhd.png in Resources */ = {isa = PBXBuildFile; fileRef = 15F990C1159C0DED00848A44 /* fps_images-ipadhd.png */; }; 506EDB88102F4C4000A389B3 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 506EDB87102F4C4000A389B3 /* libz.dylib */; }; 506EDBA5102F4C9F00A389B3 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 506EDBA4102F4C9F00A389B3 /* AVFoundation.framework */; }; 78947C6D14EBB9B100DBD5A6 /* background.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 78947C5E14EBB9B000DBD5A6 /* background.mp3 */; }; @@ -120,9 +117,6 @@ 15426A4915B5722100712A7F /* SimpleAudioEngine.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleAudioEngine.mm; sourceTree = ""; }; 15426A4A15B5722100712A7F /* SimpleAudioEngine_objc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine_objc.h; sourceTree = ""; }; 15426A4B15B5722100712A7F /* SimpleAudioEngine_objc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleAudioEngine_objc.m; sourceTree = ""; }; - 15DD6D81156DD1EF003E7567 /* fps_images.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = fps_images.png; sourceTree = ""; }; - 15F990C0159C0DED00848A44 /* fps_images-hd.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fps_images-hd.png"; sourceTree = ""; }; - 15F990C1159C0DED00848A44 /* fps_images-ipadhd.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fps_images-ipadhd.png"; sourceTree = ""; }; 1D6058910D05DD3D006BFB54 /* HelloLua.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloLua.app; sourceTree = BUILT_PRODUCTS_DIR; }; 506EDB87102F4C4000A389B3 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 506EDBA4102F4C9F00A389B3 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; @@ -356,9 +350,6 @@ D4EF94DA15BD311E00D803EB /* Icon-72.png */, D4EF94D815BD311A00D803EB /* Icon-114.png */, D4EF94D615BD311700D803EB /* Icon-57.png */, - 15F990C0159C0DED00848A44 /* fps_images-hd.png */, - 15F990C1159C0DED00848A44 /* fps_images-ipadhd.png */, - 15DD6D81156DD1EF003E7567 /* fps_images.png */, 78947C5E14EBB9B000DBD5A6 /* background.mp3 */, 78947C5F14EBB9B000DBD5A6 /* crop.png */, 78DC4C9815490B9500317402 /* Default.png */, @@ -591,9 +582,6 @@ 78947C7814EBB9B100DBD5A6 /* menu1.png in Resources */, 78947C7914EBB9B100DBD5A6 /* menu2.png in Resources */, 78DC4C9A15490B9500317402 /* Default.png in Resources */, - 15DD6D83156DD1EF003E7567 /* fps_images.png in Resources */, - 15F990C2159C0DED00848A44 /* fps_images-hd.png in Resources */, - 15F990C3159C0DED00848A44 /* fps_images-ipadhd.png in Resources */, F2837A6C15B9606900A5707B /* Android.mk in Resources */, F2837A6D15B9606900A5707B /* liblua.vcproj in Resources */, D4EF94D715BD311700D803EB /* Icon-57.png in Resources */, diff --git a/samples/TestCpp/Classes/AppDelegate.cpp b/samples/TestCpp/Classes/AppDelegate.cpp index 5a8b9e838c..7204d6f56a 100644 --- a/samples/TestCpp/Classes/AppDelegate.cpp +++ b/samples/TestCpp/Classes/AppDelegate.cpp @@ -20,7 +20,7 @@ bool AppDelegate::applicationDidFinishLaunching() { // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); - pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); + pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. // pDirector->enableRetinaDisplay(true); diff --git a/samples/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp b/samples/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp index fd55255217..0651dabb2d 100644 --- a/samples/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp +++ b/samples/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp @@ -15,8 +15,8 @@ USING_NS_CC_EXT; EditBoxTest::EditBoxTest() { - CCPoint visibleOrigin = CCEGLView::sharedOpenGLView().getVisibleOrigin(); - CCSize visibleSize = CCEGLView::sharedOpenGLView().getVisibleSize(); + CCPoint visibleOrigin = CCEGLView::sharedOpenGLView()->getVisibleOrigin(); + CCSize visibleSize = CCEGLView::sharedOpenGLView()->getVisibleSize(); CCSprite* pBg = CCSprite::create("Images/HelloWorld.png"); pBg->setPosition(ccp(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); diff --git a/samples/TestCpp/proj.android/jni/testcpp/main.cpp b/samples/TestCpp/proj.android/jni/testcpp/main.cpp index 197e90e3b1..e5e8d72dad 100644 --- a/samples/TestCpp/proj.android/jni/testcpp/main.cpp +++ b/samples/TestCpp/proj.android/jni/testcpp/main.cpp @@ -24,7 +24,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi { if (!CCDirector::sharedDirector()->getOpenGLView()) { - CCEGLView *view = &CCEGLView::sharedOpenGLView(); + CCEGLView *view = CCEGLView::sharedOpenGLView(); view->setFrameSize(w, h); AppDelegate *pAppDelegate = new AppDelegate(); diff --git a/samples/TestJavascript/Classes/AppDelegate.cpp b/samples/TestJavascript/Classes/AppDelegate.cpp index e9681cc3a5..b61b7ca3c2 100644 --- a/samples/TestJavascript/Classes/AppDelegate.cpp +++ b/samples/TestJavascript/Classes/AppDelegate.cpp @@ -25,7 +25,7 @@ bool AppDelegate::applicationDidFinishLaunching() { // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); - pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); + pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. // pDirector->enableRetinaDisplay(true); diff --git a/samples/TestJavascript/proj.android/jni/testjavascript/main.cpp b/samples/TestJavascript/proj.android/jni/testjavascript/main.cpp index 1abaf1917e..00edd06d31 100644 --- a/samples/TestJavascript/proj.android/jni/testjavascript/main.cpp +++ b/samples/TestJavascript/proj.android/jni/testjavascript/main.cpp @@ -24,7 +24,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi { if (!CCDirector::sharedDirector()->getOpenGLView()) { - CCEGLView *view = &CCEGLView::sharedOpenGLView(); + CCEGLView *view = CCEGLView::sharedOpenGLView(); view->setFrameSize(w, h); AppDelegate *pAppDelegate = new AppDelegate(); diff --git a/scripting/lua/cocos2dx_support/CCLuaEngine.cpp b/scripting/lua/cocos2dx_support/CCLuaEngine.cpp index 2f2a0ee6d3..c4df69d3a4 100644 --- a/scripting/lua/cocos2dx_support/CCLuaEngine.cpp +++ b/scripting/lua/cocos2dx_support/CCLuaEngine.cpp @@ -252,7 +252,7 @@ int CCLuaEngine::pushCCObjectToLuaStack(CCObject* pObject, const char* typeName) // functions for excute touch event int CCLuaEngine::executeTouchEvent(int nHandler, int eventType, CCTouch *pTouch) { - CCPoint pt = CCDirector::sharedDirector()->convertToGL(pTouch->locationInView()); + CCPoint pt = CCDirector::sharedDirector()->convertToGL(pTouch->getLocationInView()); lua_pushinteger(m_state, eventType); lua_pushnumber(m_state, pt.x); lua_pushnumber(m_state, pt.y); @@ -271,7 +271,7 @@ int CCLuaEngine::executeTouchesEvent(int nHandler, int eventType, CCSet *pTouche while (it != pTouches->end()) { pTouch = (CCTouch*)*it; - CCPoint pt = pDirector->convertToGL(pTouch->locationInView()); + CCPoint pt = pDirector->convertToGL(pTouch->getLocationInView()); lua_pushnumber(m_state, pt.x); lua_rawseti(m_state, -2, n++); lua_pushnumber(m_state, pt.y); From 07ddd4369587da16a2a79c54ccef5a28db0b6963 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 21 Aug 2012 15:28:43 +0800 Subject: [PATCH 06/53] issue #1437:make CCApplication::sharedApplication() return pointer --- cocos2dx/CCDirector.cpp | 2 +- cocos2dx/platform/android/CCApplication.cpp | 4 ++-- cocos2dx/platform/android/CCApplication.h | 2 +- cocos2dx/platform/blackberry/CCApplication.cpp | 4 ++-- cocos2dx/platform/blackberry/CCApplication.h | 2 +- cocos2dx/platform/ios/CCApplication.h | 2 +- cocos2dx/platform/ios/CCApplication.mm | 4 ++-- cocos2dx/platform/linux/CCApplication.cpp | 4 ++-- cocos2dx/platform/linux/CCApplication.h | 2 +- cocos2dx/platform/mac/CCApplication.h | 2 +- cocos2dx/platform/mac/CCApplication.mm | 4 ++-- samples/HelloCpp/Classes/HelloWorldScene.cpp | 2 +- samples/HelloCpp/proj.android/jni/hellocpp/main.cpp | 2 +- samples/HelloCpp/proj.blackberry/main.cpp | 8 ++++---- samples/HelloCpp/proj.ios/AppController.mm | 6 +++--- samples/HelloCpp/proj.linux/main.cpp | 8 ++++---- samples/HelloCpp/proj.mac/AppController.mm | 3 +-- samples/HelloLua/proj.android/jni/hellolua/main.cpp | 2 +- samples/HelloLua/proj.ios/AppController.mm | 6 +++--- samples/HelloLua/proj.win32/main.cpp | 6 +++--- .../Classes/CurrentLanguageTest/CurrentLanguageTest.cpp | 2 +- samples/TestCpp/proj.android/jni/testcpp/main.cpp | 2 +- samples/TestCpp/proj.blackberry/main.cpp | 8 ++++---- samples/TestCpp/proj.ios/Classes/testsAppDelegate.mm | 6 +++--- samples/TestCpp/proj.linux/main.cpp | 8 ++++---- samples/TestCpp/proj.mac/AppController.mm | 3 +-- samples/TestCpp/proj.win32/main.cpp | 6 +++--- .../proj.android/jni/testjavascript/main.cpp | 2 +- samples/TestJavascript/proj.ios/AppController.mm | 6 +++--- samples/TestJavascript/proj.linux/main.cpp | 8 ++++---- samples/TestJavascript/proj.win32/main.cpp | 6 +++--- .../lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id | 2 +- .../CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp | 2 +- .../xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp | 2 +- .../cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp | 2 +- .../cocos2dx_box2d.xctemplate/Classes/HelloWorldScene.cpp | 2 +- .../cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp | 2 +- .../Classes/HelloWorldScene.cpp | 2 +- .../cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp | 2 +- tools/tolua++/CCApplication.pkg | 2 +- 40 files changed, 74 insertions(+), 76 deletions(-) diff --git a/cocos2dx/CCDirector.cpp b/cocos2dx/CCDirector.cpp index a9099c5897..3ac6a385eb 100644 --- a/cocos2dx/CCDirector.cpp +++ b/cocos2dx/CCDirector.cpp @@ -953,7 +953,7 @@ void CCDisplayLinkDirector::startAnimation(void) } m_bInvalid = false; - CCApplication::sharedApplication().setAnimationInterval(m_dAnimationInterval); + CCApplication::sharedApplication()->setAnimationInterval(m_dAnimationInterval); } void CCDisplayLinkDirector::mainLoop(void) diff --git a/cocos2dx/platform/android/CCApplication.cpp b/cocos2dx/platform/android/CCApplication.cpp index 0702b144ac..d475346c4c 100644 --- a/cocos2dx/platform/android/CCApplication.cpp +++ b/cocos2dx/platform/android/CCApplication.cpp @@ -69,10 +69,10 @@ CCApplication::Orientation CCApplication::setOrientation(Orientation orientation ////////////////////////////////////////////////////////////////////////// // static member function ////////////////////////////////////////////////////////////////////////// -CCApplication& CCApplication::sharedApplication() +CCApplication* CCApplication::sharedApplication() { CC_ASSERT(sm_pSharedApplication); - return *sm_pSharedApplication; + return sm_pSharedApplication; } ccLanguageType CCApplication::getCurrentLanguage() diff --git a/cocos2dx/platform/android/CCApplication.h b/cocos2dx/platform/android/CCApplication.h index 8a6308fade..8e42f45b9b 100644 --- a/cocos2dx/platform/android/CCApplication.h +++ b/cocos2dx/platform/android/CCApplication.h @@ -48,7 +48,7 @@ public: @brief Get current applicaiton instance. @return Current application instance pointer. */ - static CCApplication& sharedApplication(); + static CCApplication* sharedApplication(); /** @brief Get current language config diff --git a/cocos2dx/platform/blackberry/CCApplication.cpp b/cocos2dx/platform/blackberry/CCApplication.cpp index 08a0b87925..cdd25eb557 100644 --- a/cocos2dx/platform/blackberry/CCApplication.cpp +++ b/cocos2dx/platform/blackberry/CCApplication.cpp @@ -106,10 +106,10 @@ TargetPlatform CCApplication::getTargetPlatform() ////////////////////////////////////////////////////////////////////////// // static member function ////////////////////////////////////////////////////////////////////////// -CCApplication& CCApplication::sharedApplication() +CCApplication* CCApplication::sharedApplication() { CC_ASSERT(sm_pSharedApplication); - return *sm_pSharedApplication; + return sm_pSharedApplication; } ccLanguageType CCApplication::getCurrentLanguage() diff --git a/cocos2dx/platform/blackberry/CCApplication.h b/cocos2dx/platform/blackberry/CCApplication.h index f69b6ebe33..ef24c2f308 100644 --- a/cocos2dx/platform/blackberry/CCApplication.h +++ b/cocos2dx/platform/blackberry/CCApplication.h @@ -49,7 +49,7 @@ public: @brief Get current applicaiton instance. @return Current application instance pointer. */ - static CCApplication& sharedApplication(); + static CCApplication* sharedApplication(); /** @brief Get current language config diff --git a/cocos2dx/platform/ios/CCApplication.h b/cocos2dx/platform/ios/CCApplication.h index 361a6f4f4c..8b7e383c8f 100644 --- a/cocos2dx/platform/ios/CCApplication.h +++ b/cocos2dx/platform/ios/CCApplication.h @@ -47,7 +47,7 @@ public: @brief Get current applicaiton instance. @return Current application instance pointer. */ - static CCApplication& sharedApplication(); + static CCApplication* sharedApplication(); /** @brief Callback by CCDirector for limit FPS. diff --git a/cocos2dx/platform/ios/CCApplication.mm b/cocos2dx/platform/ios/CCApplication.mm index ae3552d787..ff295f7ab5 100644 --- a/cocos2dx/platform/ios/CCApplication.mm +++ b/cocos2dx/platform/ios/CCApplication.mm @@ -63,10 +63,10 @@ void CCApplication::setAnimationInterval(double interval) // static member function ////////////////////////////////////////////////////////////////////////////////////////////////// -CCApplication& CCApplication::sharedApplication() +CCApplication* CCApplication::sharedApplication() { CC_ASSERT(sm_pSharedApplication); - return *sm_pSharedApplication; + return sm_pSharedApplication; } ccLanguageType CCApplication::getCurrentLanguage() diff --git a/cocos2dx/platform/linux/CCApplication.cpp b/cocos2dx/platform/linux/CCApplication.cpp index cb9d434cdd..86c2352c02 100644 --- a/cocos2dx/platform/linux/CCApplication.cpp +++ b/cocos2dx/platform/linux/CCApplication.cpp @@ -92,10 +92,10 @@ TargetPlatform CCApplication::getTargetPlatform() ////////////////////////////////////////////////////////////////////////// // static member function ////////////////////////////////////////////////////////////////////////// -CCApplication& CCApplication::sharedApplication() +CCApplication* CCApplication::sharedApplication() { CC_ASSERT(sm_pSharedApplication); - return *sm_pSharedApplication; + return sm_pSharedApplication; } ccLanguageType CCApplication::getCurrentLanguage() diff --git a/cocos2dx/platform/linux/CCApplication.h b/cocos2dx/platform/linux/CCApplication.h index ae0dc58890..343ea2b292 100644 --- a/cocos2dx/platform/linux/CCApplication.h +++ b/cocos2dx/platform/linux/CCApplication.h @@ -35,7 +35,7 @@ public: @brief Get current applicaiton instance. @return Current application instance pointer. */ - static CCApplication& sharedApplication(); + static CCApplication* sharedApplication(); /* override functions */ virtual ccLanguageType getCurrentLanguage(); diff --git a/cocos2dx/platform/mac/CCApplication.h b/cocos2dx/platform/mac/CCApplication.h index 7bfdf21583..5d18795a67 100755 --- a/cocos2dx/platform/mac/CCApplication.h +++ b/cocos2dx/platform/mac/CCApplication.h @@ -56,7 +56,7 @@ public: @brief Get current applicaiton instance. @return Current application instance pointer. */ - static CCApplication& sharedApplication(); + static CCApplication* sharedApplication(); /** @brief Get current language config diff --git a/cocos2dx/platform/mac/CCApplication.mm b/cocos2dx/platform/mac/CCApplication.mm index e16e6e8407..5ad820bc92 100755 --- a/cocos2dx/platform/mac/CCApplication.mm +++ b/cocos2dx/platform/mac/CCApplication.mm @@ -69,10 +69,10 @@ TargetPlatform CCApplication::getTargetPlatform() // static member function ////////////////////////////////////////////////////////////////////////////////////////////////// -CCApplication& CCApplication::sharedApplication() +CCApplication* CCApplication::sharedApplication() { CC_ASSERT(sm_pSharedApplication); - return *sm_pSharedApplication; + return sm_pSharedApplication; } ccLanguageType CCApplication::getCurrentLanguage() diff --git a/samples/HelloCpp/Classes/HelloWorldScene.cpp b/samples/HelloCpp/Classes/HelloWorldScene.cpp index a9ad685a7e..43117c740f 100644 --- a/samples/HelloCpp/Classes/HelloWorldScene.cpp +++ b/samples/HelloCpp/Classes/HelloWorldScene.cpp @@ -41,7 +41,7 @@ bool HelloWorld::init() this, menu_selector(HelloWorld::menuCloseCallback)); - if (CCApplication::sharedApplication().getTargetPlatform() == kTargetIphone) + if (CCApplication::sharedApplication()->getTargetPlatform() == kTargetIphone) { pCloseItem->setPosition(ccp(visibleSize.width - 20 + origin.x, 20 + origin.y)); } diff --git a/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp b/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp index 18fa21da50..035fb201c4 100644 --- a/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp +++ b/samples/HelloCpp/proj.android/jni/hellocpp/main.cpp @@ -28,7 +28,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi view->setFrameSize(w, h); AppDelegate *pAppDelegate = new AppDelegate(); - CCApplication::sharedApplication().run(); + CCApplication::sharedApplication()->run(); } else { diff --git a/samples/HelloCpp/proj.blackberry/main.cpp b/samples/HelloCpp/proj.blackberry/main.cpp index 8251cd34f8..af00341f86 100644 --- a/samples/HelloCpp/proj.blackberry/main.cpp +++ b/samples/HelloCpp/proj.blackberry/main.cpp @@ -25,10 +25,10 @@ int main(int argc, char **argv) height = 600; } - CCApplication::sharedApplication().setResourceRootPath("app/native/Resources/"); + CCApplication::sharedApplication()->setResourceRootPath("app/native/Resources/"); - CCEGLView& eglView = CCEGLView::sharedOpenGLView(); - eglView.setFrameSize(width, height); + CCEGLView* eglView = CCEGLView::sharedOpenGLView(); + eglView->setFrameSize(width, height); - return CCApplication::sharedApplication().run(); + return CCApplication::sharedApplication()->run(); } diff --git a/samples/HelloCpp/proj.ios/AppController.mm b/samples/HelloCpp/proj.ios/AppController.mm index c632ed2b35..db16a9024e 100644 --- a/samples/HelloCpp/proj.ios/AppController.mm +++ b/samples/HelloCpp/proj.ios/AppController.mm @@ -62,7 +62,7 @@ static AppDelegate s_sharedApplication; [[UIApplication sharedApplication] setStatusBarHidden: YES]; - cocos2d::CCApplication::sharedApplication().run(); + cocos2d::CCApplication::sharedApplication()->run(); return YES; } @@ -87,14 +87,14 @@ static AppDelegate s_sharedApplication; Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground(); + cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground(); + cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication *)application { diff --git a/samples/HelloCpp/proj.linux/main.cpp b/samples/HelloCpp/proj.linux/main.cpp index e18a28ef38..af006d3292 100644 --- a/samples/HelloCpp/proj.linux/main.cpp +++ b/samples/HelloCpp/proj.linux/main.cpp @@ -9,8 +9,8 @@ int main(int argc, char **argv) { // create the application instance AppDelegate app; - CCApplication::sharedApplication().setResourceRootPath("../Resources/"); - CCEGLView& eglView = CCEGLView::sharedOpenGLView(); - eglView.setFrameSize(960, 640); - return CCApplication::sharedApplication().run(); + CCApplication::sharedApplication()->setResourceRootPath("../Resources/"); + CCEGLView* eglView = CCEGLView::sharedOpenGLView(); + eglView->setFrameSize(960, 640); + return CCApplication::sharedApplication()->run(); } diff --git a/samples/HelloCpp/proj.mac/AppController.mm b/samples/HelloCpp/proj.mac/AppController.mm index 166579ba2f..687b81c60b 100644 --- a/samples/HelloCpp/proj.mac/AppController.mm +++ b/samples/HelloCpp/proj.mac/AppController.mm @@ -54,8 +54,7 @@ static AppDelegate s_sharedApplication; [window makeKeyAndOrderFront:self]; [window setAcceptsMouseMovedEvents:NO]; - // set cocos2d-x's opengl view - cocos2d::CCApplication::sharedApplication().run(); + cocos2d::CCApplication::sharedApplication()->run(); } -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication diff --git a/samples/HelloLua/proj.android/jni/hellolua/main.cpp b/samples/HelloLua/proj.android/jni/hellolua/main.cpp index 21ae99dba1..aebf5c9481 100644 --- a/samples/HelloLua/proj.android/jni/hellolua/main.cpp +++ b/samples/HelloLua/proj.android/jni/hellolua/main.cpp @@ -27,7 +27,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi view->setFrameSize(w, h); AppDelegate *pAppDelegate = new AppDelegate(); - CCApplication::sharedApplication().run(); + CCApplication::sharedApplication()->run(); } else { diff --git a/samples/HelloLua/proj.ios/AppController.mm b/samples/HelloLua/proj.ios/AppController.mm index d1a4bf868d..ef4552b40d 100644 --- a/samples/HelloLua/proj.ios/AppController.mm +++ b/samples/HelloLua/proj.ios/AppController.mm @@ -62,7 +62,7 @@ static AppDelegate s_sharedApplication; [[UIApplication sharedApplication] setStatusBarHidden: YES]; - cocos2d::CCApplication::sharedApplication().run(); + cocos2d::CCApplication::sharedApplication()->run(); return YES; } @@ -87,14 +87,14 @@ static AppDelegate s_sharedApplication; Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground(); + cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground(); + cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication *)application { diff --git a/samples/HelloLua/proj.win32/main.cpp b/samples/HelloLua/proj.win32/main.cpp index 4ec6228a62..c9b1f38569 100644 --- a/samples/HelloLua/proj.win32/main.cpp +++ b/samples/HelloLua/proj.win32/main.cpp @@ -24,9 +24,9 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - CCEGLView& eglView = CCEGLView::sharedOpenGLView(); - eglView.setFrameSize(480, 320); - int ret = CCApplication::sharedApplication().run(); + CCEGLView* eglView = CCEGLView::sharedOpenGLView(); + eglView->setFrameSize(480, 320); + int ret = CCApplication::sharedApplication()->run(); #ifdef USE_WIN32_CONSOLE FreeConsole(); diff --git a/samples/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp b/samples/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp index 4b4c7f1e0b..b08d3b552e 100644 --- a/samples/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp +++ b/samples/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp @@ -10,7 +10,7 @@ CurrentLanguageTest::CurrentLanguageTest() CCLabelTTF *labelLanguage = CCLabelTTF::create("", "Arial", 20); labelLanguage->setPosition(ccp(s.width/2, s.height/2)); - ccLanguageType currentLanguageType = CCApplication::sharedApplication().getCurrentLanguage(); + ccLanguageType currentLanguageType = CCApplication::sharedApplication()->getCurrentLanguage(); switch (currentLanguageType) { case kLanguageEnglish: diff --git a/samples/TestCpp/proj.android/jni/testcpp/main.cpp b/samples/TestCpp/proj.android/jni/testcpp/main.cpp index e5e8d72dad..8c51db5100 100644 --- a/samples/TestCpp/proj.android/jni/testcpp/main.cpp +++ b/samples/TestCpp/proj.android/jni/testcpp/main.cpp @@ -28,7 +28,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi view->setFrameSize(w, h); AppDelegate *pAppDelegate = new AppDelegate(); - CCApplication::sharedApplication().run(); + CCApplication::sharedApplication()->run(); } else { diff --git a/samples/TestCpp/proj.blackberry/main.cpp b/samples/TestCpp/proj.blackberry/main.cpp index ad38087a0c..4791cea650 100644 --- a/samples/TestCpp/proj.blackberry/main.cpp +++ b/samples/TestCpp/proj.blackberry/main.cpp @@ -23,10 +23,10 @@ int main(int argc, char **argv) height = 600; } - CCApplication::sharedApplication().setResourceRootPath("app/native/Resources/"); + CCApplication::sharedApplication()->setResourceRootPath("app/native/Resources/"); - CCEGLView& eglView = CCEGLView::sharedOpenGLView(); - eglView.setFrameSize(width, height); + CCEGLView* eglView = CCEGLView::sharedOpenGLView(); + eglView->setFrameSize(width, height); - return CCApplication::sharedApplication().run(); + return CCApplication::sharedApplication()->run(); } diff --git a/samples/TestCpp/proj.ios/Classes/testsAppDelegate.mm b/samples/TestCpp/proj.ios/Classes/testsAppDelegate.mm index 1c818a1e7a..2cfe786c29 100644 --- a/samples/TestCpp/proj.ios/Classes/testsAppDelegate.mm +++ b/samples/TestCpp/proj.ios/Classes/testsAppDelegate.mm @@ -49,7 +49,7 @@ static AppDelegate s_sharedApplication; [[UIApplication sharedApplication] setStatusBarHidden:true]; - cocos2d::CCApplication::sharedApplication().run(); + cocos2d::CCApplication::sharedApplication()->run(); return YES; } @@ -75,14 +75,14 @@ static AppDelegate s_sharedApplication; Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground(); + cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground(); + cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication *)application { diff --git a/samples/TestCpp/proj.linux/main.cpp b/samples/TestCpp/proj.linux/main.cpp index eb9deb0080..a8dcf70b12 100644 --- a/samples/TestCpp/proj.linux/main.cpp +++ b/samples/TestCpp/proj.linux/main.cpp @@ -6,9 +6,9 @@ USING_NS_CC; int main(int argc, char **argv) { // create the application instance AppDelegate app; - CCApplication::sharedApplication().setResourceRootPath("../Resources/"); - CCEGLView& eglView = CCEGLView::sharedOpenGLView(); - eglView.setFrameSize(480, 320); + CCApplication::sharedApplication()->setResourceRootPath("../Resources/"); + CCEGLView* eglView = CCEGLView::sharedOpenGLView(); + eglView->setFrameSize(480, 320); - return CCApplication::sharedApplication().run(); + return CCApplication::sharedApplication()->run(); } diff --git a/samples/TestCpp/proj.mac/AppController.mm b/samples/TestCpp/proj.mac/AppController.mm index 3552af2e6a..8265082278 100644 --- a/samples/TestCpp/proj.mac/AppController.mm +++ b/samples/TestCpp/proj.mac/AppController.mm @@ -54,8 +54,7 @@ [window makeKeyAndOrderFront:self]; [window setAcceptsMouseMovedEvents:NO]; - // set cocos2d-x's opengl view - cocos2d::CCApplication::sharedApplication().run(); + cocos2d::CCApplication::sharedApplication()->run(); } -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication diff --git a/samples/TestCpp/proj.win32/main.cpp b/samples/TestCpp/proj.win32/main.cpp index ace8690a1c..8de755628e 100644 --- a/samples/TestCpp/proj.win32/main.cpp +++ b/samples/TestCpp/proj.win32/main.cpp @@ -14,7 +14,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - CCEGLView& eglView = CCEGLView::sharedOpenGLView(); - eglView.setFrameSize(480, 320); - return CCApplication::sharedApplication().run(); + CCEGLView* eglView = CCEGLView::sharedOpenGLView(); + eglView->setFrameSize(480, 320); + return CCApplication::sharedApplication()->run(); } diff --git a/samples/TestJavascript/proj.android/jni/testjavascript/main.cpp b/samples/TestJavascript/proj.android/jni/testjavascript/main.cpp index 00edd06d31..2f2d1e0c10 100644 --- a/samples/TestJavascript/proj.android/jni/testjavascript/main.cpp +++ b/samples/TestJavascript/proj.android/jni/testjavascript/main.cpp @@ -28,7 +28,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi view->setFrameSize(w, h); AppDelegate *pAppDelegate = new AppDelegate(); - CCApplication::sharedApplication().run(); + CCApplication::sharedApplication()->run(); } else { diff --git a/samples/TestJavascript/proj.ios/AppController.mm b/samples/TestJavascript/proj.ios/AppController.mm index 187e55ed48..22b2e3d043 100644 --- a/samples/TestJavascript/proj.ios/AppController.mm +++ b/samples/TestJavascript/proj.ios/AppController.mm @@ -46,7 +46,7 @@ static AppDelegate s_sharedApplication; [[UIApplication sharedApplication] setStatusBarHidden: YES]; - cocos2d::CCApplication::sharedApplication().run(); + cocos2d::CCApplication::sharedApplication()->run(); return YES; } @@ -71,14 +71,14 @@ static AppDelegate s_sharedApplication; Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground(); + cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground(); + cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication *)application { diff --git a/samples/TestJavascript/proj.linux/main.cpp b/samples/TestJavascript/proj.linux/main.cpp index 8ae2e716fe..db9f8b5424 100644 --- a/samples/TestJavascript/proj.linux/main.cpp +++ b/samples/TestJavascript/proj.linux/main.cpp @@ -9,8 +9,8 @@ int main(int argc, char **argv) { // create the application instance AppDelegate app; - CCApplication::sharedApplication().setResourceRootPath("../Resources/"); - CCEGLView& eglView = CCEGLView::sharedOpenGLView(); - eglView.setFrameSize(480, 320); - return CCApplication::sharedApplication().run(); + CCApplication::sharedApplication()->setResourceRootPath("../Resources/"); + CCEGLView* eglView = CCEGLView::sharedOpenGLView(); + eglView->setFrameSize(480, 320); + return CCApplication::sharedApplication()->run(); } diff --git a/samples/TestJavascript/proj.win32/main.cpp b/samples/TestJavascript/proj.win32/main.cpp index 5ec4f5040a..85eb63c2a9 100644 --- a/samples/TestJavascript/proj.win32/main.cpp +++ b/samples/TestJavascript/proj.win32/main.cpp @@ -24,10 +24,10 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - CCEGLView& eglView = CCEGLView::sharedOpenGLView(); - eglView.setFrameSize(480, 320); + CCEGLView* eglView = CCEGLView::sharedOpenGLView(); + eglView->setFrameSize(480, 320); - int ret = CCApplication::sharedApplication().run(); + int ret = CCApplication::sharedApplication()->run(); #ifdef USE_WIN32_CONSOLE FreeConsole(); diff --git a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id index 6ca4bf16e0..dc3c78c974 100644 --- a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id +++ b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id @@ -1 +1 @@ -0b7cd029edf3970b0b444a943661d09f58aeba3d \ No newline at end of file +060676f324e6ea079a88ae194f301aea0dd73d60 \ No newline at end of file diff --git a/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp b/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp index fd680236cb..9eabbbc938 100644 --- a/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp +++ b/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp @@ -29,7 +29,7 @@ bool AppDelegate::applicationDidFinishLaunching() { // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); - pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); + pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. // pDirector->enableRetinaDisplay(true); diff --git a/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp index 07ffb55c1e..88577cd02c 100644 --- a/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp @@ -26,7 +26,7 @@ bool AppDelegate::applicationDidFinishLaunching() { // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); - pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); + pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. // pDirector->enableRetinaDisplay(true); diff --git a/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp index 34a55428e7..41237a35e9 100644 --- a/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp @@ -26,7 +26,7 @@ bool AppDelegate::applicationDidFinishLaunching() { // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); - pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); + pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. // pDirector->enableRetinaDisplay(true); diff --git a/template/xcode4/cocos2dx_box2d.xctemplate/Classes/HelloWorldScene.cpp b/template/xcode4/cocos2dx_box2d.xctemplate/Classes/HelloWorldScene.cpp index 928c6c0159..8e1e7728b3 100644 --- a/template/xcode4/cocos2dx_box2d.xctemplate/Classes/HelloWorldScene.cpp +++ b/template/xcode4/cocos2dx_box2d.xctemplate/Classes/HelloWorldScene.cpp @@ -253,7 +253,7 @@ void HelloWorld::ccTouchesEnded(CCSet* touches, CCEvent* event) if(!touch) break; - CCPoint location = touch->locationInView(); + CCPoint location = touch->getLocationInView(); location = CCDirector::sharedDirector()->convertToGL(location); diff --git a/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp index 34a55428e7..41237a35e9 100644 --- a/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp @@ -26,7 +26,7 @@ bool AppDelegate::applicationDidFinishLaunching() { // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); - pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); + pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. // pDirector->enableRetinaDisplay(true); diff --git a/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/HelloWorldScene.cpp b/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/HelloWorldScene.cpp index 9cc53922a2..480142198c 100644 --- a/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/HelloWorldScene.cpp +++ b/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/HelloWorldScene.cpp @@ -243,7 +243,7 @@ void HelloWorld::ccTouchesEnded(CCSet* touches, CCEvent* event) if(!touch) break; - CCPoint location = touch->locationInView(); + CCPoint location = touch->getLocationInView(); location = CCDirector::sharedDirector()->convertToGL(location); diff --git a/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp index d849a54ed5..bdb910919e 100644 --- a/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp @@ -25,7 +25,7 @@ bool AppDelegate::applicationDidFinishLaunching() { // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); - pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); + pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. // pDirector->enableRetinaDisplay(true); diff --git a/tools/tolua++/CCApplication.pkg b/tools/tolua++/CCApplication.pkg index a83da8ae77..35f5f5606e 100644 --- a/tools/tolua++/CCApplication.pkg +++ b/tools/tolua++/CCApplication.pkg @@ -12,6 +12,6 @@ typedef enum LanguageType class CCApplication { - static CCApplication& sharedApplication(); + static CCApplication* sharedApplication(); ccLanguageType getCurrentLanguage(); }; From 8c483613e76788356c81749d0481bf3cb4d62191 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 21 Aug 2012 15:41:00 +0800 Subject: [PATCH 07/53] issue #1437:make CCApplication::sharedApplication() return pointer --- .../msvc/CCAppWiz.win32/Templates/1033/proj.win32/main.cpp | 6 +++--- template/xcode4/cocos2dx.xctemplate/ios/AppController.mm | 6 +++--- .../xcode4/cocos2dx_box2d.xctemplate/ios/AppController.mm | 6 +++--- .../cocos2dx_chipmunk.xctemplate/ios/AppController.mm | 6 +++--- .../xcode4/cocos2dx_lua.xctemplate/ios/AppController.mm | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/template/msvc/CCAppWiz.win32/Templates/1033/proj.win32/main.cpp b/template/msvc/CCAppWiz.win32/Templates/1033/proj.win32/main.cpp index 5ec4f5040a..85eb63c2a9 100644 --- a/template/msvc/CCAppWiz.win32/Templates/1033/proj.win32/main.cpp +++ b/template/msvc/CCAppWiz.win32/Templates/1033/proj.win32/main.cpp @@ -24,10 +24,10 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - CCEGLView& eglView = CCEGLView::sharedOpenGLView(); - eglView.setFrameSize(480, 320); + CCEGLView* eglView = CCEGLView::sharedOpenGLView(); + eglView->setFrameSize(480, 320); - int ret = CCApplication::sharedApplication().run(); + int ret = CCApplication::sharedApplication()->run(); #ifdef USE_WIN32_CONSOLE FreeConsole(); diff --git a/template/xcode4/cocos2dx.xctemplate/ios/AppController.mm b/template/xcode4/cocos2dx.xctemplate/ios/AppController.mm index a209ad42a5..96281719a6 100644 --- a/template/xcode4/cocos2dx.xctemplate/ios/AppController.mm +++ b/template/xcode4/cocos2dx.xctemplate/ios/AppController.mm @@ -46,7 +46,7 @@ static AppDelegate s_sharedApplication; [[UIApplication sharedApplication] setStatusBarHidden: YES]; - cocos2d::CCApplication::sharedApplication().run(); + cocos2d::CCApplication::sharedApplication()->run(); return YES; } @@ -71,14 +71,14 @@ static AppDelegate s_sharedApplication; Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground(); + cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground(); + cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication *)application { diff --git a/template/xcode4/cocos2dx_box2d.xctemplate/ios/AppController.mm b/template/xcode4/cocos2dx_box2d.xctemplate/ios/AppController.mm index 63aa8d6d04..520b117ea2 100644 --- a/template/xcode4/cocos2dx_box2d.xctemplate/ios/AppController.mm +++ b/template/xcode4/cocos2dx_box2d.xctemplate/ios/AppController.mm @@ -46,7 +46,7 @@ static AppDelegate s_sharedApplication; [[UIApplication sharedApplication] setStatusBarHidden: YES]; - cocos2d::CCApplication::sharedApplication().run(); + cocos2d::CCApplication::sharedApplication()->run(); return YES; } @@ -71,14 +71,14 @@ static AppDelegate s_sharedApplication; Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground(); + cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground(); + cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication *)application { diff --git a/template/xcode4/cocos2dx_chipmunk.xctemplate/ios/AppController.mm b/template/xcode4/cocos2dx_chipmunk.xctemplate/ios/AppController.mm index 16882c7a1f..833f59255d 100644 --- a/template/xcode4/cocos2dx_chipmunk.xctemplate/ios/AppController.mm +++ b/template/xcode4/cocos2dx_chipmunk.xctemplate/ios/AppController.mm @@ -46,7 +46,7 @@ static AppDelegate s_sharedApplication; [[UIApplication sharedApplication] setStatusBarHidden: YES]; - cocos2d::CCApplication::sharedApplication().run(); + cocos2d::CCApplication::sharedApplication()->run(); return YES; } @@ -71,14 +71,14 @@ static AppDelegate s_sharedApplication; Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground(); + cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground(); + cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication *)application { diff --git a/template/xcode4/cocos2dx_lua.xctemplate/ios/AppController.mm b/template/xcode4/cocos2dx_lua.xctemplate/ios/AppController.mm index f4ac87abf2..6b27e1dcc9 100644 --- a/template/xcode4/cocos2dx_lua.xctemplate/ios/AppController.mm +++ b/template/xcode4/cocos2dx_lua.xctemplate/ios/AppController.mm @@ -62,7 +62,7 @@ static AppDelegate s_sharedApplication; [[UIApplication sharedApplication] setStatusBarHidden: YES]; - cocos2d::CCApplication::sharedApplication().run(); + cocos2d::CCApplication::sharedApplication()->run(); return YES; } @@ -87,14 +87,14 @@ static AppDelegate s_sharedApplication; Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ - cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground(); + cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground(); } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ - cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground(); + cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground(); } - (void)applicationWillTerminate:(UIApplication *)application { From d918c8186f05b4d223cb587f04edd1ae8b272615 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 21 Aug 2012 16:03:36 +0800 Subject: [PATCH 08/53] Update extensions/GUI/CCEditBox/CCEditBox.cpp Revert this file, uncomment some codes in 'initWithXXX'. --- extensions/GUI/CCEditBox/CCEditBox.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/extensions/GUI/CCEditBox/CCEditBox.cpp b/extensions/GUI/CCEditBox/CCEditBox.cpp index 11c4ed5f0c..acc2410894 100644 --- a/extensions/GUI/CCEditBox/CCEditBox.cpp +++ b/extensions/GUI/CCEditBox/CCEditBox.cpp @@ -79,7 +79,6 @@ CCEditBox* CCEditBox::create(const CCSize& size, CCScale9Sprite* pNormal9SpriteB bool CCEditBox::initWithSizeAndBackgroundSprite(const CCSize& size, CCScale9Sprite* pPressed9SpriteBg) { -#if 0 if (CCControlButton::initWithBackgroundSprite(pPressed9SpriteBg)) { m_pEditBoxImpl = __createSystemEditBox(this); @@ -91,7 +90,6 @@ bool CCEditBox::initWithSizeAndBackgroundSprite(const CCSize& size, CCScale9Spri return true; } -#endif return false; } From ba2049d086d466a3c6531acf605f3ca8d3638cc9 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 21 Aug 2012 16:45:23 +0800 Subject: [PATCH 09/53] iss1438_android_template --- samples/HelloCpp/proj.android/build_native.sh | 21 ++--- samples/HelloLua/proj.android/build_native.sh | 21 ++--- samples/TestCpp/proj.android/build_native.sh | 21 ++--- .../proj.android/build_native.sh | 21 ++--- template/android/Classes/AppDelegate.cpp | 57 +++++++++++++ template/android/Classes/AppDelegate.h | 38 +++++++++ template/android/Classes/HelloWorldScene.cpp | 84 +++++++++++++++++++ template/android/Classes/HelloWorldScene.h | 22 +++++ template/android/build_native.sh | 21 ++--- template/android/copy_files.sh | 12 ++- 10 files changed, 241 insertions(+), 77 deletions(-) create mode 100644 template/android/Classes/AppDelegate.cpp create mode 100644 template/android/Classes/AppDelegate.h create mode 100644 template/android/Classes/HelloWorldScene.cpp create mode 100644 template/android/Classes/HelloWorldScene.h diff --git a/samples/HelloCpp/proj.android/build_native.sh b/samples/HelloCpp/proj.android/build_native.sh index e646bba6dd..e14fddce76 100755 --- a/samples/HelloCpp/proj.android/build_native.sh +++ b/samples/HelloCpp/proj.android/build_native.sh @@ -30,23 +30,16 @@ done # paths -if [ -z "${NDK_ROOT+aaa}" ]; then -# ... if NDK_ROOT is not set, use "$HOME/bin/android-ndk" - NDK_ROOT="$HOME/bin/android-ndk" +if [ -z "${NDK_ROOT+aaa}" ];then +echo "please define NDK_ROOT" +exit 1 fi -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then -# ... if COCOS2DX_ROOT is not set -# ... find current working directory - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # ... use paths relative to current directory - COCOS2DX_ROOT="$DIR/../../.." - APP_ROOT="$DIR/.." - APP_ANDROID_ROOT="$DIR" -else - APP_ROOT="$COCOS2DX_ROOT"/samples/"$APPNAME" - APP_ANDROID_ROOT="$COCOS2DX_ROOT"/samples/"$APPNAME"/proj.android -fi +COCOS2DX_ROOT="$DIR/../../.." +APP_ROOT="$DIR/.." +APP_ANDROID_ROOT="$DIR" echo "NDK_ROOT = $NDK_ROOT" echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" diff --git a/samples/HelloLua/proj.android/build_native.sh b/samples/HelloLua/proj.android/build_native.sh index 054d89b7c2..aa7f6a2e8b 100755 --- a/samples/HelloLua/proj.android/build_native.sh +++ b/samples/HelloLua/proj.android/build_native.sh @@ -30,23 +30,16 @@ done # paths -if [ -z "${NDK_ROOT+aaa}" ]; then -# ... if NDK_ROOT is not set, use "$HOME/bin/android-ndk" - NDK_ROOT="$HOME/bin/android-ndk" +if [ -z "${NDK_ROOT+aaa}" ];then +echo "please define NDK_ROOT" +exit 1 fi -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then -# ... if COCOS2DX_ROOT is not set -# ... find current working directory - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # ... use paths relative to current directory - COCOS2DX_ROOT="$DIR/../../.." - APP_ROOT="$DIR/.." - APP_ANDROID_ROOT="$DIR" -else - APP_ROOT="$COCOS2DX_ROOT"/samples/"$APPNAME" - APP_ANDROID_ROOT="$COCOS2DX_ROOT"/samples/"$APPNAME"/proj.android -fi +COCOS2DX_ROOT="$DIR/../../.." +APP_ROOT="$DIR/.." +APP_ANDROID_ROOT="$DIR" echo "NDK_ROOT = $NDK_ROOT" echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" diff --git a/samples/TestCpp/proj.android/build_native.sh b/samples/TestCpp/proj.android/build_native.sh index 2b5066d0bf..d60ccfd4dc 100755 --- a/samples/TestCpp/proj.android/build_native.sh +++ b/samples/TestCpp/proj.android/build_native.sh @@ -30,23 +30,16 @@ done # paths -if [ -z "${NDK_ROOT+aaa}" ]; then -# ... if NDK_ROOT is not set, use "$HOME/bin/android-ndk" - NDK_ROOT="$HOME/bin/android-ndk" +if [ -z "${NDK_ROOT+aaa}" ];then +echo "please define NDK_ROOT" +exit 1 fi -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then -# ... if COCOS2DX_ROOT is not set -# ... find current working directory - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # ... use paths relative to current directory - COCOS2DX_ROOT="$DIR/../../.." - APP_ROOT="$DIR/.." - APP_ANDROID_ROOT="$DIR" -else - APP_ROOT="$COCOS2DX_ROOT"/samples/"$APPNAME" - APP_ANDROID_ROOT="$COCOS2DX_ROOT"/samples/"$APPNAME"/proj.android -fi +COCOS2DX_ROOT="$DIR/../../.." +APP_ROOT="$DIR/.." +APP_ANDROID_ROOT="$DIR" echo "NDK_ROOT = $NDK_ROOT" echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" diff --git a/samples/TestJavascript/proj.android/build_native.sh b/samples/TestJavascript/proj.android/build_native.sh index e7816cbd00..1abfcfe3d0 100755 --- a/samples/TestJavascript/proj.android/build_native.sh +++ b/samples/TestJavascript/proj.android/build_native.sh @@ -30,23 +30,16 @@ done # paths -if [ -z "${NDK_ROOT+aaa}" ]; then -# ... if NDK_ROOT is not set, use "$HOME/bin/android-ndk" - NDK_ROOT="$HOME/bin/android-ndk" +if [ -z "${NDK_ROOT+aaa}" ];then +echo "please define NDK_ROOT" +exit 1 fi -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then -# ... if COCOS2DX_ROOT is not set -# ... find current working directory - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # ... use paths relative to current directory - COCOS2DX_ROOT="$DIR/../../.." - APP_ROOT="$DIR/.." - APP_ANDROID_ROOT="$DIR" -else - APP_ROOT="$COCOS2DX_ROOT"/samples/"$APPNAME" - APP_ANDROID_ROOT="$COCOS2DX_ROOT"/samples/"$APPNAME"/proj.android -fi +COCOS2DX_ROOT="$DIR/../../.." +APP_ROOT="$DIR/.." +APP_ANDROID_ROOT="$DIR" echo "NDK_ROOT = $NDK_ROOT" echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" diff --git a/template/android/Classes/AppDelegate.cpp b/template/android/Classes/AppDelegate.cpp new file mode 100644 index 0000000000..9d796bae18 --- /dev/null +++ b/template/android/Classes/AppDelegate.cpp @@ -0,0 +1,57 @@ +#include "AppDelegate.h" + +#include "cocos2d.h" +#include "HelloWorldScene.h" + +USING_NS_CC; + +AppDelegate::AppDelegate() +{ + +} + +AppDelegate::~AppDelegate() +{ +} + +bool AppDelegate::applicationDidFinishLaunching() +{ + // initialize director + CCDirector *pDirector = CCDirector::sharedDirector(); + pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView()); + + // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. + // pDirector->enableRetinaDisplay(true); + + // turn on display FPS + pDirector->setDisplayStats(true); + + // set FPS. the default value is 1.0/60 if you don't call this + pDirector->setAnimationInterval(1.0 / 60); + + // create a scene. it's an autorelease object + CCScene *pScene = HelloWorld::scene(); + + // run + pDirector->runWithScene(pScene); + + return true; +} + +// This function will be called when the app is inactive. When comes a phone call,it's be invoked too +void AppDelegate::applicationDidEnterBackground() +{ + CCDirector::sharedDirector()->pause(); + + // if you use SimpleAudioEngine, it must be pause + // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); +} + +// this function will be called when the app is active again +void AppDelegate::applicationWillEnterForeground() +{ + CCDirector::sharedDirector()->resume(); + + // if you use SimpleAudioEngine, it must resume here + // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); +} diff --git a/template/android/Classes/AppDelegate.h b/template/android/Classes/AppDelegate.h new file mode 100644 index 0000000000..76c1c6089f --- /dev/null +++ b/template/android/Classes/AppDelegate.h @@ -0,0 +1,38 @@ +#ifndef _APP_DELEGATE_H_ +#define _APP_DELEGATE_H_ + +#include "CCApplication.h" + +/** +@brief The cocos2d Application. + +The reason for implement as private inheritance is to hide some interface call by CCDirector. +*/ +class AppDelegate : private cocos2d::CCApplication +{ +public: + AppDelegate(); + virtual ~AppDelegate(); + + /** + @brief Implement CCDirector and CCScene init code here. + @return true Initialize success, app continue. + @return false Initialize failed, app terminate. + */ + virtual bool applicationDidFinishLaunching(); + + /** + @brief The function be called when the application enter background + @param the pointer of the application + */ + virtual void applicationDidEnterBackground(); + + /** + @brief The function be called when the application enter foreground + @param the pointer of the application + */ + virtual void applicationWillEnterForeground(); +}; + +#endif // _APP_DELEGATE_H_ + diff --git a/template/android/Classes/HelloWorldScene.cpp b/template/android/Classes/HelloWorldScene.cpp new file mode 100644 index 0000000000..a936549028 --- /dev/null +++ b/template/android/Classes/HelloWorldScene.cpp @@ -0,0 +1,84 @@ +#include "HelloWorldScene.h" +#include "SimpleAudioEngine.h" + +using namespace cocos2d; +using namespace CocosDenshion; + +CCScene* HelloWorld::scene() +{ + // 'scene' is an autorelease object + CCScene *scene = CCScene::create(); + + // 'layer' is an autorelease object + HelloWorld *layer = HelloWorld::create(); + + // add layer as a child to scene + scene->addChild(layer); + + // return the scene + return scene; +} + +// on "init" you need to initialize your instance +bool HelloWorld::init() +{ + ////////////////////////////// + // 1. super init first + if ( !CCLayer::init() ) + { + return false; + } + + ///////////////////////////// + // 2. add a menu item with "X" image, which is clicked to quit the program + // you may modify it. + + // add a "close" icon to exit the progress. it's an autorelease object + CCMenuItemImage *pCloseItem = CCMenuItemImage::create( + "CloseNormal.png", + "CloseSelected.png", + this, + menu_selector(HelloWorld::menuCloseCallback) ); + pCloseItem->setPosition( ccp(CCDirector::sharedDirector()->getWinSize().width - 20, 20) ); + + // create menu, it's an autorelease object + CCMenu* pMenu = CCMenu::create(pCloseItem, NULL); + pMenu->setPosition( CCPointZero ); + this->addChild(pMenu, 1); + + ///////////////////////////// + // 3. add your codes below... + + // add a label shows "Hello World" + // create and initialize a label + CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "Thonburi", 34); + + // ask director the window size + CCSize size = CCDirector::sharedDirector()->getWinSize(); + + // position the label on the center of the screen + pLabel->setPosition( ccp(size.width / 2, size.height - 20) ); + + // add the label as a child to this layer + this->addChild(pLabel, 1); + + // add "HelloWorld" splash screen" + CCSprite* pSprite = CCSprite::create("HelloWorld.png"); + + // position the sprite on the center of the screen + pSprite->setPosition( ccp(size.width/2, size.height/2) ); + + // add the sprite as a child to this layer + this->addChild(pSprite, 0); + + return true; +} + +void HelloWorld::menuCloseCallback(CCObject* pSender) +{ + CCDirector::sharedDirector()->end(); + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + exit(0); +#endif +} diff --git a/template/android/Classes/HelloWorldScene.h b/template/android/Classes/HelloWorldScene.h new file mode 100644 index 0000000000..08442e9fd8 --- /dev/null +++ b/template/android/Classes/HelloWorldScene.h @@ -0,0 +1,22 @@ +#ifndef __HELLOWORLD_SCENE_H__ +#define __HELLOWORLD_SCENE_H__ + +#include "cocos2d.h" + +class HelloWorld : public cocos2d::CCLayer +{ +public: + // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone + virtual bool init(); + + // there's no 'id' in cpp, so we recommand to return the exactly class pointer + static cocos2d::CCScene* scene(); + + // a selector callback + void menuCloseCallback(CCObject* pSender); + + // implement the "static node()" method manually + LAYER_CREATE_FUNC(HelloWorld); +}; + +#endif // __HELLOWORLD_SCENE_H__ diff --git a/template/android/build_native.sh b/template/android/build_native.sh index 11b2ad3016..d6b410a912 100644 --- a/template/android/build_native.sh +++ b/template/android/build_native.sh @@ -30,23 +30,16 @@ done # paths -if [ -z "${NDK_ROOT+aaa}" ]; then -# ... if NDK_ROOT is not set, use "$HOME/bin/android-ndk" - NDK_ROOT="__ndkroot__" +if [ -z "${NDK_ROOT+aaa}" ];then +echo "please define NDK_ROOT" +exit 1 fi -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then -# ... if COCOS2DX_ROOT is not set -# ... find current working directory - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # ... use paths relative to current directory - COCOS2DX_ROOT="$DIR/../.." - APP_ROOT="$DIR/.." - APP_ANDROID_ROOT="$DIR" -else - APP_ROOT="$COCOS2DX_ROOT"/"$APPNAME" - APP_ANDROID_ROOT="$COCOS2DX_ROOT"/"$APPNAME"/proj.android -fi +COCOS2DX_ROOT="$DIR/../.." +APP_ROOT="$DIR/.." +APP_ANDROID_ROOT="$DIR" echo "NDK_ROOT = $NDK_ROOT" echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" diff --git a/template/android/copy_files.sh b/template/android/copy_files.sh index 1e1474e497..f208567877 100644 --- a/template/android/copy_files.sh +++ b/template/android/copy_files.sh @@ -18,13 +18,11 @@ convert_package_path_to_dir(){ PACKAGE_PATH_DIR=`echo $1 | sed -e "s/\./\//g"` } -copy_cpp_h_from_helloworld(){ +copy_cpp_h(){ mkdir $APP_DIR/Classes - for file in `ls $HELLOWORLD_ROOT/Classes/* | grep -E '.*\.(cpp|h|mk)' ` + for file in $COCOS2DX_ROOT/template/android/Classes/* do - if [ -f $file ];then - cp $file $APP_DIR/Classes - fi + cp $file $APP_DIR/Classes done } @@ -32,7 +30,7 @@ copy_cpp_h_from_helloworld(){ copy_resouces(){ mkdir $APP_DIR/Resources - for file in $HELLOWORLD_ROOT/Resources/* + for file in $HELLOWORLD_ROOT/Resources/iphone/* do cp -rf $file $APP_DIR/Resources done @@ -88,7 +86,7 @@ copy_icon(){ fi } -copy_cpp_h_from_helloworld +copy_cpp_h copy_resouces copy_src_and_jni copy_library_src From e939285c933e2106a7de81a773d00708b00b4bae Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 21 Aug 2012 17:03:01 +0800 Subject: [PATCH 10/53] change version --- cocos2dx/cocos2d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2dx/cocos2d.cpp b/cocos2dx/cocos2d.cpp index 4a0ff0ce08..f4b48636b3 100644 --- a/cocos2dx/cocos2d.cpp +++ b/cocos2dx/cocos2d.cpp @@ -30,7 +30,7 @@ NS_CC_BEGIN const char* cocos2dVersion() { - return "cocos2d-2.0-rc2-x-2.0.1"; + return "cocos2d-2.0-x-2.0.1"; } NS_CC_END From fac3e9c8de8da6e9733693192c35c34bd3f39719 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 21 Aug 2012 17:25:03 +0800 Subject: [PATCH 11/53] issue #1437: fixed some compile errors. --- cocos2dx/platform/win32/CCAccelerometer.cpp | 4 ++-- cocos2dx/platform/win32/CCApplication.cpp | 4 ++-- cocos2dx/platform/win32/CCApplication.h | 2 +- cocos2dx/platform/win32/CCEGLView.cpp | 4 ++-- samples/HelloCpp/proj.win32/main.cpp | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cocos2dx/platform/win32/CCAccelerometer.cpp b/cocos2dx/platform/win32/CCAccelerometer.cpp index 58bee51739..569d12cfcf 100644 --- a/cocos2dx/platform/win32/CCAccelerometer.cpp +++ b/cocos2dx/platform/win32/CCAccelerometer.cpp @@ -168,12 +168,12 @@ void CCAccelerometer::setDelegate(CCAccelerometerDelegate* pDelegate) if (pDelegate) { // Register our handler - CCEGLView::sharedOpenGLView().setAccelerometerKeyHook( &myAccelerometerKeyHook ); + CCEGLView::sharedOpenGLView()->setAccelerometerKeyHook( &myAccelerometerKeyHook ); } else { // De-register our handler - CCEGLView::sharedOpenGLView().setAccelerometerKeyHook( NULL ); + CCEGLView::sharedOpenGLView()->setAccelerometerKeyHook( NULL ); resetAccelerometer(); } } diff --git a/cocos2dx/platform/win32/CCApplication.cpp b/cocos2dx/platform/win32/CCApplication.cpp index fda1ac7311..d77a93a85b 100644 --- a/cocos2dx/platform/win32/CCApplication.cpp +++ b/cocos2dx/platform/win32/CCApplication.cpp @@ -99,10 +99,10 @@ void CCApplication::setAnimationInterval(double interval) ////////////////////////////////////////////////////////////////////////// // static member function ////////////////////////////////////////////////////////////////////////// -CCApplication& CCApplication::sharedApplication() +CCApplication* CCApplication::sharedApplication() { CC_ASSERT(sm_pSharedApplication); - return *sm_pSharedApplication; + return sm_pSharedApplication; } ccLanguageType CCApplication::getCurrentLanguage() diff --git a/cocos2dx/platform/win32/CCApplication.h b/cocos2dx/platform/win32/CCApplication.h index 1edb3bb607..8e05740002 100644 --- a/cocos2dx/platform/win32/CCApplication.h +++ b/cocos2dx/platform/win32/CCApplication.h @@ -24,7 +24,7 @@ public: @brief Get current applicaiton instance. @return Current application instance pointer. */ - static CCApplication& sharedApplication(); + static CCApplication* sharedApplication(); /* override functions */ virtual void setAnimationInterval(double interval); diff --git a/cocos2dx/platform/win32/CCEGLView.cpp b/cocos2dx/platform/win32/CCEGLView.cpp index 754bae910b..8158f928c8 100644 --- a/cocos2dx/platform/win32/CCEGLView.cpp +++ b/cocos2dx/platform/win32/CCEGLView.cpp @@ -248,10 +248,10 @@ LRESULT CCEGLView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) switch (wParam) { case SIZE_RESTORED: - CCApplication::sharedApplication().applicationWillEnterForeground(); + CCApplication::sharedApplication()->applicationWillEnterForeground(); break; case SIZE_MINIMIZED: - CCApplication::sharedApplication().applicationDidEnterBackground(); + CCApplication::sharedApplication()->applicationDidEnterBackground(); break; } break; diff --git a/samples/HelloCpp/proj.win32/main.cpp b/samples/HelloCpp/proj.win32/main.cpp index b876619ed6..2b81f7841a 100644 --- a/samples/HelloCpp/proj.win32/main.cpp +++ b/samples/HelloCpp/proj.win32/main.cpp @@ -14,7 +14,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - CCEGLView& eglView = CCEGLView::sharedOpenGLView(); - eglView.setFrameSize(960, 640 ); - return CCApplication::sharedApplication().run(); + CCEGLView* eglView = CCEGLView::sharedOpenGLView(); + eglView->setFrameSize(960, 640 ); + return CCApplication::sharedApplication()->run(); } From 4c2702fcef21815eb32775a9e7c095865901e32e Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 21 Aug 2012 17:42:56 +0800 Subject: [PATCH 12/53] issue #1437: fixed some compile errors for blackberry port. --- cocos2dx/platform/blackberry/CCEGLView.cpp | 8 ++++---- cocos2dx/platform/blackberry/CCEGLView.h | 2 +- cocos2dx/platform/blackberry/CCFileUtils.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos2dx/platform/blackberry/CCEGLView.cpp b/cocos2dx/platform/blackberry/CCEGLView.cpp index e784d4b519..ab625fa121 100644 --- a/cocos2dx/platform/blackberry/CCEGLView.cpp +++ b/cocos2dx/platform/blackberry/CCEGLView.cpp @@ -587,7 +587,7 @@ bool CCEGLView::handleEvents() case NAVIGATOR_WINDOW_INACTIVE: if (m_isWindowActive) { - CCApplication::sharedApplication().applicationDidEnterBackground(); + CCApplication::sharedApplication()->applicationDidEnterBackground(); m_isWindowActive = false; } break; @@ -595,7 +595,7 @@ bool CCEGLView::handleEvents() case NAVIGATOR_WINDOW_ACTIVE: if (!m_isWindowActive) { - CCApplication::sharedApplication().applicationWillEnterForeground(); + CCApplication::sharedApplication()->applicationWillEnterForeground(); m_isWindowActive = true; } break; @@ -607,14 +607,14 @@ bool CCEGLView::handleEvents() case NAVIGATOR_WINDOW_FULLSCREEN: if (!m_isWindowActive) { - CCApplication::sharedApplication().applicationWillEnterForeground(); + CCApplication::sharedApplication()->applicationWillEnterForeground(); m_isWindowActive = true; } break; case NAVIGATOR_WINDOW_THUMBNAIL: if (m_isWindowActive) { - CCApplication::sharedApplication().applicationDidEnterBackground(); + CCApplication::sharedApplication()->applicationDidEnterBackground(); m_isWindowActive = false; } break; diff --git a/cocos2dx/platform/blackberry/CCEGLView.h b/cocos2dx/platform/blackberry/CCEGLView.h index 2580d61cfb..27e07421f0 100644 --- a/cocos2dx/platform/blackberry/CCEGLView.h +++ b/cocos2dx/platform/blackberry/CCEGLView.h @@ -48,7 +48,7 @@ public: /** @brief get the shared main open gl window */ - static CCEGLView sharedOpenGLView(); + static CCEGLView* sharedOpenGLView(); bool handleEvents(); diff --git a/cocos2dx/platform/blackberry/CCFileUtils.cpp b/cocos2dx/platform/blackberry/CCFileUtils.cpp index b67c9d1fd1..17cc9373ba 100644 --- a/cocos2dx/platform/blackberry/CCFileUtils.cpp +++ b/cocos2dx/platform/blackberry/CCFileUtils.cpp @@ -58,7 +58,7 @@ void CCFileUtils::purgeCachedEntries() static std::string fullPathFromRelativePathThreadSafe(const char* pszRelativePath) { std::string ret(""); - const char* pszRootPath = CCApplication::sharedApplication().getResourceRootPath(); + const char* pszRootPath = CCApplication::sharedApplication()->getResourceRootPath(); CCAssert(pszRootPath != NULL, "The resource root path must be set in the main.cpp"); std::string pstrRelativePath = pszRelativePath; From 57659d1584a50e80bd2fd85167dc4256629db5ad Mon Sep 17 00:00:00 2001 From: mustime Date: Tue, 21 Aug 2012 18:42:35 +0800 Subject: [PATCH 13/53] issue #1425: modifing pkg files for Lua --- cocos2dx/actions/CCActionInstant.cpp | 35 +++++++++++++++++++ cocos2dx/actions/CCActionInstant.h | 11 +++++- .../LuaCocos2d.cpp.REMOVED.git-id | 2 +- tools/tolua++/CCAction.pkg | 12 ++++++- tools/tolua++/CCAnimation.pkg | 1 + tools/tolua++/CCDirector.pkg | 2 ++ tools/tolua++/CCScheduler.pkg | 13 ------- tools/tolua++/CCTransition.pkg | 5 +++ tools/tolua++/CCTransitionProgress.pkg | 35 +++++++++++++++++++ tools/tolua++/Cocos2d.pkg | 1 + tools/tolua++/basic.lua | 9 +++-- tools/tolua++/ccTypes.pkg | 1 + 12 files changed, 109 insertions(+), 18 deletions(-) create mode 100644 tools/tolua++/CCTransitionProgress.pkg diff --git a/cocos2dx/actions/CCActionInstant.cpp b/cocos2dx/actions/CCActionInstant.cpp index 8a96c919d1..fcea27c44b 100644 --- a/cocos2dx/actions/CCActionInstant.cpp +++ b/cocos2dx/actions/CCActionInstant.cpp @@ -27,6 +27,7 @@ #include "CCActionInstant.h" #include "base_nodes/CCNode.h" #include "sprite_nodes/CCSprite.h" +#include "script_support/CCScriptSupport.h" #include "cocoa/CCZone.h" NS_CC_BEGIN @@ -376,6 +377,20 @@ CCCallFunc * CCCallFunc::create(CCObject* pSelectorTarget, SEL_CallFunc selector return NULL; } +CCCallFunc * CCCallFunc::create(int nHandler) +{ + CCCallFunc *pRet = new CCCallFunc(); + + if (pRet) { + pRet->m_nScriptHandler = nHandler; + pRet->autorelease(); + return pRet; + } + + CC_SAFE_DELETE(pRet); + return NULL; +} + bool CCCallFunc::initWithTarget(CCObject* pSelectorTarget) { if (pSelectorTarget) { @@ -419,6 +434,9 @@ void CCCallFunc::execute() { if (m_pCallFunc) { (m_pSelectorTarget->*m_pCallFunc)(); } + if (m_nScriptHandler) { + CCScriptEngineManager::sharedManager()->getScriptEngine()->executeFunctionByHandler(m_nScriptHandler); + } } // @@ -428,6 +446,9 @@ void CCCallFuncN::execute() { if (m_pCallFuncN) { (m_pSelectorTarget->*m_pCallFuncN)(m_pTarget); } + if (m_nScriptHandler) { + CCScriptEngineManager::sharedManager()->getScriptEngine()->executeFunctionWithCCObject(m_nScriptHandler, m_pTarget, "CCNode"); + } } CCCallFuncN * CCCallFuncN::actionWithTarget(CCObject* pSelectorTarget, SEL_CallFuncN selector) @@ -449,6 +470,20 @@ CCCallFuncN * CCCallFuncN::create(CCObject* pSelectorTarget, SEL_CallFuncN selec return NULL; } +CCCallFuncN * CCCallFuncN::create(int nHandler) +{ + CCCallFuncN *pRet = new CCCallFuncN(); + + if (pRet) { + pRet->m_nScriptHandler = nHandler; + pRet->autorelease(); + return pRet; + } + + CC_SAFE_DELETE(pRet); + return NULL; +} + bool CCCallFuncN::initWithTarget(CCObject* pSelectorTarget, SEL_CallFuncN selector) { if (CCCallFunc::initWithTarget(pSelectorTarget)) { diff --git a/cocos2dx/actions/CCActionInstant.h b/cocos2dx/actions/CCActionInstant.h index 6b77ff69af..cedb7a2ab6 100644 --- a/cocos2dx/actions/CCActionInstant.h +++ b/cocos2dx/actions/CCActionInstant.h @@ -215,6 +215,7 @@ public: CCCallFunc() : m_pSelectorTarget(NULL) , m_pCallFunc(NULL) + , m_nScriptHandler(0) { } virtual ~CCCallFunc() @@ -233,7 +234,10 @@ public: */ static CCCallFunc * create(CCObject* pSelectorTarget, SEL_CallFunc selector); - /** initializes the action with the callback + // for lua + static CCCallFunc * create(int nHandler); + + /** initializes the action with the callback typedef void (CCObject::*SEL_CallFunc)(); */ @@ -263,6 +267,8 @@ protected: /** Target that will be called */ CCObject* m_pSelectorTarget; + int m_nScriptHandler; + union { SEL_CallFunc m_pCallFunc; @@ -292,6 +298,9 @@ public: typedef void (CCObject::*SEL_CallFuncN)(CCNode*); */ static CCCallFuncN * create(CCObject* pSelectorTarget, SEL_CallFuncN selector); + + static CCCallFuncN * create(int nHandler); + /** initializes the action with the callback typedef void (CCObject::*SEL_CallFuncN)(CCNode*); diff --git a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id index 6ca4bf16e0..dc4294bc52 100644 --- a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id +++ b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id @@ -1 +1 @@ -0b7cd029edf3970b0b444a943661d09f58aeba3d \ No newline at end of file +7aff15afa879ea4b61124205ef40e28b879e17e9 \ No newline at end of file diff --git a/tools/tolua++/CCAction.pkg b/tools/tolua++/CCAction.pkg index 3181a2ebba..d01ad2a2f8 100644 --- a/tools/tolua++/CCAction.pkg +++ b/tools/tolua++/CCAction.pkg @@ -91,7 +91,7 @@ class CCSpawn : public CCActionInterval CCActionInterval* reverse(void); static CCFiniteTimeAction* create(CCArray *actions); - static CCFiniteTimeAction* create(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2); + static CCFiniteTimeAction* createWithTwoActions(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2); }; class CCRotateTo : public CCActionInterval @@ -328,3 +328,13 @@ class CCPlace : public CCActionInstant // static CCPlace* create(CCPoint pos); }; + +class CCCallFunc : public CCActioninstant +{ + static CCCallFunc* create(LUA_FUNCTION funcID); +}; + +class CCCallFuncN : public CCCallFunc +{ + static CCCallFuncN* create(LUA_FUNCTION funcID); +}; diff --git a/tools/tolua++/CCAnimation.pkg b/tools/tolua++/CCAnimation.pkg index 8001ec4033..ac8161b33a 100644 --- a/tools/tolua++/CCAnimation.pkg +++ b/tools/tolua++/CCAnimation.pkg @@ -40,6 +40,7 @@ class CCAnimation : public CCObject float getDuration(); + CCAnimation* copy(); CCArray* getFrames(); void setFrames(CCArray* pFrames); diff --git a/tools/tolua++/CCDirector.pkg b/tools/tolua++/CCDirector.pkg index d57327dc27..7de1da1fb9 100644 --- a/tools/tolua++/CCDirector.pkg +++ b/tools/tolua++/CCDirector.pkg @@ -38,5 +38,7 @@ class CCDirector : public CCObject CCKeypadDispatcher* getKeypadDispatcher(); CCAccelerometer* getAccelerometer(); + void setDepthTest(bool var); + static CCDirector* sharedDirector(void); }; diff --git a/tools/tolua++/CCScheduler.pkg b/tools/tolua++/CCScheduler.pkg index 4c4032b34e..f749f35422 100644 --- a/tools/tolua++/CCScheduler.pkg +++ b/tools/tolua++/CCScheduler.pkg @@ -16,17 +16,4 @@ class CCScheduler : public CCObject unsigned int scheduleScriptFunc(LUA_FUNCTION funcID, float fInterval, bool bPaused); void unscheduleScriptEntry(unsigned int uScheduleScriptEntryID); - - void scheduleUpdateForTarget(CCObject *pTarget, int nPriority, bool bPaused); - void unscheduleUpdateForTarget(CCObject *pTarget); - - void unscheduleAllSelectorsForTarget(CCObject *pTarget); - void unscheduleAllSelectors(void); - - void unscheduleAllSelectorsWithMinPriority(int nMinPriority); - - void pauseTarget(CCObject *pTarget); - void resumeTarget(CCObject *pTarget); - bool isTargetPaused(CCObject *pTarget); - }; diff --git a/tools/tolua++/CCTransition.pkg b/tools/tolua++/CCTransition.pkg index 8ca9834ba3..19b0c61cae 100644 --- a/tools/tolua++/CCTransition.pkg +++ b/tools/tolua++/CCTransition.pkg @@ -10,6 +10,11 @@ typedef enum { kOrientationDownOver = 1, } tOrientation; +class CCTransitionScene : public CCScene +{ + static CCTransitionScene* create(float t, CCScene* scene); +}; + class CCTransitionSceneOriented : public CCScene { static CCTransitionSceneOriented* create(float t, CCScene* scene, tOrientation o); diff --git a/tools/tolua++/CCTransitionProgress.pkg b/tools/tolua++/CCTransitionProgress.pkg new file mode 100644 index 0000000000..d7a4f5cc89 --- /dev/null +++ b/tools/tolua++/CCTransitionProgress.pkg @@ -0,0 +1,35 @@ +class CCTransitionProgress : public CCTransitionScene +{ + static CCTransitionProgress* create(float t, CCScene* scene); +}; + +class CCTransitionProgressRadialCCW : public CCTransitionProgress +{ + static CCTransitionProgressRadialCCW* create(float t, CCScene* scene); +}; + +class CCTransitionProgressRadialCW : public CCTransitionProgress +{ + static CCTransitionProgressRadialCW* create(float t, CCScene* scene); +}; + +class CCTransitionProgressHorizontal : public CCTransitionProgress +{ + static CCTransitionProgressHorizontal* create(float t, CCScene* scene); +}; + +class CCTransitionProgressVertical : public CCTransitionProgress +{ + static CCTransitionProgressVertical* create(float t, CCScene* scene); +}; + +class CCTransitionProgressInOut : public CCTransitionProgress +{ + static CCTransitionProgressInOut* create(float t, CCScene* scene); +}; + +class CCTransitionProgressOutIn : public CCTransitionProgress +{ + static CCTransitionProgressOutIn* create(float t, CCScene* scene); +}; + diff --git a/tools/tolua++/Cocos2d.pkg b/tools/tolua++/Cocos2d.pkg index ca4c798f14..d78da213f9 100644 --- a/tools/tolua++/Cocos2d.pkg +++ b/tools/tolua++/Cocos2d.pkg @@ -57,6 +57,7 @@ $pfile "CCTMXTiledMap.pkg" $pfile "CCTMXXMLParser.pkg" $pfile "CCTouch.pkg" $pfile "CCTransition.pkg" +$pfile "CCTransitionProgress.pkg" $pfile "ccTypes.pkg" $pfile "CCUserDefault.pkg" $pfile "matrix.pkg" diff --git a/tools/tolua++/basic.lua b/tools/tolua++/basic.lua index 8997610623..714dd98939 100644 --- a/tools/tolua++/basic.lua +++ b/tools/tolua++/basic.lua @@ -10,8 +10,6 @@ local CCObjectTypes = { "CCActionInstant", "CCCallFunc", "CCCallFuncN", - "CCCallFuncND", - "CCCallFuncO", "CCFlipX", "CCFlipY", "CCHide", @@ -146,6 +144,13 @@ local CCObjectTypes = { "CCTransitionSplitCols", "CCTransitionSplitRows", "CCTransitionTurnOffTiles", + "CCTransitionProgress", + "CCTransitionProgressRadialCCW", + "CCTransitionProgressRadialCW", + "CCTransitionProgressHorizontal", + "CCTransitionProgressVertical", + "CCTransitionProgressInOut", + "CCTransitionProgressOutIn", "CCSprite", "CCLabelTTF", "CCTextFieldTTF", diff --git a/tools/tolua++/ccTypes.pkg b/tools/tolua++/ccTypes.pkg index 69e9088f60..fc93830008 100644 --- a/tools/tolua++/ccTypes.pkg +++ b/tools/tolua++/ccTypes.pkg @@ -8,6 +8,7 @@ typedef unsigned char GLubyte; typedef unsigned short GLushort; typedef unsigned int GLuint; typedef float GLfloat; +typedef short GLshort; typedef struct _ccColor3B { From d76d9a64517dece6f3dcc4599feaa093356ff881 Mon Sep 17 00:00:00 2001 From: Dale Ducharme Date: Tue, 21 Aug 2012 13:32:28 -0400 Subject: [PATCH 14/53] Adding lua scripting to BlackBerry port. --- samples/HelloCpp/proj.blackberry/.cproject | 4 +- samples/HelloLua/Resources/hello.lua | 8 +- samples/HelloLua/proj.blackberry/.cproject | 738 ++++++++++++++++++ samples/HelloLua/proj.blackberry/.project | 97 +++ .../proj.blackberry/bar-descriptor.xml | 132 ++++ samples/HelloLua/proj.blackberry/main.cpp | 34 + scripting/lua/proj.blackberry/.cproject | 550 +++++++++++++ scripting/lua/proj.blackberry/.project | 93 +++ 8 files changed, 1651 insertions(+), 5 deletions(-) create mode 100644 samples/HelloLua/proj.blackberry/.cproject create mode 100644 samples/HelloLua/proj.blackberry/.project create mode 100644 samples/HelloLua/proj.blackberry/bar-descriptor.xml create mode 100644 samples/HelloLua/proj.blackberry/main.cpp create mode 100644 scripting/lua/proj.blackberry/.cproject create mode 100644 scripting/lua/proj.blackberry/.project diff --git a/samples/HelloCpp/proj.blackberry/.cproject b/samples/HelloCpp/proj.blackberry/.cproject index e5c28e0fe2..c3615f5b11 100644 --- a/samples/HelloCpp/proj.blackberry/.cproject +++ b/samples/HelloCpp/proj.blackberry/.cproject @@ -68,7 +68,7 @@