From afbed7ee3231535132dc88545002d49b91b72dc3 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Thu, 12 Jun 2014 20:16:52 +0900 Subject: [PATCH 01/27] Fix video scale issue in iOS --- cocos/ui/UIVideoPlayerIOS.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cocos/ui/UIVideoPlayerIOS.mm b/cocos/ui/UIVideoPlayerIOS.mm index 7bf359f822..6d0600d921 100644 --- a/cocos/ui/UIVideoPlayerIOS.mm +++ b/cocos/ui/UIVideoPlayerIOS.mm @@ -333,9 +333,13 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, uint32_t flags auto uiLeft = (frameSize.width / 2 + (leftBottom.x - winSize.width / 2 ) * glView->getScaleX()) / scaleFactor; auto uiTop = (frameSize.height /2 - (rightTop.y - winSize.height / 2) * glView->getScaleY()) / scaleFactor; + CCEAGLView *eaglView = (CCEAGLView*) glView->getEAGLView(); + auto uiHeight = (rightTop.x - leftBottom.x) * glView->getScaleX() / scaleFactor / [eaglView contentScaleFactor]; + auto uiWidth = (rightTop.y - leftBottom.y) * glView->getScaleY()/scaleFactor / [eaglView contentScaleFactor]; + [((UIVideoViewWrapperIos*)_videoView) setFrame :uiLeft :uiTop - :(rightTop.x - leftBottom.x) * glView->getScaleX() / scaleFactor - :( (rightTop.y - leftBottom.y) * glView->getScaleY()/scaleFactor)]; + :uiHeight + :uiWidth]; } #if CC_VIDEOPLAYER_DEBUG_DRAW From bc5f4d9d598daf1de58eb007f393aea962b89614 Mon Sep 17 00:00:00 2001 From: Reck Hou Date: Mon, 16 Jun 2014 16:05:40 +0800 Subject: [PATCH 02/27] Optimize FPS control algorithm under Android. --- .../org/cocos2dx/lib/Cocos2dxRenderer.java | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java index a40d06019e..14cb7739c6 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java @@ -82,31 +82,30 @@ public class Cocos2dxRenderer implements GLSurfaceView.Renderer { @Override public void onDrawFrame(final GL10 gl) { /* - * FPS controlling algorithm is not accurate, and it will slow down FPS - * on some devices. So comment FPS controlling code. + * No need to use algorithm in default(60 FPS) situation, + * since onDrawFrame() was called by system 60 times per second by default. */ + if (sAnimationInterval <= 1.0 / 60 * Cocos2dxRenderer.NANOSECONDSPERSECOND) { + Cocos2dxRenderer.nativeRender(); + } else { + final long now = System.nanoTime(); + final long interval = now - this.mLastTickInNanoSeconds; - /* - final long nowInNanoSeconds = System.nanoTime(); - final long interval = nowInNanoSeconds - this.mLastTickInNanoSeconds; - */ - - // should render a frame when onDrawFrame() is called or there is a - // "ghost" - Cocos2dxRenderer.nativeRender(); - - /* - // fps controlling - if (interval < Cocos2dxRenderer.sAnimationInterval) { - try { - // because we render it before, so we should sleep twice time interval - Thread.sleep((Cocos2dxRenderer.sAnimationInterval - interval) / Cocos2dxRenderer.NANOSECONDSPERMICROSECOND); - } catch (final Exception e) { + if (interval < Cocos2dxRenderer.sAnimationInterval) { + try { + Thread.sleep((Cocos2dxRenderer.sAnimationInterval - interval) / Cocos2dxRenderer.NANOSECONDSPERMICROSECOND); + } catch (final Exception e) { + } } + /* + * Render time MUST be counted in, or the FPS will slower than appointed. + */ + final long renderStart = System.nanoTime(); + Cocos2dxRenderer.nativeRender(); + final long renderEnd = System.nanoTime(); + final long renderInterval = renderEnd - renderStart; + this.mLastTickInNanoSeconds = renderEnd - renderInterval; } - - this.mLastTickInNanoSeconds = nowInNanoSeconds; - */ } // =========================================================== From 46ac5d12b2c99ca6fc30a08472a88e4b871c5f8e Mon Sep 17 00:00:00 2001 From: wagulu Date: Wed, 23 Jul 2014 21:04:17 +0800 Subject: [PATCH 03/27] Update CCParticleSystem.cpp diff is base on WorldSpace, when you scale scene,you will get the wrong value. --- cocos/2d/CCParticleSystem.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index 25c1066098..917c6bf81d 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -771,7 +771,12 @@ void ParticleSystem::update(float dt) Vec2 newPos; - if (_positionType == PositionType::FREE || _positionType == PositionType::RELATIVE) + if (_positionType == PositionType::FREE) + { + Vec2 diff = converToNodeSpace(currentPosition) - convertToNodeSpace(p-> startPos); + newPos = p->pos - diff; + } + else if(_positionType == PositionType::RELATIVE) { Vec2 diff = currentPosition - p->startPos; newPos = p->pos - diff; From 44c675f9ee0ad8524163867f7b9b5a05e0025dfb Mon Sep 17 00:00:00 2001 From: Reck Hou Date: Thu, 24 Jul 2014 19:22:17 +0800 Subject: [PATCH 04/27] Fix: Application::setAnimationInterval() not implemented. --- cocos/platform/android/CCApplication.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cocos/platform/android/CCApplication.cpp b/cocos/platform/android/CCApplication.cpp index 9cfaf5d8a8..e3afdb9ba2 100644 --- a/cocos/platform/android/CCApplication.cpp +++ b/cocos/platform/android/CCApplication.cpp @@ -68,7 +68,16 @@ int Application::run() void Application::setAnimationInterval(double interval) { - // NYI + JniMethodInfo methodInfo; + if (! JniHelper::getStaticMethodInfo(methodInfo, "org/cocos2dx/lib/Cocos2dxRenderer", "setAnimationInterval", + "(D)V")) + { + CCLOG("%s %d: error to get methodInfo", __FILE__, __LINE__); + } + else + { + methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, interval); + } } ////////////////////////////////////////////////////////////////////////// From 2f10e8e468444019fbf3d10f1a2aec3364fbcbac Mon Sep 17 00:00:00 2001 From: LiuZhuo Date: Fri, 25 Jul 2014 11:40:23 +0800 Subject: [PATCH 05/27] Update CCParticleSystem.cpp --- cocos/2d/CCParticleSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index 917c6bf81d..1dc57a04f2 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -773,7 +773,7 @@ void ParticleSystem::update(float dt) if (_positionType == PositionType::FREE) { - Vec2 diff = converToNodeSpace(currentPosition) - convertToNodeSpace(p-> startPos); + Vec2 diff = convertToNodeSpace(currentPosition) - convertToNodeSpace(p-> startPos); newPos = p->pos - diff; } else if(_positionType == PositionType::RELATIVE) From 4ee13994ce116b6340e0fccea9860a08f32472a3 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Fri, 25 Jul 2014 13:10:16 +0900 Subject: [PATCH 06/27] Fix Scale issue on cocos2d-x cpp-test --- cocos/ui/UIVideoPlayerIOS.mm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cocos/ui/UIVideoPlayerIOS.mm b/cocos/ui/UIVideoPlayerIOS.mm index 6d0600d921..2877a3dbcc 100644 --- a/cocos/ui/UIVideoPlayerIOS.mm +++ b/cocos/ui/UIVideoPlayerIOS.mm @@ -323,7 +323,7 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, uint32_t flags auto directorInstance = Director::getInstance(); auto glView = directorInstance->getOpenGLView(); auto frameSize = glView->getFrameSize(); - auto scaleFactor = directorInstance->getContentScaleFactor(); + auto scaleFactor = [((CCEAGLView*) glView->getEAGLView()) contentScaleFactor]; auto winSize = directorInstance->getWinSize(); @@ -333,13 +333,9 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, uint32_t flags auto uiLeft = (frameSize.width / 2 + (leftBottom.x - winSize.width / 2 ) * glView->getScaleX()) / scaleFactor; auto uiTop = (frameSize.height /2 - (rightTop.y - winSize.height / 2) * glView->getScaleY()) / scaleFactor; - CCEAGLView *eaglView = (CCEAGLView*) glView->getEAGLView(); - auto uiHeight = (rightTop.x - leftBottom.x) * glView->getScaleX() / scaleFactor / [eaglView contentScaleFactor]; - auto uiWidth = (rightTop.y - leftBottom.y) * glView->getScaleY()/scaleFactor / [eaglView contentScaleFactor]; - [((UIVideoViewWrapperIos*)_videoView) setFrame :uiLeft :uiTop - :uiHeight - :uiWidth]; + :(rightTop.x - leftBottom.x) * glView->getScaleX() / scaleFactor + :( (rightTop.y - leftBottom.y) * glView->getScaleY()/scaleFactor)]; } #if CC_VIDEOPLAYER_DEBUG_DRAW From 3502cb0a23a17967fac4a7bccaf7d2e52297a2c6 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 23 Jul 2014 18:52:03 +0800 Subject: [PATCH 07/27] fix remove self in Widget touch callback issue --- cocos/ui/UIWidget.cpp | 10 ++- .../CocoStudioGUITest/CocosGUIScene.cpp | 2 +- .../UIButtonTest/UIButtonTest.cpp | 77 +++++++++++++++++++ .../UIButtonTest/UIButtonTest.h | 13 ++++ .../CocoStudioGUITest/UISceneManager.cpp | 4 +- .../UITest/CocoStudioGUITest/UISceneManager.h | 1 + 6 files changed, 103 insertions(+), 4 deletions(-) diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index c6cab6ec0c..e0e62dd4e8 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -719,6 +719,7 @@ void Widget::onTouchCancelled(Touch *touch, Event *unusedEvent) void Widget::pushDownEvent() { + this->retain(); if (_touchEventCallback) { _touchEventCallback(this, TouchEventType::BEGAN); } @@ -727,10 +728,12 @@ void Widget::pushDownEvent() { (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_BEGAN); } + this->release(); } void Widget::moveEvent() { + this->retain(); if (_touchEventCallback) { _touchEventCallback(this, TouchEventType::MOVED); } @@ -739,11 +742,12 @@ void Widget::moveEvent() { (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_MOVED); } + this->release(); } void Widget::releaseUpEvent() { - + this->retain(); if (_touchEventCallback) { _touchEventCallback(this, TouchEventType::ENDED); } @@ -752,10 +756,12 @@ void Widget::releaseUpEvent() { (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_ENDED); } + this->release(); } void Widget::cancelUpEvent() { + this->retain(); if (_touchEventCallback) { _touchEventCallback(this, TouchEventType::CANCELED); @@ -765,7 +771,7 @@ void Widget::cancelUpEvent() { (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_CANCELED); } - + this->release(); } void Widget::addTouchEventListener(Ref *target, SEL_TouchEvent selector) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 7f56938d5e..9b0ec74364 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -51,7 +51,7 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(kUIButtonTest); sceneManager->setMinUISceneId(kUIButtonTest); - sceneManager->setMaxUISceneId(kUIButtonTest_Title); + sceneManager->setMaxUISceneId(kUIButtonTest_RemoveSelf); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 35c713551b..7e4e9a0016 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -344,3 +344,80 @@ void UIButtonTest_Title::touchEvent(Ref *pSender, Widget::TouchEventType type) break; } } + + +// UIButtonTest_RemoveSelf +UIButtonTest_RemoveSelf::UIButtonTest_RemoveSelf() +: _displayValueLabel(nullptr) +{ + +} + +UIButtonTest_RemoveSelf::~UIButtonTest_RemoveSelf() +{ +} + +bool UIButtonTest_RemoveSelf::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + // Add a label in which the button events will be displayed + _displayValueLabel = Text::create("No Event", "fonts/Marker Felt.ttf",32); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + _uiLayer->addChild(_displayValueLabel); + + // Add the alert + Text* alert = Text::create("Button Callback RemoveSelf shouldn't crash!","fonts/Marker Felt.ttf",30); + alert->setColor(Color3B(159, 168, 176)); + + alert->setPosition(Vec2(widgetSize.width / 2.0f, + widgetSize.height / 2.0f - alert->getContentSize().height * 1.75f)); + + _uiLayer->addChild(alert); + + // Create the button + Button* button = Button::create("cocosui/animationbuttonnormal.png", + "cocosui/animationbuttonpressed.png"); + button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + // button->addTouchEventListener(this, toucheventselector(UIButtonTest::touchEvent)); + button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_RemoveSelf::touchEvent, this)); + _uiLayer->addChild(button); + + + + return true; + } + return false; +} + +void UIButtonTest_RemoveSelf::touchEvent(Ref *pSender, Widget::TouchEventType type) +{ + switch (type) + { + case Widget::TouchEventType::BEGAN: + _displayValueLabel->setString(String::createWithFormat("Touch Down")->getCString()); + break; + + case Widget::TouchEventType::MOVED: + _displayValueLabel->setString(String::createWithFormat("Touch Move")->getCString()); + break; + + case Widget::TouchEventType::ENDED: + { + _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); + + _uiLayer->removeFromParentAndCleanup(true); + } + break; + + case Widget::TouchEventType::CANCELED: + _displayValueLabel->setString(String::createWithFormat("Touch Cancelled")->getCString()); + break; + + default: + break; + } +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h index 0cf2f01c8f..18f0671567 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h @@ -79,4 +79,17 @@ protected: Text* _displayValueLabel; }; +class UIButtonTest_RemoveSelf : public UIScene +{ +public: + UIButtonTest_RemoveSelf(); + ~UIButtonTest_RemoveSelf(); + bool init(); + void touchEvent(Ref *pSender, Widget::TouchEventType type); + +protected: + UI_SCENE_CREATE_FUNC(UIButtonTest_RemoveSelf) + Text* _displayValueLabel; +}; + #endif /* defined(__TestCpp__UIButtonTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index edbecf2bd2..86b145881b 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -45,6 +45,7 @@ static const char* s_testArray[] = "UIButtonTest_Scale9", "UIButtonTest_PressedAction", "UIButtonTest_Title", + "UIButtonTest_RemoveSelf", "UICheckBoxTest", "UISliderTest", "UISliderTest_Scale9", @@ -190,7 +191,8 @@ Scene *UISceneManager::currentUIScene() case kUIButtonTest_Title: return UIButtonTest_Title::sceneWithTitle(s_testArray[_currentUISceneId]); - + case kUIButtonTest_RemoveSelf: + return UIButtonTest_RemoveSelf::sceneWithTitle(s_testArray[_currentUISceneId]); case kUICheckBoxTest: return UICheckBoxTest::sceneWithTitle(s_testArray[_currentUISceneId]); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index 0dd94ad395..c576308d96 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -35,6 +35,7 @@ enum kUIButtonTest_Scale9, kUIButtonTest_PressedAction, kUIButtonTest_Title, + kUIButtonTest_RemoveSelf, kUICheckBoxTest, kUISliderTest, kUISliderTest_Scale9, From b9cfa4a8b51ad0f7643feb8eb3b10f801555a577 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 25 Jul 2014 14:38:02 +0800 Subject: [PATCH 08/27] fix warn --- cocos/2d/CCLabel.cpp | 5 +++-- cocos/base/ccUtils.h | 4 ++-- cocos/ui/UILayoutParameter.h | 2 -- extensions/GUI/CCScrollView/CCScrollView.h | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 6071882ea9..ab0b98023c 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -881,11 +881,12 @@ void Label::drawShadowWithoutBlur() void Label::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { // Don't do calculate the culling if the transform was not updated - _insideBounds = (flags & FLAGS_TRANSFORM_DIRTY) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; + bool transformUpdated = flags & FLAGS_TRANSFORM_DIRTY; + _insideBounds = transformUpdated ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; if(_insideBounds) { _customCommand.init(_globalZOrder); - _customCommand.func = CC_CALLBACK_0(Label::onDraw, this, transform, flags); + _customCommand.func = CC_CALLBACK_0(Label::onDraw, this, transform, transformUpdated); renderer->addCommand(&_customCommand); } } diff --git a/cocos/base/ccUtils.h b/cocos/base/ccUtils.h index 39204ae6e5..faf95cf4a0 100644 --- a/cocos/base/ccUtils.h +++ b/cocos/base/ccUtils.h @@ -74,8 +74,8 @@ namespace utils */ std::vector CC_DLL findChildren(const Node &node, const std::string &name); - /** Same to ::atof, but strip the string, remain 7 numbers after '.' before call atof。 - * Why we need this? Because in android c++_static, atof ( and std::atof ) is unsupported for numbers have long decimal part and contain several numbers can approximate to 1 ( like 90.099998474121094 ), it will return inf. this function is used to fix this bug. + /** Same to ::atof, but strip the string, remain 7 numbers after '.' before call atof. + * Why we need this? Because in android c++_static, atof ( and std::atof ) is unsupported for numbers have long decimal part and contain several numbers can approximate to 1 ( like 90.099998474121094 ), it will return inf. this function is used to fix this bug. */ double CC_DLL atof(const char* str); } diff --git a/cocos/ui/UILayoutParameter.h b/cocos/ui/UILayoutParameter.h index 4862e91e68..0fcdc98794 100644 --- a/cocos/ui/UILayoutParameter.h +++ b/cocos/ui/UILayoutParameter.h @@ -135,8 +135,6 @@ protected: class LayoutParameterProtocol { public: - LayoutParameterProtocol(){} - virtual ~LayoutParameterProtocol(){} virtual LayoutParameter* getLayoutParameter() const= 0; }; diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index b8df096ef1..e4d62a7947 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -41,7 +41,7 @@ NS_CC_EXT_BEGIN class ScrollView; -class ScrollViewDelegate +class CC_EX_DLL ScrollViewDelegate { public: /** From e56e015be2b468c6eca4e5956f60d8b8f18911a5 Mon Sep 17 00:00:00 2001 From: andyque Date: Fri, 25 Jul 2014 14:40:58 +0800 Subject: [PATCH 09/27] minor modification of tests --- .../UIButtonTest/UIButtonTest.cpp | 14 +++++++------- .../CocoStudioGUITest/UIButtonTest/UIButtonTest.h | 8 ++++---- .../UITest/CocoStudioGUITest/UISceneManager.cpp | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 7e4e9a0016..8b8e7959dd 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -347,17 +347,17 @@ void UIButtonTest_Title::touchEvent(Ref *pSender, Widget::TouchEventType type) // UIButtonTest_RemoveSelf -UIButtonTest_RemoveSelf::UIButtonTest_RemoveSelf() +UIButtonTestRemoveSelf::UIButtonTestRemoveSelf() : _displayValueLabel(nullptr) { } -UIButtonTest_RemoveSelf::~UIButtonTest_RemoveSelf() +UIButtonTestRemoveSelf::~UIButtonTestRemoveSelf() { } -bool UIButtonTest_RemoveSelf::init() +bool UIButtonTestRemoveSelf::init() { if (UIScene::init()) { @@ -370,11 +370,11 @@ bool UIButtonTest_RemoveSelf::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - Text* alert = Text::create("Button Callback RemoveSelf shouldn't crash!","fonts/Marker Felt.ttf",30); + Text* alert = Text::create("Remove Self in the Button's Callback shouldn't cause crash!","fonts/Marker Felt.ttf",10); alert->setColor(Color3B(159, 168, 176)); alert->setPosition(Vec2(widgetSize.width / 2.0f, - widgetSize.height / 2.0f - alert->getContentSize().height * 1.75f)); + widgetSize.height / 2.0f - alert->getContentSize().height * 2.75f)); _uiLayer->addChild(alert); @@ -383,7 +383,7 @@ bool UIButtonTest_RemoveSelf::init() "cocosui/animationbuttonpressed.png"); button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); // button->addTouchEventListener(this, toucheventselector(UIButtonTest::touchEvent)); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_RemoveSelf::touchEvent, this)); + button->addTouchEventListener(CC_CALLBACK_2(UIButtonTestRemoveSelf::touchEvent, this)); _uiLayer->addChild(button); @@ -393,7 +393,7 @@ bool UIButtonTest_RemoveSelf::init() return false; } -void UIButtonTest_RemoveSelf::touchEvent(Ref *pSender, Widget::TouchEventType type) +void UIButtonTestRemoveSelf::touchEvent(Ref *pSender, Widget::TouchEventType type) { switch (type) { diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h index 18f0671567..48031ba3b3 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h @@ -79,16 +79,16 @@ protected: Text* _displayValueLabel; }; -class UIButtonTest_RemoveSelf : public UIScene +class UIButtonTestRemoveSelf : public UIScene { public: - UIButtonTest_RemoveSelf(); - ~UIButtonTest_RemoveSelf(); + UIButtonTestRemoveSelf(); + ~UIButtonTestRemoveSelf(); bool init(); void touchEvent(Ref *pSender, Widget::TouchEventType type); protected: - UI_SCENE_CREATE_FUNC(UIButtonTest_RemoveSelf) + UI_SCENE_CREATE_FUNC(UIButtonTestRemoveSelf) Text* _displayValueLabel; }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index 86b145881b..85076bd987 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -192,7 +192,7 @@ Scene *UISceneManager::currentUIScene() case kUIButtonTest_Title: return UIButtonTest_Title::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIButtonTest_RemoveSelf: - return UIButtonTest_RemoveSelf::sceneWithTitle(s_testArray[_currentUISceneId]); + return UIButtonTestRemoveSelf::sceneWithTitle(s_testArray[_currentUISceneId]); case kUICheckBoxTest: return UICheckBoxTest::sceneWithTitle(s_testArray[_currentUISceneId]); From 7353f8685af4a1111d8f579be11652d1a0a0c59e Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 24 Jul 2014 11:52:42 +0800 Subject: [PATCH 10/27] Simplify Widget ContentSize cascade change algorithm --- cocos/ui/UIWidget.cpp | 7 +- .../CocoStudioGUITest/CocosGUIScene.cpp | 2 +- .../UIImageViewTest/UIImageViewTest.cpp | 68 +++++++++++++++++++ .../UIImageViewTest/UIImageViewTest.h | 9 +++ .../CocoStudioGUITest/UISceneManager.cpp | 4 +- .../UITest/CocoStudioGUITest/UISceneManager.h | 1 + 6 files changed, 84 insertions(+), 7 deletions(-) diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index c6cab6ec0c..f16248a3b8 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -319,7 +319,6 @@ void Widget::setSizePercent(const Vec2 &percent) this->setContentSize(cSize); } _customSize = cSize; - onSizeChanged(); } void Widget::updateSizeAndPosition() @@ -373,7 +372,8 @@ void Widget::updateSizeAndPosition(const cocos2d::Size &parentSize) default: break; } - onSizeChanged(); + + //update position & position percent Vec2 absPos = getPosition(); switch (_positionType) { @@ -426,7 +426,6 @@ void Widget::ignoreContentAdaptWithSize(bool ignore) { this->setContentSize(_customSize); } - onSizeChanged(); } bool Widget::isIgnoreContentAdaptWithSize() const @@ -486,7 +485,6 @@ void Widget::updateContentSizeWithTextureSize(const cocos2d::Size &size) { this->setContentSize(_customSize); } - onSizeChanged(); } void Widget::setTouchEnabled(bool enable) @@ -1036,7 +1034,6 @@ void Widget::copyProperties(Widget *widget) { setLayoutParameter(iter->second->clone()); } - onSizeChanged(); } void Widget::setFlippedX(bool flippedX) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 7f56938d5e..04e6c0eead 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -87,7 +87,7 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(kUIImageViewTest); sceneManager->setMinUISceneId(kUIImageViewTest); - sceneManager->setMaxUISceneId(kUIImageViewTest_Scale9); + sceneManager->setMaxUISceneId(kUIImageViewTest_ContentSize); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp index a8b34f408e..01978a4e86 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp @@ -61,3 +61,71 @@ bool UIImageViewTest_Scale9::init() } return false; } + +// UIImageViewTest_ContentSize + +bool UIImageViewTest_ContentSize::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + Text* alert = Text::create("ImageView ContentSize Change", "fonts/Marker Felt.ttf", 26); + alert->setColor(Color3B(159, 168, 176)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, + widgetSize.height / 2.0f - alert->getContentSize().height * 2.125f)); + + _uiLayer->addChild(alert); + + Text *status = Text::create("child ImageView position percent", "fonts/Marker Felt.ttf", 16); + status->setColor(Color3B::RED); + status->setPosition(Vec2(widgetSize.width/2, widgetSize.height/2 + 80)); + _uiLayer->addChild(status,20); + + // Create the imageview + ImageView* imageView = ImageView::create("cocosui/buttonHighlighted.png"); + imageView->setScale9Enabled(true); + imageView->setContentSize(Size(200, 80)); + imageView->setPosition(Vec2(widgetSize.width / 2.0f, + widgetSize.height / 2.0f )); + + + ImageView* imageViewChild = ImageView::create("cocosui/buttonHighlighted.png"); + imageViewChild->setScale9Enabled(true); + imageViewChild->setSizeType(Widget::SizeType::PERCENT); + imageViewChild->setPositionType(Widget::PositionType::PERCENT); + imageViewChild->setSizePercent(Vec2::ANCHOR_MIDDLE); + imageViewChild->setPositionPercent(Vec2::ANCHOR_MIDDLE); + imageViewChild->setPosition(Vec2(widgetSize.width / 2.0f, + widgetSize.height / 2.0f)); + + ImageView* imageViewChild2 = ImageView::create("cocosui/buttonHighlighted.png"); + imageViewChild2->setScale9Enabled(true); + imageViewChild2->setSizeType(Widget::SizeType::PERCENT); + imageViewChild2->setPositionType(Widget::PositionType::PERCENT); + imageViewChild2->setSizePercent(Vec2::ANCHOR_MIDDLE); + imageViewChild2->setPositionPercent(Vec2::ANCHOR_MIDDLE); + imageViewChild->addChild(imageViewChild2); + + + imageView->addChild(imageViewChild); + + imageView->setTouchEnabled(true); + imageView->addTouchEventListener([=](Ref* sender, Widget::TouchEventType type){ + if (type == Widget::TouchEventType::ENDED) { + float width = CCRANDOM_0_1() * 200 + 50; + float height = CCRANDOM_0_1() * 80 + 30; + imageView->setContentSize(Size(width, height)); + + imageViewChild->setPositionPercent(Vec2(CCRANDOM_0_1(), CCRANDOM_0_1())); + status->setString(StringUtils::format("child ImageView position percent: %f, %f", + imageViewChild->getPositionPercent().x, imageViewChild->getPositionPercent().y)); + } + }); + + _uiLayer->addChild(imageView); + + return true; + } + return false; +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h index 7067bbb407..a70668751c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h @@ -45,4 +45,13 @@ protected: UI_SCENE_CREATE_FUNC(UIImageViewTest_Scale9) }; +class UIImageViewTest_ContentSize : public UIScene +{ +public: + bool init(); + +protected: + UI_SCENE_CREATE_FUNC(UIImageViewTest_ContentSize) +}; + #endif /* defined(__TestCpp__UIImageViewTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index edbecf2bd2..444a95c75b 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -58,6 +58,7 @@ static const char* s_testArray[] = */ "UIImageViewTest", "UIImageViewTest_Scale9", + "UIImageViewTest_ContentSize", "UILoadingBarTest_Left", "UILoadingBarTest_Right", "UILoadingBarTest_Left_Scale9", @@ -205,7 +206,8 @@ Scene *UISceneManager::currentUIScene() case kUIImageViewTest_Scale9: return UIImageViewTest_Scale9::sceneWithTitle(s_testArray[_currentUISceneId]); - + case kUIImageViewTest_ContentSize: + return UIImageViewTest_ContentSize::sceneWithTitle(s_testArray[_currentUISceneId]); case kUILoadingBarTest_Left: return UILoadingBarTest_Left::sceneWithTitle(s_testArray[_currentUISceneId]); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index 0dd94ad395..ccda1e8905 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -48,6 +48,7 @@ enum */ kUIImageViewTest, kUIImageViewTest_Scale9, + kUIImageViewTest_ContentSize, kUILoadingBarTest_Left, kUILoadingBarTest_Right, kUILoadingBarTest_Left_Scale9, From c66ebbf528dd3f3bd7956cc104047e48d1c800a8 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Fri, 25 Jul 2014 16:41:12 +0900 Subject: [PATCH 11/27] Fix void* casting --- cocos/ui/UIVideoPlayerIOS.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/ui/UIVideoPlayerIOS.mm b/cocos/ui/UIVideoPlayerIOS.mm index 2877a3dbcc..3f84e28b8a 100644 --- a/cocos/ui/UIVideoPlayerIOS.mm +++ b/cocos/ui/UIVideoPlayerIOS.mm @@ -323,7 +323,7 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, uint32_t flags auto directorInstance = Director::getInstance(); auto glView = directorInstance->getOpenGLView(); auto frameSize = glView->getFrameSize(); - auto scaleFactor = [((CCEAGLView*) glView->getEAGLView()) contentScaleFactor]; + auto scaleFactor = [static_cast(glView->getEAGLView()) contentScaleFactor]; auto winSize = directorInstance->getWinSize(); From e3b79f41506bbbdc85a9b94b7f884906fbc279fe Mon Sep 17 00:00:00 2001 From: boyu0 Date: Fri, 25 Jul 2014 18:01:32 +0800 Subject: [PATCH 12/27] delete Image::_preMulti, Deprecate Image::isPremultipliedAlpha(), change Image::hasPremultipliedAlpha() meaning. --- cocos/platform/CCImage.cpp | 19 ++++++++++--------- cocos/platform/CCImage.h | 3 +-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index 07335110cd..907904b302 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -455,7 +455,6 @@ Image::Image() , _unpack(false) , _fileType(Format::UNKOWN) , _renderFormat(Texture2D::PixelFormat::NONE) -, _preMulti(false) , _numberOfMipmaps(0) , _hasPremultipliedAlpha(true) { @@ -875,7 +874,7 @@ bool Image::initWithJpgData(const unsigned char * data, ssize_t dataLen) /* init image info */ _width = cinfo.output_width; _height = cinfo.output_height; - _preMulti = false; + _hasPremultipliedAlpha = false; row_pointer[0] = static_cast(malloc(cinfo.output_width*cinfo.output_components * sizeof(unsigned char))); CC_BREAK_IF(! row_pointer[0]); @@ -1043,7 +1042,7 @@ bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen) } else { - _preMulti = false; + _hasPremultipliedAlpha = false; } if (row_pointers != nullptr) @@ -1216,7 +1215,7 @@ bool Image::initWithTiffData(const unsigned char * data, ssize_t dataLen) { /* the raster data is pre-multiplied by the alpha component after invoking TIFFReadRGBAImageOriented*/ - _preMulti = true; + _hasPremultipliedAlpha = true; memcpy(_data, raster, npixels*sizeof (uint32)); } @@ -1288,7 +1287,9 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) Configuration *configuration = Configuration::getInstance(); - _hasPremultipliedAlpha = false; + //can not detect the premultiplied alpha from pvr file. + + unsigned int flags = CC_SWAP_INT32_LITTLE_TO_HOST(header->flags); PVR2TexturePixelFormat formatFlags = static_cast(flags & PVR_TEXTURE_FLAG_TYPE_MASK); bool flipped = (flags & (unsigned int)PVR2TextureFlag::VerticalFlip) ? true : false; @@ -1478,7 +1479,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) // PVRv3 specifies premultiply alpha in a flag -- should always respect this in PVRv3 files if (flags & (unsigned int)PVR3TextureFlag::PremultipliedAlpha) { - _preMulti = true; + _hasPremultipliedAlpha = true; } // sizing @@ -1706,7 +1707,7 @@ bool Image::initWithTGAData(tImageTGA* tgaData) _dataLen = _width * _height * tgaData->pixelDepth / 8; _fileType = Format::TGA; - _preMulti = false; + _hasPremultipliedAlpha = false; ret = true; @@ -2056,7 +2057,7 @@ bool Image::initWithRawData(const unsigned char * data, ssize_t dataLen, int wid _height = height; _width = width; - _preMulti = preMulti; + _hasPremultipliedAlpha = preMulti; _renderFormat = Texture2D::PixelFormat::RGBA8888; // only RGBA8888 supported @@ -2351,7 +2352,7 @@ void Image::premultipliedAlpha() fourBytes[i] = CC_RGB_PREMULTIPLY_ALPHA(p[0], p[1], p[2], p[3]); } - _preMulti = true; + _hasPremultipliedAlpha = true; } NS_CC_END diff --git a/cocos/platform/CCImage.h b/cocos/platform/CCImage.h index 9cb49f63d1..46d49aa93c 100644 --- a/cocos/platform/CCImage.h +++ b/cocos/platform/CCImage.h @@ -122,10 +122,10 @@ public: inline Texture2D::PixelFormat getRenderFormat() { return _renderFormat; } inline int getWidth() { return _width; } inline int getHeight() { return _height; } - inline bool isPremultipliedAlpha() { return _preMulti; } inline int getNumberOfMipmaps() { return _numberOfMipmaps; } inline MipmapInfo* getMipmaps() { return _mipmaps; } inline bool hasPremultipliedAlpha() { return _hasPremultipliedAlpha; } + CC_DEPRECATED_ATTRIBUTE inline bool isPremultipliedAlpha() { return _hasPremultipliedAlpha; } int getBitPerPixel(); bool hasAlpha(); @@ -171,7 +171,6 @@ protected: bool _unpack; Format _fileType; Texture2D::PixelFormat _renderFormat; - bool _preMulti; MipmapInfo _mipmaps[MIPMAP_MAX]; // pointer to mipmap images int _numberOfMipmaps; // false if we cann't auto detect the image is premultiplied or not. From 34a8d26124313d6be9f7cc8b58829eaf5638625a Mon Sep 17 00:00:00 2001 From: boyu0 Date: Fri, 25 Jul 2014 18:19:04 +0800 Subject: [PATCH 13/27] Deprecate Texture2D::PVRImagesHavePremultipliedAlpha(), move Texture2D::PVRImagesHavePremultipliedAlpha() to Image. --- cocos/platform/CCImage.cpp | 12 ++++++++++-- cocos/platform/CCImage.h | 9 +++++++++ cocos/renderer/CCTexture2D.cpp | 22 ++++------------------ cocos/renderer/CCTexture2D.h | 4 +++- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index 907904b302..835ab73422 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -97,6 +97,8 @@ namespace { static const int PVR_TEXTURE_FLAG_TYPE_MASK = 0xff; + static bool _PVRHaveAlphaPremultiplied = false; + // Values taken from PVRTexture.h from http://www.imgtec.com enum class PVR2TextureFlag { @@ -1287,8 +1289,8 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) Configuration *configuration = Configuration::getInstance(); - //can not detect the premultiplied alpha from pvr file. - + //can not detect the premultiplied alpha from pvr file, use _PVRHaveAlphaPremultiplied instead. + _hasPremultipliedAlpha = _PVRHaveAlphaPremultiplied; unsigned int flags = CC_SWAP_INT32_LITTLE_TO_HOST(header->flags); PVR2TexturePixelFormat formatFlags = static_cast(flags & PVR_TEXTURE_FLAG_TYPE_MASK); @@ -2355,5 +2357,11 @@ void Image::premultipliedAlpha() _hasPremultipliedAlpha = true; } + +void Image::PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied) +{ + _PVRHaveAlphaPremultiplied = haveAlphaPremultiplied; +} + NS_CC_END diff --git a/cocos/platform/CCImage.h b/cocos/platform/CCImage.h index 46d49aa93c..e31a35c3cd 100644 --- a/cocos/platform/CCImage.h +++ b/cocos/platform/CCImage.h @@ -138,6 +138,15 @@ public: @param isToRGB whether the image is saved as RGB format. */ bool saveToFile(const std::string &filename, bool isToRGB = true); + + + /** treats (or not) PVR files as if they have alpha premultiplied. + Since it is impossible to know at runtime if the PVR images have the alpha channel premultiplied, it is + possible load them as if they have (or not) the alpha channel premultiplied. + + By default it is disabled. + */ + static void PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied); protected: bool initWithJpgData(const unsigned char * data, ssize_t dataLen); diff --git a/cocos/renderer/CCTexture2D.cpp b/cocos/renderer/CCTexture2D.cpp index d120aa3112..602eed20f5 100644 --- a/cocos/renderer/CCTexture2D.cpp +++ b/cocos/renderer/CCTexture2D.cpp @@ -121,8 +121,6 @@ const Texture2D::PixelFormatInfoMap Texture2D::_pixelFormatInfoTables(TexturePix // Default is: RGBA8888 (32-bit textures) static Texture2D::PixelFormat g_defaultAlphaPixelFormat = Texture2D::PixelFormat::DEFAULT; -static bool _PVRHaveAlphaPremultiplied = false; - ////////////////////////////////////////////////////////////////////////// //conventer function @@ -779,20 +777,8 @@ bool Texture2D::initWithImage(Image *image, PixelFormat format) } // set the premultiplied tag - if (!image->hasPremultipliedAlpha()) - { - if (image->getFileType() == Image::Format::PVR) - { - _hasPremultipliedAlpha = _PVRHaveAlphaPremultiplied; - }else - { - CCLOG("wanning: We cann't find the data is premultiplied or not, we will assume it's false."); - _hasPremultipliedAlpha = false; - } - }else - { - _hasPremultipliedAlpha = image->isPremultipliedAlpha(); - } + _hasPremultipliedAlpha = image->hasPremultipliedAlpha(); + return true; } } @@ -1218,10 +1204,10 @@ void Texture2D::drawInRect(const Rect& rect) void Texture2D::PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied) { - _PVRHaveAlphaPremultiplied = haveAlphaPremultiplied; + Image::PVRImagesHavePremultipliedAlpha(haveAlphaPremultiplied); } - + // // Use to apply MIN/MAG filter // diff --git a/cocos/renderer/CCTexture2D.h b/cocos/renderer/CCTexture2D.h index 97b515dc7e..ddd2d2f121 100644 --- a/cocos/renderer/CCTexture2D.h +++ b/cocos/renderer/CCTexture2D.h @@ -182,10 +182,12 @@ public: possible load them as if they have (or not) the alpha channel premultiplied. By default it is disabled. + + deprecated, please use Image::PVRImagesHavePremultipliedAlpha() instead. @since v0.99.5 */ - static void PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied); + CC_DEPRECATED_ATTRIBUTE static void PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied); public: /** From f7a08d5697ae12b3474ab53e98f677923245017e Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 28 Jul 2014 10:09:46 +0800 Subject: [PATCH 14/27] Fix the size of VideoPlayer is incorrect on android. --- .../android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java index 11ca29a137..48dc5d8d67 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java @@ -119,7 +119,7 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl mViewHeight = maxHeight; if (mVideoWidth != 0 && mVideoHeight != 0) { - fixSize(mViewLeft, mViewTop, mViewWidth, mVideoHeight); + fixSize(mViewLeft, mViewTop, mViewWidth, mViewHeight); } } @@ -324,7 +324,7 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl if (mFullScreenEnabled) { fixSize(0, 0, mFullScreenWidth, mFullScreenHeight); } else { - fixSize(mViewLeft, mViewTop, mViewWidth, mVideoHeight); + fixSize(mViewLeft, mViewTop, mViewWidth, mViewHeight); } } From 85b9765b8ffb7a58d8b9d9ad398d363e05bfe0d7 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 28 Jul 2014 10:38:22 +0800 Subject: [PATCH 15/27] Change Image::PVRImagesHavePremultipliedAlpha() to Image::setPVRImagesHavePremultipliedAlpha() --- cocos/platform/CCImage.cpp | 2 +- cocos/platform/CCImage.h | 2 +- cocos/renderer/CCTexture2D.cpp | 2 +- cocos/renderer/CCTexture2D.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index 835ab73422..08cd3e5f10 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -2358,7 +2358,7 @@ void Image::premultipliedAlpha() } -void Image::PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied) +void Image::setPVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied) { _PVRHaveAlphaPremultiplied = haveAlphaPremultiplied; } diff --git a/cocos/platform/CCImage.h b/cocos/platform/CCImage.h index e31a35c3cd..483ea686ff 100644 --- a/cocos/platform/CCImage.h +++ b/cocos/platform/CCImage.h @@ -146,7 +146,7 @@ public: By default it is disabled. */ - static void PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied); + static void setPVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied); protected: bool initWithJpgData(const unsigned char * data, ssize_t dataLen); diff --git a/cocos/renderer/CCTexture2D.cpp b/cocos/renderer/CCTexture2D.cpp index 602eed20f5..1857c24d43 100644 --- a/cocos/renderer/CCTexture2D.cpp +++ b/cocos/renderer/CCTexture2D.cpp @@ -1204,7 +1204,7 @@ void Texture2D::drawInRect(const Rect& rect) void Texture2D::PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied) { - Image::PVRImagesHavePremultipliedAlpha(haveAlphaPremultiplied); + Image::setPVRImagesHavePremultipliedAlpha(haveAlphaPremultiplied); } diff --git a/cocos/renderer/CCTexture2D.h b/cocos/renderer/CCTexture2D.h index ddd2d2f121..9944c2b163 100644 --- a/cocos/renderer/CCTexture2D.h +++ b/cocos/renderer/CCTexture2D.h @@ -183,7 +183,7 @@ public: By default it is disabled. - deprecated, please use Image::PVRImagesHavePremultipliedAlpha() instead. + deprecated, please use Image::setPVRImagesHavePremultipliedAlpha() instead. @since v0.99.5 */ From a6d5f7cca874ad34f6d84bcffc4a586fca2cc614 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 28 Jul 2014 10:44:30 +0800 Subject: [PATCH 16/27] [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 6ff1e5efd7..216378ba75 100644 --- a/AUTHORS +++ b/AUTHORS @@ -909,6 +909,7 @@ Developers: gin0606 Add a new line at the end of a file Fix a bug that crash happened when try to remove videoView(STATE_PLAYBACK_COMPLETED) in android + Fix video scale issue in iOS billtt Fixed a bug that Node::setScale(float) may not work properly From a878bd27dbe2e5f2bea6885667e6b863128ed122 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 28 Jul 2014 10:50:13 +0800 Subject: [PATCH 17/27] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 28a4cb64e3..e3bd65b1fc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,7 @@ cocos2d-x-3.3 ?? [FIX] UIListView: can not insert an item in specific position, it is added at bottom [FIX] TabelView: can handle touch event though its parents are invisible [FIX] TextField: can not use backspace to delete a character + [FIX] UIVideoPlayer: video frame size is not calculated correctly on iOS [FIX] Others: can not import java library shift by engine correctly when using Eclispe on Android From 823bd437d896e346903c5ba12a5cc85fe57bfa50 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Mon, 28 Jul 2014 11:14:11 +0800 Subject: [PATCH 18/27] Refactor #5580: Improve searchFullPathForFilename and comments --- cocos/platform/CCFileUtils.cpp | 30 +++++------------------------- cocos/platform/CCFileUtils.h | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/cocos/platform/CCFileUtils.cpp b/cocos/platform/CCFileUtils.cpp index 181df15699..9b4a9c0953 100644 --- a/cocos/platform/CCFileUtils.cpp +++ b/cocos/platform/CCFileUtils.cpp @@ -880,39 +880,19 @@ std::string FileUtils::getFullPathForDirectoryAndFilename(const std::string& dir std::string FileUtils::searchFullPathForFilename(const std::string& filename) const { - // If filename is absolute path, we don't need to consider 'search paths' and 'resolution orders'. if (isAbsolutePath(filename)) { return filename; } - - // Already Cached ? - auto cacheIter = _fullPathCache.find(filename); - if( cacheIter != _fullPathCache.end() ) + std::string path = const_cast(this)->fullPathForFilename(filename); + if (0 == path.compare(filename)) { - return cacheIter->second; + return ""; } - - // Get the new file name. - const std::string newFilename( getNewFilename(filename) ); - - std::string fullpath; - - for (auto searchIt = _searchPathArray.cbegin(); searchIt != _searchPathArray.cend(); ++searchIt) + else { - for (auto resolutionIt = _searchResolutionsOrderArray.cbegin(); resolutionIt != _searchResolutionsOrderArray.cend(); ++resolutionIt) - { - fullpath = const_cast(this)->getPathForFilename(newFilename, *resolutionIt, *searchIt); - - if (!fullpath.empty()) - { - // Using the filename passed in as key. - const_cast(this)->_fullPathCache.insert(std::make_pair(filename, fullpath)); - return fullpath; - } - } + return path; } - return ""; } bool FileUtils::isFileExist(const std::string& filename) const diff --git a/cocos/platform/CCFileUtils.h b/cocos/platform/CCFileUtils.h index c90a889733..7419dcea23 100644 --- a/cocos/platform/CCFileUtils.h +++ b/cocos/platform/CCFileUtils.h @@ -407,12 +407,16 @@ protected: virtual std::string getNewFilename(const std::string &filename) const; /** - * Checks whether file exists without considering search paths and resolution orders. + * Checks whether a file exists without considering search paths and resolution orders. + * @param The file (with absolute path) to look up for + * @return Returns true if the file found at the given absolute path, otherwise returns false */ virtual bool isFileExistInternal(const std::string& filename) const = 0; /** - * Checks whether file exists without considering search paths and resolution orders. + * Checks whether a directory exists without considering search paths and resolution orders. + * @param The directory (with absolute path) to look up for + * @return Returns true if the directory found at the given absolute path, otherwise returns false */ virtual bool isDirectoryExistInternal(const std::string& dirPath) const; @@ -438,7 +442,14 @@ protected: */ virtual std::string getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename); - + /** + * Returns the fullpath for a given filename. + * This is an alternative for fullPathForFilename, there are two main differences: + * First, it returns empty string instead of the original filename when no file found for the given name. + * Secondly, it's a const function. + * @param filename The file name to look up for + * @return The full path for the file, if not found, the return value will be an empty string + */ virtual std::string searchFullPathForFilename(const std::string& filename) const; From 3688ff5d2363df5369eb39d5bd71767a59e5b969 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 28 Jul 2014 11:36:50 +0800 Subject: [PATCH 19/27] [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 216378ba75..4707493aec 100644 --- a/AUTHORS +++ b/AUTHORS @@ -936,6 +936,9 @@ Developers: yongkangchen Fixed a bug that font size of EditBox is not scaled when glview is scaled on Mac OS X Fixed a bug that Label::setTextColor does not have any effect on Mac OS X + + wagulu + Fixed a bug that particle effect is wrong when scaled Retired Core Developers: WenSheng Yang From af3955f60c3474986dfb725ea229e5766deb0657 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 28 Jul 2014 11:37:59 +0800 Subject: [PATCH 20/27] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index e3bd65b1fc..74424fdfb9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,7 @@ cocos2d-x-3.3 ?? [FIX] EditBox: font size is not scaled when glview is scaled on Mac OS X [FIX] Label: can not set charmap after it is created [FIX] Label: setTextColor does not have any effect on Mac OS X + [FIX] ParticleSystem: effect is wrong if scene scaled [FIX] Scale9Sprite: new added sprite will be hidden [FIX] UIListView: can not insert an item in specific position, it is added at bottom [FIX] TabelView: can handle touch event though its parents are invisible From 12042bfd9de5dab083c5001e3e55fcdff9c5cf00 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Mon, 28 Jul 2014 03:38:12 +0000 Subject: [PATCH 21/27] [AUTO]: updating luabinding automatically --- .../scripting/lua-bindings/auto/api/Image.lua | 14 +- .../lua-bindings/auto/api/Texture2D.lua | 5 - .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 125 ++++++------------ .../lua-bindings/auto/lua_cocos2dx_auto.hpp | 1 - 4 files changed, 47 insertions(+), 98 deletions(-) diff --git a/cocos/scripting/lua-bindings/auto/api/Image.lua b/cocos/scripting/lua-bindings/auto/api/Image.lua index b491b70e7c..4ce6cd8d50 100644 --- a/cocos/scripting/lua-bindings/auto/api/Image.lua +++ b/cocos/scripting/lua-bindings/auto/api/Image.lua @@ -16,11 +16,6 @@ -- @param #bool bool -- @return bool#bool ret (return value: bool) --------------------------------- --- @function [parent=#Image] getBitPerPixel --- @param self --- @return int#int ret (return value: int) - -------------------------------- -- @function [parent=#Image] hasAlpha -- @param self @@ -48,9 +43,9 @@ -- @return int#int ret (return value: int) -------------------------------- --- @function [parent=#Image] isPremultipliedAlpha +-- @function [parent=#Image] getBitPerPixel -- @param self --- @return bool#bool ret (return value: bool) +-- @return int#int ret (return value: int) -------------------------------- -- @function [parent=#Image] getFileType @@ -67,6 +62,11 @@ -- @param self -- @return int#int ret (return value: int) +-------------------------------- +-- @function [parent=#Image] setPVRImagesHavePremultipliedAlpha +-- @param self +-- @param #bool bool + -------------------------------- -- @function [parent=#Image] Image -- @param self diff --git a/cocos/scripting/lua-bindings/auto/api/Texture2D.lua b/cocos/scripting/lua-bindings/auto/api/Texture2D.lua index 81a1947825..c7c1456291 100644 --- a/cocos/scripting/lua-bindings/auto/api/Texture2D.lua +++ b/cocos/scripting/lua-bindings/auto/api/Texture2D.lua @@ -150,11 +150,6 @@ -- @param self -- @return int#int ret (return value: int) --------------------------------- --- @function [parent=#Texture2D] PVRImagesHavePremultipliedAlpha --- @param self --- @param #bool bool - -------------------------------- -- @function [parent=#Texture2D] Texture2D -- @param self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index bc2442b771..959a3237c1 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -3500,38 +3500,6 @@ int lua_cocos2dx_Texture2D_getDefaultAlphaPixelFormat(lua_State* tolua_S) #endif return 0; } -int lua_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Texture2D",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Texture2D:PVRImagesHavePremultipliedAlpha"); - if(!ok) - return 0; - cocos2d::Texture2D::PVRImagesHavePremultipliedAlpha(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Texture2D:PVRImagesHavePremultipliedAlpha",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha'.",&tolua_err); -#endif - return 0; -} int lua_cocos2dx_Texture2D_constructor(lua_State* tolua_S) { int argc = 0; @@ -3606,7 +3574,6 @@ int lua_register_cocos2dx_Texture2D(lua_State* tolua_S) tolua_function(tolua_S,"setMaxS",lua_cocos2dx_Texture2D_setMaxS); tolua_function(tolua_S,"setDefaultAlphaPixelFormat", lua_cocos2dx_Texture2D_setDefaultAlphaPixelFormat); tolua_function(tolua_S,"getDefaultAlphaPixelFormat", lua_cocos2dx_Texture2D_getDefaultAlphaPixelFormat); - tolua_function(tolua_S,"PVRImagesHavePremultipliedAlpha", lua_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha); tolua_endmodule(tolua_S); std::string typeName = typeid(cocos2d::Texture2D).name(); g_luaType[typeName] = "cc.Texture2D"; @@ -44744,50 +44711,6 @@ int lua_cocos2dx_Image_saveToFile(lua_State* tolua_S) return 0; } -int lua_cocos2dx_Image_getBitPerPixel(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Image* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_getBitPerPixel'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - int ret = cobj->getBitPerPixel(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getBitPerPixel",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getBitPerPixel'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_Image_hasAlpha(lua_State* tolua_S) { int argc = 0; @@ -45011,7 +44934,7 @@ int lua_cocos2dx_Image_getWidth(lua_State* tolua_S) return 0; } -int lua_cocos2dx_Image_isPremultipliedAlpha(lua_State* tolua_S) +int lua_cocos2dx_Image_getBitPerPixel(lua_State* tolua_S) { int argc = 0; cocos2d::Image* cobj = nullptr; @@ -45031,7 +44954,7 @@ int lua_cocos2dx_Image_isPremultipliedAlpha(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_isPremultipliedAlpha'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_getBitPerPixel'", nullptr); return 0; } #endif @@ -45041,16 +44964,16 @@ int lua_cocos2dx_Image_isPremultipliedAlpha(lua_State* tolua_S) { if(!ok) return 0; - bool ret = cobj->isPremultipliedAlpha(); - tolua_pushboolean(tolua_S,(bool)ret); + int ret = cobj->getBitPerPixel(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:isPremultipliedAlpha",argc, 0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getBitPerPixel",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_isPremultipliedAlpha'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getBitPerPixel'.",&tolua_err); #endif return 0; @@ -45187,6 +45110,38 @@ int lua_cocos2dx_Image_getRenderFormat(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Image:setPVRImagesHavePremultipliedAlpha"); + if(!ok) + return 0; + cocos2d::Image::setPVRImagesHavePremultipliedAlpha(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Image:setPVRImagesHavePremultipliedAlpha",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha'.",&tolua_err); +#endif + return 0; +} int lua_cocos2dx_Image_constructor(lua_State* tolua_S) { int argc = 0; @@ -45236,16 +45191,16 @@ int lua_register_cocos2dx_Image(lua_State* tolua_S) tolua_function(tolua_S,"new",lua_cocos2dx_Image_constructor); tolua_function(tolua_S,"hasPremultipliedAlpha",lua_cocos2dx_Image_hasPremultipliedAlpha); tolua_function(tolua_S,"saveToFile",lua_cocos2dx_Image_saveToFile); - tolua_function(tolua_S,"getBitPerPixel",lua_cocos2dx_Image_getBitPerPixel); tolua_function(tolua_S,"hasAlpha",lua_cocos2dx_Image_hasAlpha); tolua_function(tolua_S,"isCompressed",lua_cocos2dx_Image_isCompressed); tolua_function(tolua_S,"getHeight",lua_cocos2dx_Image_getHeight); tolua_function(tolua_S,"initWithImageFile",lua_cocos2dx_Image_initWithImageFile); tolua_function(tolua_S,"getWidth",lua_cocos2dx_Image_getWidth); - tolua_function(tolua_S,"isPremultipliedAlpha",lua_cocos2dx_Image_isPremultipliedAlpha); + tolua_function(tolua_S,"getBitPerPixel",lua_cocos2dx_Image_getBitPerPixel); tolua_function(tolua_S,"getFileType",lua_cocos2dx_Image_getFileType); tolua_function(tolua_S,"getNumberOfMipmaps",lua_cocos2dx_Image_getNumberOfMipmaps); tolua_function(tolua_S,"getRenderFormat",lua_cocos2dx_Image_getRenderFormat); + tolua_function(tolua_S,"setPVRImagesHavePremultipliedAlpha", lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha); tolua_endmodule(tolua_S); std::string typeName = typeid(cocos2d::Image).name(); g_luaType[typeName] = "cc.Image"; diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index 5e6bd89644..0cff4e3b27 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -1574,7 +1574,6 @@ int register_all_cocos2dx(lua_State* tolua_S); - #endif // __cocos2dx_h__ From 152a9a04645714c830397e33d2db885f96804757 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 28 Jul 2014 14:02:16 +0800 Subject: [PATCH 22/27] [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 4707493aec..c6a0ecb2a6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -939,6 +939,9 @@ Developers: wagulu Fixed a bug that particle effect is wrong when scaled + + reckhou + Optimize FPS control on Android Retired Core Developers: WenSheng Yang From 4249311c0c9f5d131b96e26a7fd5298400b6990c Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 28 Jul 2014 14:07:40 +0800 Subject: [PATCH 23/27] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 74424fdfb9..44206a68e8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,6 +15,7 @@ cocos2d-x-3.3 ?? [FIX] UIVideoPlayer: video frame size is not calculated correctly on iOS [FIX] Others: can not import java library shift by engine correctly when using Eclispe on Android + [FIX] Others: optimize FPS contorl algorithm on Android [FIX] Lua-binding: replace dynamic_cast to std::is_base_of in object_to_luaval From cb68b006349e31724a1bf3f4130787b75e020435 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 28 Jul 2014 14:16:39 +0800 Subject: [PATCH 24/27] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 44206a68e8..8b48f633e7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,7 @@ cocos2d-x-3.3 ?? [FIX] TabelView: can handle touch event though its parents are invisible [FIX] TextField: can not use backspace to delete a character [FIX] UIVideoPlayer: video frame size is not calculated correctly on iOS + [FIX] UIWidget: may crash if remove itself in touch call back function [FIX] Others: can not import java library shift by engine correctly when using Eclispe on Android [FIX] Others: optimize FPS contorl algorithm on Android From 5b4ca604c28897b60b611db6f7a845ae1aa3f480 Mon Sep 17 00:00:00 2001 From: heliclei Date: Mon, 28 Jul 2014 14:26:49 +0800 Subject: [PATCH 25/27] [ci skip]send email to report build result --- .../jenkins-scripts/ci-dailybuild-android.py | 54 ++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/tools/jenkins-scripts/ci-dailybuild-android.py b/tools/jenkins-scripts/ci-dailybuild-android.py index 57c3d745ab..469ff1680a 100644 --- a/tools/jenkins-scripts/ci-dailybuild-android.py +++ b/tools/jenkins-scripts/ci-dailybuild-android.py @@ -5,7 +5,9 @@ from shutil import copy import sys import traceback import MySQLdb - +from email.mime.text import MIMEText +import smtplib +import datetime def check_current_3rd_libs(): #get current_libs config backup_files = range(2) @@ -51,22 +53,69 @@ def save_build_stats(filename, size): cursor.execute(sql) db.commit() db.close() + def scan_all_libs(): + stats = {} _path = 'tests/cpp-empty-test/proj.android/libs/armeabi/libcpp_empty_test.so' filesize = os.path.getsize(_path)/1024 + stats['libcpp_empty_test'] = filesize save_build_stats('libcpp_empty_test', filesize) _path = 'tests/lua-empty-test/project/proj.android/libs/armeabi/liblua_empty_test.so' filesize = os.path.getsize(_path)/1024 + stats['liblua_empty_test'] = filesize save_build_stats('liblua_empty_test', filesize) lib_path = './tests/cpp-tests/proj.android/obj/local/armeabi' for root, dirs, files in os.walk(lib_path): for _file in files: if not _file.endswith(".a"): continue + print _file libfile = lib_path + '/' + _file _filename = _file.split('.')[0] filesize = os.path.getsize(libfile)/1024 + stats[_filename]=filesize save_build_stats(_filename, filesize) + return stats + +def send_mail(sub,title,content): + #to_list = os.environ['EMAIL_LIST'].split(' ') + mail_user = os.environ['EMAIL_USER'] + mail_pass = os.environ['EMAIL_PWD'] + to_list = os.environ['EMAIL_LIST'].split(' ') + mail_postfix = 'gmail.com' + me = mail_user + "<" + mail_user + "@" + mail_postfix + ">" + msg = MIMEText(content, _subtype='plain', _charset='gb2312') + msg['Subject'] = sub + msg['From'] = me + msg['To'] = " ".join(to_list) + print 'to users:', msg['To'] + msg['Content'] = 'test' + try: + s = smtplib.SMTP('smtp.gmail.com', 587) + s.ehlo() + s.starttls() + s.login(mail_user,mail_pass) + s.sendmail(me, to_list, str(msg)) + print 'info:', me, to_list, str(msg) + s.close() + return True + except Exception, e: + print str(e) + return False + +def sendEmail(stats): + now = datetime.datetime.now() + sub = "Cocos2d-x Android dailybuild stats of " + now.strftime("%Y-%m-%d") + title = "Dailybuild stats" + content = "The following list tracks the sizes of Cocos2d-x Android built libraries:\n" + + for key in stats: + content += key + content += " : " + content += str(stats[key]) + "KB" + content += "\n" + + send_mail(sub, title, content) def main(): print 'Build Config:' @@ -89,7 +138,8 @@ def main(): ret = os.system('python build/android-build.py -b release all') if(ret == 0): strip_android_libs() - scan_all_libs() + stats = scan_all_libs() + sendEmail(stats) os.system('git clean -xdf -f') print 'build exit' print ret From bf6e706ab90ebca983e39391b85bcbcae6ae0247 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 28 Jul 2014 15:37:00 +0800 Subject: [PATCH 26/27] fix xcode project setting --- .../xcschemes/CocosDenshion Mac.xcscheme | 59 ------------------- .../xcschemes/CocosDenshion iOS.xcscheme | 59 ------------------- .../xcshareddata/xcschemes/box2d Mac.xcscheme | 59 ------------------- .../xcshareddata/xcschemes/box2d iOS.xcscheme | 59 ------------------- .../xcschemes/build all libs Mac.xcscheme | 59 ------------------- .../xcschemes/build all libs iOS.xcscheme | 59 ------------------- .../xcschemes/chipmunk Mac.xcscheme | 59 ------------------- .../xcschemes/chipmunk iOS.xcscheme | 59 ------------------- .../xcschemes/cocos2dx Mac.xcscheme | 59 ------------------- .../xcschemes/cocos2dx iOS.xcscheme | 59 ------------------- .../cocos2dx-extensions Mac.xcscheme | 59 ------------------- .../cocos2dx-extensions iOS.xcscheme | 59 ------------------- .../xcschemes/build all tests Mac.xcscheme | 20 ++++++- .../xcschemes/build all tests iOS.xcscheme | 20 ++++++- .../xcschemes/cpp-empty-test Mac.xcscheme | 2 +- .../xcschemes/cpp-empty-test iOS.xcscheme | 2 +- .../xcschemes/cpp-tests Mac.xcscheme | 2 +- .../xcschemes/cpp-tests iOS.xcscheme | 2 +- .../game-controller-test IOS.xcscheme | 2 +- .../xcschemes/lua-empty-test Mac.xcscheme | 2 +- .../xcschemes/lua-empty-test iOS.xcscheme | 2 +- .../lua-game-controller-test iOS.xcscheme | 2 +- .../xcschemes/lua-tests Mac.xcscheme | 2 +- .../xcschemes/lua-tests iOS.xcscheme | 2 +- .../xcschemes/luabindings Mac.xcscheme | 20 ++++++- .../xcschemes/luabindings iOS.xcscheme | 20 ++++++- 26 files changed, 86 insertions(+), 722 deletions(-) delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion iOS.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d iOS.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk iOS.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx iOS.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions Mac.xcscheme delete mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions iOS.xcscheme diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion Mac.xcscheme deleted file mode 100644 index dbf36bb025..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion iOS.xcscheme deleted file mode 100644 index c74eed7e60..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d Mac.xcscheme deleted file mode 100644 index f0be0b3387..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d iOS.xcscheme deleted file mode 100644 index 5e6d46462b..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme deleted file mode 100644 index 25dbc11dbb..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme deleted file mode 100644 index 170dc164b6..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk Mac.xcscheme deleted file mode 100644 index cae588170f..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk iOS.xcscheme deleted file mode 100644 index e433af4505..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme deleted file mode 100644 index 1edbfaa4c2..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx iOS.xcscheme deleted file mode 100644 index 82675f8fea..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions Mac.xcscheme deleted file mode 100644 index 6f6c9a919d..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions Mac.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions iOS.xcscheme deleted file mode 100644 index 9d554e8913..0000000000 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions iOS.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme index 2937783395..784723fab8 100644 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme index ecc2fd2528..ccac8c68e7 100644 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme index 17cd1fc940..2695cf3b5b 100644 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings iOS.xcscheme b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings iOS.xcscheme index ca661aa036..d9f900f7bb 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings iOS.xcscheme +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings iOS.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + From 98b0797c0eefc61205a57033cb7a67a712a72585 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 28 Jul 2014 15:41:33 +0800 Subject: [PATCH 27/27] add shared xcscheme --- .../xcschemes/build all libs Mac.xcscheme | 77 +++++++++++++++++++ .../xcschemes/build all libs iOS.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libbox2d Mac.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libbox2d iOS.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libchipmunk Mac.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libchipmunk iOS.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libcocos2d Mac.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libcocos2d iOS.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libcocosbuilder Mac.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libcocosbuilder iOS.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libcocosdenshion Mac.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libcocosdenshion iOS.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libcocostudio Mac.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libcocostudio iOS.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libextension Mac.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libextension iOS.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libnetwork Mac.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libnetwork iOS.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libspine Mac.xcscheme | 77 +++++++++++++++++++ .../xcschemes/libspine iOS.xcscheme | 77 +++++++++++++++++++ .../xcshareddata/xcschemes/libui Mac.xcscheme | 77 +++++++++++++++++++ .../xcshareddata/xcschemes/libui iOS.xcscheme | 77 +++++++++++++++++++ 22 files changed, 1694 insertions(+) create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d Mac.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d iOS.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk Mac.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk iOS.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d Mac.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d iOS.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder Mac.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder iOS.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion Mac.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion iOS.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio Mac.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio iOS.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension Mac.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension iOS.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork Mac.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork iOS.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine Mac.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine iOS.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui Mac.xcscheme create mode 100644 build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui iOS.xcscheme diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme new file mode 100644 index 0000000000..f57131f56a --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme new file mode 100644 index 0000000000..fcbd659bae --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d Mac.xcscheme new file mode 100644 index 0000000000..a660f083f3 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d iOS.xcscheme new file mode 100644 index 0000000000..e99ccec6a6 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk Mac.xcscheme new file mode 100644 index 0000000000..ee1a4e52a6 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk iOS.xcscheme new file mode 100644 index 0000000000..fe458520e3 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d Mac.xcscheme new file mode 100644 index 0000000000..644f4fba3f --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d iOS.xcscheme new file mode 100644 index 0000000000..3f87120c62 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder Mac.xcscheme new file mode 100644 index 0000000000..5afa747562 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder iOS.xcscheme new file mode 100644 index 0000000000..e25be6f519 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion Mac.xcscheme new file mode 100644 index 0000000000..29d3c9fed6 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion iOS.xcscheme new file mode 100644 index 0000000000..23cfbd87e0 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio Mac.xcscheme new file mode 100644 index 0000000000..5685108bbc --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio iOS.xcscheme new file mode 100644 index 0000000000..694e940085 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension Mac.xcscheme new file mode 100644 index 0000000000..547a4846c5 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension iOS.xcscheme new file mode 100644 index 0000000000..7468928ac2 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork Mac.xcscheme new file mode 100644 index 0000000000..f2e0e4d87d --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork iOS.xcscheme new file mode 100644 index 0000000000..77b899549f --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine Mac.xcscheme new file mode 100644 index 0000000000..7d9db72df8 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine iOS.xcscheme new file mode 100644 index 0000000000..bc42031fd3 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui Mac.xcscheme new file mode 100644 index 0000000000..fd629758eb --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui iOS.xcscheme new file mode 100644 index 0000000000..b419d0a349 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +