From 01ebb2ac29da884a966d6c8c6602ef1baed27cec Mon Sep 17 00:00:00 2001 From: PickleMan Date: Sun, 13 Oct 2013 23:41:55 -0400 Subject: [PATCH 001/428] Added triangle, quad bezier, cubic bezier drawing to DrawNode --- cocos/2d/CCDrawNode.cpp | 80 +++++++++++++++++++++++++++++++++++++++++ cocos/2d/CCDrawNode.h | 9 +++++ 2 files changed, 89 insertions(+) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 541bd8974c..288c88aba0 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -437,6 +437,86 @@ void DrawNode::drawPolygon(Point *verts, unsigned int count, const Color4F &fill free(extrude); } +void DrawNode::drawTriangle(const Point &p1, const Point &p2, const Point &p3, const Color4F &color) +{ + unsigned int vertex_count = 2*3; + ensureCapacity(vertex_count); + + Color4B col = Color4B(color); + V2F_C4B_T2F a = {Vertex2F(p1.x, p1.y), col, Tex2F(0.0, 0.0) }; + V2F_C4B_T2F b = {Vertex2F(p2.x, p2.y), col, Tex2F(0.0, 0.0) }; + V2F_C4B_T2F c = {Vertex2F(p3.x, p3.y), col, Tex2F(0.0, 0.0) }; + + V2F_C4B_T2F_Triangle *triangles = (V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); + V2F_C4B_T2F_Triangle triangle = {a, b, c}; + triangles[0] = triangle; + + _bufferCount += vertex_count; + _dirty = true; +} + +void DrawNode::drawCubicBezier(const Point& from, const Point& control1, const Point& control2, const Point& to, unsigned int segments, const Color4F &color) +{ + unsigned int vertex_count = (segments + 1) * 3; + ensureCapacity(vertex_count); + + Tex2F texCoord = Tex2F(0.0, 0.0); + Color4B col = Color4B(color); + Vertex2F vertex; + Vertex2F firstVertex = Vertex2F(from.x, from.y); + Vertex2F lastVertex = Vertex2F(to.x, to.y); + + float t = 0; + for(unsigned int i = segments + 1; i > 0; i--) + { + float x = powf(1 - t, 3) * from.x + 3.0f * powf(1 - t, 2) * t * control1.x + 3.0f * (1 - t) * t * t * control2.x + t * t * t * to.x; + float y = powf(1 - t, 3) * from.y + 3.0f * powf(1 - t, 2) * t * control1.y + 3.0f * (1 - t) * t * t * control2.y + t * t * t * to.y; + vertex = Vertex2F(x, y); + + V2F_C4B_T2F a = {firstVertex, col, texCoord }; + V2F_C4B_T2F b = {lastVertex, col, texCoord }; + V2F_C4B_T2F c = {vertex, col, texCoord }; + V2F_C4B_T2F_Triangle triangle = {a, b, c}; + ((V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount))[0] = triangle; + + lastVertex = vertex; + t += 1.0f / segments; + _bufferCount += 3; + } + _dirty = true; +} + +void DrawNode::drawQuadraticBezier(const Point& from, const Point& control, const Point& to, unsigned int segments, const Color4F &color) +{ + unsigned int vertex_count = (segments + 1) * 3; + ensureCapacity(vertex_count); + + Tex2F texCoord = Tex2F(0.0, 0.0); + Color4B col = Color4B(color); + Vertex2F vertex; + Vertex2F firstVertex = Vertex2F(from.x, from.y); + Vertex2F lastVertex = Vertex2F(to.x, to.y); + + float t = 0; + for(unsigned int i = segments + 1; i > 0; i--) + { + float x = powf(1 - t, 2) * from.x + 2.0f * (1 - t) * t * control.x + t * t * to.x; + float y = powf(1 - t, 2) * from.y + 2.0f * (1 - t) * t * control.y + t * t * to.y; + vertex = Vertex2F(x, y); + + V2F_C4B_T2F a = {firstVertex, col, texCoord }; + V2F_C4B_T2F b = {lastVertex, col, texCoord }; + V2F_C4B_T2F c = {vertex, col, texCoord }; + V2F_C4B_T2F_Triangle triangle = {a, b, c}; + ((V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount))[0] = triangle; + + lastVertex = vertex; + t += 1.0f / segments; + _bufferCount += 3; + } + _dirty = true; +} + void DrawNode::clear() { _bufferCount = 0; diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index 9349430880..231c87c07c 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -72,6 +72,15 @@ public: * @endcode */ void drawPolygon(Point *verts, unsigned int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor); + + /** draw a triangle with color */ + void drawTriangle(const Point &p1, const Point &p2, const Point &p3, const Color4F &color); + + /** draw a cubic bezier curve with color and number of segments */ + void drawCubicBezier(const Point& from, const Point& control1, const Point& control2, const Point& to, unsigned int segments, const Color4F &color); + + /** draw a quadratic bezier curve with color and number of segments */ + void drawQuadraticBezier(const Point& from, const Point& control, const Point& to, unsigned int segments, const Color4F &color) /** Clear the geometry in the node's buffer. */ void clear(); From 870f7de357c150fb9c7b7f6cc0f2e0aef32d7dfb Mon Sep 17 00:00:00 2001 From: ThePickleMan Date: Sun, 13 Oct 2013 23:12:41 -0500 Subject: [PATCH 002/428] Readded trimmed semicolon --- cocos/2d/CCDrawNode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index 231c87c07c..1978c26ef0 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -80,7 +80,7 @@ public: void drawCubicBezier(const Point& from, const Point& control1, const Point& control2, const Point& to, unsigned int segments, const Color4F &color); /** draw a quadratic bezier curve with color and number of segments */ - void drawQuadraticBezier(const Point& from, const Point& control, const Point& to, unsigned int segments, const Color4F &color) + void drawQuadraticBezier(const Point& from, const Point& control, const Point& to, unsigned int segments, const Color4F &color); /** Clear the geometry in the node's buffer. */ void clear(); From 3b5ae69ac8e9ffe01dd74034d5d9b7c86718d769 Mon Sep 17 00:00:00 2001 From: PickleMan Date: Mon, 14 Oct 2013 00:52:58 -0400 Subject: [PATCH 003/428] Added triangle, cubic bezier and quad bezier tests to DrawPrimitivesTest --- .../Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp index ca4f1f2be5..e236a189d9 100644 --- a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp +++ b/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp @@ -286,6 +286,14 @@ DrawNodeTest::DrawNodeTest() draw->drawSegment(Point(20,s.height), Point(20,s.height/2), 10, Color4F(0, 1, 0, 1)); draw->drawSegment(Point(10,s.height/2), Point(s.width/2, s.height/2), 40, Color4F(1, 0, 1, 0.5)); + + // Draw triangle + draw->drawTriangle(Point(10, 10), Point(70, 30), Point(100, 140), Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5)); + + // Draw some beziers + draw->drawQuadraticBezier(Point(s.width - 150, s.height - 150), Point(s.width - 70, s.height - 10), Point(s.width - 10, s.height - 10), 10, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5)); + + draw->drawCubicBezier(Point(s.width - 250, 40), Point(s.width - 70, 100), Point(s.width - 30, 250), Point(s.width - 10, s.height - 50), 10, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5)); } string DrawNodeTest::title() From 550245c6dc46cc165c0ef247a28a99a28df48923 Mon Sep 17 00:00:00 2001 From: Victor Buldakov Date: Mon, 4 Nov 2013 01:17:32 +0400 Subject: [PATCH 004/428] Add selected image to slider --- .../CCControlExtension/CCControlSlider.cpp | 64 ++++++++++++++++--- .../GUI/CCControlExtension/CCControlSlider.h | 38 +++++++++-- 2 files changed, 90 insertions(+), 12 deletions(-) diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index 80840c4482..52ab8d08b8 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -40,6 +40,7 @@ ControlSlider::ControlSlider() , _minimumAllowedValue(0.0f) , _maximumAllowedValue(0.0f) , _thumbSprite(NULL) +, _selectedThumbSprite(NULL) , _progressSprite(NULL) , _backgroundSprite(NULL) { @@ -49,6 +50,7 @@ ControlSlider::ControlSlider() ControlSlider::~ControlSlider() { CC_SAFE_RELEASE(_thumbSprite); + CC_SAFE_RELEASE(_selectedThumbSprite); CC_SAFE_RELEASE(_progressSprite); CC_SAFE_RELEASE(_backgroundSprite); } @@ -57,6 +59,21 @@ ControlSlider* ControlSlider::create(const char* bgFile, const char* progressFil { // Prepare background for slider Sprite *backgroundSprite = Sprite::create(bgFile); + + // Prepare progress for slider + Sprite *progressSprite = Sprite::create(progressFile); + + // Prepare thumb (menuItem) for slider + Sprite *thumbSprite = Sprite::create(thumbFile); + + return ControlSlider::create(backgroundSprite, progressSprite, thumbSprite); +} + +ControlSlider* ControlSlider::create(const char* bgFile, const char* progressFile, const char* thumbFile, + const char* selectedThumbSpriteFile) +{ + // Prepare background for slider + Sprite *backgroundSprite = Sprite::create(bgFile); // Prepare progress for slider Sprite *progressSprite = Sprite::create(progressFile); @@ -64,7 +81,10 @@ ControlSlider* ControlSlider::create(const char* bgFile, const char* progressFil // Prepare thumb (menuItem) for slider Sprite *thumbSprite = Sprite::create(thumbFile); - return ControlSlider::create(backgroundSprite, progressSprite, thumbSprite); + // Prepare selected thumb (menuItem) for slider + Sprite *selectedThumbSprite = Sprite::create(selectedThumbSpriteFile); + + return ControlSlider::create(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite); } ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite) @@ -75,13 +95,32 @@ ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressS return pRet; } - bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite) +ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite, + Sprite* selectedThumbSprite) +{ + ControlSlider *pRet = new ControlSlider(); + pRet->initWithSprites(backgroundSprite, pogressSprite, thumbSprite, selectedThumbSprite); + pRet->autorelease(); + return pRet; +} + +bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite) +{ + Sprite* selectedThumbSprite = Sprite::createWithTexture(thumbSprite->getTexture(), + thumbSprite->getTextureRect()); + selectedThumbSprite->setColor(Color3B::GRAY); + this->initWithSprites(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite); +} + + bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite, + Sprite* selectedThumbSprite) { if (Control::init()) { - CCASSERT(backgroundSprite, "Background sprite must be not nil"); - CCASSERT(progressSprite, "Progress sprite must be not nil"); - CCASSERT(thumbSprite, "Thumb sprite must be not nil"); + CCASSERT(backgroundSprite, "Background sprite must be not nil"); + CCASSERT(progressSprite, "Progress sprite must be not nil"); + CCASSERT(thumbSprite, "Thumb sprite must be not nil"); + CCASSERT(selectedThumbSprite, "Thumb sprite must be not nil"); ignoreAnchorPointForPosition(false); setTouchEnabled(true); @@ -89,6 +128,7 @@ ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressS this->setBackgroundSprite(backgroundSprite); this->setProgressSprite(progressSprite); this->setThumbSprite(thumbSprite); + this->setSelectedThumbSprite(selectedThumbSprite); // Defines the content size Rect maxRect = ControlUtils::RectUnion(backgroundSprite->getBoundingBox(), thumbSprite->getBoundingBox()); @@ -109,6 +149,10 @@ ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressS _thumbSprite->setPosition(Point(0.0f, this->getContentSize().height / 2)); addChild(_thumbSprite); + _selectedThumbSprite->setPosition(Point(0.0f, this->getContentSize().height / 2)); + _selectedThumbSprite->setVisible(false); + addChild(_selectedThumbSprite); + // Init default values _minimumValue = 0.0f; _maximumValue = 1.0f; @@ -228,7 +272,8 @@ void ControlSlider::onTouchEnded(Touch *pTouch, Event *pEvent) void ControlSlider::needsLayout() { - if (NULL == _thumbSprite || NULL == _backgroundSprite || NULL == _progressSprite) + if (NULL == _thumbSprite || NULL == _selectedThumbSprite || NULL == _backgroundSprite + || NULL == _progressSprite) { return; } @@ -238,6 +283,7 @@ void ControlSlider::needsLayout() Point pos = _thumbSprite->getPosition(); pos.x = percent * _backgroundSprite->getContentSize().width; _thumbSprite->setPosition(pos); + _selectedThumbSprite->setPosition(pos); // Stretches content proportional to newLevel Rect textureRect = _progressSprite->getTextureRect(); @@ -248,7 +294,8 @@ void ControlSlider::needsLayout() void ControlSlider::sliderBegan(Point location) { this->setSelected(true); - this->getThumbSprite()->setColor(Color3B::GRAY); + _thumbSprite->setVisible(false); + _selectedThumbSprite->setVisible(true); setValue(valueForLocation(location)); } @@ -263,7 +310,8 @@ void ControlSlider::sliderEnded(Point location) { setValue(valueForLocation(_thumbSprite->getPosition())); } - this->getThumbSprite()->setColor(Color3B::WHITE); + _thumbSprite->setVisible(true); + _selectedThumbSprite->setVisible(false); this->setSelected(false); } diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.h b/extensions/GUI/CCControlExtension/CCControlSlider.h index 2a9f782e2d..0a5f4a3779 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.h +++ b/extensions/GUI/CCControlExtension/CCControlSlider.h @@ -58,6 +58,22 @@ public: * @see initWithSprites */ static ControlSlider* create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite); + + /** + * Creates slider with a background filename, a progress filename, a thumb + * and a selected thumb image filename. + */ + static ControlSlider* create(const char* bgFile, const char* progressFile, const char* thumbFile, + const char* selectedThumbSpriteFile); + + /** + * Creates a slider with a given background sprite and a progress bar, a thumb + * and a selected thumb . + * + * @see initWithSprites + */ + static ControlSlider* create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite, + Sprite* selectedThumbSprite); /** * @js ctor */ @@ -68,15 +84,27 @@ public: */ virtual ~ControlSlider(); + /** + * Initializes a slider with a background sprite, a progress bar and a thumb + * item. + * + * @param backgroundSprite Sprite, that is used as a background. + * @param progressSprite Sprite, that is used as a progress bar. + * @param thumbSprite Sprite, that is used as a thumb. + */ + virtual bool initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite); + /** * Initializes a slider with a background sprite, a progress bar and a thumb * item. * - * @param backgroundSprite Sprite, that is used as a background. - * @param progressSprite Sprite, that is used as a progress bar. - * @param thumbSprite Sprite, that is used as a thumb. + * @param backgroundSprite Sprite, that is used as a background. + * @param progressSprite Sprite, that is used as a progress bar. + * @param thumbSprite Sprite, that is used as a thumb. + * @param selectedThumbSprite Sprite, that is used as a selected thumb. */ - virtual bool initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite); + virtual bool initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite, + Sprite* selectedThumbSprite); virtual void needsLayout(); @@ -116,8 +144,10 @@ protected: // maybe this should be read-only CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite); + CC_SYNTHESIZE_RETAIN(Sprite*, _selectedThumbSprite, SelectedThumbSprite); CC_SYNTHESIZE_RETAIN(Sprite*, _progressSprite, ProgressSprite); CC_SYNTHESIZE_RETAIN(Sprite*, _backgroundSprite, BackgroundSprite); + }; // end of GUI group From 5213aa7bc9c4d5980f601735be387ca9b8b8c131 Mon Sep 17 00:00:00 2001 From: Victor Buldakov Date: Mon, 4 Nov 2013 01:27:16 +0400 Subject: [PATCH 005/428] fix cc --- .../GUI/CCControlExtension/CCControlSlider.cpp | 12 ++++++------ extensions/GUI/CCControlExtension/CCControlSlider.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index 52ab8d08b8..7393e3f1b0 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -96,7 +96,7 @@ ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressS } ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite, - Sprite* selectedThumbSprite) + Sprite* selectedThumbSprite) { ControlSlider *pRet = new ControlSlider(); pRet->initWithSprites(backgroundSprite, pogressSprite, thumbSprite, selectedThumbSprite); @@ -106,14 +106,14 @@ ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressS bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite) { - Sprite* selectedThumbSprite = Sprite::createWithTexture(thumbSprite->getTexture(), - thumbSprite->getTextureRect()); - selectedThumbSprite->setColor(Color3B::GRAY); - this->initWithSprites(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite); + Sprite* selectedThumbSprite = Sprite::createWithTexture(thumbSprite->getTexture(), + thumbSprite->getTextureRect()); + selectedThumbSprite->setColor(Color3B::GRAY); + this->initWithSprites(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite); } bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite, - Sprite* selectedThumbSprite) + Sprite* selectedThumbSprite) { if (Control::init()) { diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.h b/extensions/GUI/CCControlExtension/CCControlSlider.h index 0a5f4a3779..9d5f2bc2ff 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.h +++ b/extensions/GUI/CCControlExtension/CCControlSlider.h @@ -64,7 +64,7 @@ public: * and a selected thumb image filename. */ static ControlSlider* create(const char* bgFile, const char* progressFile, const char* thumbFile, - const char* selectedThumbSpriteFile); + const char* selectedThumbSpriteFile); /** * Creates a slider with a given background sprite and a progress bar, a thumb @@ -73,7 +73,7 @@ public: * @see initWithSprites */ static ControlSlider* create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite, - Sprite* selectedThumbSprite); + Sprite* selectedThumbSprite); /** * @js ctor */ @@ -104,7 +104,7 @@ public: * @param selectedThumbSprite Sprite, that is used as a selected thumb. */ virtual bool initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite, - Sprite* selectedThumbSprite); + Sprite* selectedThumbSprite); virtual void needsLayout(); From 07215f11845fdca57ac24eab235753b2c8cec7c3 Mon Sep 17 00:00:00 2001 From: Victor Buldakov Date: Mon, 4 Nov 2013 17:17:01 +0400 Subject: [PATCH 006/428] Add scale ratio to button touchdown --- extensions/GUI/CCControlExtension/CCControlButton.cpp | 6 +++--- extensions/GUI/CCControlExtension/CCControlButton.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index 247634a72c..b0878b8933 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -50,6 +50,7 @@ ControlButton::ControlButton() , _titleLabel(NULL) , _backgroundSprite(NULL) , _zoomOnTouchDown(false) +, _scaleRatio(1.0) , _titleDispatchTable(NULL) , _titleColorDispatchTable(NULL) , _titleLabelDispatchTable(NULL) @@ -98,8 +99,6 @@ bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* b setTouchEnabled(true); _isPushed = false; - _zoomOnTouchDown = true; - _currentTitle=NULL; // Adjust the background image by default @@ -107,6 +106,7 @@ bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* b setPreferredSize(Size::ZERO); // Zooming button by default _zoomOnTouchDown = true; + _scaleRatio = 1.1f; // Set the default anchor point ignoreAnchorPointForPosition(false); @@ -221,7 +221,7 @@ void ControlButton::setHighlighted(bool enabled) needsLayout(); if( _zoomOnTouchDown ) { - float scaleValue = (isHighlighted() && isEnabled() && !isSelected()) ? 1.1f : 1.0f; + float scaleValue = (isHighlighted() && isEnabled() && !isSelected()) ? _scaleRatio : 1.0f; Action *zoomAction = ScaleTo::create(0.05f, scaleValue); zoomAction->setTag(kZoomActionTag); runAction(zoomAction); diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index 5a30c64f4c..61bc24f76e 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -230,6 +230,8 @@ protected: /** Adjust the button zooming on touchdown. Default value is YES. */ CC_PROPERTY(bool, _zoomOnTouchDown, ZoomOnTouchDown); + /** Scale ratio button on touchdown. Default value 1.1f */ + CC_SYNTHESIZE(float, _scaleRatio, ScaleRatio); CC_PROPERTY(Point, _labelAnchorPoint, LabelAnchorPoint); From 3c26106ffbdb7fa0cf6bc07e68d3402991bef18f Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 16 Dec 2013 18:13:49 +0800 Subject: [PATCH 007/428] update ui animation with frame ease type --- cocos/editor-support/cocostudio/Android.mk | 1 + .../cocostudio/CCActionEaseEx.cpp | 755 ++++++++++++++++++ .../cocostudio/CCActionEaseEx.h | 397 +++++++++ .../editor-support/cocostudio/CMakeLists.txt | 1 + .../proj.win32/libCocosStudio.vcxproj | 2 + .../proj.win32/libCocosStudio.vcxproj.filters | 6 + 6 files changed, 1162 insertions(+) create mode 100644 cocos/editor-support/cocostudio/CCActionEaseEx.cpp create mode 100644 cocos/editor-support/cocostudio/CCActionEaseEx.h diff --git a/cocos/editor-support/cocostudio/Android.mk b/cocos/editor-support/cocostudio/Android.mk index ea352f8485..02f130bca7 100644 --- a/cocos/editor-support/cocostudio/Android.mk +++ b/cocos/editor-support/cocostudio/Android.mk @@ -7,6 +7,7 @@ LOCAL_MODULE_FILENAME := libcocostudio LOCAL_SRC_FILES := CCActionFrame.cpp \ CCActionFrameEasing.cpp \ +CCActionEaseEx.cpp \ CCActionManagerEx.cpp \ CCActionNode.cpp \ CCActionObject.cpp \ diff --git a/cocos/editor-support/cocostudio/CCActionEaseEx.cpp b/cocos/editor-support/cocostudio/CCActionEaseEx.cpp new file mode 100644 index 0000000000..7cf8887a04 --- /dev/null +++ b/cocos/editor-support/cocostudio/CCActionEaseEx.cpp @@ -0,0 +1,755 @@ +/**************************************************************************** +Copyright (c) 2013 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#include "CCActionEaseEx.h" + +using namespace cocos2d; + +namespace cocostudio { + +static inline float bezieratFunction( float a, float b, float c, float d, float t ) +{ + return (powf(1-t,3) * a + + 3*t*(powf(1-t,2))*b + + 3*powf(t,2)*(1-t)*c + + powf(t,3)*d ); +} + +// +// EaseBezier +// + +EaseBezierAction* EaseBezierAction::create(CCActionInterval* pAction) +{ + EaseBezierAction *pRet = new EaseBezierAction(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +void EaseBezierAction::setBezierParamer( float p0, float p1, float p2, float p3) +{ + m_p0 = p0; + m_p1 = p1; + m_p2 = p2; + m_p3 = p3; +} + +EaseBezierAction* EaseBezierAction::clone() const +{ + // no copy constructor + auto a = new EaseBezierAction(); + a->initWithAction(_inner->clone()); + a->setBezierParamer(m_p0,m_p1,m_p2,m_p3); + a->autorelease(); + return a; +} + +void EaseBezierAction::update(float time) +{ + _inner->update(bezieratFunction(m_p0,m_p1,m_p2,m_p3,time)); +} + +EaseBezierAction* EaseBezierAction::reverse() const +{ + EaseBezierAction* reverseAction = EaseBezierAction::create(_inner->reverse()); + reverseAction->setBezierParamer(m_p3,m_p2,m_p1,m_p0); + return reverseAction; +} + +// +// EaseQuadraticActionIn +// + +EaseQuadraticActionIn* EaseQuadraticActionIn::create(CCActionInterval* pAction) +{ + EaseQuadraticActionIn *pRet = new EaseQuadraticActionIn(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseQuadraticActionIn* EaseQuadraticActionIn::clone() const +{ + // no copy constructor + auto a = new EaseQuadraticActionIn(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} +void EaseQuadraticActionIn::update(float time) +{ + _inner->update(powf(time,2)); +} + +EaseQuadraticActionIn* EaseQuadraticActionIn::reverse() const +{ + return EaseQuadraticActionIn::create(_inner->reverse()); +} + +// +// EaseQuadraticActionOut +// + +EaseQuadraticActionOut* EaseQuadraticActionOut::create(CCActionInterval* pAction) +{ + EaseQuadraticActionOut *pRet = new EaseQuadraticActionOut(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseQuadraticActionOut* EaseQuadraticActionOut::clone() const +{ + // no copy constructor + auto a = new EaseQuadraticActionOut(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseQuadraticActionOut::update(float time) +{ + _inner->update(-time*(time-2)); +} + +EaseQuadraticActionOut* EaseQuadraticActionOut::reverse() const +{ + return EaseQuadraticActionOut::create(_inner->reverse()); +} + +// +// EaseQuadraticActionInOut +// + +EaseQuadraticActionInOut* EaseQuadraticActionInOut::create(CCActionInterval* pAction) +{ + EaseQuadraticActionInOut *pRet = new EaseQuadraticActionInOut(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseQuadraticActionInOut* EaseQuadraticActionInOut::clone() const +{ + // no copy constructor + auto a = new EaseQuadraticActionInOut(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseQuadraticActionInOut::update(float time) +{ + float resultTime = time; + time = time*0.5f; + if (time < 1) + { + resultTime = time * time * 0.5f; + } + else + { + --time; + resultTime = -0.5f * (time * (time - 2) - 1); + } + + _inner->update(resultTime); +} + +EaseQuadraticActionInOut* EaseQuadraticActionInOut::reverse() const +{ + return EaseQuadraticActionInOut::create(_inner->reverse()); +} + +// +// EaseQuarticActionIn +// + +EaseQuarticActionIn* EaseQuarticActionIn::create(CCActionInterval* pAction) +{ + EaseQuarticActionIn *pRet = new EaseQuarticActionIn(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseQuarticActionIn* EaseQuarticActionIn::clone() const +{ + // no copy constructor + auto a = new EaseQuarticActionIn(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseQuarticActionIn::update(float time) +{ + _inner->update(powf(time,4.0f)); +} + +EaseQuarticActionIn* EaseQuarticActionIn::reverse() const +{ + return EaseQuarticActionIn::create(_inner->reverse()); +} + +// +// EaseQuarticActionOut +// + +EaseQuarticActionOut* EaseQuarticActionOut::create(CCActionInterval* pAction) +{ + EaseQuarticActionOut *pRet = new EaseQuarticActionOut(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseQuarticActionOut* EaseQuarticActionOut::clone() const +{ + // no copy constructor + auto a = new EaseQuarticActionOut(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseQuarticActionOut::update(float time) +{ + float tempTime = time -1; + _inner->update(1- powf(tempTime,4.0f)); +} + +EaseQuarticActionOut* EaseQuarticActionOut::reverse() const +{ + return EaseQuarticActionOut::create(_inner->reverse()); +} + +// +// EaseQuarticActionInOut +// + +EaseQuarticActionInOut* EaseQuarticActionInOut::create(CCActionInterval* pAction) +{ + EaseQuarticActionInOut *pRet = new EaseQuarticActionInOut(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseQuarticActionInOut* EaseQuarticActionInOut::clone() const +{ + // no copy constructor + auto a = new EaseQuarticActionInOut(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseQuarticActionInOut::update(float time) +{ + float tempTime = time * 0.5f; + if (tempTime < 1) + tempTime = powf(tempTime,4.0f) * 0.5f; + else + { + tempTime -= 2; + tempTime = 1 - powf(tempTime,4.0f)* 0.5f; + } + + _inner->update(tempTime); +} + +EaseQuarticActionInOut* EaseQuarticActionInOut::reverse() const +{ + return EaseQuarticActionInOut::create(_inner->reverse()); +} + +// +// EaseQuinticActionIn +// + +EaseQuinticActionIn* EaseQuinticActionIn::create(CCActionInterval* pAction) +{ + EaseQuinticActionIn *pRet = new EaseQuinticActionIn(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseQuinticActionIn* EaseQuinticActionIn::clone() const +{ + // no copy constructor + auto a = new EaseQuinticActionIn(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseQuinticActionIn::update(float time) +{ + _inner->update(powf(time,5.0f)); +} + +EaseQuinticActionIn* EaseQuinticActionIn::reverse() const +{ + return EaseQuinticActionIn::create(_inner->reverse()); +} + +// +// EaseQuinticActionOut +// + +EaseQuinticActionOut* EaseQuinticActionOut::create(CCActionInterval* pAction) +{ + EaseQuinticActionOut *pRet = new EaseQuinticActionOut(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseQuinticActionOut* EaseQuinticActionOut::clone() const +{ + // no copy constructor + auto a = new EaseQuinticActionOut(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseQuinticActionOut::update(float time) +{ + float tempTime = time -1; + _inner->update(1 + powf(tempTime,5.0f)); +} + +EaseQuinticActionOut* EaseQuinticActionOut::reverse() const +{ + return EaseQuinticActionOut::create(_inner->reverse()); +} + +// +// EaseQuinticActionInOut +// + +EaseQuinticActionInOut* EaseQuinticActionInOut::create(CCActionInterval* pAction) +{ + EaseQuinticActionInOut *pRet = new EaseQuinticActionInOut(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseQuinticActionInOut* EaseQuinticActionInOut::clone() const +{ + // no copy constructor + auto a = new EaseQuinticActionInOut(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseQuinticActionInOut::update(float time) +{ + float tempTime = time * 0.5f; + if (tempTime < 1) + tempTime = powf(tempTime,5.0f) * 0.5f; + else + { + tempTime -= 2; + tempTime = 1 + powf(tempTime,5.0f)* 0.5f; + } + + _inner->update(tempTime); +} + +EaseQuinticActionInOut* EaseQuinticActionInOut::reverse() const +{ + return EaseQuinticActionInOut::create(_inner->reverse()); +} + +// +// EaseCircleActionIn +// + +EaseCircleActionIn* EaseCircleActionIn::create(CCActionInterval* pAction) +{ + EaseCircleActionIn *pRet = new EaseCircleActionIn(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseCircleActionIn* EaseCircleActionIn::clone() const +{ + // no copy constructor + auto a = new EaseCircleActionIn(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseCircleActionIn::update(float time) +{ + _inner->update(1-sqrt(1-powf(time,2.0f))); +} + +EaseCircleActionIn* EaseCircleActionIn::reverse() const +{ + return EaseCircleActionIn::create(_inner->reverse()); +} + +// +// EaseCircleActionOut +// + +EaseCircleActionOut* EaseCircleActionOut::create(CCActionInterval* pAction) +{ + EaseCircleActionOut *pRet = new EaseCircleActionOut(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseCircleActionOut* EaseCircleActionOut::clone() const +{ + // no copy constructor + auto a = new EaseCircleActionOut(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseCircleActionOut::update(float time) +{ + float tempTime = time - 1; + _inner->update(sqrt(1-powf(tempTime,2.0f))); +} + +EaseCircleActionOut* EaseCircleActionOut::reverse() const +{ + return EaseCircleActionOut::create(_inner->reverse()); +} + +// +// EaseCircleActionInOut +// + +EaseCircleActionInOut* EaseCircleActionInOut::create(CCActionInterval* pAction) +{ + EaseCircleActionInOut *pRet = new EaseCircleActionInOut(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseCircleActionInOut* EaseCircleActionInOut::clone() const +{ + // no copy constructor + auto a = new EaseCircleActionInOut(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseCircleActionInOut::update(float time) +{ + float tempTime = time * 0.5f; + if (tempTime < 1) + tempTime = (1- sqrt(1 - powf(tempTime,2.0f))) * 0.5f; + else + { + tempTime -= 2; + tempTime = (1+ sqrt(1 - powf(tempTime,2.0f))); + } + + _inner->update(time); +} + +EaseCircleActionInOut* EaseCircleActionInOut::reverse() const +{ + return EaseCircleActionInOut::create(_inner->reverse()); +} + +// +// EaseCubicActionIn +// + +EaseCubicActionIn* EaseCubicActionIn::create(CCActionInterval* pAction) +{ + EaseCubicActionIn *pRet = new EaseCubicActionIn(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseCubicActionIn* EaseCubicActionIn::clone() const +{ + // no copy constructor + auto a = new EaseCubicActionIn(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseCubicActionIn::update(float time) +{ + _inner->update(powf(time,3.0f)); +} + +EaseCubicActionIn* EaseCubicActionIn::reverse() const +{ + return EaseCubicActionIn::create(_inner->reverse()); +} + +// +// EaseCubicActionOut +// + +EaseCubicActionOut* EaseCubicActionOut::create(CCActionInterval* pAction) +{ + EaseCubicActionOut *pRet = new EaseCubicActionOut(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseCubicActionOut* EaseCubicActionOut::clone() const +{ + // no copy constructor + auto a = new EaseCubicActionOut(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseCubicActionOut::update(float time) +{ + _inner->update(1+powf(time,3.0f)); +} + +EaseCubicActionOut* EaseCubicActionOut::reverse() const +{ + return EaseCubicActionOut::create(_inner->reverse()); +} + +// +// EaseCubicActionInOut +// + +EaseCubicActionInOut* EaseCubicActionInOut::create(CCActionInterval* pAction) +{ + EaseCubicActionInOut *pRet = new EaseCubicActionInOut(); + if (pRet) + { + if (pRet->initWithAction(pAction)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(pRet); + } + } + + return pRet; +} + +EaseCubicActionInOut* EaseCubicActionInOut::clone() const +{ + // no copy constructor + auto a = new EaseCubicActionInOut(); + a->initWithAction(_inner->clone()); + a->autorelease(); + return a; +} + +void EaseCubicActionInOut::update(float time) +{ + float tempTime = time * 0.5f; + if (tempTime < 1) + tempTime = powf(tempTime,3.0f) * 0.5f; + else + { + tempTime -= 2; + tempTime = 1 + powf(tempTime,3.0f)* 0.5f; + } + _inner->update(time); +} + +EaseCubicActionInOut* EaseCubicActionInOut::reverse() const +{ + return EaseCubicActionInOut::create(_inner->reverse()); +} + +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/CCActionEaseEx.h b/cocos/editor-support/cocostudio/CCActionEaseEx.h new file mode 100644 index 0000000000..dca3cc3ed3 --- /dev/null +++ b/cocos/editor-support/cocostudio/CCActionEaseEx.h @@ -0,0 +1,397 @@ +/**************************************************************************** +Copyright (c) 2013 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#ifndef __ActionEaseEx_H__ +#define __ActionEaseEx_H__ + +#include "cocos2d.h" +#include "ExtensionMacros.h" + +namespace cocostudio { + +/** + @brief Ease Bezier + @ingroup Actions + */ +class EaseBezierAction:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseBezierAction* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseBezierAction* clone() const override; + virtual EaseBezierAction* reverse() const override; + + virtual void setBezierParamer( float p0, float p1, float p2, float p3); + +protected: + EaseBezierAction() {} + virtual ~EaseBezierAction() {} + + float m_p0; + float m_p1; + float m_p2; + float m_p3; + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction); +}; + +/** + @brief Ease Quadratic In + @ingroup Actions + */ +class EaseQuadraticActionIn:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseQuadraticActionIn* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseQuadraticActionIn* clone() const override; + virtual EaseQuadraticActionIn* reverse() const override; + +protected: + EaseQuadraticActionIn() {} + virtual ~EaseQuadraticActionIn() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionIn); + +}; + +/** + @brief Ease Quadratic Out + @ingroup Actions + */ +class EaseQuadraticActionOut:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseQuadraticActionOut* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseQuadraticActionOut* clone() const override; + virtual EaseQuadraticActionOut* reverse() const override; + +protected: + EaseQuadraticActionOut() {} + virtual ~EaseQuadraticActionOut() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionOut); + +}; + +/** + @brief Ease Quadratic InOut + @ingroup Actions + */ +class EaseQuadraticActionInOut:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseQuadraticActionInOut* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseQuadraticActionInOut* clone() const override; + virtual EaseQuadraticActionInOut* reverse() const override; + +protected: + EaseQuadraticActionInOut() {} + virtual ~EaseQuadraticActionInOut() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionInOut); +}; + +/** + @brief Ease Quartic In + @ingroup Actions + */ +class EaseQuarticActionIn:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseQuarticActionIn* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseQuarticActionIn* clone() const override; + virtual EaseQuarticActionIn* reverse() const override; + +protected: + EaseQuarticActionIn() {} + virtual ~EaseQuarticActionIn() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionIn); +}; + +/** + @brief Ease Quartic Out + @ingroup Actions + */ +class EaseQuarticActionOut:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseQuarticActionOut* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseQuarticActionOut* clone() const override; + virtual EaseQuarticActionOut* reverse() const override; + +protected: + EaseQuarticActionOut() {} + virtual ~EaseQuarticActionOut() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionOut); +}; + +/** + @brief Ease Quartic InOut + @ingroup Actions + */ +class EaseQuarticActionInOut:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseQuarticActionInOut* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseQuarticActionInOut* clone() const override; + virtual EaseQuarticActionInOut* reverse() const override; + +protected: + EaseQuarticActionInOut() {} + virtual ~EaseQuarticActionInOut() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionInOut); +}; + + +/** + @brief Ease Quintic In + @ingroup Actions + */ +class EaseQuinticActionIn:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseQuinticActionIn* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseQuinticActionIn* clone() const override; + virtual EaseQuinticActionIn* reverse() const override; + +protected: + EaseQuinticActionIn() {} + virtual ~EaseQuinticActionIn() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionIn); +}; + +/** + @brief Ease Quintic Out + @ingroup Actions + */ +class EaseQuinticActionOut:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseQuinticActionOut* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseQuinticActionOut* clone() const override; + virtual EaseQuinticActionOut* reverse() const override; + +protected: + EaseQuinticActionOut() {} + virtual ~EaseQuinticActionOut() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionOut); +}; + +/** + @brief Ease Quintic InOut + @ingroup Actions + */ +class EaseQuinticActionInOut:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseQuinticActionInOut* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseQuinticActionInOut* clone() const override; + virtual EaseQuinticActionInOut* reverse() const override; + +protected: + EaseQuinticActionInOut() {} + virtual ~EaseQuinticActionInOut() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionInOut); +}; + +/** + @brief Ease Circle In + @ingroup Actions + */ +class EaseCircleActionIn:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseCircleActionIn* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseCircleActionIn* clone() const override; + virtual EaseCircleActionIn* reverse() const override; + +protected: + EaseCircleActionIn() {} + virtual ~EaseCircleActionIn() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionIn); +}; + +/** + @brief Ease Circle Out + @ingroup Actions + */ +class EaseCircleActionOut:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseCircleActionOut* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseCircleActionOut* clone() const override; + virtual EaseCircleActionOut* reverse() const override; + +protected: + EaseCircleActionOut() {} + virtual ~EaseCircleActionOut() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionOut); +}; + +/** + @brief Ease Circle InOut + @ingroup Actions + */ +class EaseCircleActionInOut:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseCircleActionInOut* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseCircleActionInOut* clone() const override; + virtual EaseCircleActionInOut* reverse() const override; + +protected: + EaseCircleActionInOut() {} + virtual ~EaseCircleActionInOut() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionInOut); +}; + +/** + @brief Ease Cubic In + @ingroup Actions + */ +class EaseCubicActionIn:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseCubicActionIn* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseCubicActionIn* clone() const override; + virtual EaseCubicActionIn* reverse() const override; + +protected: + EaseCubicActionIn() {} + virtual ~EaseCubicActionIn() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionIn); +}; + +/** + @brief Ease Cubic Out + @ingroup Actions + */ +class EaseCubicActionOut:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseCubicActionOut* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseCubicActionOut* clone() const override; + virtual EaseCubicActionOut* reverse() const override; + +protected: + EaseCubicActionOut() {} + virtual ~EaseCubicActionOut() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionOut); +}; + +/** + @brief Ease Cubic InOut + @ingroup Actions + */ +class EaseCubicActionInOut:public cocos2d::ActionEase +{ +public: + /** creates the action */ + static EaseCubicActionInOut* create(cocos2d::ActionInterval* pAction); + + virtual void update(float time) override; + virtual EaseCubicActionInOut* clone() const override; + virtual EaseCubicActionInOut* reverse() const override; + +protected: + EaseCubicActionInOut() {} + virtual ~EaseCubicActionInOut() {} + +private: + CC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionInOut); +}; + +} + +#endif diff --git a/cocos/editor-support/cocostudio/CMakeLists.txt b/cocos/editor-support/cocostudio/CMakeLists.txt index acff17a4a9..4ad625539e 100644 --- a/cocos/editor-support/cocostudio/CMakeLists.txt +++ b/cocos/editor-support/cocostudio/CMakeLists.txt @@ -1,4 +1,5 @@ set(CS_SRC + CCActionEaseEx.cpp CCActionFrame.cpp CCActionFrameEasing.cpp CCActionManagerEx.cpp diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj index 77de7fdb61..43ab0a6ecf 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj +++ b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj @@ -14,6 +14,7 @@ + @@ -58,6 +59,7 @@ + diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters index 10053f03e2..232cc4df2b 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters +++ b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters @@ -144,6 +144,9 @@ json\libjson + + action + @@ -272,6 +275,9 @@ json\libjson + + action + From e8f55069e337f1758bbf88400d9f581d7730902e Mon Sep 17 00:00:00 2001 From: xuzhiqiang Date: Mon, 16 Dec 2013 18:20:10 +0800 Subject: [PATCH 008/428] reduce useless convert --- extensions/GUI/CCScrollView/CCScrollView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 2a61d5223e..60d541dda8 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -612,7 +612,7 @@ bool ScrollView::onTouchBegan(Touch* touch, Event* event) //dispatcher does not know about clipping. reject touches outside visible bounds. if (_touches.size() > 2 || _touchMoved || - !frame.containsPoint(_container->convertToWorldSpace(_container->convertTouchToNodeSpace(touch)))) + !frame.containsPoint(touch->getLocation())) { return false; } From 19e1609c2729525d2dd9e0a77d90f81f54ce7b17 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Fri, 20 Dec 2013 09:50:53 +0800 Subject: [PATCH 009/428] issue #2050: unsigned int to int --- cocos/2d/CCTMXLayer.cpp | 54 ++++++++++++++++++------------------- cocos/2d/CCTMXLayer.h | 34 +++++++++++------------ cocos/2d/CCTMXXMLParser.cpp | 18 ++++++------- cocos/2d/CCTMXXMLParser.h | 26 +++++++++--------- 4 files changed, 66 insertions(+), 66 deletions(-) diff --git a/cocos/2d/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp index e9fec6db02..b69bd235ab 100644 --- a/cocos/2d/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -61,7 +61,7 @@ bool TMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *la texture = Director::getInstance()->getTextureCache()->addImage(tilesetInfo->_sourceImage.c_str()); } - if (SpriteBatchNode::initWithTexture(texture, (unsigned int)capacity)) + if (SpriteBatchNode::initWithTexture(texture, static_cast(capacity))) { // layerInfo _layerName = layerInfo->_name; @@ -85,7 +85,7 @@ bool TMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *la Point offset = this->calculateLayerOffset(layerInfo->_offset); this->setPosition(CC_POINT_PIXELS_TO_POINTS(offset)); - _atlasIndexArray = ccCArrayNew((unsigned int)totalNumberOfTiles); + _atlasIndexArray = ccCArrayNew(totalNumberOfTiles); this->setContentSize(CC_SIZE_PIXELS_TO_POINTS(Size(_layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height))); @@ -161,12 +161,12 @@ void TMXLayer::setupTiles() // Parse cocos2d properties this->parseInternalProperties(); - for (unsigned int y=0; y < _layerSize.height; y++) + for (int y=0; y < _layerSize.height; y++) { - for (unsigned int x=0; x < _layerSize.width; x++) + for (int x=0; x < _layerSize.width; x++) { - unsigned int pos = (unsigned int)(x + _layerSize.width * y); - unsigned int gid = _tiles[ pos ]; + int pos = (int)(x + _layerSize.width * y); + int gid = _tiles[ pos ]; // gid are stored in little endian. // if host is big endian, then swap @@ -231,7 +231,7 @@ void TMXLayer::parseInternalProperties() } } -void TMXLayer::setupTileSprite(Sprite* sprite, Point pos, unsigned int gid) +void TMXLayer::setupTileSprite(Sprite* sprite, Point pos, int gid) { sprite->setPosition(getPositionAt(pos)); sprite->setVertexZ((float)getVertexZForPos(pos)); @@ -252,7 +252,7 @@ void TMXLayer::setupTileSprite(Sprite* sprite, Point pos, unsigned int gid) sprite->setPosition(Point(getPositionAt(pos).x + sprite->getContentSize().height/2, getPositionAt(pos).y + sprite->getContentSize().width/2 ) ); - unsigned int flag = gid & (kTMXTileHorizontalFlag | kTMXTileVerticalFlag ); + int flag = gid & (kTMXTileHorizontalFlag | kTMXTileVerticalFlag ); // handle the 4 diagonally flipped states. if (flag == kTMXTileHorizontalFlag) @@ -319,7 +319,7 @@ Sprite * TMXLayer::getTileAt(const Point& pos) CCASSERT(_tiles && _atlasIndexArray, "TMXLayer: the tiles map has been released"); Sprite *tile = nullptr; - unsigned int gid = this->getTileGIDAt(pos); + int gid = this->getTileGIDAt(pos); // if GID == 0, then no tile is present if (gid) @@ -348,14 +348,14 @@ Sprite * TMXLayer::getTileAt(const Point& pos) return tile; } -unsigned int TMXLayer::getTileGIDAt(const Point& pos, ccTMXTileFlags* flags/* = nullptr*/) +int TMXLayer::getTileGIDAt(const Point& pos, ccTMXTileFlags* flags/* = nullptr*/) { CCASSERT(pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, "TMXLayer: invalid position"); CCASSERT(_tiles && _atlasIndexArray, "TMXLayer: the tiles map has been released"); - int idx = (int)(pos.x + pos.y * _layerSize.width); + int idx = static_cast((pos.x + pos.y * _layerSize.width)); // Bits on the far end of the 32-bit global tile ID are used for tile flags - unsigned int tile = _tiles[idx]; + int tile = _tiles[idx]; // issue1264, flipped tiles can be changed dynamically if (flags) @@ -367,7 +367,7 @@ unsigned int TMXLayer::getTileGIDAt(const Point& pos, ccTMXTileFlags* flags/* = } // TMXLayer - adding helper methods -Sprite * TMXLayer::insertTileForGID(unsigned int gid, const Point& pos) +Sprite * TMXLayer::insertTileForGID(int gid, const Point& pos) { Rect rect = _tileSet->rectForGID(gid); rect = CC_RECT_PIXELS_TO_POINTS(rect); @@ -405,7 +405,7 @@ Sprite * TMXLayer::insertTileForGID(unsigned int gid, const Point& pos) return tile; } -Sprite * TMXLayer::updateTileForGID(unsigned int gid, const Point& pos) +Sprite * TMXLayer::updateTileForGID(int gid, const Point& pos) { Rect rect = _tileSet->rectForGID(gid); rect = Rect(rect.origin.x / _contentScaleFactor, rect.origin.y / _contentScaleFactor, rect.size.width/ _contentScaleFactor, rect.size.height/ _contentScaleFactor); @@ -427,7 +427,7 @@ Sprite * TMXLayer::updateTileForGID(unsigned int gid, const Point& pos) // used only when parsing the map. useless after the map was parsed // since lot's of assumptions are no longer true -Sprite * TMXLayer::appendTileForGID(unsigned int gid, const Point& pos) +Sprite * TMXLayer::appendTileForGID(int gid, const Point& pos) { Rect rect = _tileSet->rectForGID(gid); rect = CC_RECT_PIXELS_TO_POINTS(rect); @@ -458,7 +458,7 @@ static inline int compareInts(const void * a, const void * b) return ((*(int*)a) - (*(int*)b)); } -ssize_t TMXLayer::atlasIndexForExistantZ(unsigned int z) +ssize_t TMXLayer::atlasIndexForExistantZ(int z) { int key=z; int *item = (int*)bsearch((void*)&key, (void*)&_atlasIndexArray->arr[0], _atlasIndexArray->num, sizeof(void*), compareInts); @@ -486,23 +486,23 @@ ssize_t TMXLayer::atlasIndexForNewZ(int z) } // TMXLayer - adding / remove tiles -void TMXLayer::setTileGID(unsigned int gid, const Point& pos) +void TMXLayer::setTileGID(int gid, const Point& pos) { setTileGID(gid, pos, (ccTMXTileFlags)0); } -void TMXLayer::setTileGID(unsigned int gid, const Point& pos, ccTMXTileFlags flags) +void TMXLayer::setTileGID(int gid, const Point& pos, ccTMXTileFlags flags) { CCASSERT(pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, "TMXLayer: invalid position"); CCASSERT(_tiles && _atlasIndexArray, "TMXLayer: the tiles map has been released"); CCASSERT(gid == 0 || gid >= _tileSet->_firstGid, "TMXLayer: invalid gid" ); ccTMXTileFlags currentFlags; - unsigned int currentGID = getTileGIDAt(pos, ¤tFlags); + int currentGID = getTileGIDAt(pos, ¤tFlags); if (currentGID != gid || currentFlags != flags) { - unsigned gidAndFlags = gid | flags; + int gidAndFlags = gid | flags; // setting gid=0 is equal to remove the tile if (gid == 0) @@ -517,7 +517,7 @@ void TMXLayer::setTileGID(unsigned int gid, const Point& pos, ccTMXTileFlags fla // modifying an existing tile with a non-empty tile else { - unsigned int z = (unsigned int)(pos.x + pos.y * _layerSize.width); + int z = pos.x + pos.y * _layerSize.width; Sprite *sprite = static_cast(getChildByTag(z)); if (sprite) { @@ -570,11 +570,11 @@ void TMXLayer::removeTileAt(const Point& pos) CCASSERT(pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, "TMXLayer: invalid position"); CCASSERT(_tiles && _atlasIndexArray, "TMXLayer: the tiles map has been released"); - unsigned int gid = getTileGIDAt(pos); + int gid = getTileGIDAt(pos); if (gid) { - unsigned int z = (unsigned int)(pos.x + pos.y * _layerSize.width); + int z = pos.x + pos.y * _layerSize.width; ssize_t atlasIndex = atlasIndexForExistantZ(z); // remove tile from GID map @@ -676,17 +676,17 @@ Point TMXLayer::getPositionForHexAt(const Point& pos) int TMXLayer::getVertexZForPos(const Point& pos) { int ret = 0; - unsigned int maxVal = 0; + int maxVal = 0; if (_useAutomaticVertexZ) { switch (_layerOrientation) { case TMXOrientationIso: - maxVal = (unsigned int)(_layerSize.width + _layerSize.height); - ret = (int)(-(maxVal - (pos.x + pos.y))); + maxVal = static_cast(_layerSize.width + _layerSize.height); + ret = static_cast(-(maxVal - (pos.x + pos.y))); break; case TMXOrientationOrtho: - ret = (int)(-(_layerSize.height-pos.y)); + ret = static_cast(-(_layerSize.height-pos.y)); break; case TMXOrientationHex: CCASSERT(0, "TMX Hexa zOrder not supported"); diff --git a/cocos/2d/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h index b2d254fac4..49950cd508 100644 --- a/cocos/2d/CCTMXLayer.h +++ b/cocos/2d/CCTMXLayer.h @@ -109,8 +109,8 @@ public: /** returns the tile gid at a given tile coordinate. It also returns the tile flags. This method requires the the tile map has not been previously released (eg. don't call [layer releaseMap]) */ - unsigned int getTileGIDAt(const Point& tileCoordinate, ccTMXTileFlags* flags = nullptr); - CC_DEPRECATED_ATTRIBUTE unsigned int tileGIDAt(const Point& tileCoordinate, ccTMXTileFlags* flags = nullptr){ + int getTileGIDAt(const Point& tileCoordinate, ccTMXTileFlags* flags = nullptr); + CC_DEPRECATED_ATTRIBUTE int tileGIDAt(const Point& tileCoordinate, ccTMXTileFlags* flags = nullptr){ return getTileGIDAt(tileCoordinate, flags); }; @@ -118,7 +118,7 @@ public: The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1. If a tile is already placed at that position, then it will be removed. */ - void setTileGID(unsigned int gid, const Point& tileCoordinate); + void setTileGID(int gid, const Point& tileCoordinate); /** sets the tile gid (gid = tile global id) at a given tile coordinate. The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1. @@ -127,7 +127,7 @@ public: Use withFlags if the tile flags need to be changed as well */ - void setTileGID(unsigned int gid, const Point& tileCoordinate, ccTMXTileFlags flags); + void setTileGID(int gid, const Point& tileCoordinate, ccTMXTileFlags flags); /** removes a tile at given tile coordinate */ void removeTileAt(const Point& tileCoordinate); @@ -158,8 +158,8 @@ public: * @js NA * @lua NA */ - inline unsigned int* getTiles() const { return _tiles; }; - inline void setTiles(unsigned int* tiles) { _tiles = tiles; }; + inline int* getTiles() const { return _tiles; }; + inline void setTiles(int* tiles) { _tiles = tiles; }; /** Tileset information for the layer */ inline TMXTilesetInfo* getTileSet() const { return _tileSet; }; @@ -170,8 +170,8 @@ public: }; /** Layer orientation, which is the same as the map orientation */ - inline unsigned int getLayerOrientation() const { return _layerOrientation; }; - inline void setLayerOrientation(unsigned int orientation) { _layerOrientation = orientation; }; + inline int getLayerOrientation() const { return _layerOrientation; }; + inline void setLayerOrientation(int orientation) { _layerOrientation = orientation; }; /** properties from the layer. They can be added using Tiled */ inline const ValueMap& getProperties() const { return _properties; }; @@ -198,18 +198,18 @@ private: Point calculateLayerOffset(const Point& offset); /* optimization methods */ - Sprite* appendTileForGID(unsigned int gid, const Point& pos); - Sprite* insertTileForGID(unsigned int gid, const Point& pos); - Sprite* updateTileForGID(unsigned int gid, const Point& pos); + Sprite* appendTileForGID(int gid, const Point& pos); + Sprite* insertTileForGID(int gid, const Point& pos); + Sprite* updateTileForGID(int gid, const Point& pos); /* The layer recognizes some special properties, like cc_vertez */ void parseInternalProperties(); - void setupTileSprite(Sprite* sprite, Point pos, unsigned int gid); + void setupTileSprite(Sprite* sprite, Point pos, int gid); Sprite* reusedTileWithRect(Rect rect); int getVertexZForPos(const Point& pos); // index - ssize_t atlasIndexForExistantZ(unsigned int z); + ssize_t atlasIndexForExistantZ(int z); ssize_t atlasIndexForNewZ(int z); protected: @@ -218,8 +218,8 @@ protected: //! TMX Layer supports opacity unsigned char _opacity; - unsigned int _minGID; - unsigned int _maxGID; + int _minGID; + int _maxGID; //! Only used when vertexZ is used int _vertexZvalue; @@ -237,11 +237,11 @@ protected: /** size of the map's tile (could be different from the tile's size) */ Size _mapTileSize; /** pointer to the map of tiles */ - unsigned int* _tiles; + int* _tiles; /** Tileset information for the layer */ TMXTilesetInfo* _tileSet; /** Layer orientation, which is the same as the map orientation */ - unsigned int _layerOrientation; + int _layerOrientation; /** properties from the layer. They can be added using Tiled */ ValueMap _properties; }; diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index 71bb6993bb..66ad606f9b 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -83,7 +83,7 @@ TMXTilesetInfo::~TMXTilesetInfo() CCLOGINFO("deallocing TMXTilesetInfo: %p", this); } -Rect TMXTilesetInfo::rectForGID(unsigned int gid) +Rect TMXTilesetInfo::rectForGID(int gid) { Rect rect; rect.size = _tileSize; @@ -265,7 +265,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) } externalTilesetFilename = FileUtils::getInstance()->fullPathForFilename(externalTilesetFilename.c_str()); - _currentFirstGID = (unsigned int)attributeDict["firstgid"].asInt(); + _currentFirstGID = attributeDict["firstgid"].asInt(); tmxMapInfo->parseXMLFile(externalTilesetFilename.c_str()); } @@ -275,15 +275,15 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) tileset->_name = attributeDict["name"].asString(); if (_currentFirstGID == 0) { - tileset->_firstGid = (unsigned int)attributeDict["firstgid"].asInt(); + tileset->_firstGid = attributeDict["firstgid"].asInt(); } else { tileset->_firstGid = _currentFirstGID; _currentFirstGID = 0; } - tileset->_spacing = (unsigned int)attributeDict["spacing"].asInt(); - tileset->_margin = (unsigned int)attributeDict["margin"].asInt(); + tileset->_spacing = attributeDict["spacing"].asInt(); + tileset->_margin = attributeDict["margin"].asInt(); Size s; s.width = attributeDict["tilewidth"].asFloat(); s.height = attributeDict["tileheight"].asFloat(); @@ -299,7 +299,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) { TMXLayerInfo* layer = tmxMapInfo->getLayers().back(); Size layerSize = layer->_layerSize; - unsigned int gid = (unsigned int)attributeDict["gid"].asInt(); + int gid = attributeDict["gid"].asInt(); int tilesAmount = layerSize.width*layerSize.height; do @@ -435,7 +435,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) tiles[tilesAmount - 1] = tilesAmount - 1; } - layer->_tiles = (unsigned int*) tiles; + layer->_tiles = tiles; } else if (encoding == "base64") { @@ -678,11 +678,11 @@ void TMXMapInfo::endElement(void *ctx, const char *name) return; } - layer->_tiles = (unsigned int*) deflated; + layer->_tiles = reinterpret_cast(deflated); } else { - layer->_tiles = (unsigned int*) buffer; + layer->_tiles = reinterpret_cast(buffer); } tmxMapInfo->setCurrentString(""); diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index 4753bf81a0..40934e1c62 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -107,12 +107,12 @@ public: ValueMap _properties; std::string _name; Size _layerSize; - unsigned int *_tiles; + int *_tiles; bool _visible; unsigned char _opacity; bool _ownTiles; - unsigned int _minGID; - unsigned int _maxGID; + int _minGID; + int _maxGID; Point _offset; }; @@ -130,14 +130,14 @@ class CC_DLL TMXTilesetInfo : public Object { public: std::string _name; - unsigned int _firstGid; - Size _tileSize; - unsigned int _spacing; - unsigned int _margin; + int _firstGid; + Size _tileSize; + int _spacing; + int _margin; //! filename containing the tiles (should be spritesheet / texture atlas) std::string _sourceImage; //! size in pixels of the image - Size _imageSize; + Size _imageSize; public: /** * @js ctor @@ -148,7 +148,7 @@ public: * @lua NA */ virtual ~TMXTilesetInfo(); - Rect rectForGID(unsigned int gid); + Rect rectForGID(int gid); }; /** @brief TMXMapInfo contains the information about the map like: @@ -238,8 +238,8 @@ public: inline void setParentElement(int element) { _parentElement = element; }; /// parent GID - inline unsigned int getParentGID() const { return _parentGID; }; - inline void setParentGID(unsigned int gid) { _parentGID = gid; }; + inline int getParentGID() const { return _parentGID; }; + inline void setParentGID(int gid) { _parentGID = gid; }; /// layer attribs inline int getLayerAttribs() const { return _layerAttribs; }; @@ -296,7 +296,7 @@ protected: /// parent element int _parentElement; /// parent GID - unsigned int _parentGID; + int _parentGID; /// layer attribs int _layerAttribs; /// is storing characters? @@ -312,7 +312,7 @@ protected: std::string _currentString; //! tile properties IntValueMap _tileProperties; - unsigned int _currentFirstGID; + int _currentFirstGID; }; // end of tilemap_parallax_nodes group From baf8cb06c553956e3337bcc8a5256687bc4987ef Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 23 Dec 2013 10:37:46 +0800 Subject: [PATCH 010/428] issue #2050: delete max/minGID, fix firstGID bug --- cocos/2d/CCTMXLayer.cpp | 129 ++++++++++++++++++------------------ cocos/2d/CCTMXLayer.h | 5 +- cocos/2d/CCTMXTiledMap.cpp | 8 +-- cocos/2d/CCTMXXMLParser.cpp | 55 ++++++++++----- cocos/2d/CCTMXXMLParser.h | 3 +- 5 files changed, 107 insertions(+), 93 deletions(-) diff --git a/cocos/2d/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp index b69bd235ab..2bf3409296 100644 --- a/cocos/2d/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -67,8 +67,6 @@ bool TMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *la _layerName = layerInfo->_name; _layerSize = size; _tiles = layerInfo->_tiles; - _minGID = layerInfo->_minGID; - _maxGID = layerInfo->_maxGID; _opacity = layerInfo->_opacity; setProperties(layerInfo->getProperties()); _contentScaleFactor = Director::getInstance()->getContentScaleFactor(); @@ -100,8 +98,6 @@ bool TMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *la TMXLayer::TMXLayer() :_layerName("") ,_opacity(0) -,_minGID(0) -,_maxGID(0) ,_vertexZvalue(0) ,_useAutomaticVertexZ(false) ,_reusedTile(nullptr) @@ -165,7 +161,7 @@ void TMXLayer::setupTiles() { for (int x=0; x < _layerSize.width; x++) { - int pos = (int)(x + _layerSize.width * y); + int pos = static_cast(x + _layerSize.width * y); int gid = _tiles[ pos ]; // gid are stored in little endian. @@ -178,16 +174,9 @@ void TMXLayer::setupTiles() if (gid != 0) { this->appendTileForGID(gid, Point(x, y)); - - // Optimization: update min and max GID rendered by the layer - _minGID = MIN(gid, _minGID); - _maxGID = MAX(gid, _maxGID); } } } - - CCASSERT( _maxGID >= _tileSet->_firstGid && - _minGID >= _tileSet->_firstGid, "TMX: Only 1 tileset per layer is supported"); } // TMXLayer - Properties @@ -369,40 +358,45 @@ int TMXLayer::getTileGIDAt(const Point& pos, ccTMXTileFlags* flags/* = nullptr*/ // TMXLayer - adding helper methods Sprite * TMXLayer::insertTileForGID(int gid, const Point& pos) { - Rect rect = _tileSet->rectForGID(gid); - rect = CC_RECT_PIXELS_TO_POINTS(rect); - - intptr_t z = (intptr_t)(pos.x + pos.y * _layerSize.width); - - Sprite *tile = reusedTileWithRect(rect); - - setupTileSprite(tile, pos, gid); - - // get atlas index - ssize_t indexForZ = atlasIndexForNewZ(static_cast(z)); - - // Optimization: add the quad without adding a child - this->insertQuadFromSprite(tile, indexForZ); - - // insert it into the local atlasindex array - ccCArrayInsertValueAtIndex(_atlasIndexArray, (void*)z, indexForZ); - - // update possible children - - std::for_each(_children.begin(), _children.end(), [&indexForZ](Node* child){ - Sprite* sp = static_cast(child); - if (child) - { - ssize_t ai = sp->getAtlasIndex(); - if ( ai >= indexForZ ) + if (gid != 0 && (static_cast((gid & kFlippedMask)) - _tileSet->_firstGid) >= 0) + { + Rect rect = _tileSet->rectForGID(gid); + rect = CC_RECT_PIXELS_TO_POINTS(rect); + + intptr_t z = (intptr_t)(pos.x + pos.y * _layerSize.width); + + Sprite *tile = reusedTileWithRect(rect); + + setupTileSprite(tile, pos, gid); + + // get atlas index + ssize_t indexForZ = atlasIndexForNewZ(static_cast(z)); + + // Optimization: add the quad without adding a child + this->insertQuadFromSprite(tile, indexForZ); + + // insert it into the local atlasindex array + ccCArrayInsertValueAtIndex(_atlasIndexArray, (void*)z, indexForZ); + + // update possible children + + std::for_each(_children.begin(), _children.end(), [&indexForZ](Node* child){ + Sprite* sp = static_cast(child); + if (child) { - sp->setAtlasIndex(ai+1); + ssize_t ai = sp->getAtlasIndex(); + if ( ai >= indexForZ ) + { + sp->setAtlasIndex(ai+1); + } } - } - }); - - _tiles[z] = gid; - return tile; + }); + + _tiles[z] = gid; + return tile; + } + + return nullptr; } Sprite * TMXLayer::updateTileForGID(int gid, const Point& pos) @@ -429,27 +423,32 @@ Sprite * TMXLayer::updateTileForGID(int gid, const Point& pos) // since lot's of assumptions are no longer true Sprite * TMXLayer::appendTileForGID(int gid, const Point& pos) { - Rect rect = _tileSet->rectForGID(gid); - rect = CC_RECT_PIXELS_TO_POINTS(rect); - - intptr_t z = (intptr_t)(pos.x + pos.y * _layerSize.width); - - Sprite *tile = reusedTileWithRect(rect); - - setupTileSprite(tile ,pos ,gid); - - // optimization: - // The difference between appendTileForGID and insertTileforGID is that append is faster, since - // it appends the tile at the end of the texture atlas - ssize_t indexForZ = _atlasIndexArray->num; - - // don't add it using the "standard" way. - insertQuadFromSprite(tile, indexForZ); - - // append should be after addQuadFromSprite since it modifies the quantity values - ccCArrayInsertValueAtIndex(_atlasIndexArray, (void*)z, indexForZ); - - return tile; + if (gid != 0 && (static_cast((gid & kFlippedMask)) - _tileSet->_firstGid) >= 0) + { + Rect rect = _tileSet->rectForGID(gid); + rect = CC_RECT_PIXELS_TO_POINTS(rect); + + intptr_t z = (intptr_t)(pos.x + pos.y * _layerSize.width); + + Sprite *tile = reusedTileWithRect(rect); + + setupTileSprite(tile ,pos ,gid); + + // optimization: + // The difference between appendTileForGID and insertTileforGID is that append is faster, since + // it appends the tile at the end of the texture atlas + ssize_t indexForZ = _atlasIndexArray->num; + + // don't add it using the "standard" way. + insertQuadFromSprite(tile, indexForZ); + + // append should be after addQuadFromSprite since it modifies the quantity values + ccCArrayInsertValueAtIndex(_atlasIndexArray, (void*)z, indexForZ); + + return tile; + } + + return nullptr; } // TMXLayer - atlasIndex and Z diff --git a/cocos/2d/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h index 49950cd508..b245f976c6 100644 --- a/cocos/2d/CCTMXLayer.h +++ b/cocos/2d/CCTMXLayer.h @@ -217,10 +217,7 @@ protected: std::string _layerName; //! TMX Layer supports opacity unsigned char _opacity; - - int _minGID; - int _maxGID; - + //! Only used when vertexZ is used int _vertexZvalue; bool _useAutomaticVertexZ; diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index cc71bdce58..01e4560983 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -122,12 +122,12 @@ TMXTilesetInfo * TMXTiledMap::tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInf tileset = *iter; if (tileset) { - for( unsigned int y=0; y < size.height; y++ ) + for( int y=0; y < size.height; y++ ) { - for( unsigned int x=0; x < size.width; x++ ) + for( int x=0; x < size.width; x++ ) { - unsigned int pos = (unsigned int)(x + size.width * y); - unsigned int gid = layerInfo->_tiles[ pos ]; + int pos = (int)(x + size.width * y); + int gid = layerInfo->_tiles[ pos ]; // gid are stored in little endian. // if host is big endian, then swap diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index 66ad606f9b..ab7c789c0a 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -43,8 +43,6 @@ TMXLayerInfo::TMXLayerInfo() : _name("") , _tiles(nullptr) , _ownTiles(true) -, _minGID(100000) -, _maxGID(0) , _offset(Point::ZERO) { } @@ -141,7 +139,7 @@ void TMXMapInfo::internalInit(const std::string& tmxFileName, const std::string& _storingCharacters = false; _layerAttribs = TMXLayerAttribNone; _parentElement = TMXPropertyNone; - _currentFirstGID = 0; + _currentFirstGID = -1; } bool TMXMapInfo::initWithXML(const std::string& tmxString, const std::string& resourcePath) { @@ -160,7 +158,8 @@ TMXMapInfo::TMXMapInfo() , _tileSize(Size::ZERO) , _layerAttribs(0) , _storingCharacters(false) -, _currentFirstGID(0) +, _currentFirstGID(-1) +, _recordFirstGID(true) { } @@ -266,6 +265,11 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) externalTilesetFilename = FileUtils::getInstance()->fullPathForFilename(externalTilesetFilename.c_str()); _currentFirstGID = attributeDict["firstgid"].asInt(); + if (_currentFirstGID < 0) + { + _currentFirstGID = 0; + } + _recordFirstGID = false; tmxMapInfo->parseXMLFile(externalTilesetFilename.c_str()); } @@ -273,15 +277,23 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) { TMXTilesetInfo *tileset = new TMXTilesetInfo(); tileset->_name = attributeDict["name"].asString(); - if (_currentFirstGID == 0) + + if (_recordFirstGID) { + // unset before, so this is tmx file. tileset->_firstGid = attributeDict["firstgid"].asInt(); + + if (tileset->_firstGid < 0) + { + tileset->_firstGid = 0; + } } else { tileset->_firstGid = _currentFirstGID; _currentFirstGID = 0; } + tileset->_spacing = attributeDict["spacing"].asInt(); tileset->_margin = attributeDict["margin"].asInt(); Size s; @@ -304,15 +316,12 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) do { - // Check the gid is legal or not - CC_BREAK_IF(gid == 0); - if (tilesAmount > 1) { // Check the value is all set or not - CC_BREAK_IF(layer->_tiles[tilesAmount - 2] != 0 && layer->_tiles[tilesAmount - 1] != 0); + CC_BREAK_IF(layer->_tiles[tilesAmount - 2] != -1 && layer->_tiles[tilesAmount - 1] != -1); - int currentTileIndex = tilesAmount - layer->_tiles[tilesAmount - 1] - 1; + int currentTileIndex = tilesAmount - layer->_tiles[tilesAmount - 1] - 2; layer->_tiles[currentTileIndex] = gid; if (currentTileIndex != tilesAmount - 1) @@ -322,7 +331,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) } else if(tilesAmount == 1) { - if (layer->_tiles[0] == 0) + if (layer->_tiles[0] == -1) { layer->_tiles[0] = gid; } @@ -419,10 +428,8 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) int tilesAmount = layerSize.width*layerSize.height; int *tiles = (int *) malloc(tilesAmount*sizeof(int)); - for (int i = 0; i < tilesAmount; i++) - { - tiles[i] = 0; - } + // set all value to -1 + memset(tiles, 0xFF, tilesAmount*sizeof(int)); /* Save the special index in tiles[tilesAmount - 1]; * When we load tiles, we can do this: @@ -432,7 +439,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) */ if (tilesAmount > 1) { - tiles[tilesAmount - 1] = tilesAmount - 1; + tiles[tilesAmount - 1] = tilesAmount - 2; } layer->_tiles = tiles; @@ -693,11 +700,19 @@ void TMXMapInfo::endElement(void *ctx, const char *name) Size layerSize = layer->_layerSize; int tilesAmount = layerSize.width * layerSize.height; - //reset the layer->_tiles[tilesAmount - 1] - if (tilesAmount > 1 && layer->_tiles[tilesAmount - 2] == 0) + //set all the tiles unseted to 0 + if (tilesAmount > 1 && layer->_tiles[tilesAmount - 2] == -1) + { + for (int i = tilesAmount - layer->_tiles[tilesAmount - 1] - 2; i < tilesAmount; ++i) + { + layer->_tiles[i] = 0; + } + } + else if (layer->_tiles[tilesAmount - 1] == -1) { layer->_tiles[tilesAmount - 1] = 0; } + } } @@ -721,6 +736,10 @@ void TMXMapInfo::endElement(void *ctx, const char *name) // The object element has ended tmxMapInfo->setParentElement(TMXPropertyNone); } + else if (elementName == "tileset") + { + _recordFirstGID = true; + } } void TMXMapInfo::textHandler(void *ctx, const char *ch, int len) diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index 40934e1c62..815fbaa0aa 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -111,8 +111,6 @@ public: bool _visible; unsigned char _opacity; bool _ownTiles; - int _minGID; - int _maxGID; Point _offset; }; @@ -313,6 +311,7 @@ protected: //! tile properties IntValueMap _tileProperties; int _currentFirstGID; + bool _recordFirstGID; }; // end of tilemap_parallax_nodes group From 1072711a4cf2359acd12e963e96262ef8249cb05 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 23 Dec 2013 10:46:35 +0800 Subject: [PATCH 011/428] issue #2050: use static_cast --- cocos/2d/CCTMXTiledMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 01e4560983..3cf44b1eb7 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -126,7 +126,7 @@ TMXTilesetInfo * TMXTiledMap::tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInf { for( int x=0; x < size.width; x++ ) { - int pos = (int)(x + size.width * y); + int pos = static_cast(x + size.width * y); int gid = layerInfo->_tiles[ pos ]; // gid are stored in little endian. From 669ba8149a732cbcd6f4626ffb1f58fce45e55b3 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 23 Dec 2013 17:06:13 +0800 Subject: [PATCH 012/428] closed #2050: fix js glue code. --- .../javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id index 9a92d58fff..6e24a48fe8 100644 --- a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id +++ b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id @@ -1 +1 @@ -4f58619fbbaa2bb184766db408386d247df236ce \ No newline at end of file +9caaea87daa94b5e02bfea23b3d47d89c4acaabf \ No newline at end of file From 2308e94c2f9b06154f0563ef6b874bf6bb9d26fb Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Tue, 24 Dec 2013 09:42:37 +0800 Subject: [PATCH 013/428] modify template --- template/multi-platform-cpp/CMakeLists.txt | 2 - .../multi-platform-cpp/proj.android/.cproject | 111 +++++++ .../proj.android/build_native.py | 2 +- .../proj.android/project.properties | 2 +- .../HelloCpp.xcodeproj/project.pbxproj | 70 ++--- .../proj.win32/HelloCpp.sln | 6 +- .../proj.win32/HelloCpp.vcxproj | 14 +- .../multi-platform-js/proj.android/.cproject | 109 +++++++ .../multi-platform-js/proj.android/.project | 10 + .../proj.android/build_native.py | 4 +- .../HelloJavascript.xcodeproj/project.pbxproj | 122 ++++---- .../proj.win32/HelloJavascript.sln | 18 +- .../proj.win32/HelloJavascript.vcxproj | 26 +- template/multi-platform-lua/CMakeLists.txt | 2 - .../proj.android/build_native.py | 4 +- .../HelloLua.xcodeproj/project.pbxproj | 42 +-- .../proj.win32/HelloLua.sln | 18 +- .../proj.win32/HelloLua.vcxproj | 32 +- tools/project-creator/create_project.py | 179 +---------- .../project-creator/{ => module}/__init__.py | 0 tools/project-creator/module/core.py | 278 ++++++++++++++++++ tools/project-creator/module/ui.py | 197 +++++++++++++ 22 files changed, 896 insertions(+), 352 deletions(-) create mode 100644 template/multi-platform-cpp/proj.android/.cproject create mode 100644 template/multi-platform-js/proj.android/.cproject rename tools/project-creator/{ => module}/__init__.py (100%) mode change 100755 => 100644 create mode 100644 tools/project-creator/module/core.py create mode 100644 tools/project-creator/module/ui.py diff --git a/template/multi-platform-cpp/CMakeLists.txt b/template/multi-platform-cpp/CMakeLists.txt index f94f571ef2..88299d0d83 100644 --- a/template/multi-platform-cpp/CMakeLists.txt +++ b/template/multi-platform-cpp/CMakeLists.txt @@ -52,7 +52,6 @@ include_directories( ${COCOS2D_ROOT}/cocos ${COCOS2D_ROOT}/cocos/audio/include ${COCOS2D_ROOT}/cocos/2d - ${COCOS2D_ROOT}/cocos/2d/renderer ${COCOS2D_ROOT}/cocos/2d/platform ${COCOS2D_ROOT}/cocos/2d/platform/linux ${COCOS2D_ROOT}/cocos/base @@ -61,7 +60,6 @@ include_directories( ${COCOS2D_ROOT}/cocos/math/kazmath/include ${COCOS2D_ROOT}/extensions ${COCOS2D_ROOT}/external - ${COCOS2D_ROOT}/external/edtaa3func ${COCOS2D_ROOT}/external/jpeg/include/linux ${COCOS2D_ROOT}/external/tiff/include/linux ${COCOS2D_ROOT}/external/webp/include/linux diff --git a/template/multi-platform-cpp/proj.android/.cproject b/template/multi-platform-cpp/proj.android/.cproject new file mode 100644 index 0000000000..3514d06dd2 --- /dev/null +++ b/template/multi-platform-cpp/proj.android/.cproject @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/template/multi-platform-cpp/proj.android/build_native.py b/template/multi-platform-cpp/proj.android/build_native.py index e426c2c0ec..74c92aa2ee 100755 --- a/template/multi-platform-cpp/proj.android/build_native.py +++ b/template/multi-platform-cpp/proj.android/build_native.py @@ -88,7 +88,7 @@ def build(): select_toolchain_version() current_dir = os.path.dirname(os.path.realpath(__file__)) - cocos_root = os.path.join(current_dir, "../../..") + cocos_root = os.path.join(current_dir, "../cocos2d") app_android_root = current_dir copy_resources(app_android_root) diff --git a/template/multi-platform-cpp/proj.android/project.properties b/template/multi-platform-cpp/proj.android/project.properties index 16f145cfc9..870a4a196d 100644 --- a/template/multi-platform-cpp/proj.android/project.properties +++ b/template/multi-platform-cpp/proj.android/project.properties @@ -10,4 +10,4 @@ # Project target. target=android-10 -android.library.reference.1=../../../cocos/2d/platform/android/java +android.library.reference.1=../cocos2d/cocos/2d/platform/android/java diff --git a/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj b/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj index fdf23b3796..5b91461e19 100644 --- a/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj +++ b/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj @@ -243,7 +243,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../build/cocos2d_libs.xcodeproj; sourceTree = ""; }; + 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../cocos2d/build/cocos2d_libs.xcodeproj; sourceTree = ""; }; 1ACB3243164770DE00914215 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = ""; }; 1AFAF8B416D35DE700DB1158 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = ""; }; @@ -820,8 +820,8 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( "$(inherited)", - "$(SRCROOT)/../../../cocos/2d/platform/ios", - "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/ios", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/ios/Simulation", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; @@ -849,8 +849,8 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( "$(inherited)", - "$(SRCROOT)/../../../cocos/2d/platform/ios", - "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/ios", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/ios/Simulation", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; @@ -881,8 +881,8 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( "$(inherited)", - "$(SRCROOT)/../../../cocos/2d/platform/mac", - "$(SRCROOT)/../../../external/glfw3/include/mac", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/mac", + "$(SRCROOT)/../cocos2d/external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; LIBRARY_SEARCH_PATHS = ""; @@ -908,8 +908,8 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( "$(inherited)", - "$(SRCROOT)/../../../cocos/2d/platform/mac", - "$(SRCROOT)/../../../external/glfw3/include/mac", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/mac", + "$(SRCROOT)/../cocos2d/external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; LIBRARY_SEARCH_PATHS = ""; @@ -927,19 +927,19 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../..", - "$(SRCROOT)/../../../cocos", - "$(SRCROOT)/../../../cocos/base", - "$(SRCROOT)/../../../cocos/physics", - "$(SRCROOT)/../../../cocos/math/kazmath/include", - "$(SRCROOT)/../../../cocos/2d", - "$(SRCROOT)/../../../cocos/gui", - "$(SRCROOT)/../../../cocos/network", - "$(SRCROOT)/../../../cocos/audio/include", - "$(SRCROOT)/../../../cocos/editor-support", - "$(SRCROOT)/../../../extensions", - "$(SRCROOT)/../../../external", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", + "$(SRCROOT)/../cocos2d", + "$(SRCROOT)/../cocos2d/cocos", + "$(SRCROOT)/../cocos2d/cocos/base", + "$(SRCROOT)/../cocos2d/cocos/physics", + "$(SRCROOT)/../cocos2d/cocos/math/kazmath/include", + "$(SRCROOT)/../cocos2d/cocos/2d", + "$(SRCROOT)/../cocos2d/cocos/gui", + "$(SRCROOT)/../cocos2d/cocos/network", + "$(SRCROOT)/../cocos2d/cocos/audio/include", + "$(SRCROOT)/../cocos2d/cocos/editor-support", + "$(SRCROOT)/../cocos2d/extensions", + "$(SRCROOT)/../cocos2d/external", + "$(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk", ); ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -955,19 +955,19 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../..", - "$(SRCROOT)/../../../cocos", - "$(SRCROOT)/../../../cocos/base", - "$(SRCROOT)/../../../cocos/physics", - "$(SRCROOT)/../../../cocos/math/kazmath/include", - "$(SRCROOT)/../../../cocos/2d", - "$(SRCROOT)/../../../cocos/gui", - "$(SRCROOT)/../../../cocos/network", - "$(SRCROOT)/../../../cocos/audio/include", - "$(SRCROOT)/../../../cocos/editor-support", - "$(SRCROOT)/../../../extensions", - "$(SRCROOT)/../../../external", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", + "$(SRCROOT)/../cocos2d", + "$(SRCROOT)/../cocos2d/cocos", + "$(SRCROOT)/../cocos2d/cocos/base", + "$(SRCROOT)/../cocos2d/cocos/physics", + "$(SRCROOT)/../cocos2d/cocos/math/kazmath/include", + "$(SRCROOT)/../cocos2d/cocos/2d", + "$(SRCROOT)/../cocos2d/cocos/gui", + "$(SRCROOT)/../cocos2d/cocos/network", + "$(SRCROOT)/../cocos2d/cocos/audio/include", + "$(SRCROOT)/../cocos2d/cocos/editor-support", + "$(SRCROOT)/../cocos2d/extensions", + "$(SRCROOT)/../cocos2d/external", + "$(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk", ); OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/template/multi-platform-cpp/proj.win32/HelloCpp.sln b/template/multi-platform-cpp/proj.win32/HelloCpp.sln index 774ee12d79..b4dca4c0f5 100644 --- a/template/multi-platform-cpp/proj.win32/HelloCpp.sln +++ b/template/multi-platform-cpp/proj.win32/HelloCpp.sln @@ -8,11 +8,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp", "HelloCpp.vcxpro {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\..\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos2d\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\..\..\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\cocos2d\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\..\..\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\cocos2d\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/template/multi-platform-cpp/proj.win32/HelloCpp.vcxproj b/template/multi-platform-cpp/proj.win32/HelloCpp.vcxproj index f2e35df259..e29153ca14 100644 --- a/template/multi-platform-cpp/proj.win32/HelloCpp.vcxproj +++ b/template/multi-platform-cpp/proj.win32/HelloCpp.vcxproj @@ -36,13 +36,13 @@ - - + + - - + + @@ -143,14 +143,14 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)" - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} false - + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - + {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} diff --git a/template/multi-platform-js/proj.android/.cproject b/template/multi-platform-js/proj.android/.cproject new file mode 100644 index 0000000000..9ebba484ce --- /dev/null +++ b/template/multi-platform-js/proj.android/.cproject @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/template/multi-platform-js/proj.android/.project b/template/multi-platform-js/proj.android/.project index df461895c5..c65124f88e 100644 --- a/template/multi-platform-js/proj.android/.project +++ b/template/multi-platform-js/proj.android/.project @@ -20,6 +20,16 @@ + + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, + + + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch + + + com.android.ide.eclipse.adt.ApkBuilder diff --git a/template/multi-platform-js/proj.android/build_native.py b/template/multi-platform-js/proj.android/build_native.py index 4e67dd7cfb..e45ee3fa16 100755 --- a/template/multi-platform-js/proj.android/build_native.py +++ b/template/multi-platform-js/proj.android/build_native.py @@ -83,7 +83,7 @@ def copy_resources(app_android_root): copy_files(resources_dir, assets_dir) # jsb project should copy javascript files and resources(shared with cocos2d-html5) - resources_dir = os.path.join(app_android_root, "../../../cocos/scripting/javascript/script") + resources_dir = os.path.join(app_android_root, "../cocos2d/cocos/scripting/javascript/script") copy_files(resources_dir, assets_dir) def build(): @@ -92,7 +92,7 @@ def build(): select_toolchain_version() current_dir = os.path.dirname(os.path.realpath(__file__)) - cocos_root = os.path.join(current_dir, "../../..") + cocos_root = os.path.join(current_dir, "../cocos2d") app_android_root = current_dir copy_resources(app_android_root) diff --git a/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj b/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj index c43a50cddd..3f18ef509c 100644 --- a/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj +++ b/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj @@ -275,26 +275,26 @@ /* Begin PBXFileReference section */ 15FD5C5F183A60FE005CFF55 /* cocos2d-jsb.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = "cocos2d-jsb.js"; path = "../Resources/cocos2d-jsb.js"; sourceTree = ""; }; 15FD5C67183A6112005CFF55 /* cocos2d-jsb.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = "cocos2d-jsb.js"; path = "../Resources/cocos2d-jsb.js"; sourceTree = ""; }; - 15FD5C69183A6170005CFF55 /* jsb_cocos2d_gui.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_gui.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d_gui.js; sourceTree = ""; }; - 15FD5C6A183A6170005CFF55 /* jsb_cocos2d_studio.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_studio.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d_studio.js; sourceTree = ""; }; - 15FD5C6D183A6189005CFF55 /* jsb_cocos2d_gui.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_gui.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d_gui.js; sourceTree = ""; }; - 15FD5C6E183A6189005CFF55 /* jsb_cocos2d_studio.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_studio.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d_studio.js; sourceTree = ""; }; - 1A6767ED180E9B160076BC67 /* debugger */ = {isa = PBXFileReference; lastKnownFileType = folder; name = debugger; path = ../../../cocos/scripting/javascript/script/debugger; sourceTree = ""; }; - 1A6767EE180E9B160076BC67 /* jsb_chipmunk_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk_constants.js; path = ../../../cocos/scripting/javascript/script/jsb_chipmunk_constants.js; sourceTree = ""; }; - 1A6767EF180E9B160076BC67 /* jsb_chipmunk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk.js; path = ../../../cocos/scripting/javascript/script/jsb_chipmunk.js; sourceTree = ""; }; - 1A6767F0180E9B160076BC67 /* jsb_cocos2d_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_constants.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d_constants.js; sourceTree = ""; }; - 1A6767F1180E9B160076BC67 /* jsb_cocos2d_extension.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_extension.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d_extension.js; sourceTree = ""; }; - 1A6767F2180E9B160076BC67 /* jsb_cocos2d.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d.js; sourceTree = ""; }; - 1A6767F3180E9B160076BC67 /* jsb_cocosbuilder.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocosbuilder.js; path = ../../../cocos/scripting/javascript/script/jsb_cocosbuilder.js; sourceTree = ""; }; - 1A6767F4180E9B160076BC67 /* jsb_debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_debugger.js; path = ../../../cocos/scripting/javascript/script/jsb_debugger.js; sourceTree = ""; }; - 1A6767F5180E9B160076BC67 /* jsb_deprecated.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_deprecated.js; path = ../../../cocos/scripting/javascript/script/jsb_deprecated.js; sourceTree = ""; }; - 1A6767F6180E9B160076BC67 /* jsb_opengl_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl_constants.js; path = ../../../cocos/scripting/javascript/script/jsb_opengl_constants.js; sourceTree = ""; }; - 1A6767F7180E9B160076BC67 /* jsb_opengl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl.js; path = ../../../cocos/scripting/javascript/script/jsb_opengl.js; sourceTree = ""; }; - 1A6767F8180E9B160076BC67 /* jsb_sys.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_sys.js; path = ../../../cocos/scripting/javascript/script/jsb_sys.js; sourceTree = ""; }; - 1A6767F9180E9B160076BC67 /* jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb.js; path = ../../../cocos/scripting/javascript/script/jsb.js; sourceTree = ""; }; + 15FD5C69183A6170005CFF55 /* jsb_cocos2d_gui.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_gui.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_cocos2d_gui.js; sourceTree = ""; }; + 15FD5C6A183A6170005CFF55 /* jsb_cocos2d_studio.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_studio.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_cocos2d_studio.js; sourceTree = ""; }; + 15FD5C6D183A6189005CFF55 /* jsb_cocos2d_gui.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_gui.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_cocos2d_gui.js; sourceTree = ""; }; + 15FD5C6E183A6189005CFF55 /* jsb_cocos2d_studio.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_studio.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_cocos2d_studio.js; sourceTree = ""; }; + 1A6767ED180E9B160076BC67 /* debugger */ = {isa = PBXFileReference; lastKnownFileType = folder; name = debugger; path = ../cocos2d/cocos/scripting/javascript/script/debugger; sourceTree = ""; }; + 1A6767EE180E9B160076BC67 /* jsb_chipmunk_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk_constants.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_chipmunk_constants.js; sourceTree = ""; }; + 1A6767EF180E9B160076BC67 /* jsb_chipmunk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_chipmunk.js; sourceTree = ""; }; + 1A6767F0180E9B160076BC67 /* jsb_cocos2d_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_constants.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_cocos2d_constants.js; sourceTree = ""; }; + 1A6767F1180E9B160076BC67 /* jsb_cocos2d_extension.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_extension.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_cocos2d_extension.js; sourceTree = ""; }; + 1A6767F2180E9B160076BC67 /* jsb_cocos2d.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_cocos2d.js; sourceTree = ""; }; + 1A6767F3180E9B160076BC67 /* jsb_cocosbuilder.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocosbuilder.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_cocosbuilder.js; sourceTree = ""; }; + 1A6767F4180E9B160076BC67 /* jsb_debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_debugger.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_debugger.js; sourceTree = ""; }; + 1A6767F5180E9B160076BC67 /* jsb_deprecated.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_deprecated.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_deprecated.js; sourceTree = ""; }; + 1A6767F6180E9B160076BC67 /* jsb_opengl_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl_constants.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_opengl_constants.js; sourceTree = ""; }; + 1A6767F7180E9B160076BC67 /* jsb_opengl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_opengl.js; sourceTree = ""; }; + 1A6767F8180E9B160076BC67 /* jsb_sys.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_sys.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb_sys.js; sourceTree = ""; }; + 1A6767F9180E9B160076BC67 /* jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb.js; path = ../cocos2d/cocos/scripting/javascript/script/jsb.js; sourceTree = ""; }; 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; - 1A96A4F2174A3432008653A9 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; - 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../build/cocos2d_libs.xcodeproj; sourceTree = ""; }; + 1A96A4F2174A3432008653A9 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../cocos2d/cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; + 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../cocos2d/build/cocos2d_libs.xcodeproj; sourceTree = ""; }; 1AE4B40016D1FECD003C6D1C /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.js; path = ../Resources/main.js; sourceTree = ""; }; 1AE4B40116D1FECD003C6D1C /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = res; path = ../Resources/res; sourceTree = ""; }; 1AE4B40216D1FECD003C6D1C /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../Resources/src; sourceTree = ""; }; @@ -905,9 +905,9 @@ ); HEADER_SEARCH_PATHS = ( "$(inherited)", - "$(SRCROOT)/../../../cocos/2d/platform/mac", - "$(SRCROOT)/../../../external/spidermonkey/include/mac", - "$(SRCROOT)/../../../external/glfw3/include/mac", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/mac", + "$(SRCROOT)/../cocos2d/external/spidermonkey/include/mac", + "$(SRCROOT)/../cocos2d/external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; LIBRARY_SEARCH_PATHS = ""; @@ -930,9 +930,9 @@ ); HEADER_SEARCH_PATHS = ( "$(inherited)", - "$(SRCROOT)/../../../cocos/2d/platform/mac", - "$(SRCROOT)/../../../external/spidermonkey/include/mac", - "$(SRCROOT)/../../../external/glfw3/include/mac", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/mac", + "$(SRCROOT)/../cocos2d/external/spidermonkey/include/mac", + "$(SRCROOT)/../cocos2d/external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; LIBRARY_SEARCH_PATHS = ""; @@ -960,21 +960,21 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../..", - "$(SRCROOT)/../../../cocos", - "$(SRCROOT)/../../../cocos/base", - "$(SRCROOT)/../../../cocos/physics", - "$(SRCROOT)/../../../cocos/math/kazmath/include", - "$(SRCROOT)/../../../cocos/2d", - "$(SRCROOT)/../../../cocos/gui", - "$(SRCROOT)/../../../cocos/network", - "$(SRCROOT)/../../../cocos/audio/include", - "$(SRCROOT)/../../../cocos/editor-support", - "$(SRCROOT)/../../../cocos/scripting/javascript/bindings", - "$(SRCROOT)/../../../cocos/scripting/auto-generated/js-bindings", - "$(SRCROOT)/../../../extensions", - "$(SRCROOT)/../../../external", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", + "$(SRCROOT)/../cocos2d", + "$(SRCROOT)/../cocos2d/cocos", + "$(SRCROOT)/../cocos2d/cocos/base", + "$(SRCROOT)/../cocos2d/cocos/physics", + "$(SRCROOT)/../cocos2d/cocos/math/kazmath/include", + "$(SRCROOT)/../cocos2d/cocos/2d", + "$(SRCROOT)/../cocos2d/cocos/gui", + "$(SRCROOT)/../cocos2d/cocos/network", + "$(SRCROOT)/../cocos2d/cocos/audio/include", + "$(SRCROOT)/../cocos2d/cocos/editor-support", + "$(SRCROOT)/../cocos2d/cocos/scripting/javascript/bindings", + "$(SRCROOT)/../cocos2d/cocos/scripting/auto-generated/js-bindings", + "$(SRCROOT)/../cocos2d/extensions", + "$(SRCROOT)/../cocos2d/external", + "$(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk", ); IPHONEOS_DEPLOYMENT_TARGET = 5.1; ONLY_ACTIVE_ARCH = YES; @@ -997,21 +997,21 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../..", - "$(SRCROOT)/../../../cocos", - "$(SRCROOT)/../../../cocos/base", - "$(SRCROOT)/../../../cocos/physics", - "$(SRCROOT)/../../../cocos/math/kazmath/include", - "$(SRCROOT)/../../../cocos/2d", - "$(SRCROOT)/../../../cocos/gui", - "$(SRCROOT)/../../../cocos/network", - "$(SRCROOT)/../../../cocos/audio/include", - "$(SRCROOT)/../../../cocos/editor-support", - "$(SRCROOT)/../../../cocos/scripting/javascript/bindings", - "$(SRCROOT)/../../../cocos/scripting/auto-generated/js-bindings", - "$(SRCROOT)/../../../extensions", - "$(SRCROOT)/../../../external", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", + "$(SRCROOT)/../cocos2d", + "$(SRCROOT)/../cocos2d/cocos", + "$(SRCROOT)/../cocos2d/cocos/base", + "$(SRCROOT)/../cocos2d/cocos/physics", + "$(SRCROOT)/../cocos2d/cocos/math/kazmath/include", + "$(SRCROOT)/../cocos2d/cocos/2d", + "$(SRCROOT)/../cocos2d/cocos/gui", + "$(SRCROOT)/../cocos2d/cocos/network", + "$(SRCROOT)/../cocos2d/cocos/audio/include", + "$(SRCROOT)/../cocos2d/cocos/editor-support", + "$(SRCROOT)/../cocos2d/cocos/scripting/javascript/bindings", + "$(SRCROOT)/../cocos2d/cocos/scripting/auto-generated/js-bindings", + "$(SRCROOT)/../cocos2d/extensions", + "$(SRCROOT)/../cocos2d/external", + "$(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk", ); IPHONEOS_DEPLOYMENT_TARGET = 5.1; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -1035,9 +1035,9 @@ ); HEADER_SEARCH_PATHS = ( "$(inherited)", - "$(SRCROOT)/../../../cocos/2d/platform/ios", - "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", - "$(SRCROOT)/../../../external/spidermonkey/include/ios", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/ios", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/ios/Simulation", + "$(SRCROOT)/../cocos2d/external/spidermonkey/include/ios", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; @@ -1062,9 +1062,9 @@ ); HEADER_SEARCH_PATHS = ( "$(inherited)", - "$(SRCROOT)/../../../cocos/2d/platform/ios", - "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", - "$(SRCROOT)/../../../external/spidermonkey/include/ios", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/ios", + "$(SRCROOT)/../cocos2d/cocos/2d/platform/ios/Simulation", + "$(SRCROOT)/../cocos2d/external/spidermonkey/include/ios", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; diff --git a/template/multi-platform-js/proj.win32/HelloJavascript.sln b/template/multi-platform-js/proj.win32/HelloJavascript.sln index 5880df4c17..05d76f1c83 100644 --- a/template/multi-platform-js/proj.win32/HelloJavascript.sln +++ b/template/multi-platform-js/proj.win32/HelloJavascript.sln @@ -10,16 +10,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloJavascript", "HelloJav {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\..\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos2d\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\..\..\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\cocos2d\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\..\..\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\cocos2d\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" ProjectSection(ProjectDependencies) = postProject {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBinding", "..\..\..\cocos\scripting\javascript\bindings\proj.win32\libJSBinding.vcxproj", "{39379840-825A-45A0-B363-C09FFEF864BD}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBinding", "..\cocos2d\cocos\scripting\javascript\bindings\proj.win32\libJSBinding.vcxproj", "{39379840-825A-45A0-B363-C09FFEF864BD}" ProjectSection(ProjectDependencies) = postProject {21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28} {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} @@ -27,15 +27,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBinding", "..\..\..\co {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBindingForChipmunk", "..\..\..\cocos\scripting\javascript\bindings\chipmunk\libJSBindingForChipmunk.vcxproj", "{21070E58-EEC6-4E16-8B4F-6D083DF55790}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBindingForChipmunk", "..\cocos2d\cocos\scripting\javascript\bindings\chipmunk\libJSBindingForChipmunk.vcxproj", "{21070E58-EEC6-4E16-8B4F-6D083DF55790}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libLocalStorage", "..\..\..\cocos\storage\local-storage\proj.win32\libLocalStorage.vcxproj", "{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libLocalStorage", "..\cocos2d\cocos\storage\local-storage\proj.win32\libLocalStorage.vcxproj", "{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBindingForLocalStorage", "..\..\..\cocos\scripting\javascript\bindings\localstorage\libJSBindingForLocalStorage.vcxproj", "{68F5F371-BD7B-4C30-AE5B-0B08F22E0CDE}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBindingForLocalStorage", "..\cocos2d\cocos\scripting\javascript\bindings\localstorage\libJSBindingForLocalStorage.vcxproj", "{68F5F371-BD7B-4C30-AE5B-0B08F22E0CDE}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBindingForExtension", "..\..\..\cocos\scripting\javascript\bindings\extension\libJSBindingForExtension.vcxproj", "{625F7391-9A91-48A1-8CFC-79508C822637}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBindingForExtension", "..\cocos2d\cocos\scripting\javascript\bindings\extension\libJSBindingForExtension.vcxproj", "{625F7391-9A91-48A1-8CFC-79508C822637}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\..\..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\cocos2d\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/template/multi-platform-js/proj.win32/HelloJavascript.vcxproj b/template/multi-platform-js/proj.win32/HelloJavascript.vcxproj index 35da6b1ee0..caf0791fc7 100644 --- a/template/multi-platform-js/proj.win32/HelloJavascript.vcxproj +++ b/template/multi-platform-js/proj.win32/HelloJavascript.vcxproj @@ -34,13 +34,13 @@ - - + + - - + + @@ -184,31 +184,31 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)\HelloJavascriptRes\" /e /Y - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - + {21070e58-eec6-4e16-8b4f-6d083df55790} - + {625f7391-9a91-48a1-8cfc-79508c822637} - + {68f5f371-bd7b-4c30-ae5b-0b08f22e0cde} - + {39379840-825a-45a0-b363-c09ffef864bd} - + {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - + {21b2c324-891f-48ea-ad1a-5ae13de12e28} - + {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} diff --git a/template/multi-platform-lua/CMakeLists.txt b/template/multi-platform-lua/CMakeLists.txt index 8f3f930bd4..a3cf368403 100644 --- a/template/multi-platform-lua/CMakeLists.txt +++ b/template/multi-platform-lua/CMakeLists.txt @@ -55,7 +55,6 @@ include_directories( ${COCOS2D_ROOT}/cocos ${COCOS2D_ROOT}/cocos/audio/include ${COCOS2D_ROOT}/cocos/2d - ${COCOS2D_ROOT}/cocos/2d/renderer ${COCOS2D_ROOT}/cocos/2d/platform ${COCOS2D_ROOT}/cocos/2d/platform/linux ${COCOS2D_ROOT}/cocos/base @@ -64,7 +63,6 @@ include_directories( ${COCOS2D_ROOT}/cocos/math/kazmath/include ${COCOS2D_ROOT}/extensions ${COCOS2D_ROOT}/external - ${COCOS2D_ROOT}/external/edtaa3func ${COCOS2D_ROOT}/external/jpeg/include/linux ${COCOS2D_ROOT}/external/tiff/include/linux ${COCOS2D_ROOT}/external/webp/include/linux diff --git a/template/multi-platform-lua/proj.android/build_native.py b/template/multi-platform-lua/proj.android/build_native.py index c1fe04ac28..07dacc4368 100755 --- a/template/multi-platform-lua/proj.android/build_native.py +++ b/template/multi-platform-lua/proj.android/build_native.py @@ -83,7 +83,7 @@ def copy_resources(app_android_root): copy_files(resources_dir, assets_dir) # lua project should copy lua script - resources_dir = os.path.join(app_android_root, "../../../cocos/scripting/lua/script") + resources_dir = os.path.join(app_android_root, "../cocos2d/cocos/scripting/lua/script") copy_files(resources_dir, assets_dir) def build(): @@ -92,7 +92,7 @@ def build(): select_toolchain_version() current_dir = os.path.dirname(os.path.realpath(__file__)) - cocos_root = os.path.join(current_dir, "../../..") + cocos_root = os.path.join(current_dir, "../cocos2d") app_android_root = current_dir copy_resources(app_android_root) diff --git a/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj b/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj index ec0d5f7366..76f9c16c73 100644 --- a/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj +++ b/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj @@ -219,24 +219,24 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../build/cocos2d_libs.xcodeproj; sourceTree = ""; }; - 15A8A4551834C6AD00142BE0 /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AudioEngine.lua; path = ../../../cocos/scripting/lua/script/AudioEngine.lua; sourceTree = ""; }; - 15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CCBReaderLoad.lua; path = ../../../cocos/scripting/lua/script/CCBReaderLoad.lua; sourceTree = ""; }; - 15A8A4571834C6AD00142BE0 /* Cocos2d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2d.lua; path = ../../../cocos/scripting/lua/script/Cocos2d.lua; sourceTree = ""; }; - 15A8A4581834C6AD00142BE0 /* Cocos2dConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2dConstants.lua; path = ../../../cocos/scripting/lua/script/Cocos2dConstants.lua; sourceTree = ""; }; - 15A8A4591834C6AD00142BE0 /* Deprecated.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Deprecated.lua; path = ../../../cocos/scripting/lua/script/Deprecated.lua; sourceTree = ""; }; - 15A8A45A1834C6AD00142BE0 /* DeprecatedClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedClass.lua; path = ../../../cocos/scripting/lua/script/DeprecatedClass.lua; sourceTree = ""; }; - 15A8A45B1834C6AD00142BE0 /* DeprecatedEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedEnum.lua; path = ../../../cocos/scripting/lua/script/DeprecatedEnum.lua; sourceTree = ""; }; - 15A8A45C1834C6AD00142BE0 /* DeprecatedOpenglEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedOpenglEnum.lua; path = ../../../cocos/scripting/lua/script/DeprecatedOpenglEnum.lua; sourceTree = ""; }; - 15A8A45D1834C6AD00142BE0 /* DrawPrimitives.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DrawPrimitives.lua; path = ../../../cocos/scripting/lua/script/DrawPrimitives.lua; sourceTree = ""; }; - 15A8A45E1834C6AD00142BE0 /* json.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = json.lua; path = ../../../cocos/scripting/lua/script/json.lua; sourceTree = ""; }; - 15A8A45F1834C6AD00142BE0 /* luaj.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaj.lua; path = ../../../cocos/scripting/lua/script/luaj.lua; sourceTree = ""; }; - 15A8A4601834C6AD00142BE0 /* luaoc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaoc.lua; path = ../../../cocos/scripting/lua/script/luaoc.lua; sourceTree = ""; }; - 15A8A4611834C6AD00142BE0 /* Opengl.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Opengl.lua; path = ../../../cocos/scripting/lua/script/Opengl.lua; sourceTree = ""; }; - 15A8A4621834C6AD00142BE0 /* OpenglConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OpenglConstants.lua; path = ../../../cocos/scripting/lua/script/OpenglConstants.lua; sourceTree = ""; }; - 15A8A4631834C6AD00142BE0 /* StudioConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = StudioConstants.lua; path = ../../../cocos/scripting/lua/script/StudioConstants.lua; sourceTree = ""; }; + 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../cocos2d/build/cocos2d_libs.xcodeproj; sourceTree = ""; }; + 15A8A4551834C6AD00142BE0 /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AudioEngine.lua; path = ../cocos2d/cocos/scripting/lua/script/AudioEngine.lua; sourceTree = ""; }; + 15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CCBReaderLoad.lua; path = ../cocos2d/cocos/scripting/lua/script/CCBReaderLoad.lua; sourceTree = ""; }; + 15A8A4571834C6AD00142BE0 /* Cocos2d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2d.lua; path = ../cocos2d/cocos/scripting/lua/script/Cocos2d.lua; sourceTree = ""; }; + 15A8A4581834C6AD00142BE0 /* Cocos2dConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2dConstants.lua; path = ../cocos2d/cocos/scripting/lua/script/Cocos2dConstants.lua; sourceTree = ""; }; + 15A8A4591834C6AD00142BE0 /* Deprecated.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Deprecated.lua; path = ../cocos2d/cocos/scripting/lua/script/Deprecated.lua; sourceTree = ""; }; + 15A8A45A1834C6AD00142BE0 /* DeprecatedClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedClass.lua; path = ../cocos2d/cocos/scripting/lua/script/DeprecatedClass.lua; sourceTree = ""; }; + 15A8A45B1834C6AD00142BE0 /* DeprecatedEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedEnum.lua; path = ../cocos2d/cocos/scripting/lua/script/DeprecatedEnum.lua; sourceTree = ""; }; + 15A8A45C1834C6AD00142BE0 /* DeprecatedOpenglEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedOpenglEnum.lua; path = ../cocos2d/cocos/scripting/lua/script/DeprecatedOpenglEnum.lua; sourceTree = ""; }; + 15A8A45D1834C6AD00142BE0 /* DrawPrimitives.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DrawPrimitives.lua; path = ../cocos2d/cocos/scripting/lua/script/DrawPrimitives.lua; sourceTree = ""; }; + 15A8A45E1834C6AD00142BE0 /* json.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = json.lua; path = ../cocos2d/cocos/scripting/lua/script/json.lua; sourceTree = ""; }; + 15A8A45F1834C6AD00142BE0 /* luaj.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaj.lua; path = ../cocos2d/cocos/scripting/lua/script/luaj.lua; sourceTree = ""; }; + 15A8A4601834C6AD00142BE0 /* luaoc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaoc.lua; path = ../cocos2d/cocos/scripting/lua/script/luaoc.lua; sourceTree = ""; }; + 15A8A4611834C6AD00142BE0 /* Opengl.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Opengl.lua; path = ../cocos2d/cocos/scripting/lua/script/Opengl.lua; sourceTree = ""; }; + 15A8A4621834C6AD00142BE0 /* OpenglConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OpenglConstants.lua; path = ../cocos2d/cocos/scripting/lua/script/OpenglConstants.lua; sourceTree = ""; }; + 15A8A4631834C6AD00142BE0 /* StudioConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = StudioConstants.lua; path = ../cocos2d/cocos/scripting/lua/script/StudioConstants.lua; sourceTree = ""; }; 15A8A4871834C90E00142BE0 /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; - 15C1568D1683131500D239F2 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; + 15C1568D1683131500D239F2 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../cocos2d/cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; 1AC3622316D47C5C000847F2 /* background.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = background.mp3; path = ../Resources/background.mp3; sourceTree = ""; }; 1AC3622416D47C5C000847F2 /* background.ogg */ = {isa = PBXFileReference; lastKnownFileType = file; name = background.ogg; path = ../Resources/background.ogg; sourceTree = ""; }; 1AC3622516D47C5C000847F2 /* crop.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = crop.png; path = ../Resources/crop.png; sourceTree = ""; }; @@ -824,7 +824,7 @@ 10000, ); SDKROOT = macosx; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../cocos $(SRCROOT)/../../../cocos/base $(SRCROOT)/../../../cocos/2d $(SRCROOT)/../../../cocos/physics $(SRCROOT)/../../../cocos/math/kazmath/include $(SRCROOT)/../../../cocos/2d/platform/mac $(SRCROOT)/../../../cocos/audio/include $(SRCROOT)/../../../cocos/editor-support $(SRCROOT)/../../../cocos/gui $(SRCROOT)/../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../external $(SRCROOT)/../../../external/glfw3/include/mac $(SRCROOT)/../../../cocos/scripting/lua/bindings $(SRCROOT)/../../../external/lua/luajit/include $(SRCROOT)/../../../external/lua/tolua"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos2d/cocos $(SRCROOT)/../cocos2d/cocos/base $(SRCROOT)/../cocos2d/cocos/2d $(SRCROOT)/../cocos2d/cocos/physics $(SRCROOT)/../cocos2d/cocos/math/kazmath/include $(SRCROOT)/../cocos2d/cocos/2d/platform/mac $(SRCROOT)/../cocos2d/cocos/audio/include $(SRCROOT)/../cocos2d/cocos/editor-support $(SRCROOT)/../cocos2d/cocos/gui $(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk $(SRCROOT)/../cocos2d/external $(SRCROOT)/../cocos2d/external/glfw3/include/mac $(SRCROOT)/../cocos2d/cocos/scripting/lua/bindings $(SRCROOT)/../cocos2d/external/lua/luajit/include $(SRCROOT)/../cocos2d/external/lua/tolua"; }; name = Debug; }; @@ -850,7 +850,7 @@ 10000, ); SDKROOT = macosx; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../cocos $(SRCROOT)/../../../cocos/base $(SRCROOT)/../../../cocos/2d $(SRCROOT)/../../../cocos/physics $(SRCROOT)/../../../cocos/math/kazmath/include $(SRCROOT)/../../../cocos/2d/platform/mac $(SRCROOT)/../../../cocos/audio/include $(SRCROOT)/../../../cocos/editor-support $(SRCROOT)/../../../cocos/gui $(SRCROOT)/../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../external $(SRCROOT)/../../../external/glfw3/include/mac $(SRCROOT)/../../../cocos/scripting/lua/bindings $(SRCROOT)/../../../external/lua/luajit/include $(SRCROOT)/../../../external/lua/tolua"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos2d/cocos $(SRCROOT)/../cocos2d/cocos/base $(SRCROOT)/../cocos2d/cocos/2d $(SRCROOT)/../cocos2d/cocos/physics $(SRCROOT)/../cocos2d/cocos/math/kazmath/include $(SRCROOT)/../cocos2d/cocos/2d/platform/mac $(SRCROOT)/../cocos2d/cocos/audio/include $(SRCROOT)/../cocos2d/cocos/editor-support $(SRCROOT)/../cocos2d/cocos/gui $(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk $(SRCROOT)/../cocos2d/external $(SRCROOT)/../cocos2d/external/glfw3/include/mac $(SRCROOT)/../cocos2d/cocos/scripting/lua/bindings $(SRCROOT)/../cocos2d/external/lua/luajit/include $(SRCROOT)/../cocos2d/external/lua/tolua"; }; name = Release; }; @@ -942,7 +942,7 @@ LIBRARY_SEARCH_PATHS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../cocos $(SRCROOT)/../../../cocos/base $(SRCROOT)/../../../cocos/2d $(SRCROOT)/../../../cocos/physics $(SRCROOT)/../../../cocos/math/kazmath/include $(SRCROOT)/../../../cocos/2d/platform/ios $(SRCROOT)/../../../cocos/audio/include $(SRCROOT)/../../../cocos/editor-support $(SRCROOT)/../../../cocos/gui $(SRCROOT)/../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../external $(SRCROOT)/../../../cocos/scripting/lua/bindings $(SRCROOT)/../../../external/lua/luajit/include $(SRCROOT)/../../../external/lua/tolua"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos2d/cocos $(SRCROOT)/../cocos2d/cocos/base $(SRCROOT)/../cocos2d/cocos/2d $(SRCROOT)/../cocos2d/cocos/physics $(SRCROOT)/../cocos2d/cocos/math/kazmath/include $(SRCROOT)/../cocos2d/cocos/2d/platform/ios $(SRCROOT)/../cocos2d/cocos/audio/include $(SRCROOT)/../cocos2d/cocos/editor-support $(SRCROOT)/../cocos2d/cocos/gui $(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk $(SRCROOT)/../cocos2d/external $(SRCROOT)/../cocos2d/cocos/scripting/lua/bindings $(SRCROOT)/../cocos2d/external/lua/luajit/include $(SRCROOT)/../cocos2d/external/lua/tolua"; }; name = Debug; }; @@ -964,7 +964,7 @@ LIBRARY_SEARCH_PATHS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../cocos $(SRCROOT)/../../../cocos/base $(SRCROOT)/../../../cocos/2d $(SRCROOT)/../../../cocos/physics $(SRCROOT)/../../../cocos/math/kazmath/include $(SRCROOT)/../../../cocos/2d/platform/ios $(SRCROOT)/../../../cocos/audio/include $(SRCROOT)/../../../cocos/editor-support $(SRCROOT)/../../../cocos/gui $(SRCROOT)/../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../external $(SRCROOT)/../../../cocos/scripting/lua/bindings $(SRCROOT)/../../../external/lua/luajit/include $(SRCROOT)/../../../external/lua/tolua"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos2d/cocos $(SRCROOT)/../cocos2d/cocos/base $(SRCROOT)/../cocos2d/cocos/2d $(SRCROOT)/../cocos2d/cocos/physics $(SRCROOT)/../cocos2d/cocos/math/kazmath/include $(SRCROOT)/../cocos2d/cocos/2d/platform/ios $(SRCROOT)/../cocos2d/cocos/audio/include $(SRCROOT)/../cocos2d/cocos/editor-support $(SRCROOT)/../cocos2d/cocos/gui $(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk $(SRCROOT)/../cocos2d/external $(SRCROOT)/../cocos2d/cocos/scripting/lua/bindings $(SRCROOT)/../cocos2d/external/lua/luajit/include $(SRCROOT)/../cocos2d/external/lua/tolua"; }; name = Release; }; diff --git a/template/multi-platform-lua/proj.win32/HelloLua.sln b/template/multi-platform-lua/proj.win32/HelloLua.sln index d5769661f0..1da75a564c 100644 --- a/template/multi-platform-lua/proj.win32/HelloLua.sln +++ b/template/multi-platform-lua/proj.win32/HelloLua.sln @@ -10,28 +10,28 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "HelloLua.vcxpro {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\..\..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\cocos2d\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" ProjectSection(ProjectDependencies) = postProject {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\..\..\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\cocos2d\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\..\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos2d\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\..\..\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\cocos2d\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\..\..\cocos\scripting\lua\bindings\liblua.vcxproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\cocos2d\cocos\scripting\lua\bindings\liblua.vcxproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libNetwork", "..\..\..\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libNetwork", "..\cocos2d\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosBuilder", "..\..\..\cocos\editor-support\cocosbuilder\proj.win32\libCocosBuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosBuilder", "..\cocos2d\cocos\editor-support\cocosbuilder\proj.win32\libCocosBuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosStudio", "..\..\..\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosStudio", "..\cocos2d\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGUI", "..\..\..\cocos\gui\proj.win32\libGUI.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGUI", "..\cocos2d\cocos\gui\proj.win32\libGUI.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/template/multi-platform-lua/proj.win32/HelloLua.vcxproj b/template/multi-platform-lua/proj.win32/HelloLua.vcxproj index 6762f6a744..df4d1907a2 100644 --- a/template/multi-platform-lua/proj.win32/HelloLua.vcxproj +++ b/template/multi-platform-lua/proj.win32/HelloLua.vcxproj @@ -36,13 +36,13 @@ - - + + - - + + @@ -104,13 +104,13 @@ - xcopy "$(ProjectDir)..\..\..\cocos\scripting\lua\script" "$(ProjectDir)..\Resources" /e /Y + xcopy "$(ProjectDir)..\cocos2d\cocos\scripting\lua\script" "$(ProjectDir)..\Resources" /e /Y if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\cocos2d\external\websockets\prebuilt\win32\*.*" "$(OutDir)" @@ -160,7 +160,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(Ou if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\cocos2d\external\websockets\prebuilt\win32\*.*" "$(OutDir)" @@ -175,31 +175,31 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(Ou - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - + {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - + {b57cf53f-2e49-4031-9822-047cc0e6bde2} - + {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - + {df2638c0-8128-4847-867c-6eafe3dee7b5} - + {ddc3e27f-004d-4dd4-9dd3-931a013d2159} - + {21b2c324-891f-48ea-ad1a-5ae13de12e28} - + {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} diff --git a/tools/project-creator/create_project.py b/tools/project-creator/create_project.py index 640fa4e038..48eb9d0ef0 100755 --- a/tools/project-creator/create_project.py +++ b/tools/project-creator/create_project.py @@ -1,177 +1,20 @@ #!/usr/bin/python # create_project.py +#coding=utf-8 # Create cross-platform cocos2d-x project # Copyright (c) 2012 cocos2d-x.org -# Author: WangZhe +# Author: chuanwei -# define global variables -PLATFORMS = { - "cpp" : ["ios_mac", "android", "win32", "linux"], - "lua" : ["ios_mac", "android", "win32", "linux"], - "javascript" : ["ios_mac", "android", "win32"] -} - - -# begin import sys -import os, os.path -import json -import shutil +from module.ui import TkProjectDialog +from module.core import CocosProject -def checkParams(): - from optparse import OptionParser - - # set the parser to parse input params - # the correspond variable name of "-x, --xxx" is parser.xxx - parser = OptionParser(usage="Usage: %prog -p -k -l \nSample: %prog -p MyGame -k com.MyCompany.AwesomeGame -l javascript") - parser.add_option("-p", "--project", metavar="PROJECT_NAME", help="Set a project name") - parser.add_option("-k", "--package", metavar="PACKAGE_NAME", help="Set a package name for project") - parser.add_option("-l", "--language", - metavar="PROGRAMMING_NAME", - type="choice", - choices=["cpp", "lua", "javascript"], - help="Major programming language you want to use, should be [cpp | lua | javascript]") - - #parse the params - (opts, args) = parser.parse_args() - - # generate our internal params - context = {}.fromkeys(("language", "src_project_name", "src_package_name", "dst_project_name", "dst_package_name", "src_project_path", "dst_project_path", "script_dir")) - platforms_list = [] - - context["script_dir"] = os.path.abspath(os.path.dirname(__file__)) - - if opts.project: - context["dst_project_name"] = opts.project - context["dst_project_path"] = os.path.abspath(os.path.join(context["script_dir"], "..", "..", "projects", context["dst_project_name"])) - else: - parser.error("-p or --project is not specified") - - if opts.package: - context["dst_package_name"] = opts.package - else: - parser.error("-k or --package is not specified") - - if opts.language: - context["language"] = opts.language - else: - parser.error("-l or --language is not specified") - - # fill in src_project_name and src_package_name according to "language" - template_dir = os.path.abspath(os.path.join(context["script_dir"], "..", "..", "template")) - if ("cpp" == context["language"]): - context["src_project_name"] = "HelloCpp" - context["src_package_name"] = "org.cocos2dx.hellocpp" - context["src_project_path"] = os.path.join(template_dir, "multi-platform-cpp") - elif ("lua" == context["language"]): - context["src_project_name"] = "HelloLua" - context["src_package_name"] = "org.cocos2dx.hellolua" - context["src_project_path"] = os.path.join(template_dir, "multi-platform-lua") - elif ("javascript" == context["language"]): - context["src_project_name"] = "HelloJavascript" - context["src_package_name"] = "org.cocos2dx.hellojavascript" - context["src_project_path"] = os.path.join(template_dir, "multi-platform-js") - else: - print ("Your language parameter doesn\'t exist." \ - "Check correct language option\'s parameter") - sys.exit() - platforms_list = PLATFORMS.get(context["language"], []) - return context, platforms_list -# end of checkParams(context) function - -def replaceString(filepath, src_string, dst_string): - content = "" - f1 = open(filepath, "rb") - for line in f1: - strline = line.decode('utf8') - if src_string in strline: - content += strline.replace(src_string, dst_string) - else: - content += strline - f1.close() - f2 = open(filepath, "wb") - f2.write(content.encode('utf8')) - f2.close() -# end of replaceString - -def processPlatformProjects(context, platform): - # determine proj_path - proj_path = os.path.join(context["dst_project_path"], "proj." + platform) - java_package_path = "" - - # read json config file for the current platform - conf_path = os.path.join(context["script_dir"], "%s.json" % platform) - f = open(conf_path) - data = json.load(f) - - # rename package path, like "org.cocos2dx.hello" to "com.company.game". This is a special process for android - if platform == "android": - src_pkg = context["src_package_name"].split('.') - dst_pkg = context["dst_package_name"].split('.') - - java_package_path = os.path.join(*dst_pkg) - - # rename files and folders - for item in data["rename"]: - tmp = item.replace("PACKAGE_PATH", java_package_path) - src = tmp.replace("PROJECT_NAME", context["src_project_name"]) - dst = tmp.replace("PROJECT_NAME", context["dst_project_name"]) - if os.path.exists(os.path.join(proj_path, src)): - os.rename(os.path.join(proj_path, src), os.path.join(proj_path, dst)) - - # remove useless files and folders - for item in data["remove"]: - dst = item.replace("PROJECT_NAME", context["dst_project_name"]) - if os.path.exists(os.path.join(proj_path, dst)): - shutil.rmtree(os.path.join(proj_path, dst)) - - # rename package_name. This should be replaced at first. Don't change this sequence - for item in data["replace_package_name"]: - tmp = item.replace("PACKAGE_PATH", java_package_path) - dst = tmp.replace("PROJECT_NAME", context["dst_project_name"]) - if os.path.exists(os.path.join(proj_path, dst)): - replaceString(os.path.join(proj_path, dst), context["src_package_name"], context["dst_package_name"]) - - # rename project_name - for item in data["replace_project_name"]: - tmp = item.replace("PACKAGE_PATH", java_package_path) - dst = tmp.replace("PROJECT_NAME", context["dst_project_name"]) - if os.path.exists(os.path.join(proj_path, dst)): - replaceString(os.path.join(proj_path, dst), context["src_project_name"], context["dst_project_name"]) - - # done! - print ("proj.%s\t\t: Done!" % platform) -# end of processPlatformProjects - -def createPlatformProjects(): - # prepare valid "context" dictionary - context, platforms_list = checkParams() - # print context, platforms_list - - # copy "lauguage"(cpp/lua/javascript) platform.proj into cocos2d-x/projects//folder - if os.path.exists(context["dst_project_path"]): - print ("Error:" + context["dst_project_path"] + " folder is already existing") - print ("Please remove the old project or choose a new PROJECT_NAME in -project parameter") - sys.exit() - else: - shutil.copytree(context["src_project_path"], context["dst_project_path"], True) - - # call process_proj from each platform's script folder - for platform in platforms_list: - processPlatformProjects(context, platform) - # exec "import %s.handle_project_files" % (platform) - # exec "%s.handle_project_files.handle_project_files(context)" % (platform) - - print ("New project has been created in this path: " + context["dst_project_path"].replace("/tools/project-creator/../..", "")) - print ("Have Fun!") - - - - - -# -------------- main -------------- -# dump argvs -# print sys.argv +# ------------ main -------------- if __name__ == '__main__': - createPlatformProjects() + if len(sys.argv)==1: + TkProjectDialog() + else: + project = CocosProject() + name, package, language, path = project.checkParams() + project.createPlatformProjects(name, package, language, path) diff --git a/tools/project-creator/__init__.py b/tools/project-creator/module/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from tools/project-creator/__init__.py rename to tools/project-creator/module/__init__.py diff --git a/tools/project-creator/module/core.py b/tools/project-creator/module/core.py new file mode 100644 index 0000000000..80c01d6c57 --- /dev/null +++ b/tools/project-creator/module/core.py @@ -0,0 +1,278 @@ +#!/usr/bin/python +#coding=utf-8 +# create_project.py +# Create cross-platform cocos2d-x project +# Copyright (c) 2012 cocos2d-x.org +# Author: WangZhe +#modify:chuanwei 2013.12.23 + + +import sys +import os, os.path +import json +import shutil + +def replaceString(filepath, src_string, dst_string): + """ From file's content replace specified string + Arg: + filepath: Specify a file contains the path + src_string: old string + dst_string: new string + """ + content = "" + f1 = open(filepath, "rb") + for line in f1: + strline = line.decode('utf8') + if src_string in strline: + content += strline.replace(src_string, dst_string) + else: + content += strline + f1.close() + f2 = open(filepath, "wb") + f2.write(content.encode('utf8')) + f2.close() +#end of replaceString + +class CocosProject: + + def __init__(self): + """ + """ + self.platforms= { + "cpp" : ["ios_mac", "android", "win32", "linux"], + "lua" : ["ios_mac", "android", "win32", "linux"], + "javascript" : ["ios_mac", "android", "win32"] + } + self.context = { + "language": None, + "src_project_name": None, + "src_package_name": None, + "dst_project_name": None, + "dst_package_name": None, + "src_project_path": None, + "dst_project_path": None, + "script_dir": None + } + self.platforms_list = [] + self.cocos_root =os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) + self.callbackfun = None + self.totalStep =1 + self.step=0 + + def checkParams(self): + """Custom and check param list. + """ + from optparse import OptionParser + # set the parser to parse input params + # the correspond variable name of "-x, --xxx" is parser.xxx + parser = OptionParser( + usage="Usage: %prog -n -k -l -p \n\ + Sample: %prog -n MyGame -k com.MyCompany.AwesomeGame -l javascript -p c:/mycompany" + ) + parser.add_option("-n", "--name", metavar="PROJECT_NAME",help="Set a project name") + parser.add_option("-k", "--package", metavar="PACKAGE_NAME",help="Set a package name for project") + parser.add_option("-l", "--language",metavar="PROGRAMMING_NAME", + type="choice", + choices=["cpp", "lua", "javascript"], + help="Major programming language you want to use, should be [cpp | lua | javascript]") + parser.add_option("-p", "--path", metavar="PROJECT_PATH",help="Set generate project path for project") + + # parse the params + (opts, args) = parser.parse_args() + if not opts.name: + parser.error("-n or --name is not specified") + + if not opts.package: + parser.error("-k or --package is not specified") + + if not opts.language: + parser.error("-l or --language is not specified") + + if not opts.path: + parser.error("-p or --path is not specified") + + return opts.name, opts.package, opts.language, opts.path + + def createPlatformProjects(self, projectName, packageName, language, projectPath, callbackfun = None): + """ Create a plantform project. + Arg: + projectName: Project name, like this: "helloworld". + packageName: It's used for android platform,like this:"com.cocos2dx.helloworld". + language: There have three languages can be choice: [cpp | lua | javascript], like this:"javascript". + projectPath: The path of generate project. + callbackfun: It's new project callback function.There have four Params. + As follow: + def newProjectCallBack(step, totalStep, showMsg): + #step: processing step,at present + #totalStep: all the steps + #showMsg: message about the progress + pass + + """ + self.callbackfun = callbackfun + + # init our internal params + self.context["dst_project_name"] = projectName + self.context["dst_package_name"] = packageName + self.context["language"] = language + self.context["dst_project_path"] = os.path.join(projectPath,projectName) + self.context["script_dir"] = os.path.abspath(os.path.dirname(__file__)) + + # fill in src_project_name and src_package_name according to "language" + template_dir = os.path.abspath(os.path.join(self.cocos_root, "template")) + if ("cpp" == self.context["language"]): + self.context["src_project_name"] = "HelloCpp" + self.context["src_package_name"] = "org.cocos2dx.hellocpp" + self.context["src_project_path"] = os.path.join(template_dir, "multi-platform-cpp") + elif ("lua" == self.context["language"]): + self.context["src_project_name"] = "HelloLua" + self.context["src_package_name"] = "org.cocos2dx.hellolua" + self.context["src_project_path"] = os.path.join(template_dir, "multi-platform-lua") + elif ("javascript" == self.context["language"]): + self.context["src_project_name"] = "HelloJavascript" + self.context["src_package_name"] = "org.cocos2dx.hellojavascript" + self.context["src_project_path"] = os.path.join(template_dir, "multi-platform-js") + else: + print ("Your language parameter doesn\'t exist." \ + "Check correct language option\'s parameter") + return False + + # copy "lauguage"(cpp/lua/javascript) platform.proj into cocos2d-x/projects//folder + if os.path.exists(self.context["dst_project_path"]): + print ("Error:" + self.context["dst_project_path"] + " folder is already existing") + print ("Please remove the old project or choose a new PROJECT_NAME in -project parameter") + return False + else: + shutil.copytree(self.context["src_project_path"], self.context["dst_project_path"], True) + + # + dirlist = os.listdir(self.cocos_root) + if (not "cocos" in dirlist) or (not "extensions" in dirlist): + print ("The Cocos2d Engine doesn\'t exist." \ + "Check engine path, please") + return False + + # call process_proj from each platform's script folder + self.platforms_list = self.platforms.get(self.context["language"], []) + self.totalStep = len(self.platforms_list) + len(dirlist) + self.step = 0 + for platform in self.platforms_list: + self.__processPlatformProjects(platform) + + # copy cocos2d engine. + if not self.__copyCocos2dEngine(): + print "New project Failure" + if os.path.exists(self.context["dst_project_path"]): + shutil.rmtree(self.context["dst_project_path"]) + return False + + print ("\n") + print ("New project has been created in this path: " + self.context["dst_project_path"].replace("\\", "/")) + print ("Have Fun!") + return True + + def __copyCocos2dEngine(self): + """Copy cocos2d engine to dst_project_path. + Arg: + empty + """ + + ignoreList={ + "samples": None, + "docs": None, + "licenses": None, + "template": None + } + + # create "cocos2d" folder + dstPath = os.path.join(self.context["dst_project_path"],"cocos2d") + if not os.path.exists(dstPath): + os.makedirs(dstPath) + + # begin copy + print("\n") + print("begin copy engine...") + # list engine root dir. + dirlist = os.listdir(self.cocos_root) + for line in dirlist: + filepath = os.path.join(self.cocos_root,line) + showMsg = "%s\t\t\t: Done!" % line + self.step += 1 + if self.callbackfun: + self.callbackfun(self.step,self.totalStep,showMsg) + if ignoreList.has_key(line): + continue + if os.path.isdir(filepath): + shutil.copytree(filepath, os.path.join(dstPath,line), True) + print (showMsg) + else: + shutil.copyfile(filepath, os.path.join(dstPath,line)) + #print ("%s\t\t\t: Done!" % line) + return True + + def __processPlatformProjects(self, platform): + """ Process each platform project. + Arg: + platform: win32ã€androidã€ios + """ + + # determine proj_path + proj_path = os.path.join(self.context["dst_project_path"], "proj." + platform) + java_package_path = "" + + # read json config file for the current platform + conf_path = os.path.join(self.context["script_dir"], "%s.json" % platform) + f = open(conf_path) + data = json.load(f) + + # rename package path, like "org.cocos2dx.hello" to "com.company.game". This is a special process for android + if platform == "android": + src_pkg = self.context["src_package_name"].split('.') + dst_pkg = self.context["dst_package_name"].split('.') + + java_package_path = os.path.join(*dst_pkg) + + # rename files and folders + for item in data["rename"]: + tmp = item.replace("PACKAGE_PATH", java_package_path) + src = tmp.replace("PROJECT_NAME", self.context["src_project_name"]) + dst = tmp.replace("PROJECT_NAME", self.context["dst_project_name"]) + if os.path.exists(os.path.join(proj_path, src)): + os.rename(os.path.join(proj_path, src), os.path.join(proj_path, dst)) + + # remove useless files and folders + for item in data["remove"]: + dst = item.replace("PROJECT_NAME", self.context["dst_project_name"]) + if os.path.exists(os.path.join(proj_path, dst)): + shutil.rmtree(os.path.join(proj_path, dst)) + + # rename package_name. This should be replaced at first. Don't change this sequence + for item in data["replace_package_name"]: + tmp = item.replace("PACKAGE_PATH", java_package_path) + dst = tmp.replace("PROJECT_NAME", self.context["dst_project_name"]) + if os.path.exists(os.path.join(proj_path, dst)): + replaceString(os.path.join(proj_path, dst), self.context["src_package_name"], self.context["dst_package_name"]) + + # rename project_name + for item in data["replace_project_name"]: + tmp = item.replace("PACKAGE_PATH", java_package_path) + dst = tmp.replace("PROJECT_NAME", self.context["dst_project_name"]) + if os.path.exists(os.path.join(proj_path, dst)): + replaceString(os.path.join(proj_path, dst), self.context["src_project_name"], self.context["dst_project_name"]) + + # done! + showMsg = "proj.%s\t\t: Done!" % platform + self.step += 1 + if self.callbackfun: + self.callbackfun(self.step,self.totalStep,showMsg) + print (showMsg) + # end of processPlatformProjects + +# -------------- main -------------- +# dump argvs +# print sys.argv +if __name__ == '__main__': + project = CocosProject() + name, package, language, path = project.checkParams() + project.createPlatformProjects(name, package, language, path) + diff --git a/tools/project-creator/module/ui.py b/tools/project-creator/module/ui.py new file mode 100644 index 0000000000..8ce767a1df --- /dev/null +++ b/tools/project-creator/module/ui.py @@ -0,0 +1,197 @@ +#!/usr/bin/python +#coding=utf-8 +# ui.py +# Create cross-platform cocos2d-x project +# Copyright (c) 2012 cocos2d-x.org +# Author: chuanwei + + +import platform +import os, os.path +import shutil +import threading +import Queue +import time + +from core import CocosProject + +if int(platform.python_version().split('.')[0])>=3: + from tkinter import * + from tkinter.filedialog import * + from tkinter.messagebox import * +else: + from Tkinter import * + from tkFileDialog import * + from tkMessageBox import * + + + +class ThreadedTask(threading.Thread): + def __init__(self, queue, projectName, packageName, language, projectPath): + threading.Thread.__init__(self) + self.queue = queue + self.projectName = projectName + self.packageName = packageName + self.language = language + self.projectPath = projectPath + + def run(self): + + if os.path.exists(os.path.join(self.projectPath, self.projectName)): + shutil.rmtree(os.path.join(self.projectPath, self.projectName)) + putMsg = "begin@%d@%d@%s" %(0,100,"begin create") + self.queue.put(putMsg) + project = CocosProject() + breturn=project.createPlatformProjects( + self.projectName, + self.packageName, + self.language, + self.projectPath, + self.newProjectCallBack + ) + if breturn: + putMsg = "end@%d@%d@%s" %(100,100,"create successful") + else: + putMsg = "end@%d@%d@%s" %(100,100,"create failure") + self.queue.put(putMsg) + + def newProjectCallBack(self, step, totalStep, showMsg): + putMsg = "doing@%d@%d@%s" %(step,totalStep,showMsg) + self.queue.put(putMsg) + +class TkProjectDialog(): + def __init__(self): + + #reload(sys) + #sys.setdefaultencoding('utf-8') + self.projectName = "" + self.packageName = "" + self.language = "" + + self.top = Tk() + top_width = 500 + top_height = 250 + screen_width = self.top.winfo_screenwidth() + screen_height = self.top.winfo_screenheight() + #center window on desktop + #self.top.geometry('%sx%s+%s+%s' % (top_width,top_height, int((screen_width - top_width)/2), int((screen_height - top_height)/2)) ) + #self.top.maxsize(top_width,top_height) + #self.top.minsize(top_width,top_height) + self.top.title("CocosCreateProject") + + self.frameName = Frame(self.top) + self.labName = Label(self.frameName,text="project_name:",width=15) + self.strName=StringVar() + self.strName.set("MyGame") + self.editName = Entry(self.frameName,textvariable=self.strName,width=40 ) + self.labName.pack(side = LEFT,fill = BOTH) + self.editName.pack(side = LEFT) + self.frameName.pack(padx=0,pady=10,anchor="nw") + + self.framePackage = Frame(self.top) + self.labPackage = Label(self.framePackage,text="package_name:",width=15) + self.strPackage=StringVar() + self.strPackage.set("com.MyCompany.AwesomeGame") + self.editPackage = Entry(self.framePackage,textvariable=self.strPackage,width=40 ) + self.labPackage.pack(side = LEFT) + self.editPackage.pack(side = LEFT) + self.framePackage.pack(padx=0, anchor="nw") + + self.framePath = Frame(self.top) + self.labPath = Label(self.framePath,text="project_path:",width=15) + self.editPath = Entry(self.framePath,width=40) + self.btnPath = Button(self.framePath,text="...",width=10,command = self.pathCallback) + self.labPath.pack(side = LEFT) + self.editPath.pack(side = LEFT) + self.btnPath.pack(side = RIGHT) + self.framePath.pack(padx=0,pady=10,anchor="nw") + + self.frameLanguage = Frame(self.top) + self.labLanguage = Label(self.frameLanguage,text="language:",width=15) + self.var=IntVar() + self.var.set(1) + self.checkcpp = Radiobutton(self.frameLanguage,text="cpp", variable=self.var, value=1, width=8) + self.checklua = Radiobutton(self.frameLanguage,text="lua", variable=self.var, value=2, width=8) + self.checkjs = Radiobutton(self.frameLanguage,text="javascript", variable=self.var, value=3, width=15) + self.labLanguage.pack(side = LEFT) + self.checkcpp.pack(side = LEFT) + self.checklua.pack(side = LEFT) + self.checkjs.pack(side = LEFT) + self.frameLanguage.pack(padx=0,anchor="nw") + + self.progress = Scale(self.top,state= DISABLED,length=400,from_=0,to=100,orient=HORIZONTAL) + self.progress.set(0) + self.progress.pack(padx=10,pady=0,anchor="nw") + + self.frameOperate = Frame(self.top) + self.btnCreate = Button(self.frameOperate, text="create", width=15, height =5, command = self.createBtnCallback) + self.btnCreate.pack(side = LEFT) + self.frameOperate.pack(pady=20) + + self.top.mainloop() + + def process_queue(self): + + if self.queue.empty(): + self.top.after(100, self.process_queue) + return + msg = self.queue.get(0) + msglist = msg.split("@") + if len(msglist) < 4: + return + + if msglist[0] == "begin": + pass + elif msglist[0] == "doing": + self.progress.set(0) + elif msglist[0] == "end": + showwarning("create", msglist[3]) + self.btnCreate['state'] = NORMAL + + self.progress.set(int(int(msglist[1])*100/int(msglist[2]))) + + def createBtnCallback(self): + + projectName = self.editName.get() + if projectName == "": + showwarning("warning", "project_name is empty") + return + + packageName = self.editPackage.get() + if packageName == "": + showwarning("warning", "package_name is empty") + return + + language = "cpp" + if self.var.get() == 1: + language = "cpp" + elif self.var.get() == 2: + language = "lua" + elif self.var.get() == 3: + language = "javascript" + + projectPath = self.editPath.get() + if projectPath == "": + showwarning("warning", "project_path is empty") + return + + if os.path.exists(os.path.join(projectPath, projectName)): + if not askyesno("warning", "%s had exist,do you want to recreate!" %projectName ): + return + + print("state start") + self.btnCreate['state'] = DISABLED + self.queue = Queue.Queue() + print("state end") + ThreadedTask(self.queue, projectName, packageName, language, projectPath).start() + self.top.after(100, self.process_queue) + + def pathCallback(self): + filepath = askdirectory() + if filepath: + self.editPath.delete(0, END) + self.editPath.insert(0, filepath) + #entry.insert(0,filepath) + +if __name__ =='__main__': + TkProjectDialog() \ No newline at end of file From 1ce75bb444a90e5f4ca473a0d66fbeda78407024 Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Tue, 24 Dec 2013 15:07:51 +0800 Subject: [PATCH 014/428] modify ui --- tools/project-creator/create_project.py | 10 +- tools/project-creator/module/core.py | 7 +- tools/project-creator/module/ui.py | 172 +++++++++++++++++------- 3 files changed, 132 insertions(+), 57 deletions(-) diff --git a/tools/project-creator/create_project.py b/tools/project-creator/create_project.py index 48eb9d0ef0..685fbc3f03 100755 --- a/tools/project-creator/create_project.py +++ b/tools/project-creator/create_project.py @@ -6,13 +6,19 @@ # Author: chuanwei import sys -from module.ui import TkProjectDialog +from module.ui import TkCocosDialog from module.core import CocosProject # ------------ main -------------- if __name__ == '__main__': + """ + There have double ways to create cocos project. + 1.UI + 2.console + #create_project.py -n MyGame -k com.MyCompany.AwesomeGame -l javascript -p c:/mycompany + """ if len(sys.argv)==1: - TkProjectDialog() + TkCocosDialog() else: project = CocosProject() name, package, language, path = project.checkParams() diff --git a/tools/project-creator/module/core.py b/tools/project-creator/module/core.py index 80c01d6c57..fea4c38832 100644 --- a/tools/project-creator/module/core.py +++ b/tools/project-creator/module/core.py @@ -166,8 +166,8 @@ class CocosProject: shutil.rmtree(self.context["dst_project_path"]) return False - print ("\n") - print ("New project has been created in this path: " + self.context["dst_project_path"].replace("\\", "/")) + print ("###New project has been created in this path: ") + print (self.context["dst_project_path"].replace("\\", "/")) print ("Have Fun!") return True @@ -190,8 +190,7 @@ class CocosProject: os.makedirs(dstPath) # begin copy - print("\n") - print("begin copy engine...") + print("###begin copy engine...") # list engine root dir. dirlist = os.listdir(self.cocos_root) for line in dirlist: diff --git a/tools/project-creator/module/ui.py b/tools/project-creator/module/ui.py index 8ce767a1df..40e1cefac6 100644 --- a/tools/project-creator/module/ui.py +++ b/tools/project-creator/module/ui.py @@ -15,6 +15,7 @@ import time from core import CocosProject +#import head files by python version. if int(platform.python_version().split('.')[0])>=3: from tkinter import * from tkinter.filedialog import * @@ -25,8 +26,9 @@ else: from tkMessageBox import * - class ThreadedTask(threading.Thread): + """Create cocos project thread. + """ def __init__(self, queue, projectName, packageName, language, projectPath): threading.Thread.__init__(self) self.queue = queue @@ -36,13 +38,23 @@ class ThreadedTask(threading.Thread): self.projectPath = projectPath def run(self): - + """Create cocos project. + custom message rules to notify ui + As follow: + begin@%d@%d@%s --- create before + doing@%d@%d@%s --- creating + end@%d@%d@%s --- create after + """ + #delete exist project. if os.path.exists(os.path.join(self.projectPath, self.projectName)): + print ("###begin remove... " + self.projectName) shutil.rmtree(os.path.join(self.projectPath, self.projectName)) - putMsg = "begin@%d@%d@%s" %(0,100,"begin create") + print ("###remove finish: " + self.projectName) + putMsg = "begin@%d@%d@%s" %(0, 100, "begin create") self.queue.put(putMsg) + project = CocosProject() - breturn=project.createPlatformProjects( + breturn = project.createPlatformProjects( self.projectName, self.packageName, self.language, @@ -50,118 +62,175 @@ class ThreadedTask(threading.Thread): self.newProjectCallBack ) if breturn: - putMsg = "end@%d@%d@%s" %(100,100,"create successful") + putMsg = "end@%d@%d@%s" %(100, 100, "create successful") else: - putMsg = "end@%d@%d@%s" %(100,100,"create failure") + putMsg = "end@%d@%d@%s" %(100, 100, "create failure") self.queue.put(putMsg) def newProjectCallBack(self, step, totalStep, showMsg): - putMsg = "doing@%d@%d@%s" %(step,totalStep,showMsg) + """Creating cocos project callback. + """ + putMsg = "doing@%d@%d@%s" %(step, totalStep, showMsg) self.queue.put(putMsg) -class TkProjectDialog(): - def __init__(self): +class StdoutRedirector(object): + """Redirect output. + """ + def __init__(self, text_area): + self.text_area = text_area - #reload(sys) - #sys.setdefaultencoding('utf-8') + def write(self, str): + self.text_area.insert(END, str) + self.text_area.see(END) + +class TkCocosDialog(): + def __init__(self): self.projectName = "" self.packageName = "" self.language = "" + self.old_stdout = sys.stdout + print("create_project.py -n MyGame -k com.MyCompany.AwesomeGame -l javascript -p c:/mycompany") + # top window self.top = Tk() - top_width = 500 - top_height = 250 - screen_width = self.top.winfo_screenwidth() - screen_height = self.top.winfo_screenheight() - #center window on desktop - #self.top.geometry('%sx%s+%s+%s' % (top_width,top_height, int((screen_width - top_width)/2), int((screen_height - top_height)/2)) ) - #self.top.maxsize(top_width,top_height) - #self.top.minsize(top_width,top_height) self.top.title("CocosCreateProject") + # project name frame self.frameName = Frame(self.top) - self.labName = Label(self.frameName,text="project_name:",width=15) - self.strName=StringVar() + self.labName = Label(self.frameName, text="projectName:", width=15) + self.strName = StringVar() self.strName.set("MyGame") - self.editName = Entry(self.frameName,textvariable=self.strName,width=40 ) - self.labName.pack(side = LEFT,fill = BOTH) + self.editName = Entry(self.frameName, textvariable=self.strName, width=40 ) + self.labName.pack(side = LEFT, fill = BOTH) self.editName.pack(side = LEFT) - self.frameName.pack(padx=0,pady=10,anchor="nw") + self.frameName.pack(padx=0, pady=10, anchor="nw") + # package name frame self.framePackage = Frame(self.top) - self.labPackage = Label(self.framePackage,text="package_name:",width=15) + self.labPackage = Label(self.framePackage, text="packageName:", width=15) self.strPackage=StringVar() self.strPackage.set("com.MyCompany.AwesomeGame") - self.editPackage = Entry(self.framePackage,textvariable=self.strPackage,width=40 ) + self.editPackage = Entry(self.framePackage, textvariable=self.strPackage, width=40 ) self.labPackage.pack(side = LEFT) self.editPackage.pack(side = LEFT) self.framePackage.pack(padx=0, anchor="nw") + # project path frame self.framePath = Frame(self.top) - self.labPath = Label(self.framePath,text="project_path:",width=15) - self.editPath = Entry(self.framePath,width=40) - self.btnPath = Button(self.framePath,text="...",width=10,command = self.pathCallback) + self.labPath = Label(self.framePath, text="projectPath:", width=15) + self.editPath = Entry(self.framePath, width=40) + self.btnPath = Button(self.framePath, text="...", width=10, command = self.pathCallback) self.labPath.pack(side = LEFT) self.editPath.pack(side = LEFT) self.btnPath.pack(side = RIGHT) - self.framePath.pack(padx=0,pady=10,anchor="nw") + self.framePath.pack(padx=0, pady=10, anchor="nw") + # language frame self.frameLanguage = Frame(self.top) - self.labLanguage = Label(self.frameLanguage,text="language:",width=15) + self.labLanguage = Label(self.frameLanguage, text="language:", width=15) self.var=IntVar() self.var.set(1) - self.checkcpp = Radiobutton(self.frameLanguage,text="cpp", variable=self.var, value=1, width=8) - self.checklua = Radiobutton(self.frameLanguage,text="lua", variable=self.var, value=2, width=8) - self.checkjs = Radiobutton(self.frameLanguage,text="javascript", variable=self.var, value=3, width=15) + self.checkcpp = Radiobutton(self.frameLanguage, text="cpp", variable=self.var, value=1, width=8) + self.checklua = Radiobutton(self.frameLanguage, text="lua", variable=self.var, value=2, width=8) + self.checkjs = Radiobutton(self.frameLanguage, text="javascript", variable=self.var, value=3, width=15) self.labLanguage.pack(side = LEFT) self.checkcpp.pack(side = LEFT) self.checklua.pack(side = LEFT) self.checkjs.pack(side = LEFT) self.frameLanguage.pack(padx=0,anchor="nw") - self.progress = Scale(self.top,state= DISABLED,length=400,from_=0,to=100,orient=HORIZONTAL) + # show progress + self.progress = Scale(self.top, state= DISABLED, length=400, from_=0, to=100, orient=HORIZONTAL) self.progress.set(0) - self.progress.pack(padx=10,pady=0,anchor="nw") + self.progress.pack(padx=10, pady=0, anchor="nw") + # msg text frame + self.frameText = Frame(self.top) + self.text=Text(self.frameText, height=10, width=50) + self.text.bind("", lambda e : "break") + self.scroll=Scrollbar(self.frameText, command=self.text.yview) + self.text.configure(yscrollcommand=self.scroll.set) + self.text.pack(side=LEFT, anchor="nw") + self.scroll.pack(side=RIGHT, fill=Y) + self.frameText.pack(padx=10, pady=5, anchor="nw") + + # new project button self.frameOperate = Frame(self.top) self.btnCreate = Button(self.frameOperate, text="create", width=15, height =5, command = self.createBtnCallback) self.btnCreate.pack(side = LEFT) self.frameOperate.pack(pady=20) + #center window on desktop + self.top.update() + curWidth = self.top.winfo_reqwidth() + curHeight = self.top.winfo_height() + scnWidth = self.top.winfo_screenwidth() + scnHeight = self.top.winfo_screenheight() + tmpcnf = '%dx%d+%d+%d'%(curWidth, curHeight, int((scnWidth-curWidth)/2), int((scnHeight-curHeight)/2)) + self.top.geometry(tmpcnf) + + #fix size + self.top.maxsize(curWidth, curHeight) + self.top.minsize(curWidth, curHeight) + + #redirect out to text + sys.stdout = StdoutRedirector(self.text) self.top.mainloop() + sys.stdout = self.old_stdout def process_queue(self): - + """ + """ + #message is empty if self.queue.empty(): self.top.after(100, self.process_queue) return + + #parse message msg = self.queue.get(0) msglist = msg.split("@") if len(msglist) < 4: return + #begin if msglist[0] == "begin": - pass + self.progress['state'] = NORMAL + #doing elif msglist[0] == "doing": - self.progress.set(0) - elif msglist[0] == "end": - showwarning("create", msglist[3]) - self.btnCreate['state'] = NORMAL + pass self.progress.set(int(int(msglist[1])*100/int(msglist[2]))) + #end + if msglist[0] == "end": + showwarning("create", msglist[3]) + self.progress.set(0) + self.text.insert(END,"=================END==============\n") + self.progress['state'] = DISABLED + self.btnCreate['state'] = NORMAL + return + self.top.after(100, self.process_queue) def createBtnCallback(self): - + """Create button event. + """ + #Check project name projectName = self.editName.get() if projectName == "": - showwarning("warning", "project_name is empty") + showwarning("warning", "projectName is empty") return + #Check the package name is effective packageName = self.editPackage.get() - if packageName == "": - showwarning("warning", "package_name is empty") + packageList = packageName.split(".") + if len(packageList) < 2: + showwarning("warning", "packageName format error!") return + for index in range(len(packageList)): + if (packageList[index] == "") or (packageList[index][0].isdigit()): + showwarning("warning", "packageName format error!") + return + # get select language type language = "cpp" if self.var.get() == 1: language = "cpp" @@ -172,26 +241,27 @@ class TkProjectDialog(): projectPath = self.editPath.get() if projectPath == "": - showwarning("warning", "project_path is empty") + showwarning("warning", "projectPath is empty") return + # if project has already exist,.... if os.path.exists(os.path.join(projectPath, projectName)): if not askyesno("warning", "%s had exist,do you want to recreate!" %projectName ): return - print("state start") + #create a new thread to deal with create new project. self.btnCreate['state'] = DISABLED self.queue = Queue.Queue() - print("state end") ThreadedTask(self.queue, projectName, packageName, language, projectPath).start() self.top.after(100, self.process_queue) def pathCallback(self): + """Paht button event. + """ filepath = askdirectory() if filepath: self.editPath.delete(0, END) self.editPath.insert(0, filepath) - #entry.insert(0,filepath) if __name__ =='__main__': - TkProjectDialog() \ No newline at end of file + TkCocosDialog() \ No newline at end of file From 2989e9b46d68246bd5ec13068603e586cec964ba Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Wed, 25 Dec 2013 10:24:46 +0800 Subject: [PATCH 015/428] adapt ui --- tools/project-creator/create_project.py | 4 +- tools/project-creator/module/ui.py | 120 +++++++++++------------- 2 files changed, 58 insertions(+), 66 deletions(-) diff --git a/tools/project-creator/create_project.py b/tools/project-creator/create_project.py index 685fbc3f03..a2ca8122c4 100755 --- a/tools/project-creator/create_project.py +++ b/tools/project-creator/create_project.py @@ -6,7 +6,7 @@ # Author: chuanwei import sys -from module.ui import TkCocosDialog +from module.ui import createTkCocosDialog from module.core import CocosProject # ------------ main -------------- @@ -18,7 +18,7 @@ if __name__ == '__main__': #create_project.py -n MyGame -k com.MyCompany.AwesomeGame -l javascript -p c:/mycompany """ if len(sys.argv)==1: - TkCocosDialog() + createTkCocosDialog() else: project = CocosProject() name, package, language, path = project.checkParams() diff --git a/tools/project-creator/module/ui.py b/tools/project-creator/module/ui.py index 40e1cefac6..1b0b1b06c6 100644 --- a/tools/project-creator/module/ui.py +++ b/tools/project-creator/module/ui.py @@ -83,107 +83,91 @@ class StdoutRedirector(object): self.text_area.insert(END, str) self.text_area.see(END) -class TkCocosDialog(): - def __init__(self): +class TkCocosDialog(Frame): + def __init__(self, parent): + Frame.__init__(self,parent) + self.projectName = "" self.packageName = "" self.language = "" - self.old_stdout = sys.stdout - print("create_project.py -n MyGame -k com.MyCompany.AwesomeGame -l javascript -p c:/mycompany") - # top window - self.top = Tk() - self.top.title("CocosCreateProject") + self.parent = parent + self.columnconfigure(3, weight=1) + self.rowconfigure(5, weight=1) # project name frame - self.frameName = Frame(self.top) - self.labName = Label(self.frameName, text="projectName:", width=15) + self.labName = Label(self, text="projectName:") self.strName = StringVar() self.strName.set("MyGame") - self.editName = Entry(self.frameName, textvariable=self.strName, width=40 ) - self.labName.pack(side = LEFT, fill = BOTH) - self.editName.pack(side = LEFT) - self.frameName.pack(padx=0, pady=10, anchor="nw") + self.editName = Entry(self, textvariable=self.strName) + self.labName.grid(sticky=W, pady=4, padx=5) + self.editName.grid(row=0, column=1, columnspan=3,padx=5, pady=2,sticky=E+W) # package name frame - self.framePackage = Frame(self.top) - self.labPackage = Label(self.framePackage, text="packageName:", width=15) + self.labPackage = Label(self, text="packageName:") self.strPackage=StringVar() self.strPackage.set("com.MyCompany.AwesomeGame") - self.editPackage = Entry(self.framePackage, textvariable=self.strPackage, width=40 ) - self.labPackage.pack(side = LEFT) - self.editPackage.pack(side = LEFT) - self.framePackage.pack(padx=0, anchor="nw") + self.editPackage = Entry(self, textvariable=self.strPackage) + self.labPackage.grid(row=1, column=0,sticky=W, padx=5) + self.editPackage.grid(row=1, column=1, columnspan=3,padx=5, pady=2,sticky=E+W) # project path frame - self.framePath = Frame(self.top) - self.labPath = Label(self.framePath, text="projectPath:", width=15) - self.editPath = Entry(self.framePath, width=40) - self.btnPath = Button(self.framePath, text="...", width=10, command = self.pathCallback) - self.labPath.pack(side = LEFT) - self.editPath.pack(side = LEFT) - self.btnPath.pack(side = RIGHT) - self.framePath.pack(padx=0, pady=10, anchor="nw") + self.labPath = Label(self, text="projectPath:") + self.editPath = Entry(self) + self.btnPath = Button(self, text="...", width = 6, command = self.pathCallback) + self.labPath.grid(row=2, column=0,sticky=W, pady=4, padx=5) + self.editPath.grid(row=2, column=1, columnspan=3,padx=5, pady=2, sticky=E+W) + self.btnPath.grid(row=2, column=4,) # language frame - self.frameLanguage = Frame(self.top) - self.labLanguage = Label(self.frameLanguage, text="language:", width=15) + self.labLanguage = Label(self, text="language:") self.var=IntVar() self.var.set(1) - self.checkcpp = Radiobutton(self.frameLanguage, text="cpp", variable=self.var, value=1, width=8) - self.checklua = Radiobutton(self.frameLanguage, text="lua", variable=self.var, value=2, width=8) - self.checkjs = Radiobutton(self.frameLanguage, text="javascript", variable=self.var, value=3, width=15) - self.labLanguage.pack(side = LEFT) - self.checkcpp.pack(side = LEFT) - self.checklua.pack(side = LEFT) - self.checkjs.pack(side = LEFT) - self.frameLanguage.pack(padx=0,anchor="nw") + self.checkcpp = Radiobutton(self, text="cpp", variable=self.var, value=1) + self.checklua = Radiobutton(self, text="lua", variable=self.var, value=2) + self.checkjs = Radiobutton(self, text="javascript", variable=self.var, value=3) + self.labLanguage.grid(row=3, column=0,sticky=W, padx=5) + self.checkcpp.grid(row=3, column=1,sticky=N+W) + self.checklua.grid(row=3, column=2,padx=5,sticky=N+W) + self.checkjs.grid(row=3, column=3,padx=5,sticky=N+W) # show progress - self.progress = Scale(self.top, state= DISABLED, length=400, from_=0, to=100, orient=HORIZONTAL) + self.progress = Scale(self, state= DISABLED, from_=0, to=100, orient=HORIZONTAL) self.progress.set(0) - self.progress.pack(padx=10, pady=0, anchor="nw") + self.progress.grid(row=4, column=0, columnspan=4,padx=5, pady=2,sticky=E+W+S+N) # msg text frame - self.frameText = Frame(self.top) - self.text=Text(self.frameText, height=10, width=50) + self.text=Text(self,background = '#d9efff') self.text.bind("", lambda e : "break") - self.scroll=Scrollbar(self.frameText, command=self.text.yview) - self.text.configure(yscrollcommand=self.scroll.set) - self.text.pack(side=LEFT, anchor="nw") - self.scroll.pack(side=RIGHT, fill=Y) - self.frameText.pack(padx=10, pady=5, anchor="nw") + self.text.grid(row=5, column=0, columnspan=4, rowspan=1, padx=5, sticky=E+W+S+N) # new project button - self.frameOperate = Frame(self.top) - self.btnCreate = Button(self.frameOperate, text="create", width=15, height =5, command = self.createBtnCallback) - self.btnCreate.pack(side = LEFT) - self.frameOperate.pack(pady=20) + self.btnCreate = Button(self, text="create", command = self.createBtnCallback) + self.btnCreate.grid(row=7, column=3, columnspan=1, rowspan=1,pady=2,ipadx=15,ipady =10, sticky=W) #center window on desktop - self.top.update() - curWidth = self.top.winfo_reqwidth() - curHeight = self.top.winfo_height() - scnWidth = self.top.winfo_screenwidth() - scnHeight = self.top.winfo_screenheight() + curWidth = 500 + curHeight = 450 + scnWidth = self.parent.winfo_screenwidth() + scnHeight = self.parent.winfo_screenheight() tmpcnf = '%dx%d+%d+%d'%(curWidth, curHeight, int((scnWidth-curWidth)/2), int((scnHeight-curHeight)/2)) - self.top.geometry(tmpcnf) + self.parent.geometry(tmpcnf) + self.parent.title("CocosCreateProject") #fix size - self.top.maxsize(curWidth, curHeight) - self.top.minsize(curWidth, curHeight) + #self.parent.maxsize(curWidth, curHeight) + #self.parent.minsize(curWidth, curHeight) #redirect out to text + self.pack(fill=BOTH, expand=1) sys.stdout = StdoutRedirector(self.text) - self.top.mainloop() - sys.stdout = self.old_stdout def process_queue(self): """ """ #message is empty if self.queue.empty(): - self.top.after(100, self.process_queue) + self.parent.after(100, self.process_queue) return #parse message @@ -208,7 +192,7 @@ class TkCocosDialog(): self.progress['state'] = DISABLED self.btnCreate['state'] = NORMAL return - self.top.after(100, self.process_queue) + self.parent.after(100, self.process_queue) def createBtnCallback(self): """Create button event. @@ -253,7 +237,7 @@ class TkCocosDialog(): self.btnCreate['state'] = DISABLED self.queue = Queue.Queue() ThreadedTask(self.queue, projectName, packageName, language, projectPath).start() - self.top.after(100, self.process_queue) + self.parent.after(100, self.process_queue) def pathCallback(self): """Paht button event. @@ -263,5 +247,13 @@ class TkCocosDialog(): self.editPath.delete(0, END) self.editPath.insert(0, filepath) +def createTkCocosDialog(): + + old_stdout = sys.stdout + root = Tk() + app = TkCocosDialog(root) + root.mainloop() + sys.stdout = old_stdout + if __name__ =='__main__': - TkCocosDialog() \ No newline at end of file + createTkCocosDialog() \ No newline at end of file From 067d4fed0eeadbcb3e80e5a13d8711009b095999 Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Wed, 25 Dec 2013 11:01:23 +0800 Subject: [PATCH 016/428] modify template --- template/multi-platform-cpp/CMakeLists.txt | 2 + .../multi-platform-cpp/proj.android/.cproject | 111 ------------------ .../proj.android/build_native.py | 61 ++++++++-- .../multi-platform-cpp/proj.linux/build.sh | 2 +- .../multi-platform-js/Classes/AppDelegate.cpp | 2 + .../multi-platform-js/proj.android/.cproject | 109 ----------------- .../multi-platform-js/proj.android/.project | 10 -- .../proj.android/build_native.py | 61 ++++++++-- .../proj.android/jni/Android.mk | 2 +- template/multi-platform-lua/CMakeLists.txt | 2 + .../proj.android/build_native.py | 61 ++++++++-- .../proj.android/project.properties | 2 +- 12 files changed, 171 insertions(+), 254 deletions(-) delete mode 100644 template/multi-platform-cpp/proj.android/.cproject delete mode 100644 template/multi-platform-js/proj.android/.cproject diff --git a/template/multi-platform-cpp/CMakeLists.txt b/template/multi-platform-cpp/CMakeLists.txt index 88299d0d83..f94f571ef2 100644 --- a/template/multi-platform-cpp/CMakeLists.txt +++ b/template/multi-platform-cpp/CMakeLists.txt @@ -52,6 +52,7 @@ include_directories( ${COCOS2D_ROOT}/cocos ${COCOS2D_ROOT}/cocos/audio/include ${COCOS2D_ROOT}/cocos/2d + ${COCOS2D_ROOT}/cocos/2d/renderer ${COCOS2D_ROOT}/cocos/2d/platform ${COCOS2D_ROOT}/cocos/2d/platform/linux ${COCOS2D_ROOT}/cocos/base @@ -60,6 +61,7 @@ include_directories( ${COCOS2D_ROOT}/cocos/math/kazmath/include ${COCOS2D_ROOT}/extensions ${COCOS2D_ROOT}/external + ${COCOS2D_ROOT}/external/edtaa3func ${COCOS2D_ROOT}/external/jpeg/include/linux ${COCOS2D_ROOT}/external/tiff/include/linux ${COCOS2D_ROOT}/external/webp/include/linux diff --git a/template/multi-platform-cpp/proj.android/.cproject b/template/multi-platform-cpp/proj.android/.cproject deleted file mode 100644 index 3514d06dd2..0000000000 --- a/template/multi-platform-cpp/proj.android/.cproject +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/template/multi-platform-cpp/proj.android/build_native.py b/template/multi-platform-cpp/proj.android/build_native.py index 74c92aa2ee..03ee8de50f 100755 --- a/template/multi-platform-cpp/proj.android/build_native.py +++ b/template/multi-platform-cpp/proj.android/build_native.py @@ -6,7 +6,19 @@ import sys import os, os.path import shutil +from optparse import OptionParser +def check_environment_variables_sdk(): + ''' Checking the environment ANDROID_SDK_ROOT, which will be used for building + ''' + + try: + SDK_ROOT = os.environ['ANDROID_SDK_ROOT'] + except Exception: + print "ANDROID_SDK_ROOT not defined. Please define ANDROID_SDK_ROOT in your environment" + sys.exit(1) + + return SDK_ROOT def check_environment_variables(): ''' Checking the environment NDK_ROOT, which will be used for building @@ -39,7 +51,7 @@ def select_toolchain_version(): print "Couldn't find the gcc toolchain." exit(1) -def do_build(cocos_root, ndk_root, app_android_root): +def do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode): ndk_path = os.path.join(ndk_root, "ndk-build") @@ -50,12 +62,24 @@ def do_build(cocos_root, ndk_root, app_android_root): else: ndk_module_path = 'NDK_MODULE_PATH=%s:%s/external:%s/cocos' % (cocos_root, cocos_root, cocos_root) - ndk_build_param = sys.argv[1:] - if len(ndk_build_param) == 0: + if ndk_build_param == None: command = '%s -C %s %s' % (ndk_path, app_android_root, ndk_module_path) else: command = '%s -C %s %s %s' % (ndk_path, app_android_root, ''.join(str(e) for e in ndk_build_param), ndk_module_path) - os.system(command) + if os.system(command) != 0: + raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!") + elif android_platform is not None: + sdk_tool_path = os.path.join(sdk_root, "tools/android") + cocoslib_path = os.path.join(cocos_root, "cocos/2d/platform/android/java") + command = '%s update lib-project -t %s -p %s' % (sdk_tool_path,android_platform,cocoslib_path) + if os.system(command) != 0: + raise Exception("update cocos lib-project [ " + cocoslib_path + " ] fails!") + command = '%s update project -t %s -p %s -s' % (sdk_tool_path,android_platform,app_android_root) + if os.system(command) != 0: + raise Exception("update project [ " + app_android_root + " ] fails!") + buildfile_path = os.path.join(app_android_root, "build.xml") + command = 'ant clean %s -f %s -Dsdk.dir=%s' % (build_mode,buildfile_path,sdk_root) + os.system(command) def copy_files(src, dst): @@ -82,9 +106,10 @@ def copy_resources(app_android_root): if os.path.isdir(resources_dir): copy_files(resources_dir, assets_dir) -def build(): +def build(ndk_build_param,android_platform,build_mode): ndk_root = check_environment_variables() + sdk_root = None select_toolchain_version() current_dir = os.path.dirname(os.path.realpath(__file__)) @@ -92,9 +117,31 @@ def build(): app_android_root = current_dir copy_resources(app_android_root) - do_build(cocos_root, ndk_root, app_android_root) + + if android_platform is not None: + sdk_root = check_environment_variables_sdk() + if android_platform.isdigit(): + android_platform = 'android-'+android_platform + else: + print 'please use vaild android platform' + exit(1) + + if build_mode is None: + build_mode = 'debug' + elif build_mode != 'release': + build_mode = 'debug' + + do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode) # -------------- main -------------- if __name__ == '__main__': - build() + parser = OptionParser() + parser.add_option("-n", "--ndk", dest="ndk_build_param", help='parameter for ndk-build') + parser.add_option("-p", "--platform", dest="android_platform", + help='parameter for android-update.Without the parameter,the script just build dynamic library for project. Valid android-platform are:[10|11|12|13|14|15|16|17|18|19]') + parser.add_option("-b", "--build", dest="build_mode", + help='the build mode for java project,debug[default] or release.Get more information,please refer to http://developer.android.com/tools/building/building-cmdline.html') + (opts, args) = parser.parse_args() + + build(opts.ndk_build_param,opts.android_platform,opts.build_mode) diff --git a/template/multi-platform-cpp/proj.linux/build.sh b/template/multi-platform-cpp/proj.linux/build.sh index d6316e4764..6df1fe6bfd 100755 --- a/template/multi-platform-cpp/proj.linux/build.sh +++ b/template/multi-platform-cpp/proj.linux/build.sh @@ -4,7 +4,7 @@ TXTCOLOR_DEFAULT="\033[0;m" TXTCOLOR_RED="\033[0;31m" TXTCOLOR_GREEN="\033[0;32m" -COCOS2DX20_TRUNK=`pwd`/../../.. +COCOS2DX20_TRUNK=`pwd`/../cocos2d OUTPUT_DEBUG=$COCOS2DX20_TRUNK/lib/linux/debug/ OUTPUT_RELEASE=$COCOS2DX20_TRUNK/lib/linux/release/ diff --git a/template/multi-platform-js/Classes/AppDelegate.cpp b/template/multi-platform-js/Classes/AppDelegate.cpp index e409b974b5..0794c10c9a 100644 --- a/template/multi-platform-js/Classes/AppDelegate.cpp +++ b/template/multi-platform-js/Classes/AppDelegate.cpp @@ -5,6 +5,7 @@ #include "ScriptingCore.h" #include "jsb_cocos2dx_auto.hpp" #include "jsb_cocos2dx_extension_auto.hpp" +#include "jsb_cocos2dx_spine_auto.hpp" #include "cocos2d_specifics.hpp" #include "extension/jsb_cocos2dx_extension_manual.h" #include "chipmunk/js_bindings_chipmunk_registration.h" @@ -40,6 +41,7 @@ bool AppDelegate::applicationDidFinishLaunching() sc->addRegisterCallback(register_all_cocos2dx_extension); sc->addRegisterCallback(register_cocos2dx_js_extensions); sc->addRegisterCallback(register_all_cocos2dx_extension_manual); + sc->addRegisterCallback(register_all_cocos2dx_spine); sc->addRegisterCallback(jsb_register_chipmunk); sc->addRegisterCallback(JSB_register_opengl); sc->addRegisterCallback(jsb_register_system); diff --git a/template/multi-platform-js/proj.android/.cproject b/template/multi-platform-js/proj.android/.cproject deleted file mode 100644 index 9ebba484ce..0000000000 --- a/template/multi-platform-js/proj.android/.cproject +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/template/multi-platform-js/proj.android/.project b/template/multi-platform-js/proj.android/.project index c65124f88e..df461895c5 100644 --- a/template/multi-platform-js/proj.android/.project +++ b/template/multi-platform-js/proj.android/.project @@ -20,16 +20,6 @@ - - org.eclipse.ui.externaltools.ExternalToolBuilder - full,incremental, - - - LaunchConfigHandle - <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch - - - com.android.ide.eclipse.adt.ApkBuilder diff --git a/template/multi-platform-js/proj.android/build_native.py b/template/multi-platform-js/proj.android/build_native.py index e45ee3fa16..4b20992504 100755 --- a/template/multi-platform-js/proj.android/build_native.py +++ b/template/multi-platform-js/proj.android/build_native.py @@ -6,7 +6,19 @@ import sys import os, os.path import shutil +from optparse import OptionParser +def check_environment_variables_sdk(): + ''' Checking the environment ANDROID_SDK_ROOT, which will be used for building + ''' + + try: + SDK_ROOT = os.environ['ANDROID_SDK_ROOT'] + except Exception: + print "ANDROID_SDK_ROOT not defined. Please define ANDROID_SDK_ROOT in your environment" + sys.exit(1) + + return SDK_ROOT def check_environment_variables(): ''' Checking the environment NDK_ROOT, which will be used for building @@ -39,7 +51,7 @@ def select_toolchain_version(): print "Couldn't find the gcc toolchain." exit(1) -def do_build(cocos_root, ndk_root, app_android_root): +def do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode): ndk_path = os.path.join(ndk_root, "ndk-build") @@ -50,12 +62,24 @@ def do_build(cocos_root, ndk_root, app_android_root): else: ndk_module_path = 'NDK_MODULE_PATH=%s:%s/external:%s/cocos' % (cocos_root, cocos_root, cocos_root) - ndk_build_param = sys.argv[1:] - if len(ndk_build_param) == 0: + if ndk_build_param == None: command = '%s -C %s %s' % (ndk_path, app_android_root, ndk_module_path) else: command = '%s -C %s %s %s' % (ndk_path, app_android_root, ''.join(str(e) for e in ndk_build_param), ndk_module_path) - os.system(command) + if os.system(command) != 0: + raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!") + elif android_platform is not None: + sdk_tool_path = os.path.join(sdk_root, "tools/android") + cocoslib_path = os.path.join(cocos_root, "cocos/2d/platform/android/java") + command = '%s update lib-project -t %s -p %s' % (sdk_tool_path,android_platform,cocoslib_path) + if os.system(command) != 0: + raise Exception("update cocos lib-project [ " + cocoslib_path + " ] fails!") + command = '%s update project -t %s -p %s -s' % (sdk_tool_path,android_platform,app_android_root) + if os.system(command) != 0: + raise Exception("update project [ " + app_android_root + " ] fails!") + buildfile_path = os.path.join(app_android_root, "build.xml") + command = 'ant clean %s -f %s -Dsdk.dir=%s' % (build_mode,buildfile_path,sdk_root) + os.system(command) def copy_files(src, dst): @@ -86,9 +110,10 @@ def copy_resources(app_android_root): resources_dir = os.path.join(app_android_root, "../cocos2d/cocos/scripting/javascript/script") copy_files(resources_dir, assets_dir) -def build(): +def build(ndk_build_param,android_platform,build_mode): ndk_root = check_environment_variables() + sdk_root = None select_toolchain_version() current_dir = os.path.dirname(os.path.realpath(__file__)) @@ -96,9 +121,31 @@ def build(): app_android_root = current_dir copy_resources(app_android_root) - do_build(cocos_root, ndk_root, app_android_root) + + if android_platform is not None: + sdk_root = check_environment_variables_sdk() + if android_platform.isdigit(): + android_platform = 'android-'+android_platform + else: + print 'please use vaild android platform' + exit(1) + + if build_mode is None: + build_mode = 'debug' + elif build_mode != 'release': + build_mode = 'debug' + + do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode) # -------------- main -------------- if __name__ == '__main__': - build() + parser = OptionParser() + parser.add_option("-n", "--ndk", dest="ndk_build_param", help='parameter for ndk-build') + parser.add_option("-p", "--platform", dest="android_platform", + help='parameter for android-update.Without the parameter,the script just build dynamic library for project. Valid android-platform are:[10|11|12|13|14|15|16|17|18|19]') + parser.add_option("-b", "--build", dest="build_mode", + help='the build mode for java project,debug[default] or release.Get more information,please refer to http://developer.android.com/tools/building/building-cmdline.html') + (opts, args) = parser.parse_args() + + build(opts.ndk_build_param,opts.android_platform,opts.build_mode) diff --git a/template/multi-platform-js/proj.android/jni/Android.mk b/template/multi-platform-js/proj.android/jni/Android.mk index 08a89b6f22..48746a0ffc 100644 --- a/template/multi-platform-js/proj.android/jni/Android.mk +++ b/template/multi-platform-js/proj.android/jni/Android.mk @@ -24,4 +24,4 @@ include $(BUILD_SHARED_LIBRARY) $(call import-module,scripting/javascript/bindings) $(call import-module,scripting/javascript/bindings/extension) $(call import-module,scripting/javascript/bindings/chipmunk) -$(call import-module,scripting/javascript/bindings/localstorage) +$(call import-module,scripting/javascript/bindings/localstorage) \ No newline at end of file diff --git a/template/multi-platform-lua/CMakeLists.txt b/template/multi-platform-lua/CMakeLists.txt index a3cf368403..8f3f930bd4 100644 --- a/template/multi-platform-lua/CMakeLists.txt +++ b/template/multi-platform-lua/CMakeLists.txt @@ -55,6 +55,7 @@ include_directories( ${COCOS2D_ROOT}/cocos ${COCOS2D_ROOT}/cocos/audio/include ${COCOS2D_ROOT}/cocos/2d + ${COCOS2D_ROOT}/cocos/2d/renderer ${COCOS2D_ROOT}/cocos/2d/platform ${COCOS2D_ROOT}/cocos/2d/platform/linux ${COCOS2D_ROOT}/cocos/base @@ -63,6 +64,7 @@ include_directories( ${COCOS2D_ROOT}/cocos/math/kazmath/include ${COCOS2D_ROOT}/extensions ${COCOS2D_ROOT}/external + ${COCOS2D_ROOT}/external/edtaa3func ${COCOS2D_ROOT}/external/jpeg/include/linux ${COCOS2D_ROOT}/external/tiff/include/linux ${COCOS2D_ROOT}/external/webp/include/linux diff --git a/template/multi-platform-lua/proj.android/build_native.py b/template/multi-platform-lua/proj.android/build_native.py index 07dacc4368..7414dd23af 100755 --- a/template/multi-platform-lua/proj.android/build_native.py +++ b/template/multi-platform-lua/proj.android/build_native.py @@ -6,7 +6,19 @@ import sys import os, os.path import shutil +from optparse import OptionParser +def check_environment_variables_sdk(): + ''' Checking the environment ANDROID_SDK_ROOT, which will be used for building + ''' + + try: + SDK_ROOT = os.environ['ANDROID_SDK_ROOT'] + except Exception: + print "ANDROID_SDK_ROOT not defined. Please define ANDROID_SDK_ROOT in your environment" + sys.exit(1) + + return SDK_ROOT def check_environment_variables(): ''' Checking the environment NDK_ROOT, which will be used for building @@ -39,7 +51,7 @@ def select_toolchain_version(): print "Couldn't find the gcc toolchain." exit(1) -def do_build(cocos_root, ndk_root, app_android_root): +def do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode): ndk_path = os.path.join(ndk_root, "ndk-build") @@ -50,12 +62,24 @@ def do_build(cocos_root, ndk_root, app_android_root): else: ndk_module_path = 'NDK_MODULE_PATH=%s:%s/external:%s/cocos' % (cocos_root, cocos_root, cocos_root) - ndk_build_param = sys.argv[1:] - if len(ndk_build_param) == 0: + if ndk_build_param == None: command = '%s -C %s %s' % (ndk_path, app_android_root, ndk_module_path) else: command = '%s -C %s %s %s' % (ndk_path, app_android_root, ''.join(str(e) for e in ndk_build_param), ndk_module_path) - os.system(command) + if os.system(command) != 0: + raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!") + elif android_platform is not None: + sdk_tool_path = os.path.join(sdk_root, "tools/android") + cocoslib_path = os.path.join(cocos_root, "cocos/2d/platform/android/java") + command = '%s update lib-project -t %s -p %s' % (sdk_tool_path,android_platform,cocoslib_path) + if os.system(command) != 0: + raise Exception("update cocos lib-project [ " + cocoslib_path + " ] fails!") + command = '%s update project -t %s -p %s -s' % (sdk_tool_path,android_platform,app_android_root) + if os.system(command) != 0: + raise Exception("update project [ " + app_android_root + " ] fails!") + buildfile_path = os.path.join(app_android_root, "build.xml") + command = 'ant clean %s -f %s -Dsdk.dir=%s' % (build_mode,buildfile_path,sdk_root) + os.system(command) def copy_files(src, dst): @@ -86,9 +110,10 @@ def copy_resources(app_android_root): resources_dir = os.path.join(app_android_root, "../cocos2d/cocos/scripting/lua/script") copy_files(resources_dir, assets_dir) -def build(): +def build(ndk_build_param,android_platform,build_mode): ndk_root = check_environment_variables() + sdk_root = None select_toolchain_version() current_dir = os.path.dirname(os.path.realpath(__file__)) @@ -96,9 +121,31 @@ def build(): app_android_root = current_dir copy_resources(app_android_root) - do_build(cocos_root, ndk_root, app_android_root) + + if android_platform is not None: + sdk_root = check_environment_variables_sdk() + if android_platform.isdigit(): + android_platform = 'android-'+android_platform + else: + print 'please use vaild android platform' + exit(1) + + if build_mode is None: + build_mode = 'debug' + elif build_mode != 'release': + build_mode = 'debug' + + do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode) # -------------- main -------------- if __name__ == '__main__': - build() + parser = OptionParser() + parser.add_option("-n", "--ndk", dest="ndk_build_param", help='parameter for ndk-build') + parser.add_option("-p", "--platform", dest="android_platform", + help='parameter for android-update.Without the parameter,the script just build dynamic library for project. Valid android-platform are:[10|11|12|13|14|15|16|17|18|19]') + parser.add_option("-b", "--build", dest="build_mode", + help='the build mode for java project,debug[default] or release.Get more information,please refer to http://developer.android.com/tools/building/building-cmdline.html') + (opts, args) = parser.parse_args() + + build(opts.ndk_build_param,opts.android_platform,opts.build_mode) diff --git a/template/multi-platform-lua/proj.android/project.properties b/template/multi-platform-lua/proj.android/project.properties index 16f145cfc9..870a4a196d 100644 --- a/template/multi-platform-lua/proj.android/project.properties +++ b/template/multi-platform-lua/proj.android/project.properties @@ -10,4 +10,4 @@ # Project target. target=android-10 -android.library.reference.1=../../../cocos/2d/platform/android/java +android.library.reference.1=../cocos2d/cocos/2d/platform/android/java From 94420563b358827f11ff77cb3a4d171d38f0d1eb Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Wed, 25 Dec 2013 11:12:06 +0800 Subject: [PATCH 017/428] ingore .git --- tools/project-creator/module/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/project-creator/module/core.py b/tools/project-creator/module/core.py index fea4c38832..d453ee565a 100644 --- a/tools/project-creator/module/core.py +++ b/tools/project-creator/module/core.py @@ -181,7 +181,8 @@ class CocosProject: "samples": None, "docs": None, "licenses": None, - "template": None + "template": None, + ".git":None } # create "cocos2d" folder From c53537e7c28e6362948e07391663f410897d1e8f Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Wed, 25 Dec 2013 15:53:47 +0800 Subject: [PATCH 018/428] modify create_project --- README.md | 4 +- .../multi-platform-cpp/proj.linux/Makefile | 2 +- .../multi-platform-js/Classes/AppDelegate.cpp | 4 +- .../multi-platform-lua/proj.linux/Makefile | 2 +- tools/project-creator/README.md | 1 + .../{create_project.py => create_project.pyw} | 5 ++- tools/project-creator/module/core.py | 39 +++++++++++++------ tools/project-creator/module/ui.py | 33 ++++++++++++---- 8 files changed, 64 insertions(+), 26 deletions(-) create mode 100644 tools/project-creator/README.md rename tools/project-creator/{create_project.py => create_project.pyw} (83%) mode change 100755 => 100644 diff --git a/README.md b/README.md index c5d464e62f..edf7822ec5 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ How to start a new game Example: $ cd cocos2d-x/tools/project-creator - $ ./create-multi-platform-projects.py -p mygame -k com.your_company.mygame -l cpp - $ cd ../../projects/mygame + $ ./create-multi-platform-projects.py -n mygame -k com.your_company.mygame -l cpp -p /usr/mygame + $ cd /usr/mygame Main features diff --git a/template/multi-platform-cpp/proj.linux/Makefile b/template/multi-platform-cpp/proj.linux/Makefile index 1b851ad66a..170b1d2c95 100644 --- a/template/multi-platform-cpp/proj.linux/Makefile +++ b/template/multi-platform-cpp/proj.linux/Makefile @@ -6,7 +6,7 @@ SOURCES = main.cpp \ ../Classes/AppDelegate.cpp \ ../Classes/HelloWorldScene.cpp -COCOS_ROOT = ../../.. +COCOS_ROOT = ../cocos2d include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk SHAREDLIBS += -lcocos2d diff --git a/template/multi-platform-js/Classes/AppDelegate.cpp b/template/multi-platform-js/Classes/AppDelegate.cpp index 0794c10c9a..13f0345ccc 100644 --- a/template/multi-platform-js/Classes/AppDelegate.cpp +++ b/template/multi-platform-js/Classes/AppDelegate.cpp @@ -5,7 +5,7 @@ #include "ScriptingCore.h" #include "jsb_cocos2dx_auto.hpp" #include "jsb_cocos2dx_extension_auto.hpp" -#include "jsb_cocos2dx_spine_auto.hpp" +//#include "jsb_cocos2dx_spine_auto.hpp" #include "cocos2d_specifics.hpp" #include "extension/jsb_cocos2dx_extension_manual.h" #include "chipmunk/js_bindings_chipmunk_registration.h" @@ -41,7 +41,7 @@ bool AppDelegate::applicationDidFinishLaunching() sc->addRegisterCallback(register_all_cocos2dx_extension); sc->addRegisterCallback(register_cocos2dx_js_extensions); sc->addRegisterCallback(register_all_cocos2dx_extension_manual); - sc->addRegisterCallback(register_all_cocos2dx_spine); + //sc->addRegisterCallback(register_all_cocos2dx_spine); sc->addRegisterCallback(jsb_register_chipmunk); sc->addRegisterCallback(JSB_register_opengl); sc->addRegisterCallback(jsb_register_system); diff --git a/template/multi-platform-lua/proj.linux/Makefile b/template/multi-platform-lua/proj.linux/Makefile index b9cdb5c66c..368020726c 100644 --- a/template/multi-platform-lua/proj.linux/Makefile +++ b/template/multi-platform-lua/proj.linux/Makefile @@ -1,6 +1,6 @@ EXECUTABLE = HelloLua -COCOS_ROOT = ../../.. +COCOS_ROOT = ../cocos2d INCLUDES = -I../ -I../Classes -I$(COCOS_ROOT)/audio/include \ -I$(COCOS_ROOT)/scripting/lua/lua \ -I$(COCOS_ROOT)/scripting/lua/tolua \ diff --git a/tools/project-creator/README.md b/tools/project-creator/README.md new file mode 100644 index 0000000000..1b03809589 --- /dev/null +++ b/tools/project-creator/README.md @@ -0,0 +1 @@ +#create_project diff --git a/tools/project-creator/create_project.py b/tools/project-creator/create_project.pyw old mode 100755 new mode 100644 similarity index 83% rename from tools/project-creator/create_project.py rename to tools/project-creator/create_project.pyw index a2ca8122c4..86ff095181 --- a/tools/project-creator/create_project.py +++ b/tools/project-creator/create_project.pyw @@ -6,8 +6,6 @@ # Author: chuanwei import sys -from module.ui import createTkCocosDialog -from module.core import CocosProject # ------------ main -------------- if __name__ == '__main__': @@ -15,11 +13,14 @@ if __name__ == '__main__': There have double ways to create cocos project. 1.UI 2.console + #create_project.py --help #create_project.py -n MyGame -k com.MyCompany.AwesomeGame -l javascript -p c:/mycompany """ if len(sys.argv)==1: + from module.ui import createTkCocosDialog createTkCocosDialog() else: + from module.core import CocosProject project = CocosProject() name, package, language, path = project.checkParams() project.createPlatformProjects(name, package, language, path) diff --git a/tools/project-creator/module/core.py b/tools/project-creator/module/core.py index d453ee565a..9fab6d4ac3 100644 --- a/tools/project-creator/module/core.py +++ b/tools/project-creator/module/core.py @@ -1,11 +1,28 @@ #!/usr/bin/python #coding=utf-8 -# create_project.py -# Create cross-platform cocos2d-x project -# Copyright (c) 2012 cocos2d-x.org -# Author: WangZhe -#modify:chuanwei 2013.12.23 +"""**************************************************************************** +Copyright (c) 2010 cocos2d-x.org +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************""" import sys import os, os.path @@ -145,7 +162,7 @@ class CocosProject: else: shutil.copytree(self.context["src_project_path"], self.context["dst_project_path"], True) - # + # check cocos engine exist dirlist = os.listdir(self.cocos_root) if (not "cocos" in dirlist) or (not "extensions" in dirlist): print ("The Cocos2d Engine doesn\'t exist." \ @@ -161,7 +178,7 @@ class CocosProject: # copy cocos2d engine. if not self.__copyCocos2dEngine(): - print "New project Failure" + print ("New project Failure") if os.path.exists(self.context["dst_project_path"]): shutil.rmtree(self.context["dst_project_path"]) return False @@ -198,8 +215,6 @@ class CocosProject: filepath = os.path.join(self.cocos_root,line) showMsg = "%s\t\t\t: Done!" % line self.step += 1 - if self.callbackfun: - self.callbackfun(self.step,self.totalStep,showMsg) if ignoreList.has_key(line): continue if os.path.isdir(filepath): @@ -207,13 +222,15 @@ class CocosProject: print (showMsg) else: shutil.copyfile(filepath, os.path.join(dstPath,line)) - #print ("%s\t\t\t: Done!" % line) + + if self.callbackfun: + self.callbackfun(self.step,self.totalStep,showMsg) return True def __processPlatformProjects(self, platform): """ Process each platform project. Arg: - platform: win32ã€androidã€ios + platform: "ios_mac", "android", "win32", "linux" """ # determine proj_path diff --git a/tools/project-creator/module/ui.py b/tools/project-creator/module/ui.py index 1b0b1b06c6..5151630c62 100644 --- a/tools/project-creator/module/ui.py +++ b/tools/project-creator/module/ui.py @@ -1,29 +1,48 @@ #!/usr/bin/python #coding=utf-8 -# ui.py -# Create cross-platform cocos2d-x project -# Copyright (c) 2012 cocos2d-x.org -# Author: chuanwei +"""**************************************************************************** +Copyright (c) 2010 cocos2d-x.org +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************""" import platform import os, os.path import shutil import threading -import Queue import time -from core import CocosProject +from module.core import CocosProject #import head files by python version. if int(platform.python_version().split('.')[0])>=3: from tkinter import * from tkinter.filedialog import * from tkinter.messagebox import * + from queue import * else: from Tkinter import * from tkFileDialog import * from tkMessageBox import * + from Queue import * class ThreadedTask(threading.Thread): @@ -235,7 +254,7 @@ class TkCocosDialog(Frame): #create a new thread to deal with create new project. self.btnCreate['state'] = DISABLED - self.queue = Queue.Queue() + self.queue = Queue() ThreadedTask(self.queue, projectName, packageName, language, projectPath).start() self.parent.after(100, self.process_queue) From 017fb550b732e1b512b91d70b4a1daa7f4042259 Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Wed, 25 Dec 2013 16:34:23 +0800 Subject: [PATCH 019/428] add README.md --- tools/project-creator/README.md | 14 ++++++++++++ tools/project-creator/create_project.pyw | 27 ++++++++++++++++++++---- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/tools/project-creator/README.md b/tools/project-creator/README.md index 1b03809589..b282f0f0db 100644 --- a/tools/project-creator/README.md +++ b/tools/project-creator/README.md @@ -1 +1,15 @@ #create_project + +First you need install python environment. + +There have double ways create new cocos project. +Notice:The best of generate path is english path. +##1.UI +* Windows: double click "create_project.pyw" file +* Mac: ./create_project.pyw +* Linux: The tkinter was not installed in the linux's default python, +##2.console + $ cd cocos2d-x/tools/project-creator + $ ./project-creator.pyw --help + $ ./project-creator.pyw -n mygame -k com.your_company.mygame -l cpp -p /home/mygame + $ cd /home/mygame \ No newline at end of file diff --git a/tools/project-creator/create_project.pyw b/tools/project-creator/create_project.pyw index 86ff095181..e546c4db63 100644 --- a/tools/project-creator/create_project.pyw +++ b/tools/project-creator/create_project.pyw @@ -1,9 +1,28 @@ #!/usr/bin/python -# create_project.py #coding=utf-8 -# Create cross-platform cocos2d-x project -# Copyright (c) 2012 cocos2d-x.org -# Author: chuanwei +"""**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************""" import sys From 6d36414dce3ef235b9d511754edbc8441c8a33a8 Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Wed, 25 Dec 2013 16:35:17 +0800 Subject: [PATCH 020/428] modify cocos README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index edf7822ec5..7c71a9a713 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ How to start a new game Example: $ cd cocos2d-x/tools/project-creator - $ ./create-multi-platform-projects.py -n mygame -k com.your_company.mygame -l cpp -p /usr/mygame - $ cd /usr/mygame + $ ./project-creator.pyw -n mygame -k com.your_company.mygame -l cpp -p /home/mygame + $ cd /home/mygame Main features From bbb11831b674d815008a63e34a22878d699d0ac2 Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Wed, 25 Dec 2013 18:15:40 +0800 Subject: [PATCH 021/428] Reverts submodules --- cocos/scripting/auto-generated | 2 +- samples/Javascript/Shared | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index aaa97fbd16..2f60892e10 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit aaa97fbd16ff316f929b42ccdc9983f4a86472d8 +Subproject commit 2f60892e1053a2e7dabfbab9da1058063475eb97 diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index 148868f7f4..ff3a95b059 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit 148868f7f4407a12444f07cb5e5378b1dbd7511c +Subproject commit ff3a95b059be8421677ed6817b73ae2ac577781d From 02e139f1daa30bb8e2e9988af3c606f83f2a7d2d Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Wed, 25 Dec 2013 18:16:59 +0800 Subject: [PATCH 022/428] Reverts bindings-generator reference. --- tools/bindings-generator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bindings-generator b/tools/bindings-generator index ad53201245..1b34f5852f 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit ad532012457e2eaff15d73d9ba28a638fa748d2d +Subproject commit 1b34f5852fcf494499be7eb5ce2bada72a0b16a2 From 23192a883ccf479d447cb3f335f5a599e82e9541 Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Wed, 25 Dec 2013 18:32:23 +0800 Subject: [PATCH 023/428] modify linux tempalte --- template/multi-platform-cpp/CMakeLists.txt | 2 +- .../multi-platform-cpp/proj.linux/.cproject | 422 ------------------ .../multi-platform-cpp/proj.linux/.project | 110 ----- .../multi-platform-cpp/proj.linux/Makefile | 25 -- .../multi-platform-cpp/proj.linux/build.sh | 59 --- template/multi-platform-lua/CMakeLists.txt | 2 +- .../multi-platform-lua/proj.linux/.cproject | 411 ----------------- .../multi-platform-lua/proj.linux/.project | 44 -- .../multi-platform-lua/proj.linux/Makefile | 27 -- tools/project-creator/README.md | 2 +- 10 files changed, 3 insertions(+), 1101 deletions(-) delete mode 100644 template/multi-platform-cpp/proj.linux/.cproject delete mode 100644 template/multi-platform-cpp/proj.linux/.project delete mode 100644 template/multi-platform-cpp/proj.linux/Makefile delete mode 100755 template/multi-platform-cpp/proj.linux/build.sh delete mode 100644 template/multi-platform-lua/proj.linux/.cproject delete mode 100644 template/multi-platform-lua/proj.linux/.project delete mode 100644 template/multi-platform-lua/proj.linux/Makefile diff --git a/template/multi-platform-cpp/CMakeLists.txt b/template/multi-platform-cpp/CMakeLists.txt index f94f571ef2..641364914e 100644 --- a/template/multi-platform-cpp/CMakeLists.txt +++ b/template/multi-platform-cpp/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.6) set(APP_NAME HelloCpp) project (${APP_NAME}) -include(../../build/BuildHelpers.CMakeLists.txt) +include(cocos2d/build/BuildHelpers.CMakeLists.txt) option(USE_CHIPMUNK "Use chipmunk for physics library" ON) option(USE_BOX2D "Use box2d for physics library" OFF) diff --git a/template/multi-platform-cpp/proj.linux/.cproject b/template/multi-platform-cpp/proj.linux/.cproject deleted file mode 100644 index 9c759e341f..0000000000 --- a/template/multi-platform-cpp/proj.linux/.cproject +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/template/multi-platform-cpp/proj.linux/.project b/template/multi-platform-cpp/proj.linux/.project deleted file mode 100644 index 7cd8c680f4..0000000000 --- a/template/multi-platform-cpp/proj.linux/.project +++ /dev/null @@ -1,110 +0,0 @@ - - - HelloCpp - - - libBox2D - libChipmunk - libcocos2d - libCocosDenshion - libextension - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/HelloCpp/Debug} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - PARENT-1-PROJECT_LOC/Classes - - - - - 1345106176896 - Classes/ExtensionsTest - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-true-false-EditBoxTest - - - - diff --git a/template/multi-platform-cpp/proj.linux/Makefile b/template/multi-platform-cpp/proj.linux/Makefile deleted file mode 100644 index 170b1d2c95..0000000000 --- a/template/multi-platform-cpp/proj.linux/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -EXECUTABLE = HelloCpp - -INCLUDES = -I.. -I../Classes - -SOURCES = main.cpp \ - ../Classes/AppDelegate.cpp \ - ../Classes/HelloWorldScene.cpp - -COCOS_ROOT = ../cocos2d -include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk - -SHAREDLIBS += -lcocos2d -COCOS_LIBS = $(LIB_DIR)/libcocos2d.so - -$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/template/multi-platform-cpp/proj.linux/build.sh b/template/multi-platform-cpp/proj.linux/build.sh deleted file mode 100755 index 6df1fe6bfd..0000000000 --- a/template/multi-platform-cpp/proj.linux/build.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -TXTCOLOR_DEFAULT="\033[0;m" -TXTCOLOR_RED="\033[0;31m" -TXTCOLOR_GREEN="\033[0;32m" - -COCOS2DX20_TRUNK=`pwd`/../cocos2d -OUTPUT_DEBUG=$COCOS2DX20_TRUNK/lib/linux/debug/ -OUTPUT_RELEASE=$COCOS2DX20_TRUNK/lib/linux/release/ - -check_make_result() -{ - if [ 0 != $? ]; then - exit 1 - fi -} - -DEPENDS='libx11-dev' -DEPENDS+=' libxmu-dev' -DEPENDS+=' libglu1-mesa-dev' -DEPENDS+=' libgl2ps-dev' -DEPENDS+=' libxi-dev' -DEPENDS+=' libglfw-dev' -DEPENDS+=' g++' -DEPENDS+=' libzip-dev' -DEPENDS+=' libcurl4-gnutls-dev' -DEPENDS+=' libfontconfig1-dev' -DEPENDS+=' libsqlite3-dev' -DEPENDS+=' libglew-dev' - -for i in $DEPENDS; do - PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed") - echo Checking for $i: $PKG_OK - if [ "" == "$PKG_OK" ]; then - echo -e $TXTCOLOR_GREEN"No $i. Setting up $i, please enter your password:"$TXTCOLOR_DEFAULT - sudo apt-get --force-yes --yes install $i - fi -done - -mkdir -p $OUTPUT_DEBUG -mkdir -p $OUTPUT_RELEASE - -make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux DEBUG=1 -check_make_result - -make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux DEBUG=1 -check_make_result - -make -C $COCOS2DX20_TRUNK/cocos2dx/proj.linux DEBUG=1 -check_make_result - -make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux DEBUG=1 -check_make_result - -make -C $COCOS2DX20_TRUNK/extensions/proj.linux DEBUG=1 -check_make_result - -make DEBUG=1 -check_make_result diff --git a/template/multi-platform-lua/CMakeLists.txt b/template/multi-platform-lua/CMakeLists.txt index 8f3f930bd4..620e90ffe1 100644 --- a/template/multi-platform-lua/CMakeLists.txt +++ b/template/multi-platform-lua/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.6) set(APP_NAME HelloLua) project (${APP_NAME}) -include(../../build/BuildHelpers.CMakeLists.txt) +include(cocos2d/build/BuildHelpers.CMakeLists.txt) option(USE_CHIPMUNK "Use chipmunk for physics library" ON) option(USE_BOX2D "Use box2d for physics library" OFF) diff --git a/template/multi-platform-lua/proj.linux/.cproject b/template/multi-platform-lua/proj.linux/.cproject deleted file mode 100644 index d0575ca9b7..0000000000 --- a/template/multi-platform-lua/proj.linux/.cproject +++ /dev/null @@ -1,411 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/template/multi-platform-lua/proj.linux/.project b/template/multi-platform-lua/proj.linux/.project deleted file mode 100644 index 54e0b8d7d3..0000000000 --- a/template/multi-platform-lua/proj.linux/.project +++ /dev/null @@ -1,44 +0,0 @@ - - - HelloLua - - - libBox2D - libChipmunk - libcocos2d - libCocosDenshion - liblua - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - PARENT-1-PROJECT_LOC/Classes - - - cocos2dx_support - 2 - PARENT-4-PROJECT_LOC/scripting/lua/cocos2dx_support - - - diff --git a/template/multi-platform-lua/proj.linux/Makefile b/template/multi-platform-lua/proj.linux/Makefile deleted file mode 100644 index 368020726c..0000000000 --- a/template/multi-platform-lua/proj.linux/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -EXECUTABLE = HelloLua - -COCOS_ROOT = ../cocos2d -INCLUDES = -I../ -I../Classes -I$(COCOS_ROOT)/audio/include \ - -I$(COCOS_ROOT)/scripting/lua/lua \ - -I$(COCOS_ROOT)/scripting/lua/tolua \ - -I$(COCOS_ROOT)/scripting/lua/cocos2dx_support - -SOURCES = main.cpp ../Classes/AppDelegate.cpp - -SHAREDLIBS += -lcocos2d -lcocosdenshion -llua -COCOS_LIBS = $(LIB_DIR)/libcocos2d.so $(LIB_DIR)/libcocosdenshion.so $(LIB_DIR)/liblua.so - -include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk - -$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - cp -n ../../../scripting/lua/script/* ../../../../samples/Lua/TestLua/Resources - $(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/tools/project-creator/README.md b/tools/project-creator/README.md index b282f0f0db..06fb84e3ba 100644 --- a/tools/project-creator/README.md +++ b/tools/project-creator/README.md @@ -7,7 +7,7 @@ Notice:The best of generate path is english path. ##1.UI * Windows: double click "create_project.pyw" file * Mac: ./create_project.pyw -* Linux: The tkinter was not installed in the linux's default python, +* Linux: The tkinter was not installed in the linux's default python,therefore, in order to use the gui operate, you have to install the tkinter libaray manually. There is another way to create project by command line. see below for details ##2.console $ cd cocos2d-x/tools/project-creator $ ./project-creator.pyw --help From c9135eb6b9b5a88e0f20df8f3c429b4f2a294163 Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Thu, 26 Dec 2013 10:22:39 +0800 Subject: [PATCH 024/428] modify linux template --- template/multi-platform-cpp/CMakeLists.txt | 2 +- template/multi-platform-cpp/proj.linux/build.sh | 6 ++++++ template/multi-platform-lua/CMakeLists.txt | 2 +- template/multi-platform-lua/proj.linux/build.sh | 6 ++++++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 template/multi-platform-cpp/proj.linux/build.sh create mode 100644 template/multi-platform-lua/proj.linux/build.sh diff --git a/template/multi-platform-cpp/CMakeLists.txt b/template/multi-platform-cpp/CMakeLists.txt index 641364914e..bda5031162 100644 --- a/template/multi-platform-cpp/CMakeLists.txt +++ b/template/multi-platform-cpp/CMakeLists.txt @@ -45,7 +45,7 @@ set(GAME_SRC Classes/HelloWorldScene.cpp ) -set(COCOS2D_ROOT ${CMAKE_SOURCE_DIR}/../..) +set(COCOS2D_ROOT ${CMAKE_SOURCE_DIR}/cocos2d) include_directories( ${COCOS2D_ROOT} diff --git a/template/multi-platform-cpp/proj.linux/build.sh b/template/multi-platform-cpp/proj.linux/build.sh new file mode 100644 index 0000000000..8392bd3363 --- /dev/null +++ b/template/multi-platform-cpp/proj.linux/build.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +mkdir build +cd build +cmake ../.. +make diff --git a/template/multi-platform-lua/CMakeLists.txt b/template/multi-platform-lua/CMakeLists.txt index 620e90ffe1..cd29120425 100644 --- a/template/multi-platform-lua/CMakeLists.txt +++ b/template/multi-platform-lua/CMakeLists.txt @@ -44,7 +44,7 @@ set(GAME_SRC Classes/AppDelegate.cpp ) -set(COCOS2D_ROOT ${CMAKE_SOURCE_DIR}/../..) +set(COCOS2D_ROOT ${CMAKE_SOURCE_DIR}/cocos2d) include_directories( Classes diff --git a/template/multi-platform-lua/proj.linux/build.sh b/template/multi-platform-lua/proj.linux/build.sh new file mode 100644 index 0000000000..8392bd3363 --- /dev/null +++ b/template/multi-platform-lua/proj.linux/build.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +mkdir build +cd build +cmake ../.. +make From 911c7eae10a9e5500190a35040f5be81dc270dc4 Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Thu, 26 Dec 2013 14:49:06 +0800 Subject: [PATCH 025/428] modify license time --- tools/bindings-generator | 2 +- tools/project-creator/create_project.pyw | 2 +- tools/project-creator/module/core.py | 2 +- tools/project-creator/module/ui.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/bindings-generator b/tools/bindings-generator index 8777403545..1b34f5852f 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit 8777403545dbc9a131a8ae12ad6293194bd331d6 +Subproject commit 1b34f5852fcf494499be7eb5ce2bada72a0b16a2 diff --git a/tools/project-creator/create_project.pyw b/tools/project-creator/create_project.pyw index e546c4db63..d5fcb89651 100644 --- a/tools/project-creator/create_project.pyw +++ b/tools/project-creator/create_project.pyw @@ -1,7 +1,7 @@ #!/usr/bin/python #coding=utf-8 """**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2013 cocos2d-x.org http://www.cocos2d-x.org diff --git a/tools/project-creator/module/core.py b/tools/project-creator/module/core.py index 9fab6d4ac3..72aa704b60 100644 --- a/tools/project-creator/module/core.py +++ b/tools/project-creator/module/core.py @@ -1,7 +1,7 @@ #!/usr/bin/python #coding=utf-8 """**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2013 cocos2d-x.org http://www.cocos2d-x.org diff --git a/tools/project-creator/module/ui.py b/tools/project-creator/module/ui.py index 5151630c62..4042374902 100644 --- a/tools/project-creator/module/ui.py +++ b/tools/project-creator/module/ui.py @@ -1,7 +1,7 @@ #!/usr/bin/python #coding=utf-8 """**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2013 cocos2d-x.org http://www.cocos2d-x.org From 2822066a5f50f9712c67a087ea6888b43d5daec1 Mon Sep 17 00:00:00 2001 From: zarelaky Date: Mon, 30 Dec 2013 08:37:36 +0800 Subject: [PATCH 026/428] openal context not destroy correctly on mac and ios --- cocos/audio/ios/CocosDenshion.m | 1 + cocos/audio/mac/CocosDenshion.m | 1 + 2 files changed, 2 insertions(+) diff --git a/cocos/audio/ios/CocosDenshion.m b/cocos/audio/ios/CocosDenshion.m index bc3a995766..4df6b2a472 100644 --- a/cocos/audio/ios/CocosDenshion.m +++ b/cocos/audio/ios/CocosDenshion.m @@ -258,6 +258,7 @@ static BOOL _mixerRateSet = NO; device = alcGetContextsDevice(currentContext); //Release context CDLOGINFO(@"Denshion::CDSoundEngine - destroy context."); + alcMakeContextCurrent(NULL); alcDestroyContext(currentContext); //Close device CDLOGINFO(@"Denshion::CDSoundEngine - close device."); diff --git a/cocos/audio/mac/CocosDenshion.m b/cocos/audio/mac/CocosDenshion.m index 8e8cd9c8cc..028ea84042 100644 --- a/cocos/audio/mac/CocosDenshion.m +++ b/cocos/audio/mac/CocosDenshion.m @@ -259,6 +259,7 @@ static BOOL _mixerRateSet = NO; device = alcGetContextsDevice(currentContext); //Release context CDLOGINFO(@"Denshion::CDSoundEngine - destroy context."); + alcMakeContextCurrent(NULL); alcDestroyContext(currentContext); //Close device CDLOGINFO(@"Denshion::CDSoundEngine - close device."); From a76c59f644056c16784ca1cce1a70e08f07c9e9c Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 30 Dec 2013 11:33:41 +0800 Subject: [PATCH 027/428] closed #2050: add tile map xml format test and fix tile property bug. --- cocos/2d/CCTMXXMLParser.cpp | 4 +- .../Classes/TileMapTest/TileMapTest.cpp | 44 ++++++++++++++++++- .../TestCpp/Classes/TileMapTest/TileMapTest.h | 9 +++- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index ab7c789c0a..1adc516249 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -543,9 +543,9 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) } else if ( tmxMapInfo->getParentElement() == TMXPropertyTile ) { - IntValueMap& dict = tmxMapInfo->getTileProperties().at(tmxMapInfo->getParentGID()).asIntKeyMap(); + ValueMap& dict = tmxMapInfo->getTileProperties().at(tmxMapInfo->getParentGID()).asValueMap(); - int propertyName = attributeDict["name"].asInt(); + std::string propertyName = attributeDict["name"].asString(); dict[propertyName] = attributeDict["value"]; } } diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp index 61accb546b..3c5d0cf19b 100644 --- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp @@ -1061,7 +1061,10 @@ TMXTilePropertyTest::TMXTilePropertyTest() addChild(map ,0 ,kTagTileMap); for(int i=1;i<=20;i++){ - log("GID:%i, Properties:%s", i, map->getPropertiesForGID(i).asString().c_str()); + for(const auto& value : map->getPropertiesForGID(i).asValueMap()) + { + log("GID:%i, Properties:%s, %s", i, value.first.c_str(), value.second.asString().c_str()); + } } } @@ -1210,6 +1213,42 @@ std::string TMXOrthoFromXMLTest::title() const { return "TMX created from XML test"; } +//------------------------------------------------------------------ +// +// TMXOrthoFromXMLFormatTest +// +//------------------------------------------------------------------ + +TMXOrthoFromXMLFormatTest::TMXOrthoFromXMLFormatTest() +{ + // this test tests for: + // 1. load xml format tilemap + // 2. gid lower than firstgid is ignored + // 3. firstgid in tsx is ignored, tile property in tsx loaded correctly. + auto map = TMXTiledMap::create("TileMaps/xml-test.tmx"); + addChild(map, 0, kTagTileMap); + + auto s = map->getContentSize(); + log("ContentSize: %f, %f", s.width,s.height); + + auto& children = map->getChildren(); + for(const auto &node : children) { + auto child = static_cast(node); + child->getTexture()->setAntiAliasTexParameters(); + } + + for(int i=24;i<=26;i++){ + log("GID:%i, Properties:%s", i, map->getPropertiesForGID(i).asValueMap()["name"].asString().c_str()); + } + + auto action = ScaleBy::create(2, 0.5f); + map->runAction(action); +} + +std::string TMXOrthoFromXMLFormatTest::title() const +{ + return "TMX created from XML format test"; +} //------------------------------------------------------------------ // @@ -1283,7 +1322,7 @@ enum static int sceneIdx = -1; -#define MAX_LAYER 28 +#define MAX_LAYER 29 Layer* createTileMalayer(int nIndex) { @@ -1317,6 +1356,7 @@ Layer* createTileMalayer(int nIndex) case 25: return new TMXBug987(); case 26: return new TMXBug787(); case 27: return new TMXGIDObjectsTest(); + case 28: return new TMXOrthoFromXMLFormatTest(); } return NULL; diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h index 355cee1f62..86d5e69c28 100644 --- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h +++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h @@ -249,13 +249,20 @@ public: void flipIt(float dt); }; -class TMXOrthoFromXMLTest : public TileDemo +class TMXOrthoFromXMLTest : public TileDemo { public: TMXOrthoFromXMLTest(); virtual std::string title() const override; }; +class TMXOrthoFromXMLFormatTest : public TileDemo +{ +public: + TMXOrthoFromXMLFormatTest(); + virtual std::string title() const override; +}; + class TMXBug987 : public TileDemo { public: From e6dea295a2c339e18ae6a1003212debe4f93a4d5 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 30 Dec 2013 12:01:22 +0800 Subject: [PATCH 028/428] closed #2050: Change tile map test to c++11, change XMLFormatTest name and subtile --- .../Classes/TileMapTest/TileMapTest.cpp | 76 +++++++++---------- .../TestCpp/Classes/TileMapTest/TileMapTest.h | 4 +- samples/Cpp/TestCpp/Classes/testBasic.h | 1 + 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp index 3c5d0cf19b..c96f0e5a3a 100644 --- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp @@ -1215,11 +1215,11 @@ std::string TMXOrthoFromXMLTest::title() const } //------------------------------------------------------------------ // -// TMXOrthoFromXMLFormatTest +// TMXOrthoXMLFormatTest // //------------------------------------------------------------------ -TMXOrthoFromXMLFormatTest::TMXOrthoFromXMLFormatTest() +TMXOrthoXMLFormatTest::TMXOrthoXMLFormatTest() { // this test tests for: // 1. load xml format tilemap @@ -1245,9 +1245,9 @@ TMXOrthoFromXMLFormatTest::TMXOrthoFromXMLFormatTest() map->runAction(action); } -std::string TMXOrthoFromXMLFormatTest::title() const +std::string TMXOrthoXMLFormatTest::title() const { - return "TMX created from XML format test"; + return "you should see blue, green and yellow in console."; } //------------------------------------------------------------------ @@ -1324,42 +1324,42 @@ static int sceneIdx = -1; #define MAX_LAYER 29 +static std::function createFunctions[] = { + CLN(TMXIsoZorder), + CLN(TMXOrthoZorder), + CLN(TMXIsoVertexZ), + CLN(TMXOrthoVertexZ), + CLN(TMXOrthoTest), + CLN(TMXOrthoTest2), + CLN(TMXOrthoTest3), + CLN(TMXOrthoTest4), + CLN(TMXIsoTest), + CLN(TMXIsoTest1), + CLN(TMXIsoTest2), + CLN(TMXUncompressedTest), + CLN(TMXHexTest), + CLN(TMXReadWriteTest), + CLN(TMXTilesetTest), + CLN(TMXOrthoObjectsTest), + CLN(TMXIsoObjectsTest), + CLN(TMXResizeTest), + CLN(TMXIsoMoveLayer), + CLN(TMXOrthoMoveLayer), + CLN(TMXOrthoFlipTest), + CLN(TMXOrthoFlipRunTimeTest), + CLN(TMXOrthoFromXMLTest), + CLN(TMXOrthoXMLFormatTest), + CLN(TileMapTest), + CLN(TileMapEditTest), + CLN(TMXBug987), + CLN(TMXBug787), + CLN(TMXGIDObjectsTest), + +}; + Layer* createTileMalayer(int nIndex) { - switch(nIndex) - { - case 0: return new TMXIsoZorder(); - case 1: return new TMXOrthoZorder(); - case 2: return new TMXIsoVertexZ(); - case 3: return new TMXOrthoVertexZ(); - case 4: return new TMXOrthoTest(); - case 5: return new TMXOrthoTest2(); - case 6: return new TMXOrthoTest3(); - case 7: return new TMXOrthoTest4(); - case 8: return new TMXIsoTest(); - case 9: return new TMXIsoTest1(); - case 10: return new TMXIsoTest2(); - case 11: return new TMXUncompressedTest (); - case 12: return new TMXHexTest(); - case 13: return new TMXReadWriteTest(); - case 14: return new TMXTilesetTest(); - case 15: return new TMXOrthoObjectsTest(); - case 16: return new TMXIsoObjectsTest(); - case 17: return new TMXResizeTest(); - case 18: return new TMXIsoMoveLayer(); - case 19: return new TMXOrthoMoveLayer(); - case 20: return new TMXOrthoFlipTest(); - case 21: return new TMXOrthoFlipRunTimeTest(); - case 22: return new TMXOrthoFromXMLTest(); - case 23: return new TileMapTest(); - case 24: return new TileMapEditTest(); - case 25: return new TMXBug987(); - case 26: return new TMXBug787(); - case 27: return new TMXGIDObjectsTest(); - case 28: return new TMXOrthoFromXMLFormatTest(); - } - - return NULL; + return createFunctions[nIndex](); } Layer* nextTileMapAction() diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h index 86d5e69c28..83979a204d 100644 --- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h +++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h @@ -256,10 +256,10 @@ public: virtual std::string title() const override; }; -class TMXOrthoFromXMLFormatTest : public TileDemo +class TMXOrthoXMLFormatTest : public TileDemo { public: - TMXOrthoFromXMLFormatTest(); + TMXOrthoXMLFormatTest(); virtual std::string title() const override; }; diff --git a/samples/Cpp/TestCpp/Classes/testBasic.h b/samples/Cpp/TestCpp/Classes/testBasic.h index fe00736d5d..9ab7b905e7 100644 --- a/samples/Cpp/TestCpp/Classes/testBasic.h +++ b/samples/Cpp/TestCpp/Classes/testBasic.h @@ -18,5 +18,6 @@ public: // C++ 11 #define CL(__className__) [](){ return __className__::create();} +#define CLN(__className__) [](){ return new __className__();} #endif From c0a0bae21aea82ad354e582dbb60a07c6e6fff8b Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 30 Dec 2013 13:55:44 +0800 Subject: [PATCH 029/428] Fix RawStecilTest bug for node reuse --- .../ClippingNodeTest/ClippingNodeTest.cpp | 25 +++++++++++++------ .../ClippingNodeTest/ClippingNodeTest.h | 5 ++-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp index 6d4dd13628..3699703c3b 100644 --- a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -565,7 +565,10 @@ static const Color4F _planeColor[] = { RawStencilBufferTest::~RawStencilBufferTest() { - CC_SAFE_RELEASE(_sprite); + for(auto& element: _sprites) + { + CC_SAFE_RELEASE(element); + } } std::string RawStencilBufferTest::title() const @@ -584,10 +587,16 @@ void RawStencilBufferTest::setup() if (_stencilBits < 3) { CCLOGWARN("Stencil must be enabled for the current GLView."); } - _sprite = Sprite::create(s_pathGrossini); - _sprite->retain(); - _sprite->setAnchorPoint( Point(0.5, 0) ); - _sprite->setScale( 2.5f ); + + _sprites.resize(_planeCount, nullptr); + for(int i = 0; i < _planeCount; ++i) + { + _sprites[i] = Sprite::create(s_pathGrossini); + _sprites[i]->retain(); + _sprites[i]->setAnchorPoint( Point(0.5, 0) ); + _sprites[i]->setScale( 2.5f ); + } + Director::getInstance()->setAlphaBlending(true); } @@ -621,7 +630,7 @@ void RawStencilBufferTest::draw() auto spritePoint = planeSize * i; spritePoint.x += planeSize.x / 2; spritePoint.y = 0; - _sprite->setPosition( spritePoint ); + _sprites[i]->setPosition( spritePoint ); iter->init(0, _vertexZ); iter->func = CC_CALLBACK_0(RawStencilBufferTest::onBeforeDrawClip, this, i, stencilPoint); @@ -630,7 +639,7 @@ void RawStencilBufferTest::draw() kmGLPushMatrix(); this->transform(); - _sprite->visit(); + _sprites[i]->visit(); kmGLPopMatrix(); iter->init(0, _vertexZ); @@ -640,7 +649,7 @@ void RawStencilBufferTest::draw() kmGLPushMatrix(); this->transform(); - _sprite->visit(); + _sprites[i]->visit(); kmGLPopMatrix(); } diff --git a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h index 41b3f7613b..1d77a4e55b 100644 --- a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h +++ b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h @@ -5,6 +5,7 @@ #include "../BaseTest.h" #include "renderer/CCCustomCommand.h" #include +#include class BaseClippingNodeTest : public BaseTest { @@ -164,8 +165,8 @@ protected: void onDisableStencil(); void onBeforeDrawClip(int planeIndex, const Point& pt); void onBeforeDrawSprite(int planeIndex, const Point& pt); -protected: - Sprite* _sprite; +private: + std::vector _sprites; }; class RawStencilBufferTest2 : public RawStencilBufferTest From e5b0bbad74caffdc28b532658ec6dde4d00e542f Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Mon, 30 Dec 2013 14:40:49 +0800 Subject: [PATCH 030/428] Fixed bugs --- cocos/gui/UITextField.cpp | 19 ++++++++++++++---- .../UIListViewTest/UIListViewTest.cpp | 20 ++++++++----------- .../UIListViewTest/UIListViewTest.h | 4 ++-- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/cocos/gui/UITextField.cpp b/cocos/gui/UITextField.cpp index a9cc8571f8..fa7c89dbe7 100644 --- a/cocos/gui/UITextField.cpp +++ b/cocos/gui/UITextField.cpp @@ -326,10 +326,21 @@ void TextField::setTouchSize(const Size &size) void TextField::setText(const std::string& text) { - if (text.size()==0) - return; - - _textFieldRenderer->setString(text); + std::string strText(text); + if (isMaxLengthEnabled()) + { + strText = strText.substr(0, getMaxLength()); + } + const char* content = strText.c_str(); + if (isPasswordEnabled()) + { + _textFieldRenderer->setPasswordText(content); + _textFieldRenderer->insertText(content, strlen(content)); + } + else + { + _textFieldRenderer->setString(content); + } textfieldRendererScaleChangedWithSize(); } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp index 9ac47f8d73..32b32c70cb 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp @@ -70,7 +70,7 @@ bool UIListViewTest_Vertical::init() (backgroundSize.width - listView->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - listView->getSize().height) / 2.0f)); - listView->addEventListenerScrollView(this, scrollvieweventselector(UIListViewTest_Vertical::selectedItemEvent)); + listView->addEventListenerListView(this, listvieweventselector(UIListViewTest_Vertical::selectedItemEvent)); _uiLayer->addChild(listView); @@ -167,22 +167,20 @@ bool UIListViewTest_Vertical::init() return false; } -void UIListViewTest_Vertical::selectedItemEvent(Object *pSender, ScrollviewEventType type) +void UIListViewTest_Vertical::selectedItemEvent(Object *pSender, ListViewEventType type) { - /* switch (type) { - case SCROLLVIEW_EVENT_SELECT_CHILD: + case LISTVIEW_ONSELECTEDITEM: { ListView* listView = static_cast(pSender); - CCLOG("select child index = %d", listView->getSelectedChildIndex()); + CCLOG("select child index = %ld", listView->getCurSelectedIndex()); } break; default: break; } - */ } // UIListViewTest_Horizontal @@ -245,7 +243,7 @@ bool UIListViewTest_Horizontal::init() (backgroundSize.width - listView->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - listView->getSize().height) / 2.0f)); - listView->addEventListenerScrollView(this, scrollvieweventselector(UIListViewTest_Horizontal::selectedItemEvent)); + listView->addEventListenerListView(this, listvieweventselector(UIListViewTest_Horizontal::selectedItemEvent)); _uiLayer->addChild(listView); @@ -342,20 +340,18 @@ bool UIListViewTest_Horizontal::init() return false; } -void UIListViewTest_Horizontal::selectedItemEvent(Object *pSender, ScrollviewEventType type) +void UIListViewTest_Horizontal::selectedItemEvent(Object *pSender, ListViewEventType type) { - /* switch (type) { - case SCROLLVIEW_EVENT_SELECT_CHILD: + case LISTVIEW_ONSELECTEDITEM: { ListView* listView = static_cast(pSender); - CCLOG("select child index = %d", listView->getSelectedChildIndex()); + CCLOG("select child index = %ld", listView->getCurSelectedIndex()); } break; default: break; } - */ } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h index c52c33eb81..5efd46d704 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h @@ -33,7 +33,7 @@ public: UIListViewTest_Vertical(); ~UIListViewTest_Vertical(); bool init(); - void selectedItemEvent(Object* pSender, ScrollviewEventType type); + void selectedItemEvent(Object* pSender, ListViewEventType type); protected: UI_SCENE_CREATE_FUNC(UIListViewTest_Vertical) @@ -48,7 +48,7 @@ public: UIListViewTest_Horizontal(); ~UIListViewTest_Horizontal(); bool init(); - void selectedItemEvent(Object* pSender, ScrollviewEventType type); + void selectedItemEvent(Object* pSender, ListViewEventType type); protected: UI_SCENE_CREATE_FUNC(UIListViewTest_Horizontal) From 839c385d3f1244042c608bc3e971e5fb89cbbbbb Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 30 Dec 2013 14:42:41 +0800 Subject: [PATCH 031/428] issue #2771: fix physics test disable text. --- samples/Cpp/TestCpp/Classes/PhysicsTest/PhysicsTest.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/Cpp/TestCpp/Classes/PhysicsTest/PhysicsTest.h b/samples/Cpp/TestCpp/Classes/PhysicsTest/PhysicsTest.h index 2bbf6b1aee..040283506b 100644 --- a/samples/Cpp/TestCpp/Classes/PhysicsTest/PhysicsTest.h +++ b/samples/Cpp/TestCpp/Classes/PhysicsTest/PhysicsTest.h @@ -26,6 +26,8 @@ private: class PhysicsDemoDisabled : public BaseTest { public: + CREATE_FUNC(PhysicsDemoDisabled); + virtual void onEnter() override; }; #else From 991db8019853f75304a3727fcb27b0e5bc24b244 Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Mon, 30 Dec 2013 15:21:25 +0800 Subject: [PATCH 032/428] reset --- cocos/scripting/auto-generated | 2 +- tools/bindings-generator | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 56286dddef..2d90634905 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 56286dddefb8d5775ac508b371d0452c08bfd191 +Subproject commit 2d90634905755c2b0106d47df9f0eff8c462ee4d diff --git a/tools/bindings-generator b/tools/bindings-generator index 6e880d8843..c842ccaa4b 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit 6e880d8843dd51fb5c4094f2672c7c846bb85401 +Subproject commit c842ccaa4b31121ac5f7be99ca64cafeb8d422c5 From 5b420df4de0c48d627541a4fae502c3437def500 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 30 Dec 2013 15:26:01 +0800 Subject: [PATCH 033/428] Fix compile bug on mobile, use Vector instead of std::vector --- .../ClippingNodeTest/ClippingNodeTest.cpp | 36 +++++++++++-------- .../ClippingNodeTest/ClippingNodeTest.h | 5 ++- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp index 3699703c3b..68a584d577 100644 --- a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -565,10 +565,7 @@ static const Color4F _planeColor[] = { RawStencilBufferTest::~RawStencilBufferTest() { - for(auto& element: _sprites) - { - CC_SAFE_RELEASE(element); - } + } std::string RawStencilBufferTest::title() const @@ -588,13 +585,12 @@ void RawStencilBufferTest::setup() CCLOGWARN("Stencil must be enabled for the current GLView."); } - _sprites.resize(_planeCount, nullptr); for(int i = 0; i < _planeCount; ++i) { - _sprites[i] = Sprite::create(s_pathGrossini); - _sprites[i]->retain(); - _sprites[i]->setAnchorPoint( Point(0.5, 0) ); - _sprites[i]->setScale( 2.5f ); + Sprite* sprite = Sprite::create(s_pathGrossini); + sprite->setAnchorPoint( Point(0.5, 0) ); + sprite->setScale( 2.5f ); + _sprites.pushBack(sprite); } Director::getInstance()->setAlphaBlending(true); @@ -630,7 +626,7 @@ void RawStencilBufferTest::draw() auto spritePoint = planeSize * i; spritePoint.x += planeSize.x / 2; spritePoint.y = 0; - _sprites[i]->setPosition( spritePoint ); + _sprites.at(i)->setPosition( spritePoint ); iter->init(0, _vertexZ); iter->func = CC_CALLBACK_0(RawStencilBufferTest::onBeforeDrawClip, this, i, stencilPoint); @@ -639,7 +635,7 @@ void RawStencilBufferTest::draw() kmGLPushMatrix(); this->transform(); - _sprites[i]->visit(); + _sprites.at(i)->visit(); kmGLPopMatrix(); iter->init(0, _vertexZ); @@ -649,7 +645,7 @@ void RawStencilBufferTest::draw() kmGLPushMatrix(); this->transform(); - _sprites[i]->visit(); + _sprites.at(i)->visit(); kmGLPopMatrix(); } @@ -763,7 +759,11 @@ void RawStencilBufferTest4::setupStencilForClippingOnPlane(GLint plane) auto program = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST); GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE); program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold); - _sprite->setShaderProgram(program ); + for(int i = 0; i < _planeCount; ++i) + { + _sprites.at(i)->setShaderProgram(program ); + } + #endif } @@ -796,7 +796,10 @@ void RawStencilBufferTest5::setupStencilForClippingOnPlane(GLint plane) auto program = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST); GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE); program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold); - _sprite->setShaderProgram( program ); + for(int i = 0; i < _planeCount; ++i) + { + _sprites.at(i)->setShaderProgram(program ); + } #endif } @@ -862,7 +865,10 @@ void RawStencilBufferTest6::setupStencilForClippingOnPlane(GLint plane) auto program = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST); GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE); program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold); - _sprite->setShaderProgram(program); + for(int i = 0; i < _planeCount; ++i) + { + _sprites.at(i)->setShaderProgram(program ); + } #endif glFlush(); } diff --git a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h index 1d77a4e55b..944c99ca2a 100644 --- a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h +++ b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h @@ -5,7 +5,6 @@ #include "../BaseTest.h" #include "renderer/CCCustomCommand.h" #include -#include class BaseClippingNodeTest : public BaseTest { @@ -165,8 +164,8 @@ protected: void onDisableStencil(); void onBeforeDrawClip(int planeIndex, const Point& pt); void onBeforeDrawSprite(int planeIndex, const Point& pt); -private: - std::vector _sprites; +protected: + Vector _sprites; }; class RawStencilBufferTest2 : public RawStencilBufferTest From 0488aa6dcbe2cd36301e9bce650066f05935cac8 Mon Sep 17 00:00:00 2001 From: chengstory Date: Mon, 30 Dec 2013 15:26:51 +0800 Subject: [PATCH 034/428] fixed #3474 1. Modify CCLOG, Add classname. 2. change ArmatureMovementDispatcher::addAnnimationEventCallBack to ArmatureMovementDispatcher::addAnimationEventCallBack. 3. remove unused do while(0). --- .../editor-support/cocostudio/TriggerMng.cpp | 36 +++++++++---------- cocos/editor-support/cocostudio/TriggerMng.h | 2 +- .../editor-support/cocostudio/TriggerObj.cpp | 14 ++++++-- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/cocos/editor-support/cocostudio/TriggerMng.cpp b/cocos/editor-support/cocostudio/TriggerMng.cpp index a81d6abb74..a73666216a 100644 --- a/cocos/editor-support/cocostudio/TriggerMng.cpp +++ b/cocos/editor-support/cocostudio/TriggerMng.cpp @@ -66,24 +66,20 @@ void TriggerMng::destroyInstance() void TriggerMng::parse(const rapidjson::Value &root) { - CCLOG("%s", triggerMngVersion()); - do { - int count = DICTOOL->getArrayCount_json(root, "Triggers"); - for (int i = 0; i < count; ++i) - { - const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(root, "Triggers", i); - TriggerObj *obj = TriggerObj::create(); - obj->serialize(subDict); - auto &vInt = obj->getEvents(); - for (const auto& e : vInt) - { - add((unsigned int)e, obj); - } - - _triggerObjs.insert(std::pair(obj->getId(), obj)); - } + int count = DICTOOL->getArrayCount_json(root, "Triggers"); + for (int i = 0; i < count; ++i) + { + const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(root, "Triggers", i); + TriggerObj *obj = TriggerObj::create(); + obj->serialize(subDict); + auto &vInt = obj->getEvents(); + for (const auto& e : vInt) + { + add((unsigned int)e, obj); + } - } while (0); + _triggerObjs.insert(std::pair(obj->getId(), obj)); + } } cocos2d::Vector* TriggerMng::get(unsigned int event) const @@ -233,14 +229,14 @@ void TriggerMng::addArmatureMovementCallBack(Armature *pAr, Object *pTarget, SEL { amd = new ArmatureMovementDispatcher(); pAr->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(ArmatureMovementDispatcher::animationEvent, amd, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); - amd->addAnnimationEventCallBack(pTarget, mecf); + amd->addAnimationEventCallBack(pTarget, mecf); _movementDispatches->insert(std::make_pair(pAr, amd)); } else { amd = iter->second; - amd->addAnnimationEventCallBack(pTarget, mecf); + amd->addAnimationEventCallBack(pTarget, mecf); } } @@ -313,7 +309,7 @@ ArmatureMovementDispatcher::~ArmatureMovementDispatcher(void) } } - void ArmatureMovementDispatcher::addAnnimationEventCallBack(Object *pTarget, SEL_MovementEventCallFunc mecf) + void ArmatureMovementDispatcher::addAnimationEventCallBack(Object *pTarget, SEL_MovementEventCallFunc mecf) { _mapEventAnimation->insert(std::make_pair(pTarget, mecf)); } diff --git a/cocos/editor-support/cocostudio/TriggerMng.h b/cocos/editor-support/cocostudio/TriggerMng.h index a0a9d1dfcc..46f50642e6 100644 --- a/cocos/editor-support/cocostudio/TriggerMng.h +++ b/cocos/editor-support/cocostudio/TriggerMng.h @@ -38,7 +38,7 @@ public: ArmatureMovementDispatcher(void); ~ArmatureMovementDispatcher(void); public: - void addAnnimationEventCallBack(cocos2d::Object*pTarget, SEL_MovementEventCallFunc mecf); + void addAnimationEventCallBack(cocos2d::Object*pTarget, SEL_MovementEventCallFunc mecf); void removeAnnimationEventCallBack(cocos2d::Object*pTarget, SEL_MovementEventCallFunc mecf); void animationEvent(Armature *armature, MovementEventType movementType, const std::string& movementID); diff --git a/cocos/editor-support/cocostudio/TriggerObj.cpp b/cocos/editor-support/cocostudio/TriggerObj.cpp index 196fd02db2..e37b0c7dc8 100644 --- a/cocos/editor-support/cocostudio/TriggerObj.cpp +++ b/cocos/editor-support/cocostudio/TriggerObj.cpp @@ -167,7 +167,13 @@ void TriggerObj::serialize(const rapidjson::Value &val) continue; } BaseTriggerCondition *con = dynamic_cast(ObjectFactory::getInstance()->createObject(classname)); - CCAssert(con != nullptr, "class named classname can not implement!"); + if(con == nullptr) + { + CCLOG("class %s can not be implemented!", classname); + CCASSERT(con != nullptr, ""); + } + + CCASSERT(con != nullptr, ""); con->serialize(subDict); con->init(); con->autorelease(); @@ -184,7 +190,11 @@ void TriggerObj::serialize(const rapidjson::Value &val) continue; } BaseTriggerAction *act = dynamic_cast(ObjectFactory::getInstance()->createObject(classname)); - CCAssert(act != nullptr, "class named classname can not implement!"); + if(act == nullptr) + { + CCLOG("class %s can not be implemented!", classname); + CCASSERT(act != nullptr, ""); + } act->serialize(subDict); act->init(); act->autorelease(); From 04a213135e7515061bdf00ac7c878d5d40c4a9ba Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Mon, 30 Dec 2013 15:28:59 +0800 Subject: [PATCH 035/428] reset --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 2d90634905..6060bdf5bd 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 2d90634905755c2b0106d47df9f0eff8c462ee4d +Subproject commit 6060bdf5bd0ee29bf7080a31e726e0c548f51851 From 0984eafaefa8b740b5cb8f2632275f470b29c18d Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 30 Dec 2013 15:32:04 +0800 Subject: [PATCH 036/428] closed #2050: move autorelease to CLN --- cocos/2d/CCTMXXMLParser.cpp | 1 - .../TestCpp/Classes/TileMapTest/TileMapTest.cpp | 17 ++++------------- samples/Cpp/TestCpp/Classes/testBasic.h | 2 +- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index 1adc516249..e325707dbc 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -342,7 +342,6 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) { TMXTilesetInfo* info = tmxMapInfo->getTilesets().back(); tmxMapInfo->setParentGID(info->_firstGid + attributeDict["id"].asInt()); - //FIXME:XXX Why insert an empty dict? tmxMapInfo->getTileProperties()[tmxMapInfo->getParentGID()] = Value(ValueMap()); tmxMapInfo->setParentElement(TMXPropertyTile); } diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp index 30a69a99d8..e1c77b4ecc 100644 --- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp @@ -1397,10 +1397,7 @@ Layer* nextTileMapAction() sceneIdx++; sceneIdx = sceneIdx % MAX_LAYER; - auto layer = createTileMalayer(sceneIdx); - layer->autorelease(); - - return layer; + return createTileMalayer(sceneIdx); } Layer* backTileMapAction() @@ -1408,20 +1405,14 @@ Layer* backTileMapAction() sceneIdx--; int total = MAX_LAYER; if( sceneIdx < 0 ) - sceneIdx += total; - - auto layer = createTileMalayer(sceneIdx); - layer->autorelease(); + sceneIdx += total; - return layer; + return createTileMalayer(sceneIdx); } Layer* restartTileMapAction() { - auto layer = createTileMalayer(sceneIdx); - layer->autorelease(); - - return layer; + return createTileMalayer(sceneIdx); } diff --git a/samples/Cpp/TestCpp/Classes/testBasic.h b/samples/Cpp/TestCpp/Classes/testBasic.h index 9ab7b905e7..2062ca2857 100644 --- a/samples/Cpp/TestCpp/Classes/testBasic.h +++ b/samples/Cpp/TestCpp/Classes/testBasic.h @@ -18,6 +18,6 @@ public: // C++ 11 #define CL(__className__) [](){ return __className__::create();} -#define CLN(__className__) [](){ return new __className__();} +#define CLN(__className__) [](){ auto obj = new __className__(); obj->autorelease(); return obj; } #endif From 326f640eb7d8ed96b8ec6eabbdeece4752a0b3a2 Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Mon, 30 Dec 2013 15:41:52 +0800 Subject: [PATCH 037/428] reset --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 6060bdf5bd..32f91b7f62 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 6060bdf5bd0ee29bf7080a31e726e0c548f51851 +Subproject commit 32f91b7f62106ddef2bccb0471e83982dddef761 From f1635924d608738eddeddbf15132fdc50d014a38 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 30 Dec 2013 15:53:36 +0800 Subject: [PATCH 038/428] migrate ShaderTestSprite to new renderer --- .../Classes/ShaderTest/ShaderTest2.cpp | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp index 89fddc5be0..b94f854c3c 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp @@ -2,6 +2,8 @@ #include "ShaderTest.h" #include "../testResource.h" #include "cocos2d.h" +#include "renderer/CCRenderCommand.h" +#include "renderer/CCCustomCommand.h" namespace ShaderTest2 { @@ -118,6 +120,10 @@ protected: virtual void setCustomUniforms() = 0; protected: std::string _fragSourceFile; + +protected: + CustomCommand _renderCommand; + void onDraw(); }; @@ -175,11 +181,20 @@ void ShaderSprite::initShader() } void ShaderSprite::draw() +{ + _renderCommand.init(0, _vertexZ); + _renderCommand.func = CC_CALLBACK_0(ShaderSprite::onDraw, this); + Director::getInstance()->getRenderer()->addCommand(&_renderCommand); + + CC_INCREMENT_GL_DRAWS(1); +} + +void ShaderSprite::onDraw() { CC_NODE_DRAW_SETUP(); - + setCustomUniforms(); - + GL::enableVertexAttribs(cocos2d::GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX ); GL::blendFunc(_blendFunc.src, _blendFunc.dst); GL::bindTexture2D( getTexture()->getName()); @@ -204,8 +219,6 @@ void ShaderSprite::draw() glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - - CC_INCREMENT_GL_DRAWS(1); } class NormalSprite : public ShaderSprite, public ShaderSpriteCreator From 3fb31e0b25eac76e5396d95aa46c78c29971c5d1 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 30 Dec 2013 15:54:57 +0800 Subject: [PATCH 039/428] remove draw increment --- samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp index b94f854c3c..fd35fbfbcc 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp @@ -186,7 +186,6 @@ void ShaderSprite::draw() _renderCommand.func = CC_CALLBACK_0(ShaderSprite::onDraw, this); Director::getInstance()->getRenderer()->addCommand(&_renderCommand); - CC_INCREMENT_GL_DRAWS(1); } void ShaderSprite::onDraw() From a5960c325241defb35d969b57a9ff8d0832f7e7e Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 30 Dec 2013 15:58:04 +0800 Subject: [PATCH 040/428] recover java activity on android. --- .../proj.android/AndroidManifest.xml | 2 +- .../proj.android/src/nojava.txt | 3 --- .../AssetsManagerTest/Cocos2dxActivity.java | 18 ++++++++++++++++++ .../HelloCpp/proj.android/AndroidManifest.xml | 2 +- .../Cpp/HelloCpp/proj.android/src/nojava.txt | 3 --- .../cocos2dx/hellocpp/Cocos2dxActivity.java | 17 +++++++++++++++++ .../proj.android/AndroidManifest.xml | 2 +- .../Cpp/SimpleGame/proj.android/src/nojava.txt | 3 --- .../cocos2dx/simplegame/Cocos2dxActivity.java | 18 ++++++++++++++++++ .../TestCpp/proj.android/AndroidManifest.xml | 2 +- .../org/cocos2dx/testcpp/Cocos2dxActivity.java | 18 ++++++++++++++++++ .../proj.android/AndroidManifest.xml | 2 +- .../CocosDragonJS/proj.android/src/nojava.txt | 3 --- .../cocosdragonjs/Cocos2dxActivity.java | 18 ++++++++++++++++++ .../proj.android/AndroidManifest.xml | 2 +- .../CrystalCraze/proj.android/src/nojava.txt | 3 --- .../crystalcraze/Cocos2dxActivity.java | 18 ++++++++++++++++++ .../proj.android/AndroidManifest.xml | 2 +- .../MoonWarriors/proj.android/src/nojava.txt | 3 --- .../moonwarriors/Cocos2dxActivity.java | 18 ++++++++++++++++++ .../proj.android/AndroidManifest.xml | 2 +- .../TestJavascript/proj.android/src/nojava.txt | 3 --- .../testjavascript/Cocos2dxActivity.java | 18 ++++++++++++++++++ .../proj.android/AndroidManifest.xml | 2 +- .../proj.android/src/nojava.txt | 3 --- .../watermelonwithme/Cocos2dxActivity.java | 18 ++++++++++++++++++ .../HelloLua/proj.android/AndroidManifest.xml | 2 +- .../Lua/HelloLua/proj.android/src/nojava.txt | 3 --- .../cocos2dx/hellolua/Cocos2dxActivity.java | 18 ++++++++++++++++++ .../TestLua/proj.android/AndroidManifest.xml | 2 +- .../Lua/TestLua/proj.android/src/nojava.txt | 3 --- .../org/cocos2dx/testlua/Cocos2dxActivity.java | 17 +++++++++++++++++ .../proj.android/AndroidManifest.xml | 2 +- .../proj.android/src/nojava.txt | 3 --- .../cocos2dx/hellocpp/Cocos2dxActivity.java | 17 +++++++++++++++++ .../proj.android/AndroidManifest.xml | 2 +- .../proj.android/src/nojava.txt | 3 --- .../hellojavascript/Cocos2dxActivity.java | 17 +++++++++++++++++ .../proj.android/AndroidManifest.xml | 2 +- .../proj.android/src/nojava.txt | 3 --- .../cocos2dx/hellolua/Cocos2dxActivity.java | 17 +++++++++++++++++ 41 files changed, 261 insertions(+), 53 deletions(-) delete mode 100644 samples/Cpp/AssetsManagerTest/proj.android/src/nojava.txt create mode 100644 samples/Cpp/AssetsManagerTest/proj.android/src/org/cocos2dx/AssetsManagerTest/Cocos2dxActivity.java delete mode 100644 samples/Cpp/HelloCpp/proj.android/src/nojava.txt create mode 100644 samples/Cpp/HelloCpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java delete mode 100644 samples/Cpp/SimpleGame/proj.android/src/nojava.txt create mode 100644 samples/Cpp/SimpleGame/proj.android/src/org/cocos2dx/simplegame/Cocos2dxActivity.java create mode 100644 samples/Cpp/TestCpp/proj.android/src/org/cocos2dx/testcpp/Cocos2dxActivity.java delete mode 100644 samples/Javascript/CocosDragonJS/proj.android/src/nojava.txt create mode 100644 samples/Javascript/CocosDragonJS/proj.android/src/org/cocos2dx/cocosdragonjs/Cocos2dxActivity.java delete mode 100644 samples/Javascript/CrystalCraze/proj.android/src/nojava.txt create mode 100644 samples/Javascript/CrystalCraze/proj.android/src/org/cocos2dx/crystalcraze/Cocos2dxActivity.java delete mode 100644 samples/Javascript/MoonWarriors/proj.android/src/nojava.txt create mode 100644 samples/Javascript/MoonWarriors/proj.android/src/org/cocos2dx/moonwarriors/Cocos2dxActivity.java delete mode 100644 samples/Javascript/TestJavascript/proj.android/src/nojava.txt create mode 100644 samples/Javascript/TestJavascript/proj.android/src/org/cocos2dx/testjavascript/Cocos2dxActivity.java delete mode 100644 samples/Javascript/WatermelonWithMe/proj.android/src/nojava.txt create mode 100644 samples/Javascript/WatermelonWithMe/proj.android/src/org/cocos2dx/watermelonwithme/Cocos2dxActivity.java delete mode 100644 samples/Lua/HelloLua/proj.android/src/nojava.txt create mode 100644 samples/Lua/HelloLua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java delete mode 100644 samples/Lua/TestLua/proj.android/src/nojava.txt create mode 100644 samples/Lua/TestLua/proj.android/src/org/cocos2dx/testlua/Cocos2dxActivity.java delete mode 100644 template/multi-platform-cpp/proj.android/src/nojava.txt create mode 100644 template/multi-platform-cpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java delete mode 100644 template/multi-platform-js/proj.android/src/nojava.txt create mode 100644 template/multi-platform-js/proj.android/src/org/cocos2dx/hellojavascript/Cocos2dxActivity.java delete mode 100644 template/multi-platform-lua/proj.android/src/nojava.txt create mode 100644 template/multi-platform-lua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java diff --git a/samples/Cpp/AssetsManagerTest/proj.android/AndroidManifest.xml b/samples/Cpp/AssetsManagerTest/proj.android/AndroidManifest.xml index 764617b6cd..b6b69e4442 100644 --- a/samples/Cpp/AssetsManagerTest/proj.android/AndroidManifest.xml +++ b/samples/Cpp/AssetsManagerTest/proj.android/AndroidManifest.xml @@ -10,7 +10,7 @@ - - - - - - - - - - - - - - Date: Mon, 30 Dec 2013 16:30:08 +0800 Subject: [PATCH 041/428] update describe for support translucency on android --- .../org/cocos2dx/hellocpp/Cocos2dxActivity.java | 15 +++++++++++++-- .../hellojavascript/Cocos2dxActivity.java | 14 ++++++++++++-- .../org/cocos2dx/hellolua/Cocos2dxActivity.java | 14 ++++++++++++-- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/template/multi-platform-cpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java b/template/multi-platform-cpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java index 27957a0e07..1cb04b5552 100644 --- a/template/multi-platform-cpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java +++ b/template/multi-platform-cpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java @@ -10,8 +10,19 @@ public class Cocos2dxActivity extends NativeActivity{ // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) + //1.Set the format of window for supports translucency //getWindow().setFormat(PixelFormat.TRANSLUCENT); + + //2.You need configure egl attribs in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) for supports translucency. + //eg: + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + EGL_BUFFER_SIZE, 32, + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + } } diff --git a/template/multi-platform-js/proj.android/src/org/cocos2dx/hellojavascript/Cocos2dxActivity.java b/template/multi-platform-js/proj.android/src/org/cocos2dx/hellojavascript/Cocos2dxActivity.java index 696a217da9..5308d8e97c 100644 --- a/template/multi-platform-js/proj.android/src/org/cocos2dx/hellojavascript/Cocos2dxActivity.java +++ b/template/multi-platform-js/proj.android/src/org/cocos2dx/hellojavascript/Cocos2dxActivity.java @@ -10,8 +10,18 @@ public class Cocos2dxActivity extends NativeActivity{ // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) + //1.Set the format of window for supports translucency //getWindow().setFormat(PixelFormat.TRANSLUCENT); + + //2.You need configure egl attribs in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) for supports translucency. + //eg: + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + EGL_BUFFER_SIZE, 32, + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ } } diff --git a/template/multi-platform-lua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java b/template/multi-platform-lua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java index 9195a8f37b..4bbe11c022 100644 --- a/template/multi-platform-lua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java +++ b/template/multi-platform-lua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java @@ -10,8 +10,18 @@ public class Cocos2dxActivity extends NativeActivity{ // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) + //1.Set the format of window for supports translucency //getWindow().setFormat(PixelFormat.TRANSLUCENT); + + //2.You need configure egl attribs in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) for supports translucency. + //eg: + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + EGL_BUFFER_SIZE, 32, + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ } } From 4f2d7f47fcc5bcf2639e2b323e137aa851a5eea4 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 30 Dec 2013 16:42:33 +0800 Subject: [PATCH 042/428] update describe for support translucency on android --- .../cocos2dx/hellocpp/Cocos2dxActivity.java | 16 ++++++++++------ .../hellojavascript/Cocos2dxActivity.java | 19 ++++++++++++------- .../cocos2dx/hellolua/Cocos2dxActivity.java | 19 ++++++++++++------- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/template/multi-platform-cpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java b/template/multi-platform-cpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java index 1cb04b5552..ed4f339cee 100644 --- a/template/multi-platform-cpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java +++ b/template/multi-platform-cpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java @@ -10,19 +10,23 @@ public class Cocos2dxActivity extends NativeActivity{ // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //1.Set the format of window for supports translucency - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency - //2.You need configure egl attribs in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) for supports translucency. - //eg: + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp /*const EGLint attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_BUFFER_SIZE, 32, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field EGL_DEPTH_SIZE, 16, EGL_STENCIL_SIZE, 8, EGL_NONE };*/ + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/template/multi-platform-js/proj.android/src/org/cocos2dx/hellojavascript/Cocos2dxActivity.java b/template/multi-platform-js/proj.android/src/org/cocos2dx/hellojavascript/Cocos2dxActivity.java index 5308d8e97c..25fac60eab 100644 --- a/template/multi-platform-js/proj.android/src/org/cocos2dx/hellojavascript/Cocos2dxActivity.java +++ b/template/multi-platform-js/proj.android/src/org/cocos2dx/hellojavascript/Cocos2dxActivity.java @@ -10,18 +10,23 @@ public class Cocos2dxActivity extends NativeActivity{ // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //1.Set the format of window for supports translucency - //getWindow().setFormat(PixelFormat.TRANSLUCENT); - - //2.You need configure egl attribs in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) for supports translucency. - //eg: + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp /*const EGLint attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_BUFFER_SIZE, 32, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field EGL_DEPTH_SIZE, 16, EGL_STENCIL_SIZE, 8, EGL_NONE };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/template/multi-platform-lua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java b/template/multi-platform-lua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java index 4bbe11c022..121f368edd 100644 --- a/template/multi-platform-lua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java +++ b/template/multi-platform-lua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java @@ -10,18 +10,23 @@ public class Cocos2dxActivity extends NativeActivity{ // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //1.Set the format of window for supports translucency - //getWindow().setFormat(PixelFormat.TRANSLUCENT); - - //2.You need configure egl attribs in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) for supports translucency. - //eg: + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp /*const EGLint attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_BUFFER_SIZE, 32, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field EGL_DEPTH_SIZE, 16, EGL_STENCIL_SIZE, 8, EGL_NONE };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } From 5cc029774835bc778742aaf60f0fc7cfa21f1ab0 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 30 Dec 2013 18:12:43 +0800 Subject: [PATCH 043/428] update describe for support translucency on android --- .../AssetsManagerTest/Cocos2dxActivity.java | 21 ++++++++++++++++--- .../cocos2dx/hellocpp/Cocos2dxActivity.java | 21 ++++++++++++++++--- .../cocos2dx/simplegame/Cocos2dxActivity.java | 21 ++++++++++++++++--- .../cocos2dx/testcpp/Cocos2dxActivity.java | 21 ++++++++++++++++--- .../cocosdragonjs/Cocos2dxActivity.java | 21 ++++++++++++++++--- .../crystalcraze/Cocos2dxActivity.java | 21 ++++++++++++++++--- .../moonwarriors/Cocos2dxActivity.java | 21 ++++++++++++++++--- .../testjavascript/Cocos2dxActivity.java | 21 ++++++++++++++++--- .../watermelonwithme/Cocos2dxActivity.java | 21 ++++++++++++++++--- .../cocos2dx/hellolua/Cocos2dxActivity.java | 21 ++++++++++++++++--- .../cocos2dx/testlua/Cocos2dxActivity.java | 21 ++++++++++++++++--- 11 files changed, 198 insertions(+), 33 deletions(-) diff --git a/samples/Cpp/AssetsManagerTest/proj.android/src/org/cocos2dx/AssetsManagerTest/Cocos2dxActivity.java b/samples/Cpp/AssetsManagerTest/proj.android/src/org/cocos2dx/AssetsManagerTest/Cocos2dxActivity.java index 0fb3500e8f..c30457e9fb 100644 --- a/samples/Cpp/AssetsManagerTest/proj.android/src/org/cocos2dx/AssetsManagerTest/Cocos2dxActivity.java +++ b/samples/Cpp/AssetsManagerTest/proj.android/src/org/cocos2dx/AssetsManagerTest/Cocos2dxActivity.java @@ -11,8 +11,23 @@ public class Cocos2dxActivity extends NativeActivity { // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/samples/Cpp/HelloCpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java b/samples/Cpp/HelloCpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java index 27957a0e07..ed4f339cee 100644 --- a/samples/Cpp/HelloCpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java +++ b/samples/Cpp/HelloCpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java @@ -10,8 +10,23 @@ public class Cocos2dxActivity extends NativeActivity{ // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/samples/Cpp/SimpleGame/proj.android/src/org/cocos2dx/simplegame/Cocos2dxActivity.java b/samples/Cpp/SimpleGame/proj.android/src/org/cocos2dx/simplegame/Cocos2dxActivity.java index b6b16e7001..09065bdd15 100644 --- a/samples/Cpp/SimpleGame/proj.android/src/org/cocos2dx/simplegame/Cocos2dxActivity.java +++ b/samples/Cpp/SimpleGame/proj.android/src/org/cocos2dx/simplegame/Cocos2dxActivity.java @@ -11,8 +11,23 @@ public class Cocos2dxActivity extends NativeActivity { // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/samples/Cpp/TestCpp/proj.android/src/org/cocos2dx/testcpp/Cocos2dxActivity.java b/samples/Cpp/TestCpp/proj.android/src/org/cocos2dx/testcpp/Cocos2dxActivity.java index 3360de7db2..8897f4f1bf 100644 --- a/samples/Cpp/TestCpp/proj.android/src/org/cocos2dx/testcpp/Cocos2dxActivity.java +++ b/samples/Cpp/TestCpp/proj.android/src/org/cocos2dx/testcpp/Cocos2dxActivity.java @@ -11,8 +11,23 @@ public class Cocos2dxActivity extends NativeActivity { // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/samples/Javascript/CocosDragonJS/proj.android/src/org/cocos2dx/cocosdragonjs/Cocos2dxActivity.java b/samples/Javascript/CocosDragonJS/proj.android/src/org/cocos2dx/cocosdragonjs/Cocos2dxActivity.java index a17ce0979b..bde3e3a5a0 100644 --- a/samples/Javascript/CocosDragonJS/proj.android/src/org/cocos2dx/cocosdragonjs/Cocos2dxActivity.java +++ b/samples/Javascript/CocosDragonJS/proj.android/src/org/cocos2dx/cocosdragonjs/Cocos2dxActivity.java @@ -11,8 +11,23 @@ public class Cocos2dxActivity extends NativeActivity { // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/samples/Javascript/CrystalCraze/proj.android/src/org/cocos2dx/crystalcraze/Cocos2dxActivity.java b/samples/Javascript/CrystalCraze/proj.android/src/org/cocos2dx/crystalcraze/Cocos2dxActivity.java index 2477ee1fe3..f4dfa7e83b 100644 --- a/samples/Javascript/CrystalCraze/proj.android/src/org/cocos2dx/crystalcraze/Cocos2dxActivity.java +++ b/samples/Javascript/CrystalCraze/proj.android/src/org/cocos2dx/crystalcraze/Cocos2dxActivity.java @@ -11,8 +11,23 @@ public class Cocos2dxActivity extends NativeActivity { // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/samples/Javascript/MoonWarriors/proj.android/src/org/cocos2dx/moonwarriors/Cocos2dxActivity.java b/samples/Javascript/MoonWarriors/proj.android/src/org/cocos2dx/moonwarriors/Cocos2dxActivity.java index c67080f9a3..c979c4d044 100644 --- a/samples/Javascript/MoonWarriors/proj.android/src/org/cocos2dx/moonwarriors/Cocos2dxActivity.java +++ b/samples/Javascript/MoonWarriors/proj.android/src/org/cocos2dx/moonwarriors/Cocos2dxActivity.java @@ -11,8 +11,23 @@ public class Cocos2dxActivity extends NativeActivity { // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/samples/Javascript/TestJavascript/proj.android/src/org/cocos2dx/testjavascript/Cocos2dxActivity.java b/samples/Javascript/TestJavascript/proj.android/src/org/cocos2dx/testjavascript/Cocos2dxActivity.java index 1ca3e926a1..a5852ad1ee 100644 --- a/samples/Javascript/TestJavascript/proj.android/src/org/cocos2dx/testjavascript/Cocos2dxActivity.java +++ b/samples/Javascript/TestJavascript/proj.android/src/org/cocos2dx/testjavascript/Cocos2dxActivity.java @@ -11,8 +11,23 @@ public class Cocos2dxActivity extends NativeActivity { // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/samples/Javascript/WatermelonWithMe/proj.android/src/org/cocos2dx/watermelonwithme/Cocos2dxActivity.java b/samples/Javascript/WatermelonWithMe/proj.android/src/org/cocos2dx/watermelonwithme/Cocos2dxActivity.java index 85eb49eeda..3fd0f293cf 100644 --- a/samples/Javascript/WatermelonWithMe/proj.android/src/org/cocos2dx/watermelonwithme/Cocos2dxActivity.java +++ b/samples/Javascript/WatermelonWithMe/proj.android/src/org/cocos2dx/watermelonwithme/Cocos2dxActivity.java @@ -11,8 +11,23 @@ public class Cocos2dxActivity extends NativeActivity { // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/samples/Lua/HelloLua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java b/samples/Lua/HelloLua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java index 9ec597c62d..9933cf14fd 100644 --- a/samples/Lua/HelloLua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java +++ b/samples/Lua/HelloLua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java @@ -11,8 +11,23 @@ public class Cocos2dxActivity extends NativeActivity { // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } diff --git a/samples/Lua/TestLua/proj.android/src/org/cocos2dx/testlua/Cocos2dxActivity.java b/samples/Lua/TestLua/proj.android/src/org/cocos2dx/testlua/Cocos2dxActivity.java index 29300019a3..c5eac04f8c 100644 --- a/samples/Lua/TestLua/proj.android/src/org/cocos2dx/testlua/Cocos2dxActivity.java +++ b/samples/Lua/TestLua/proj.android/src/org/cocos2dx/testlua/Cocos2dxActivity.java @@ -10,8 +10,23 @@ public class Cocos2dxActivity extends NativeActivity{ // TODO Auto-generated method stub super.onCreate(savedInstanceState); - //For supports translucency. - //You need configure egl attribs of the color buffer size in cocos\2d\platform\android\nativeactivity.cpp on some android versions(eg.4.4) - //getWindow().setFormat(PixelFormat.TRANSLUCENT); + //For supports translucency + + //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp + /*const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + //EGL_BLUE_SIZE, 5, -->delete + //EGL_GREEN_SIZE, 6, -->delete + //EGL_RED_SIZE, 5, -->delete + EGL_BUFFER_SIZE, 32, //-->new field + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_NONE + };*/ + + //2.Set the format of window + // getWindow().setFormat(PixelFormat.TRANSLUCENT); + } } From 437c6545da8a142a36288cef4ad2e7b50c477f7a Mon Sep 17 00:00:00 2001 From: cw Date: Mon, 30 Dec 2013 18:35:08 +0800 Subject: [PATCH 044/428] fix linux error not Tkinter --- tools/project-creator/create_project.pyw | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tools/project-creator/create_project.pyw b/tools/project-creator/create_project.pyw index d5fcb89651..0ff3bfae7f 100644 --- a/tools/project-creator/create_project.pyw +++ b/tools/project-creator/create_project.pyw @@ -25,6 +25,12 @@ THE SOFTWARE. ****************************************************************************""" import sys +def commandCreate(): + from module.core import CocosProject + project = CocosProject() + name, package, language, path = project.checkParams() + project.createPlatformProjects(name, package, language, path) + # ------------ main -------------- if __name__ == '__main__': @@ -36,11 +42,12 @@ if __name__ == '__main__': #create_project.py -n MyGame -k com.MyCompany.AwesomeGame -l javascript -p c:/mycompany """ if len(sys.argv)==1: - from module.ui import createTkCocosDialog - createTkCocosDialog() + try: + from module.ui import createTkCocosDialog + createTkCocosDialog() + except ImportError: + commandCreate() else: - from module.core import CocosProject - project = CocosProject() - name, package, language, path = project.checkParams() - project.createPlatformProjects(name, package, language, path) + commandCreate() + From 89838e4c93ab4121fae52216171db05d1fd6e3ed Mon Sep 17 00:00:00 2001 From: cw Date: Mon, 30 Dec 2013 18:45:20 +0800 Subject: [PATCH 045/428] 755 --- template/multi-platform-cpp/proj.linux/build.sh | 0 template/multi-platform-lua/proj.linux/build.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 template/multi-platform-cpp/proj.linux/build.sh mode change 100644 => 100755 template/multi-platform-lua/proj.linux/build.sh diff --git a/template/multi-platform-cpp/proj.linux/build.sh b/template/multi-platform-cpp/proj.linux/build.sh old mode 100644 new mode 100755 diff --git a/template/multi-platform-lua/proj.linux/build.sh b/template/multi-platform-lua/proj.linux/build.sh old mode 100644 new mode 100755 From 3292faf51314f4ca4607ca6bdfd1a2e9c78cec3d Mon Sep 17 00:00:00 2001 From: cw Date: Mon, 30 Dec 2013 18:50:26 +0800 Subject: [PATCH 046/428] fix exc create_project no args error in linux --- tools/project-creator/create_project.pyw | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tools/project-creator/create_project.pyw b/tools/project-creator/create_project.pyw index d5fcb89651..0ff3bfae7f 100644 --- a/tools/project-creator/create_project.pyw +++ b/tools/project-creator/create_project.pyw @@ -25,6 +25,12 @@ THE SOFTWARE. ****************************************************************************""" import sys +def commandCreate(): + from module.core import CocosProject + project = CocosProject() + name, package, language, path = project.checkParams() + project.createPlatformProjects(name, package, language, path) + # ------------ main -------------- if __name__ == '__main__': @@ -36,11 +42,12 @@ if __name__ == '__main__': #create_project.py -n MyGame -k com.MyCompany.AwesomeGame -l javascript -p c:/mycompany """ if len(sys.argv)==1: - from module.ui import createTkCocosDialog - createTkCocosDialog() + try: + from module.ui import createTkCocosDialog + createTkCocosDialog() + except ImportError: + commandCreate() else: - from module.core import CocosProject - project = CocosProject() - name, package, language, path = project.checkParams() - project.createPlatformProjects(name, package, language, path) + commandCreate() + From 046d6696bcb5be64ce3f6987ffe0991a40a158f6 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 30 Dec 2013 20:22:25 +0800 Subject: [PATCH 047/428] update cocos2d-x version string --- cocos/2d/cocos2d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/cocos2d.cpp b/cocos/2d/cocos2d.cpp index 1c754fd45b..d3eb4f8ce9 100644 --- a/cocos/2d/cocos2d.cpp +++ b/cocos/2d/cocos2d.cpp @@ -30,7 +30,7 @@ NS_CC_BEGIN const char* cocos2dVersion() { - return "3.0-beta0-pre"; + return "3.0-beta"; } NS_CC_END From c030553d8c0294bb5d2425313e96882f0a3839a6 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 30 Dec 2013 20:25:25 +0800 Subject: [PATCH 048/428] Fix missed popMatrix --- cocos/2d/CCRenderTexture.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 146c39e050..93a7778084 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -660,6 +660,12 @@ void RenderTexture::end() Renderer *renderer = Director::getInstance()->getRenderer(); renderer->addCommand(&_endCommand); renderer->popGroup(); + + kmGLMatrixMode(KM_GL_PROJECTION); + kmGLPopMatrix(); + + kmGLMatrixMode(KM_GL_MODELVIEW); + kmGLPopMatrix(); } NS_CC_END From 1edf748dc3429d8e6c7db65d14fecfaf70254ae3 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 30 Dec 2013 20:57:46 +0800 Subject: [PATCH 049/428] [JSB] Adds trigger bindings for CocoStudio. --- cocos/2d/CCScriptSupport.h | 8 + .../editor-support/cocostudio/TriggerMng.cpp | 53 ++- .../editor-support/cocostudio/TriggerObj.cpp | 26 +- cocos/editor-support/cocostudio/TriggerObj.h | 4 +- .../javascript/bindings/ScriptingCore.cpp | 8 + .../javascript/bindings/ScriptingCore.h | 2 + .../javascript/script/jsb_cocos2d.js | 14 +- .../javascript/script/jsb_cocos2d_studio.js | 419 ++++++++++++++++++ .../CocoStudioSceneTest/TriggerCode/acts.cpp | 4 +- 9 files changed, 504 insertions(+), 34 deletions(-) diff --git a/cocos/2d/CCScriptSupport.h b/cocos/2d/CCScriptSupport.h index 07a01923fd..8fcfba4a11 100644 --- a/cocos/2d/CCScriptSupport.h +++ b/cocos/2d/CCScriptSupport.h @@ -427,6 +427,14 @@ public: * @lua NA */ virtual bool handleAssert(const char *msg) = 0; + + enum class ConfigType + { + NONE, + COCOSTUDIO + }; + /** Parse configuration file */ + virtual bool parseConfig(ConfigType type, const std::string& str) = 0; }; /** diff --git a/cocos/editor-support/cocostudio/TriggerMng.cpp b/cocos/editor-support/cocostudio/TriggerMng.cpp index a81d6abb74..a1f7a8598c 100644 --- a/cocos/editor-support/cocostudio/TriggerMng.cpp +++ b/cocos/editor-support/cocostudio/TriggerMng.cpp @@ -23,6 +23,9 @@ THE SOFTWARE. ****************************************************************************/ #include "TriggerMng.h" +#include "json/filestream.h" +#include "json/prettywriter.h" +#include "json/stringbuffer.h" using namespace cocos2d; @@ -67,23 +70,39 @@ void TriggerMng::destroyInstance() void TriggerMng::parse(const rapidjson::Value &root) { CCLOG("%s", triggerMngVersion()); - do { - int count = DICTOOL->getArrayCount_json(root, "Triggers"); - for (int i = 0; i < count; ++i) - { - const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(root, "Triggers", i); - TriggerObj *obj = TriggerObj::create(); - obj->serialize(subDict); - auto &vInt = obj->getEvents(); - for (const auto& e : vInt) - { - add((unsigned int)e, obj); - } - - _triggerObjs.insert(std::pair(obj->getId(), obj)); - } - - } while (0); + + ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine(); + bool useBindings = engine != nullptr; + + int count = DICTOOL->getArrayCount_json(root, "Triggers"); + if (useBindings) + { + if (count > 0) + { + const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(root, "Triggers"); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + subDict.Accept(writer); + + engine->parseConfig(ScriptEngineProtocol::ConfigType::COCOSTUDIO, buffer.GetString()); + } + } + else + { + for (int i = 0; i < count; ++i) + { + const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(root, "Triggers", i); + TriggerObj *obj = TriggerObj::create(); + obj->serialize(subDict); + auto &vInt = obj->getEvents(); + for (const auto& e : vInt) + { + add((unsigned int)e, obj); + } + + _triggerObjs.insert(std::pair(obj->getId(), obj)); + } + } } cocos2d::Vector* TriggerMng::get(unsigned int event) const diff --git a/cocos/editor-support/cocostudio/TriggerObj.cpp b/cocos/editor-support/cocostudio/TriggerObj.cpp index 196fd02db2..0cf766c591 100644 --- a/cocos/editor-support/cocostudio/TriggerObj.cpp +++ b/cocos/editor-support/cocostudio/TriggerObj.cpp @@ -81,7 +81,7 @@ void BaseTriggerAction::removeAll() TriggerObj::TriggerObj(void) :_id(UINT_MAX) -,_bEnable(true) +,_enabled(true) { _vInt.clear(); } @@ -112,28 +112,29 @@ TriggerObj* TriggerObj::create() bool TriggerObj::detect() { - if (!_bEnable || _cons.size() == 0) + if (!_enabled || _cons.empty()) { return true; } - bool bRet = true; + + bool ret = true; - for(auto con : _cons) + for (const auto& con : _cons) { - bRet = bRet && con->detect(); + ret = ret && con->detect(); } - return bRet; + return ret; } void TriggerObj::done() { - if (!_bEnable || _acts.size() == 0) + if (!_enabled || _acts.empty()) { return; } - for(auto act : _acts) + for (const auto& act : _acts) { act->done(); } @@ -141,11 +142,12 @@ void TriggerObj::done() void TriggerObj::removeAll() { - for(auto con : _cons) + for (const auto& con : _cons) { con->removeAll(); } - for(auto act : _acts) + + for (const auto& act : _acts) { act->removeAll(); } @@ -209,9 +211,9 @@ unsigned int TriggerObj::getId() return _id; } -void TriggerObj::setEnable(bool bEnable) +void TriggerObj::setEnabled(bool enabled) { - _bEnable = bEnable; + _enabled = enabled; } std::vector& TriggerObj::getEvents() diff --git a/cocos/editor-support/cocostudio/TriggerObj.h b/cocos/editor-support/cocostudio/TriggerObj.h index 4c29b60021..6586bbab7d 100644 --- a/cocos/editor-support/cocostudio/TriggerObj.h +++ b/cocos/editor-support/cocostudio/TriggerObj.h @@ -70,14 +70,14 @@ public: virtual void removeAll(); virtual void serialize(const rapidjson::Value &val); unsigned int getId(); - void setEnable(bool bEnable); + void setEnabled(bool enabled); std::vector& getEvents(); private: cocos2d::Vector _cons; cocos2d::Vector _acts; unsigned int _id; - bool _bEnable; + bool _enabled; std::vector _vInt; }; diff --git a/cocos/scripting/javascript/bindings/ScriptingCore.cpp b/cocos/scripting/javascript/bindings/ScriptingCore.cpp index bdbf4978e0..75df216101 100644 --- a/cocos/scripting/javascript/bindings/ScriptingCore.cpp +++ b/cocos/scripting/javascript/bindings/ScriptingCore.cpp @@ -1160,6 +1160,14 @@ int ScriptingCore::sendEvent(ScriptEvent* evt) return 0; } +bool ScriptingCore::parseConfig(ConfigType type, const std::string &str) +{ + jsval args[2]; + args[0] = int32_to_jsval(_cx, static_cast(type)); + args[1] = std_string_to_jsval(_cx, str); + return (JS_TRUE == executeFunctionWithOwner(OBJECT_TO_JSVAL(_global), "__onParseConfig", 2, args)); +} + #pragma mark - Debug void SimpleRunLoop::update(float dt) diff --git a/cocos/scripting/javascript/bindings/ScriptingCore.h b/cocos/scripting/javascript/bindings/ScriptingCore.h index f393824a02..34f5c8021e 100644 --- a/cocos/scripting/javascript/bindings/ScriptingCore.h +++ b/cocos/scripting/javascript/bindings/ScriptingCore.h @@ -88,6 +88,8 @@ public: virtual int executeGlobalFunction(const char* functionName) { return 0; } virtual int sendEvent(ScriptEvent* message) override; + + virtual bool parseConfig(ConfigType type, const std::string& str) override; virtual bool handleAssert(const char *msg) { return false; } diff --git a/cocos/scripting/javascript/script/jsb_cocos2d.js b/cocos/scripting/javascript/script/jsb_cocos2d.js index 5021ed2bf4..02622d4d44 100644 --- a/cocos/scripting/javascript/script/jsb_cocos2d.js +++ b/cocos/scripting/javascript/script/jsb_cocos2d.js @@ -613,4 +613,16 @@ cc.Loader.preload = function (resources, selector, target) { return this._instance; }; -cc.LoaderScene = cc.Loader; \ No newline at end of file +cc.LoaderScene = cc.Loader; + +var ConfigType = { + NONE: 0, + COCOSTUDIO: 1 +}; + +var __onParseConfig = function(type, str) { + if (type === ConfigType.COCOSTUDIO) { + ccs.TriggerMng.getInstance().parse(JSON.parse(str)); + } +}; + diff --git a/cocos/scripting/javascript/script/jsb_cocos2d_studio.js b/cocos/scripting/javascript/script/jsb_cocos2d_studio.js index fadd914f00..a866f85e7b 100644 --- a/cocos/scripting/javascript/script/jsb_cocos2d_studio.js +++ b/cocos/scripting/javascript/script/jsb_cocos2d_studio.js @@ -6,6 +6,8 @@ var ccs = ccs || {}; +ccs.Class = ccs.Class || cc.Class || {}; + //movement event type ccs.MovementEventType = { start: 0, @@ -25,3 +27,420 @@ if(ccs.Armature){ ccs.ComController.extend = cc.Class.extend; ccs.Armature.extend = cc.Class.extend; } + + +ccs.sendEvent = function (event) { + var triggerObjArr = ccs.TriggerMng.getInstance().get(event); + if (triggerObjArr == null) { + return; + } + for (var i = 0; i < triggerObjArr.length; i++) { + var triObj = triggerObjArr[i]; + if (triObj != null && triObj.detect()) { + triObj.done(); + } + } +}; + + +ccs.ObjectFactory = ccs.Class.extend({ + _typeMap: null, + ctor: function () { + this._typeMap = {}; + }, + destroyInstance: function () { + this._sharedFactory = null; + }, + + createObject: function (className) { + var o = null; + var t = this._typeMap[className]; + if (t) { + o = new t._fun(); + } + return o; + }, + + registerType: function (t) { + this._typeMap[t._className] = t; + } +}); + +ccs.ObjectFactory._sharedFactory = null; + +ccs.ObjectFactory.getInstance = function () { + if (!this._sharedFactory) { + this._sharedFactory = new ccs.ObjectFactory(); + } + return this._sharedFactory; +}; + +ccs.TInfo = ccs.Class.extend({ + _className: "", + _fun: null, + /** + * + * @param {String|ccs.TInfo}c + * @param {Function}f + */ + ctor: function (c, f) { + if (f) { + this._className = c; + this._fun = f; + }else{ + this._className = c._className; + this._fun = c._fun; + } + ccs.ObjectFactory.getInstance().registerType(this); + } +}); + +ccs.registerTriggerClass = function(className, createFunc) { + new ccs.TInfo(className, createFunc); +} + +ccs.BaseTriggerCondition = ccs.Class.extend({ + init: function () { + return true; + }, + + detect: function () { + return true; + }, + + serialize: function (jsonVal) { + }, + + removeAll: function () { + } +}); +ccs.BaseTriggerAction = ccs.Class.extend({ + + init: function () { + return true; + }, + + done: function () { + + }, + + serialize: function (jsonVal) { + }, + + removeAll: function () { + } +}); + +ccs.TriggerObj = ccs.Class.extend({ + _cons: null, + _acts: null, + _id: 0, + _enable: true, + _vInt: null, + + ctor: function () { + this._id = 0; + this._enable = true; + }, + + init: function () { + this._cons = []; + this._acts = []; + this._vInt = []; + return true; + }, + + detect: function () { + if (!this._enable || this._cons.length == 0) { + return true; + } + var ret = true; + var obj = null; + for (var i = 0; i < this._cons.length; i++) { + obj = this._cons[i]; + if (obj && obj.detect) { + ret = ret && obj.detect(); + } + } + return ret; + }, + + done: function () { + if (!this._enable || this._acts.length == 0) { + return; + } + var obj; + for (var i = 0; i < this._acts.length; i++) { + obj = this._acts[i]; + if (obj && obj.done) { + obj.done(); + } + } + }, + + removeAll: function () { + var obj = null; + for (var i = 0; i < this._cons.length; i++) { + obj = this._cons[i]; + if (obj) + obj.removeAll(); + } + this._cons = []; + for (var i = 0; i < this._acts.length; i++) { + obj = this._acts[i]; + if (obj) + obj.removeAll(); + } + this._acts = []; + }, + + serialize: function (jsonVal) { + this._id = jsonVal["id"] || 0; + var conditions = jsonVal["conditions"] || []; + for (var i = 0; i < conditions.length; i++) { + var subDict = conditions[i]; + var classname = subDict["classname"]; + if (!classname) { + continue; + } + var con = ccs.ObjectFactory.getInstance().createObject(classname); + if (!con) { + cc.log("class named classname(" + classname + ") can not implement!"); + } + + con.serialize(subDict); + con.init(); + this._cons.push(con); + } + + var actions = jsonVal["actions"] || []; + for (var i = 0; i < actions.length; i++) { + var subDict = actions[i]; + var classname = subDict["classname"]; + if (!classname) { + continue; + } + var act = ccs.ObjectFactory.getInstance().createObject(classname); + if (!act) { + cc.log("class named classname(" + classname + ") can not implement!"); + } + + act.serialize(subDict); + act.init(); + this._acts.push(act); + } + + var events = jsonVal["events"] || []; + for (var i = 0; i < events.length; i++) { + var subDict = events[i]; + var event = subDict["id"]; + if (event < 0) { + continue; + } + this._vInt.push(event); + } + }, + + getId: function () { + return this._id; + }, + + setEnable: function (enable) { + this._enable = enable; + }, + + getEvents: function () { + return this._vInt; + } +}); + +ccs.TriggerObj.create = function() { + var ret = new ccs.TriggerObj(); + if (ret.init()) + return ret; + return null; +} + +ccs.TriggerMng = ccs.Class.extend({ + _eventTriggers: null, + _triggerObjs: null, + _movementDispatches: null, + ctor: function () { + this._eventTriggers = {}; + this._triggerObjs = {}; + this._movementDispatches = []; + }, + + destroyInstance: function () { + this.removeAll(); + this._instance = null; + }, + + parse: function (root) { + var triggers = root;//["Triggers"]; + for (var i = 0; i < triggers.length; ++i) { + var subDict = triggers[i]; + var triggerObj = ccs.TriggerObj.create(); + triggerObj.serialize(subDict); + var events = triggerObj.getEvents(); + for (var j = 0; j < events.length; j++) { + var event = events[j]; + this.add(event, triggerObj); + } + this._triggerObjs[triggerObj.getId()] = triggerObj; + } + }, + + get: function (event) { + return this._eventTriggers[event]; + }, + + getTriggerObj: function (id) { + return this._triggerObjs[id]; + }, + + add: function (event, triggerObj) { + var eventTriggers = this._eventTriggers[event]; + if (!eventTriggers) { + eventTriggers = []; + } + if (!cc.ArrayContainsObject(eventTriggers, triggerObj)) { + eventTriggers.push(triggerObj); + this._eventTriggers[event] = eventTriggers; + } + }, + + removeAll: function () { + for (var key in this._eventTriggers) { + var triObjArr = this._eventTriggers[key]; + for (var j = 0; j < triObjArr.length; j++) { + var obj = triObjArr[j]; + obj.removeAll(); + } + } + this._eventTriggers = {}; + }, + + remove: function (event, Obj) { + if (Obj) { + return this._removeObj(event, Obj); + } + var bRet = false; + do + { + var triObjects = this._eventTriggers[event]; + if (!triObjects) break; + for (var i = 0; i < triObjects.length; i++) { + var triObject = triObjects[i]; + if (triObject) { + triObject.removeAll(); + } + } + delete this._eventTriggers[event]; + bRet = true; + } while (0); + return bRet; + }, + + _removeObj: function (event, Obj) { + var bRet = false; + do + { + var triObjects = this._eventTriggers[event]; + if (!triObjects) break; + for (var i = 0; i < triObjects.length; i++) { + var triObject = triObjects[i]; + if (triObject && triObject == Obj) { + triObject.removeAll(); + triObjects.splice(i, 1); + break; + } + } + bRet = true; + } while (0); + return bRet; + }, + + removeTriggerObj: function (id) { + var obj = this.getTriggerObj(id); + if (!obj) { + return false; + } + var events = obj.getEvents(); + for (var i = 0; i < events.length; i++) { + var event = events[i]; + this.remove(event, obj); + } + return true; + }, + isEmpty: function () { + return !this._eventTriggers || this._eventTriggers.length <= 0; + }, + + addArmatureMovementCallBack: function (armature, callFunc, target) { + if (armature == null || target == null || callFunc == null) { + return; + } + var locAmd, hasADD = false; + for (var i = 0; i < this._movementDispatches.length; i++) { + locAmd = this._movementDispatches[i]; + if (locAmd && locAmd[0] == armature) { + locAmd.addAnimationEventCallBack(callFunc, target); + hasADD = true; + } + } + if (!hasADD) { + var newAmd = new ccs.ArmatureMovementDispatcher(); + armature.getAnimation().setMovementEventCallFunc(newAmd.animationEvent, newAmd); + newAmd.addAnimationEventCallBack(callFunc, target); + this._movementDispatches.push([armature, newAmd]); + } + }, + + removeArmatureMovementCallBack: function (armature, target, callFunc) { + if (armature == null || target == null || callFunc == null) { + return; + } + var locAmd; + for (var i = 0; i < this._movementDispatches.length; i++) { + locAmd = this._movementDispatches[i]; + if (locAmd && locAmd[0] == armature) { + locAmd.removeAnimationEventCallBack(callFunc, target); + } + } + }, + + removeArmatureAllMovementCallBack: function (armature) { + if (armature == null) { + return; + } + var locAmd; + for (var i = 0; i < this._movementDispatches.length; i++) { + locAmd = this._movementDispatches[i]; + if (locAmd && locAmd[0] == armature) { + this._movementDispatches.splice(i, 1); + break; + } + } + }, + + removeAllArmatureMovementCallBack: function () { + this._movementDispatches = []; + } +}); + +ccs.TriggerMng.triggerMngVersion = function () { + return "1.2.0.0"; +}; +ccs.TriggerMng._instance = null; +ccs.TriggerMng.getInstance = function () { + if (null == this._instance) { + this._instance = new ccs.TriggerMng(); + } + return this._instance; +}; + + + + + diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp index 67de017b49..b8b03c4e12 100755 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp @@ -656,11 +656,11 @@ void TriggerState::done() { if (_nState == 0) { - obj->setEnable(false); + obj->setEnabled(false); } else if (_nState == 1) { - obj->setEnable(true); + obj->setEnabled(true); } else if (_nState == 2) { From 165e6c2a78fd416d81ec4e98454e9892a1d66dde Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 30 Dec 2013 21:04:00 +0800 Subject: [PATCH 050/428] Adds an empty LuaEngine::parseConfig function. --- cocos/scripting/lua/bindings/CCLuaEngine.cpp | 6 ++++++ cocos/scripting/lua/bindings/CCLuaEngine.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cocos/scripting/lua/bindings/CCLuaEngine.cpp b/cocos/scripting/lua/bindings/CCLuaEngine.cpp index a8141d143b..4005c83462 100644 --- a/cocos/scripting/lua/bindings/CCLuaEngine.cpp +++ b/cocos/scripting/lua/bindings/CCLuaEngine.cpp @@ -186,6 +186,12 @@ int LuaEngine::reallocateScriptHandler(int nHandler) return nRet; } +bool LuaEngine::parseConfig(ConfigType type, const std::string& str) +{ + // FIXME: TO IMPLEMENT + return false; +} + int LuaEngine::sendEvent(ScriptEvent* evt) { if (NULL == evt) diff --git a/cocos/scripting/lua/bindings/CCLuaEngine.h b/cocos/scripting/lua/bindings/CCLuaEngine.h index 10ac6a0dff..fe076b9418 100644 --- a/cocos/scripting/lua/bindings/CCLuaEngine.h +++ b/cocos/scripting/lua/bindings/CCLuaEngine.h @@ -116,7 +116,8 @@ public: virtual bool handleAssert(const char *msg); - virtual int sendEvent(ScriptEvent* message); + virtual bool parseConfig(ConfigType type, const std::string& str) override; + virtual int sendEvent(ScriptEvent* message) override; virtual int handleEvent(ScriptHandlerMgr::HandlerType type,void* data); virtual int handleEvent(ScriptHandlerMgr::HandlerType type, void* data, int numResults, const std::function& func); private: From 0cf0ad26d24ea6246156df619da6c167815d28e9 Mon Sep 17 00:00:00 2001 From: jiusheng Date: Mon, 30 Dec 2013 21:11:32 +0800 Subject: [PATCH 051/428] add github pull request builder for Jenkins --- build/jenkins/ghprb.py | 103 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100755 build/jenkins/ghprb.py diff --git a/build/jenkins/ghprb.py b/build/jenkins/ghprb.py new file mode 100755 index 0000000000..ba6f03a39f --- /dev/null +++ b/build/jenkins/ghprb.py @@ -0,0 +1,103 @@ +#Github pull reqest builder for Jenkins + +import json +import os +import re +import urllib2 +import urllib +import base64 +import requests + +#get payload from os env +payload_str = os.environ['payload'] +#parse to json obj +payload = json.loads(payload_str) + +#get pull number +pr_num = payload['number'] +print 'pr_num:' + str(pr_num) + +#build for pull request action 'open' and 'synchronize', skip 'close' +action = payload['action'] +print 'action: ' + action +if((action != 'open') and (action != 'synchronize')): + print 'pull request #' + str(pr_num) + 'is closed, no build triggered' + exit(0) + + +pr = payload['pull_request'] +url = pr['html_url'] +print "url:" + url +pr_desc = ' pr#' + str(pr_num) + '' +#set Jenkins build description using submitDescription to mock browser behavior +#TODO: need to set parent build description +def set_description(desc): + req_data = urllib.urlencode({'description': desc}) + req = urllib2.Request(os.environ['BUILD_URL'] + 'submitDescription', req_data) + print(os.environ['BUILD_URL']) + req.add_header('Content-Type', 'application/x-www-form-urlencoded') + base64string = base64.encodestring(os.environ['JENKINS_ADMIN']+ ":" + os.environ['JENKINS_ADMIN_PW']).replace('\n', '') + req.add_header("Authorization", "Basic " + base64string) + urllib2.urlopen(req) + +set_description(pr_desc) + +#get statuses url +statuses_url = pr['statuses_url'] + +#get pr target branch +branch = pr['head']['ref'] + +#set commit status to pending +target_url = os.environ['BUILD_URL'] +data = {"state":"pending", "target_url":target_url} +acccess_token = os.environ['GITHUB_ACCESS_TOKEN'] +Headers = {"Authorization":"token " + acccess_token} +requests.post(statuses_url, data=json.dumps(data), headers=Headers) + +#reset path to workspace root +os.system("cd " + os.environ['WORKSPACE']); + +#fell pull request to local repo +git_fetch_pr = "git fetch origin pull/" + str(pr_num) + "/head" +os.system(git_fetch_pr) + +#checkout +git_checkout = "git checkout -b " + "pull" + str(pr_num) + " FETCH_HEAD" +os.system(git_checkout) + +#update submodule +git_update_submodule = "git submodule update --init --force" +os.system(git_update_submodule) + +#build +#TODO: support android-mac build currently +#TODO: add android-windows7 build +#TODO: add android-linux build +#TODO: add ios build +#TODO: add mac build +#TODO: add win32 build +if(branch == 'develop'): + ret = os.system("python build/android-build.py -n -j5 testcpp") +elif(branch == 'master'): + ret = os.system("samples/Cpp/TestCpp/proj.android/build_native.sh") + +#get build result +print "build finished and return " + str(ret) +if ret == 0: + exit_code = 0 + data['state'] = "success" + +else: + exit_code = 1 + data['state'] = "failure" + +#set commit status +requests.post(statuses_url, data=json.dumps(data), headers=Headers) + +#clean workspace +os.system("cd " + os.environ['WORKSPACE']); +os.system("git checkout develop") +os.system("git branch -D pull" + str(pr_num)) +exit(exit_code) + From a14006bb8f6c1fc77c1135b6cab03c16dd8136e5 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 30 Dec 2013 21:24:16 +0800 Subject: [PATCH 052/428] calculation matrix --- cocos/2d/CCRenderTexture.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 93a7778084..3acfe3bb74 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -639,6 +639,21 @@ void RenderTexture::begin() kmGLMatrixMode(KM_GL_MODELVIEW); kmGLPushMatrix(); kmGLGetMatrix(KM_GL_MODELVIEW, &_transformMatrix); + + Director *director = Director::getInstance(); + director->setProjection(director->getProjection()); + + const Size& texSize = _texture->getContentSizeInPixels(); + + // Calculate the adjustment ratios based on the old and new projections + Size size = director->getWinSizeInPixels(); + float widthRatio = size.width / texSize.width; + float heightRatio = size.height / texSize.height; + + kmMat4 orthoMatrix; + kmMat4OrthographicProjection(&orthoMatrix, (float)-1.0 / widthRatio, (float)1.0 / widthRatio, + (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1,1 ); + kmGLMultMatrix(&orthoMatrix); _groupCommand.init(0, _vertexZ); From 7696a5f2ccfea6b8a74b5cf5a9afd3c2886f73d9 Mon Sep 17 00:00:00 2001 From: heliclei Date: Mon, 30 Dec 2013 21:40:28 +0800 Subject: [PATCH 054/428] move ghprb.py to tools/jenkins-scripts/ --- {build/jenkins => tools/jenkins-scripts}/ghprb.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {build/jenkins => tools/jenkins-scripts}/ghprb.py (100%) diff --git a/build/jenkins/ghprb.py b/tools/jenkins-scripts/ghprb.py similarity index 100% rename from build/jenkins/ghprb.py rename to tools/jenkins-scripts/ghprb.py From 674804f1b45aef96af3c53e5dfe9dca513a94964 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Mon, 30 Dec 2013 13:49:19 +0000 Subject: [PATCH 055/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 32f91b7f62..585cb56a4d 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 32f91b7f62106ddef2bccb0471e83982dddef761 +Subproject commit 585cb56a4dd030ad396867b712659c185d6d1f9e From 62a0828f5b8afcd43b6a54296b8f34bde8c40c72 Mon Sep 17 00:00:00 2001 From: heliclei Date: Mon, 30 Dec 2013 22:03:22 +0800 Subject: [PATCH 056/428] remove other non-functional jenkins scripts --- tools/jenkins-scripts/ReportManager.py | 52 -- tools/jenkins-scripts/ant.properties | 20 - .../android/build-android-2.2-3.2-debug.sh | 138 ---- .../android/build-android-2.2-3.2-release.sh | 142 ---- .../mac/android/build-android-4.x-debug.sh | 96 --- .../mac/android/build-android-4.x-release.sh | 100 --- .../mac/android/generate-js-cxx-bindings.sh | 190 ----- .../mac/android/test-android-2.2-3.2-debug.sh | 87 --- .../android/test-android-2.2-3.2-release.sh | 86 --- .../mac/android/test-android-4.x-debug.sh | 56 -- .../mac/android/test-android-4.x-release.sh | 56 -- tools/jenkins-scripts/mac/debug.keystore | Bin 1268 -> 0 bytes .../iOS_SikuliTest.sikuli/iOS_SikuliTest.html | 573 -------------- .../iOS_SikuliTest.sikuli/iOS_SikuliTest.py | 498 ------------ .../jenkins-scripts/mac/ios/build-ios-all.sh | 47 -- .../mac/ios/build-ios-debug.sh | 81 -- .../mac/ios/build-ios-release.sh | 72 -- tools/jenkins-scripts/mac/ios/iphonesim | Bin 57124 -> 0 bytes .../jenkins-scripts/mac/ios/test-ios-debug.sh | 25 - .../mac/ios/test-ios-release.sh | 25 - .../jenkins-scripts/mac/mac/build-mac-all.sh | 15 - .../mac/mac/build-mac-debug.sh | 64 -- .../mac/mac/build-mac-release.sh | 64 -- .../jenkins-scripts/mac/mac/test-mac-debug.sh | 25 - .../mac/mac/test-mac-release.sh | 25 - tools/jenkins-scripts/mac/rootconfig-mac.sh | 31 - .../windows/android/androidtestcommon.bat | 89 --- .../android/build-android-2.2-3.2-debug.bat | 156 ---- .../android/build-android-2.2-3.2-release.bat | 179 ----- .../android/build-android-4.x-debug.bat | 112 --- .../android/build-android-4.x-release.bat | 127 ---- .../windows/android/rootconfig.sh | 45 -- .../android/test-android-2.2-3.2-debug.bat | 73 -- .../android/test-android-2.2-3.2-release.bat | 73 -- .../android/test-android-4.x-debug.bat | 52 -- .../android/test-android-4.x-release.bat | 52 -- .../ObjectRepository.bdb.REMOVED.git-id | 1 - .../win32/qtp_win32/Action0/Resource.mtr | Bin 6656 -> 0 bytes .../win32/qtp_win32/Action0/Script.mts | 1 - .../ObjectRepository.bdb.REMOVED.git-id | 1 - .../win32/qtp_win32/Action1/Resource.mtr | Bin 6656 -> 0 bytes .../win32/qtp_win32/Action1/Script.mts | 716 ------------------ .../windows/win32/qtp_win32/Default.xls | Bin 4608 -> 0 bytes .../windows/win32/qtp_win32/Error_Sub.vbs | Bin 2392 -> 0 bytes .../win32/qtp_win32/Error_appcrash.qrs | Bin 4608 -> 0 bytes .../windows/win32/qtp_win32/Parameters.mtr | Bin 5120 -> 0 bytes .../windows/win32/qtp_win32/Test.tsp | Bin 33280 -> 0 bytes .../TestCpp_Appcrash.tsr.REMOVED.git-id | 1 - .../windows/win32/qtp_win32/default.cfg | 89 --- .../windows/win32/qtp_win32/default.usp | 15 - .../windows/win32/qtp_win32/lock.lck | Bin 4096 -> 0 bytes .../windows/win32/qtp_win32/qtp_win32.usr | 54 -- .../windows/win32/qtp_win32/qtrunner.vbs | Bin 16314 -> 0 bytes .../windows/win32/test-win-vs2008-debug.bat | 32 - .../windows/win32/test-win-vs2008_release.bat | 32 - .../windows/win32/test-win-vs2010_debug.bat | 32 - .../windows/win32/test-win-vs2010_release.bat | 32 - 57 files changed, 4532 deletions(-) delete mode 100644 tools/jenkins-scripts/ReportManager.py delete mode 100644 tools/jenkins-scripts/ant.properties delete mode 100755 tools/jenkins-scripts/mac/android/build-android-2.2-3.2-debug.sh delete mode 100755 tools/jenkins-scripts/mac/android/build-android-2.2-3.2-release.sh delete mode 100755 tools/jenkins-scripts/mac/android/build-android-4.x-debug.sh delete mode 100755 tools/jenkins-scripts/mac/android/build-android-4.x-release.sh delete mode 100755 tools/jenkins-scripts/mac/android/generate-js-cxx-bindings.sh delete mode 100755 tools/jenkins-scripts/mac/android/test-android-2.2-3.2-debug.sh delete mode 100755 tools/jenkins-scripts/mac/android/test-android-2.2-3.2-release.sh delete mode 100755 tools/jenkins-scripts/mac/android/test-android-4.x-debug.sh delete mode 100755 tools/jenkins-scripts/mac/android/test-android-4.x-release.sh delete mode 100644 tools/jenkins-scripts/mac/debug.keystore delete mode 100644 tools/jenkins-scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.html delete mode 100644 tools/jenkins-scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.py delete mode 100755 tools/jenkins-scripts/mac/ios/build-ios-all.sh delete mode 100755 tools/jenkins-scripts/mac/ios/build-ios-debug.sh delete mode 100755 tools/jenkins-scripts/mac/ios/build-ios-release.sh delete mode 100755 tools/jenkins-scripts/mac/ios/iphonesim delete mode 100755 tools/jenkins-scripts/mac/ios/test-ios-debug.sh delete mode 100755 tools/jenkins-scripts/mac/ios/test-ios-release.sh delete mode 100755 tools/jenkins-scripts/mac/mac/build-mac-all.sh delete mode 100755 tools/jenkins-scripts/mac/mac/build-mac-debug.sh delete mode 100755 tools/jenkins-scripts/mac/mac/build-mac-release.sh delete mode 100755 tools/jenkins-scripts/mac/mac/test-mac-debug.sh delete mode 100755 tools/jenkins-scripts/mac/mac/test-mac-release.sh delete mode 100644 tools/jenkins-scripts/mac/rootconfig-mac.sh delete mode 100755 tools/jenkins-scripts/windows/android/androidtestcommon.bat delete mode 100755 tools/jenkins-scripts/windows/android/build-android-2.2-3.2-debug.bat delete mode 100755 tools/jenkins-scripts/windows/android/build-android-2.2-3.2-release.bat delete mode 100755 tools/jenkins-scripts/windows/android/build-android-4.x-debug.bat delete mode 100755 tools/jenkins-scripts/windows/android/build-android-4.x-release.bat delete mode 100755 tools/jenkins-scripts/windows/android/rootconfig.sh delete mode 100644 tools/jenkins-scripts/windows/android/test-android-2.2-3.2-debug.bat delete mode 100644 tools/jenkins-scripts/windows/android/test-android-2.2-3.2-release.bat delete mode 100644 tools/jenkins-scripts/windows/android/test-android-4.x-debug.bat delete mode 100644 tools/jenkins-scripts/windows/android/test-android-4.x-release.bat delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/Action0/ObjectRepository.bdb.REMOVED.git-id delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/Action0/Resource.mtr delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/Action0/Script.mts delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/Action1/ObjectRepository.bdb.REMOVED.git-id delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/Action1/Resource.mtr delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/Action1/Script.mts delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/Default.xls delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/Error_Sub.vbs delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/Error_appcrash.qrs delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/Parameters.mtr delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/Test.tsp delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/TestCpp_Appcrash.tsr.REMOVED.git-id delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/default.cfg delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/default.usp delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/lock.lck delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/qtp_win32.usr delete mode 100644 tools/jenkins-scripts/windows/win32/qtp_win32/qtrunner.vbs delete mode 100644 tools/jenkins-scripts/windows/win32/test-win-vs2008-debug.bat delete mode 100644 tools/jenkins-scripts/windows/win32/test-win-vs2008_release.bat delete mode 100644 tools/jenkins-scripts/windows/win32/test-win-vs2010_debug.bat delete mode 100644 tools/jenkins-scripts/windows/win32/test-win-vs2010_release.bat diff --git a/tools/jenkins-scripts/ReportManager.py b/tools/jenkins-scripts/ReportManager.py deleted file mode 100644 index 9e7207263c..0000000000 --- a/tools/jenkins-scripts/ReportManager.py +++ /dev/null @@ -1,52 +0,0 @@ -#------------------------------------------------ -# Monkeyrunner Test Report -# 10/08/2012 -#------------------------------------------------ - -from email.MIMEBase import MIMEBase -from email.MIMEText import MIMEText -from email.MIMEMultipart import MIMEMultipart -from email.utils import COMMASPACE,formatdate -from email import Encoders -from email.header import Header -import smtplib,email,os,sys - -if os.path.exists(os.getcwd()+'\\monkeyrunner_Error.log') or os.path.exists(os.getcwd()+'/monkeyrunner_Error.log'): - print "Sending Monkeyrunner Test Report..." - mail_from = 'redmine@cocos2d-x.org' #where the mail from - mail_to = ['739657621@qq.com','yangguangzaidongji@hotmail.com','yangguangzaidongji@gmail.com'] - to_string ='' - for item in mail_to: - to_string += item +',' - mail_subject = "Monkeyrunner Test Report" - msg = MIMEMultipart() - #msg = MIMEText('body') - mail_attachment = 'monkeyrunner_Error.log' - #msg = "\nhell" - print mail_to - - username = 'redmine@cocos2d-x.org' - password = 'cocos2d-x.org' - msg["From"] = mail_from - msg["To"] = to_string - msg["Subject"] = mail_subject - msg["Date"] = formatdate(localtime=True) - mail_body = "Monkeyrunner Test Finish! See attachment for logs." - msg.attach(MIMEText(mail_body)) - - #Add attachment. - fp = open(mail_attachment,"rb") - part = MIMEBase("application", "octet-stream") - part.set_payload(fp.read()) - fp.close() - Encoders.encode_base64(part) - part.add_header("Content-Disposition", "attachment; filename=%s" % mail_attachment) - msg.attach(part) - - #Send email. - server = smtplib.SMTP('smtp.gmail.com:587') - server.starttls() - server.login(username,password) - server.sendmail(mail_from, mail_to, msg.as_string()) - print 'Eamil success!' - server.quit() diff --git a/tools/jenkins-scripts/ant.properties b/tools/jenkins-scripts/ant.properties deleted file mode 100644 index 30a7872e3d..0000000000 --- a/tools/jenkins-scripts/ant.properties +++ /dev/null @@ -1,20 +0,0 @@ -# This file is used to override default values used by the Ant build system. -# -# This file must be checked in Version Control Systems, as it is -# integral to the build system of your project. -# This file is only used by the Ant script. -# You can use this to override default values such as -# 'source.dir' for the location of your java source folder and -# 'out.dir' for the location of your output folder. -# You can also use it define how the release builds are signed by declaring -# the following properties: -# 'key.store' for the location of your keystore and -# 'key.alias' for the name of the key to use. -# The password will be asked during the build when you use the 'release' target. -key.store=C:/.android/debug.keystore -key.alias=androiddebugkey -key.store.password=android -key.alias.password=android -#proguard.config=proguard.cfg -# Project target. -target=android-8 \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/android/build-android-2.2-3.2-debug.sh b/tools/jenkins-scripts/mac/android/build-android-2.2-3.2-debug.sh deleted file mode 100755 index cc6feacab2..0000000000 --- a/tools/jenkins-scripts/mac/android/build-android-2.2-3.2-debug.sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/bash -#This script is used to finish a android automated compiler. -#You should make sure have finished the environment setting. -#Here are the environment variables you should set. -#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT - -antcompile() -{ - #Make sure the original target is android-8 - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - - #Android ant build(debug ,API level:8) - ant debug - #If build failed,make sure the Jenkins could get the errorlevel. - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-debug.apk TestCpp-debug-8.apk - cd .. - fi - - #Change API level.(API level:10) - sed '/target=/s/=.*$/=android-10/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant debug - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-debug.apk TestCpp-debug-10.apk - cd .. - fi - - #Change API level.(API level:11) - sed '/target=/s/=.*$/=android-11/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant debug - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-debug.apk TestCpp-debug-11.apk - cd .. - fi - - #Change API level.(API level:12) - sed '/target=/s/=.*$/=android-12/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant debug - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-debug.apk TestCpp-debug-12.apk - cd .. - fi - - #Change API level.(API level:13) - sed '/target=/s/=.*$/=android-13/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant debug - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-debug.apk TestCpp-debug-13.apk - cd .. - fi - - #After all test versions completed,changed current API level to the original.(API level:8) - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties -} - -#record the relevant catalog -compileresult=0 -CUR=$(pwd) -cd ../../../.. -ROOT=$(pwd) -IsTestCpp=1 - -#copy configuration files to target. -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Cpp/TestCpp/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Cpp/TestCpp/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Cpp/TestCpp/proj.android -cd $ROOT/samples/Cpp/TestCpp/proj.android -sh rootconfig-mac.sh TestCpp -sh build_native.sh - -#update android project configuration files -cd $ROOT/samples/Cpp/TestCpp -android update project -p proj.android -cd proj.android -antcompile - -IsTestCpp=0 - -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Cpp/HelloCpp/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Cpp/HelloCpp/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Cpp/HelloCpp/proj.android -cd $ROOT/samples/Cpp/HelloCpp/proj.android -sh rootconfig-mac.sh HelloCpp -sh build_native.sh -cd $ROOT/samples/Cpp/HelloCpp -android update project -p proj.android -cd proj.android -antcompile - -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Lua/HelloLua/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Lua/HelloLua/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Lua/HelloLua/proj.android -cd $ROOT/samples/Lua/HelloLua/proj.android -sh rootconfig-mac.sh HelloLua -sh build_native.sh -cd $ROOT/samples/Lua/HelloLua -android update project -p proj.android -cd proj.android -antcompile - -#return the compileresult. -cd $ROOT -if [ $compileresult != 0 ]; then -# git checkout -f -# git clean -df -x - exit 1 -else -# git checkout -f -# git clean -df -x - exit 0 -fi \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/android/build-android-2.2-3.2-release.sh b/tools/jenkins-scripts/mac/android/build-android-2.2-3.2-release.sh deleted file mode 100755 index 61fd96784a..0000000000 --- a/tools/jenkins-scripts/mac/android/build-android-2.2-3.2-release.sh +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/bash -#This script is used to finish a android automated compiler. -#You should make sure have finished the environment setting. -#Here are the environment variables you should set. -#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT - -antcompile() -{ - #Make sure the original target is android-8 - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - - #Android ant build(debug ,API level:8) - ant release - #If build failed,make sure the Jenkins could get the errorlevel. - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-release.apk TestCpp-release-8.apk - cd .. - fi - - #Change API level.(API level:10) - sed '/target=/s/=.*$/=android-10/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-release.apk TestCpp-release-10.apk - cd .. - fi - - #Change API level.(API level:11) - sed '/target=/s/=.*$/=android-11/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-release.apk TestCpp-release-11.apk - cd .. - fi - - #Change API level.(API level:12) - sed '/target=/s/=.*$/=android-12/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-release.apk TestCpp-release-12.apk - cd .. - fi - - #Change API level.(API level:13) - sed '/target=/s/=.*$/=android-13/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-release.apk TestCpp-release-13.apk - cd .. - fi - - #After all test versions completed,changed current API level to the original.(API level:8) - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties -} - -#record the relevant catalog -compileresult=0 -CUR=$(pwd) -cd ../../../.. -ROOT=$(pwd) -IsTestCpp=1 - -#copy configuration files to target. -sed -i '' '14d' $CUR/ant.properties -gsed -i "14 i\\key.store=$ANDROID_HOME/debug.keystore" $CUR/ant.properties -cp $CUR/../debug.keystore $ANDROID_HOME - -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Cpp/TestCpp/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Cpp/TestCpp/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Cpp/TestCpp/proj.android -cd samples/Cpp/TestCpp/proj.android -sh rootconfig-mac.sh TestCpp -sh build_native.sh - -#update android project configuration files -cd .. -android update project -p proj.android -cd proj.android -antcompile - -IsTestCpp=0 - -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Cpp/HelloCpp/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Cpp/HelloCpp/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Cpp/HelloCpp/proj.android -cd ../../Cpp/HelloCpp/proj.android -sh rootconfig-mac.sh HelloCpp -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Lua/HelloLua/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Lua/HelloLua/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Lua/HelloLua/proj.android -cd ../../Lua/HelloLua/proj.android -sh rootconfig-mac.sh HelloLua -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then -# git checkout -f -# git clean -df -x - exit 1 -else -# git checkout -f -# git clean -df -x - exit 0 -fi \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/android/build-android-4.x-debug.sh b/tools/jenkins-scripts/mac/android/build-android-4.x-debug.sh deleted file mode 100755 index 83e9769894..0000000000 --- a/tools/jenkins-scripts/mac/android/build-android-4.x-debug.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -#This script is used to finish a android automated compiler. -#You should make sure have finished the environment setting. -#Here are the environment variables you should set. -#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT - -antcompile() -{ - #Change API level.(API level:14) - sed '/target=/s/=.*$/=android-14/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant debug - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-debug.apk TestCpp-debug-14.apk - cd .. - fi - - #Change API level.(API level:15) - sed '/target=/s/=.*$/=android-15/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant debug - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-debug.apk TestCpp-debug-15.apk - cd .. - fi - - #After all test versions completed,changed current API level to the original.(API level:8) - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties -} - -#record the relevant catalog -compileresult=0 -CUR=$(pwd) -cd ../../../.. -ROOT=$(pwd) -IsTestCpp=1 - -#copy configuration files to target. -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Cpp/TestCpp/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Cpp/TestCpp/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Cpp/TestCpp/proj.android -cd samples/Cpp/TestCpp/proj.android -sh rootconfig-mac.sh TestCpp -sh build_native.sh - -#update android project configuration files -cd .. -android update project -p proj.android -cd proj.android -antcompile - -IsTestCpp=0 - -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Cpp/HelloCpp/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Cpp/HelloCpp/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Cpp/HelloCpp/proj.android -cd ../../Cpp/HelloCpp/proj.android -sh rootconfig-mac.sh HelloCpp -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Lua/HelloLua/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Lua/HelloLua/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Lua/HelloLua/proj.android -cd ../../Lua/HelloLua/proj.android -sh rootconfig-mac.sh HelloLua -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then -# git checkout -f -# git clean -df -x - exit 1 -else -# git checkout -f -# git clean -df -x - exit 0 -fi diff --git a/tools/jenkins-scripts/mac/android/build-android-4.x-release.sh b/tools/jenkins-scripts/mac/android/build-android-4.x-release.sh deleted file mode 100755 index 120ab5ad4a..0000000000 --- a/tools/jenkins-scripts/mac/android/build-android-4.x-release.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -#This script is used to finish a android automated compiler. -#You should make sure have finished the environment setting. -#Here are the environment variables you should set. -#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT - -antcompile() -{ - #Change API level.(API level:14) - sed '/target=/s/=.*$/=android-14/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-release.apk TestCpp-release-14.apk - cd .. - fi - - #Change API level.(API level:15) - sed '/target=/s/=.*$/=android-15/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - if [ $IsTestCpp == 1 ] && [ $? == 0 ] - then - cd bin - mv TestCpp-release.apk TestCpp-release-15.apk - cd .. - fi - - #After all test versions completed,changed current API level to the original.(API level:8) - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties -} - -#record the relevant catalog -compileresult=0 -CUR=$(pwd) -cd ../../../.. -ROOT=$(pwd) -IsTestCpp=1 - -#copy configuration files to target. -sed -i '' '14d' $CUR/ant.properties -gsed -i "14 i\\key.store=$ANDROID_HOME/debug.keystore" $CUR/ant.properties -cp $CUR/../debug.keystore $ANDROID_HOME - -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Cpp/TestCpp/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Cpp/TestCpp/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Cpp/TestCpp/proj.android -cd samples/Cpp/TestCpp/proj.android -sh rootconfig-mac.sh TestCpp -sh build_native.sh - -#update android project configuration files -cd .. -android update project -p proj.android -cd proj.android -antcompile - -IsTestCpp=0 - -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Cpp/HelloCpp/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Cpp/HelloCpp/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Cpp/HelloCpp/proj.android -cd ../../Cpp/HelloCpp/proj.android -sh rootconfig-mac.sh HelloCpp -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Lua/HelloLua/proj.android -cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Lua/HelloLua/proj.android -cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Lua/HelloLua/proj.android -cd ../../Lua/HelloLua/proj.android -sh rootconfig-mac.sh HelloLua -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then -# git checkout -f -# git clean -df -x - exit 1 -else -# git checkout -f -# git clean -df -x - exit 0 -fi \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/android/generate-js-cxx-bindings.sh b/tools/jenkins-scripts/mac/android/generate-js-cxx-bindings.sh deleted file mode 100755 index 887ba2c055..0000000000 --- a/tools/jenkins-scripts/mac/android/generate-js-cxx-bindings.sh +++ /dev/null @@ -1,190 +0,0 @@ -#!/bin/bash - -# Generate JS bindings for Cocos2D-X -# ... using Android NDK system headers -# ... and automatically update submodule references -# ... and push these changes to remote repos - -# Dependencies -# -# For bindings generator: -# (see ../../../tojs/genbindings.sh -# ... for the defaults used if the environment is not customized) -# -# * $PYTHON_BIN -# * $CLANG_ROOT -# * $NDK_ROOT -# -# For automatically pushing changes: -# -# * REMOTE_AUTOGEN_BINDINGS_REPOSITORY -# * REMOTE_COCOS2DX_REPOSITORY -# * Note : Ensure you have commit access to above repositories -# * COCOS2DX_PULL_BASE -# * hub -# * see http://defunkt.io/hub/ -# * Ensure that hub has an OAuth token to REMOTE_COCOS2DX_REPOSITORY -# * see http://defunkt.io/hub/hub.1.html#CONFIGURATION - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -COCOS2DX_ROOT="$DIR"/../../../.. -GENERATED_WORKTREE="$COCOS2DX_ROOT"/scripting/javascript/bindings/generated - -if [ -z "${HUB+aaa}" ]; then -# ... if HUB is not set, use "$HOME/bin/hub" - HUB="$HOME/bin/hub" -fi - -# Update cocos2d-x repo -# It needs to be updated in Jenkins command before executing this script. -#pushd "$COCOS2DX_ROOT" - -#git checkout -f -#git checkout gles20 -#git pull upstream gles20 -#rm -rf "$GENERATED_WORKTREE" -#git submodule update --init - -#popd - -# Update submodule of auto-gen JSBinding repo. -pushd "$GENERATED_WORKTREE" - -git checkout -f -git clean -fdx -git fetch origin -git checkout -B master origin/master - -# Delete all directories and files except '.git' and 'README'. -ls -a | grep -E -v ^\[.\]\{1,2\}$ | grep -E -v ^\.git$ | grep -E -v ^README$ | xargs -I{} rm -rf {} - -popd - -# Exit on error -set -e - -# 1. Generate JS bindings -COCOS2DX_ROOT="$COCOS2DX_ROOT" /bin/bash ../../../tojs/genbindings.sh - -echo -echo Bindings generated successfully -echo - -if [ -z "${REMOTE_AUTOGEN_BINDINGS_REPOSITORY+aaa}" ]; then - echo - echo Environment variable must be set REMOTE_AUTOGEN_BINDINGS_REPOSITORY - echo This script expects to automatically push changes - echo to this repo - echo example - echo REMOTE_AUTOGEN_BINDINGS_REPOSITORY=\"git@github.com:folecr/cocos2dx-autogen-bindings.git\" - echo REMOTE_AUTOGEN_BINDINGS_REPOSITORY=\"\$HOME/test/cocos2dx-autogen-bindings\" - echo - echo Exiting with failure. - echo - exit 1 -fi - -if [ -z "${COMMITTAG+aaa}" ]; then -# ... if COMMITTAG is not set, use this machine's hostname - COMMITTAG=`hostname -s` -fi - -echo -echo Using "'$COMMITTAG'" in the commit messages -echo - -ELAPSEDSECS=`date +%s` -echo Using "$ELAPSEDSECS" in the branch names for pseudo-uniqueness - -GENERATED_BRANCH=autogeneratedbindings_"$ELAPSEDSECS" - - -# 2. In JSBindings repo, Check if there are any files that are different from the index - -pushd "$GENERATED_WORKTREE" - -# Run status to record the output in the log -git status - -echo -echo Comparing with origin/master ... -echo - -# Don't exit on non-zero return value -set +e - -git diff --stat --exit-code origin/master - -DIFF_RETVAL=$? -if [ $DIFF_RETVAL -eq 0 ] -then - echo - echo "No differences in generated files" - echo "Exiting with success." - echo - exit 0 -else - echo - echo "Generated files differ from origin/master. Continuing." - echo -fi - -# Exit on error -set -e - -# 3. In JSBindings repo, Check out a branch named "autogeneratedbindings" and commit the auto generated bindings to it -git checkout -b "$GENERATED_BRANCH" -git add --verbose . -git add --verbose -u . -git commit --verbose -m "$COMMITTAG : autogenerated bindings" - -# 4. In JSBindings repo, Push the commit with generated bindings to "master" of the auto generated bindings repository -git push --verbose "$REMOTE_AUTOGEN_BINDINGS_REPOSITORY" "$GENERATED_BRANCH":master - -popd - -if [ -z "${REMOTE_COCOS2DX_REPOSITORY+aaa}" ]; then - echo - echo Environment variable is not set REMOTE_COCOS2DX_REPOSITORY - echo This script will NOT automatically push changes - echo unless this variable is set. - echo example - echo REMOTE_COCOS2DX_REPOSITORY=\"git@github.com:cocos2d/cocos2d-x.git\" - echo REMOTE_COCOS2DX_REPOSITORY=\"\$HOME/test/cocos2d-x\" - echo - echo Exiting with success. - echo - exit 0 -fi - -COCOS_BRANCH=updategeneratedsubmodule_"$ELAPSEDSECS" - -pushd "${DIR}" - -# 5. In Cocos2D-X repo, Checkout a branch named "updategeneratedsubmodule" Update the submodule reference to point to the commit with generated bindings -cd "${COCOS2DX_ROOT}" -git add scripting/javascript/bindings/generated -git checkout -b "$COCOS_BRANCH" -git commit -m "$COMMITTAG : updating submodule reference to latest autogenerated bindings" - -# 6. In Cocos2D-X repo, Push the commit with updated submodule to "gles20" of the cocos2d-x repository -git push "$REMOTE_COCOS2DX_REPOSITORY" "$COCOS_BRANCH" - -if [ -z "${COCOS2DX_PULL_BASE+aaa}" ]; then - echo - echo Environment variable is not set COCOS2DX_PULL_BASE - echo This script will NOT automatically generate pull requests - echo unless this variable is set. - echo example - echo COCOS2DX_PULL_BASE=\"cocos2d/cocos2d-x:master\" - echo COCOS2DX_PULL_BASE=\"username/repository:branch\" - echo - echo Exiting with success. - echo - exit 0 -fi - -# 7. -${HUB} pull-request "$COMMITTAG : updating submodule reference to latest autogenerated bindings" -b "$COCOS2DX_PULL_BASE" -h "$COCOS_BRANCH" - -popd diff --git a/tools/jenkins-scripts/mac/android/test-android-2.2-3.2-debug.sh b/tools/jenkins-scripts/mac/android/test-android-2.2-3.2-debug.sh deleted file mode 100755 index 6608fd9240..0000000000 --- a/tools/jenkins-scripts/mac/android/test-android-2.2-3.2-debug.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash -#This script is used to finished a android automated compiler in Mac OS. -#You'd better add "export PATH=$PATH:$ANDROID_HOME/platform-tools" and "export -#PATH=$PATH:$ANDROID_HOME/tools" to you bash_profile,it will be very convenient. - -#Copy monkeyrunner python script to tools directory. -cd ../.. -CUR=$(pwd) -cp $CUR/Monkeyrunner_TestCpp.py $ANDROID_HOME/tools -cp $CUR/ReportManager.py $ANDROID_HOME/tools - -cd ../.. -PROJECT_HOME=$(pwd) -#cp -r samples/TestCpp/proj.android/obj $ANDROID_HOME/tools -cd samples/Cpp/TestCpp/proj.android/bin - -#Copy test apk to tools directory. -CUR=$(pwd) -cp $CUR/TestCpp-debug-8.apk $ANDROID_HOME/tools -cp $CUR/TestCpp-debug-10.apk $ANDROID_HOME/tools -cp $CUR/TestCpp-debug-11.apk $ANDROID_HOME/tools -cp $CUR/TestCpp-debug-12.apk $ANDROID_HOME/tools -cp $CUR/TestCpp-debug-13.apk $ANDROID_HOME/tools - -#Enter tools directory. -cd $ANDROID_HOME/tools - -#If monkeyrunner test failed,it automatically exit and make ERRORLEVEL nonzero. - -#Running monkeyrunner test(debug,API level:8) -mv TestCpp-debug-8.apk TestCpp-debug.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-debug.apk - -#Running monkeyrunner test(debug,API level:10) -mv TestCpp-debug-10.apk TestCpp-debug.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-debug.apk - -#Running monkeyrunner test(debug,API level:11) -mv TestCpp-debug-11.apk TestCpp-debug.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-debug.apk - -#Running monkeyrunner test(debug,API level:12) -mv TestCpp-debug-12.apk TestCpp-debug.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-debug.apk - -#Running monkeyrunner test(debug,API level:13) -mv TestCpp-debug-13.apk TestCpp-debug.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-debug.apk - -rm Monkeyrunner_TestCpp.py -rm ReportManager.py - -#Monkeyrunner success! -echo Monkeyrunner Test Success! - -#Clean project files. -cd $PROJECT_HOME - -git checkout -f -git clean -df -x - -#End \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/android/test-android-2.2-3.2-release.sh b/tools/jenkins-scripts/mac/android/test-android-2.2-3.2-release.sh deleted file mode 100755 index 8fe4976d30..0000000000 --- a/tools/jenkins-scripts/mac/android/test-android-2.2-3.2-release.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -#This script is used to finished a android automated compiler in Mac OS. -#You'd better add "export PATH=$PATH:$ANDROID_HOME/platform-tools" and "export -#PATH=$PATH:$ANDROID_HOME/tools" to you bash_profile,it will be very convenient. - -#Copy monkeyrunner python script to tools directory. -cd ../.. -CUR=$(pwd) -cp $CUR/Monkeyrunner_TestCpp.py $ANDROID_HOME/tools -cp $CUR/ReportManager.py $ANDROID_HOME/tools - -cd ../.. -PROJECT_HOME=$(pwd) -cd samples/Cpp/TestCpp/proj.android/bin - -#Copy test apk to tools directory. -CUR=$(pwd) -cp $CUR/TestCpp-release-8.apk $ANDROID_HOME/tools -cp $CUR/TestCpp-release-10.apk $ANDROID_HOME/tools -cp $CUR/TestCpp-release-11.apk $ANDROID_HOME/tools -cp $CUR/TestCpp-release-12.apk $ANDROID_HOME/tools -cp $CUR/TestCpp-release-13.apk $ANDROID_HOME/tools - -#Enter tools directory. -cd $ANDROID_HOME/tools - -#If monkeyrunner test failed,it automatically exit and make ERRORLEVEL nonzero. - -#Running monkeyrunner test(release,API level:8) -mv TestCpp-release-8.apk TestCpp-release.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-release.apk - -#Running monkeyrunner test(release,API level:10) -mv TestCpp-release-10.apk TestCpp-release.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-release.apk - -#Running monkeyrunner test(release,API level:11) -mv TestCpp-release-11.apk TestCpp-release.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-release.apk - -#Running monkeyrunner test(release,API level:12) -mv TestCpp-release-12.apk TestCpp-release.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-release.apk - -#Running monkeyrunner test(release,API level:13) -mv TestCpp-release-13.apk TestCpp-release.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-release.apk - -rm Monkeyrunner_TestCpp.py -rm ReportManager.py - -#Monkeyrunner success! -echo Monkeyrunner Test Success! - -#Clean project files. -cd $PROJECT_HOME - -git checkout -f -git clean -df -x - -#End \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/android/test-android-4.x-debug.sh b/tools/jenkins-scripts/mac/android/test-android-4.x-debug.sh deleted file mode 100755 index 5d31e9f621..0000000000 --- a/tools/jenkins-scripts/mac/android/test-android-4.x-debug.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -#This script is used to finished a android automated compiler in Mac OS. -#You'd better add "export PATH=$PATH:$ANDROID_HOME/platform-tools" and "export -#PATH=$PATH:$ANDROID_HOME/tools" to you bash_profile,it will be very convenient. - -#Copy monkeyrunner python script to tools directory. -cd ../.. -CUR=$(pwd) -cp $CUR/Monkeyrunner_TestCpp.py $ANDROID_HOME/tools -cp $CUR/ReportManager.py $ANDROID_HOME/tools - -cd ../.. -PROJECT_HOME=$(pwd) -cd samples/Cpp/TestCpp/proj.android/bin - -#Copy test apk to tools directory. -CUR=$(pwd) -cp $CUR/TestCpp-debug-14.apk $ANDROID_HOME/tools -cp $CUR/TestCpp-debug-15.apk $ANDROID_HOME/tools - -#Enter tools directory. -cd $ANDROID_HOME/tools - -#If monkeyrunner test failed,it automatically exit and make ERRORLEVEL nonzero. - -#Running monkeyrunner test(debug,API level:14) -mv TestCpp-debug-14.apk TestCpp-debug.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-debug.apk - -#Running monkeyrunner test(debug,API level:15) -mv TestCpp-debug-15.apk TestCpp-debug.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-debug.apk - -rm Monkeyrunner_TestCpp.py -rm ReportManager.py - -#Monkeyrunner success! -echo Monkeyrunner Test Success! - -#Clean project files. -cd $PROJECT_HOME - -git checkout -f -git clean -df -x - -#End \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/android/test-android-4.x-release.sh b/tools/jenkins-scripts/mac/android/test-android-4.x-release.sh deleted file mode 100755 index 8432addde4..0000000000 --- a/tools/jenkins-scripts/mac/android/test-android-4.x-release.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -#This script is used to finished a android automated compiler in Mac OS. -#You'd better add "export PATH=$PATH:$ANDROID_HOME/platform-tools" and "export -#PATH=$PATH:$ANDROID_HOME/tools" to you bash_profile,it will be very convenient. - -#Copy monkeyrunner python script to tools directory. -cd ../.. -CUR=$(pwd) -cp $CUR/Monkeyrunner_TestCpp.py $ANDROID_HOME/tools -cp $CUR/ReportManager.py $ANDROID_HOME/tools - -cd ../.. -PROJECT_HOME=$(pwd) -cd samples/Cpp/TestCpp/proj.android/bin - -#Copy test apk to tools directory. -CUR=$(pwd) -cp $CUR/TestCpp-release-14.apk $ANDROID_HOME/tools -cp $CUR/TestCpp-release-15.apk $ANDROID_HOME/tools - -#Enter tools directory. -cd $ANDROID_HOME/tools - -#If monkeyrunner test failed,it automatically exit and make ERRORLEVEL nonzero. - -#Running monkeyrunner test(release,API level:14) -mv TestCpp-release-14.apk TestCpp-release.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-release.apk - -#Running monkeyrunner test(release,API level:15) -mv TestCpp-release-15.apk TestCpp-release.apk -monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if [ $? != 0 ]; then - python ReportManager.py - exit 1 -fi -rm TestCpp-release.apk - -rm Monkeyrunner_TestCpp.py -rm ReportManager.py - -#Monkeyrunner success! -echo Monkeyrunner Test Success! - -#Clean project files. -cd $PROJECT_HOME - -git checkout -f -git clean -df -x - -#End \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/debug.keystore b/tools/jenkins-scripts/mac/debug.keystore deleted file mode 100644 index cfc159027afc50d89440029b94c79fa1735e08f2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1268 zcmezO_TO6u1_mY|W&~sY#JrTE{LGY;)TGk%?9@u2xW%TuLT`X-b{jM?Z8zX!GBpVCd8d{S|1p z@JQlYzFOloOeH@flsYtSdVMZfEV_4YD+|Bns-kTY?;E1mIjb=yZdoE6& zUIc%dnS4NLebepF8?J;{De>R6(@mbmq37r9-l;nKzA)itX!q~@doGBP4~-c-uzj=`fT|`p(wTol3J08KF`yu1EfNvm#a&$w5M9z z)#w~&NC~_Zm{hHuRJ}-}r}Ef6l{Hs{v+C#Se)Ruz)z5kFznfd*E4Sq(@vh#q%-?vU zfa%BJd#69kn7oqQ;%c1Mk^V?msYTHL#x=7qrF+t@a>#uCFCQLoMWrjL)G0qN$U1IA zPt-Fu<%ooWIZveb+%~+>7i5|^2AN^Lw>mbsg03cw9~SA?f%ITW{xU+dZ{;A zgSuY{tgQONQo;E^UH6~AO z<}RPTHO(!1?vwR?XT=l03kS+^DCm9mOc(0!I2a^2Z@q_p%PBMdoyPmyROL&T7)OS* z9(D^l`7ZVIc{{V|5Bw@(O=9Nh70V<{Yvq-C|7o?t&yv-Kwgs$$my}{pU)p|D?6#Fz zJ|VL2)G_(Er1aEkUj`}h;uUOc(Kn)RgVQ!^ zgr2E^B``(5G-zUc3dDX3n3))vm{=1>+k zVW!YvLjhpI2XeTC*&QJn#8AvY1SG;N%nKD!Z~^5R137VCLn8xoBV!=8Fg1)4=QROx z4b7lj@(pgBkL*TZ-eYd;WiV*$WNK_=*taWl{@tRxm#;06*sv(9ZlP+k>YEdePrnst z^C)+xg`B)(d(`5qnAV2#yN>NY>TpzazxDML&YGq-ya7=mO`P_*&Hmvl*36MS*|Z~b zK|CRB8V(vq$*mm3Mz2$itwb&{2kxz~G z{&inoGchwVFd{n-7=+9~cg=g+w!v$b@t*A~c6M=G+A_zpujlVv>CdH$X8f-?Hfy=g zGT$p}_*Nu7GRThZw4PVMAw6YXqs;6QU7LAo+oFG*|CT+q!*!?r$Lz3~=Y&Hm*D+oA zns2%5S7=&l;7&C|mD|@=wi&$LTzoBOCCh - - - - -
-

iOS_SikuliTest.sikuli

(Download this script) -
-
-setAutoWaitTimeout(10000)
-
-val = getFindFailedResponse()
-if val == ABORT:
-    print "Abort"
-if val == SKIP:
-    print "SKIP"
-if val == PROMPT:
-    print "PROMPT"
-if val == RETRY:
-    print "RETRY"
-
-def common_test(a,b,c):
-    for i in range(a,b):
-        wait(c)
-        if exists():
-            click()
-
-#ActionTest
-click()
-print("Run ActionsTest")
-common_test(1,28,1.0)
-click(Pattern().targetOffset(-93,0))
-common_test(1,3,3.0)
-common_test(1,6,1.0)
-print("ActionsTest finished!")
-click()
-
-#TransitionsTest
-click()
-print("Run TransitionsTest")
-common_test(1,27,1.0)
-print("TransitionsTest finished!")
-click(Pattern().targetOffset(49,0))
-
-#ActionsProgressTest
-click()
-print("Run ActionsProgressTest")
-common_test(1,8,1.0)
-print("ActionsProgressTest finished!")
-click()
-
-
-#EffectsTest
-click()
-print("Run EffectsTest")
-common_test(1,22,3.0)
-print("Effects finished!")
-click()
-
-#ClickAndMoveTest
-print("Run ClickAndMoveTest")
-click()
-wait(4)
-click()
-click(Pattern().targetOffset(200,-3))
-click()
-
-print("ClickAndMoveTest finished!")
-
-#RotateWorldTest
-print("Run RotateWorldTest")
-click()
-wait(4)
-click()
-print("RotateWorldTest finished!")
-
-#ParticleTest
-print("Run ParticleTest")
-click()
-common_test(1,43,2.0)
-print("ParticleTest finished!")
-click()
-
-dragDrop(Pattern().targetOffset(91,17), Pattern().targetOffset(93,-19))
-
-#ActionEaseTest
-print("Run ActionEaseTest")
-click()
-common_test(1,14,2.0)
-click()
-print("ActionEaseTest finished!")
-
-#MotionStreakTest
-print("Run MotionStreakTest")
-click()
-wait(1.0)
-click(Pattern().targetOffset(20,0))
-wait(1.0)
-click()
-dragDrop(, )
-click(Pattern().targetOffset(20,0))
-dragDrop(, )
-click()
-click(Pattern().targetOffset(20,0))
-wait(1.0)
-click()
-print("MotionStreakTest finished!")
-
-#DrawPimitivesTest
-print("Run DrawPimitivesTest")
-click()
-if exists():
-    print("DrawPrimitivesTest success!")
-print("DrawPimitivesTest finished!")
-click()
-
-#NodeTest
-print("Run NodeTest")
-click()
-common_test(1,14,1.0)
-click()
-print("NodeTest finished!")
-
-#TouchesTest
-print("Run TouchesTest")
-click()
-wait(1.0)
-click()
-print("TouchesTest finished!")
-
-#MenuTest
-print("Run MenuTest")
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-print("MenuTest finished!")
-
-#ActionManagerTest
-print("Run ActionManagerTest")
-click()
-common_test(1,5,3.0)
-click()
-print("ActionManagerTest finished!")
-
-#LayerTest
-print("Run LayerTest")
-click()
-dragDrop(, )
-click()
-wait(1.0)
-click()
-wait(1.0)
-click()
-dragDrop(, )
-common_test(1,3,1.0)
-click()
-print("LayerTest finished!")
-
-dragDrop(Pattern().targetOffset(98,6), Pattern().targetOffset(106,-11))
-
-#SceneTest
-print("Run SceneTest")
-click()
-click()
-click()
-click()
-click()
-click()
-print("SceneTest finished!")
-
-#ParallaxTest
-print("Run ParallaxTest")
-click()
-wait(3.0)
-click()
-dragDrop(, )
-click()
-print("ParallaxTest finished!")
-
-#TileMapTest
-print("Run TileMapTest")
-click()
-common_test(1,21,2.0)
-click()
-print("TileMapTest finished!")
-
-#IntervalTest
-print("Run IntervalTest")
-click()
-wait(2.0)
-click()
-wait(1.0)
-click()
-click()
-print("IntervalTest finished!")
-
-#ChipmunkAccelTouchTest
-print("Run ChipmunkAccelTouchTest")
-click()
-for i in range(1,3):
-    click()
-for i in range(1,3):
-    click()
-wait(3.0)
-click()
-print("ChipmunkAccelTouchTest finished!")
-
-#LabelTest
-print("Run LabelTest")
-click()
-wait(1.0)
-common_test(1,26,0.5)
-click()
-print("LabelTest finished!")
-
-#TextInputTest
-print("Run TextInputTest")
-click()
-type(, "1q~<?;\@")
-click()
-click()
-type(, "1q~<?;\@")
-click()
-click()
-print("TextInputTest finished!")
-
-dragDrop(Pattern().targetOffset(100,14), Pattern().targetOffset(75,-8))
-
-#SpriteTest
-print("Run SpriteTest")
-click()
-for i in range(1,3):
-    click()
-for j in range(1,3):
-    click()
-click()
-for i in range(1,3):
-    click()
-for j in range(1,3):
-    click()
-common_test(1,100,0.5)
-click()
-print("SpriteTest finished!")
-
-#SchdulerTest
-print("Run SchdulerTest")
-click()
-wait(1.0)
-click()
-dragDrop(Pattern().targetOffset(23,0),Pattern().targetOffset(-50,0))
-click()
-dragDrop(,Pattern().targetOffset(58,0))
-common_test(1,11,1)
-click()
-print("SchdulerTest finished!")
-
-#RenderTextureTest
-print("Run RenderTextureTest")
-click()
-dragDrop(, )
-dragDrop(, )
-click()
-click()
-click()
-wait(1.0)
-click()
-click()
-click()
-click()
-click()
-wait(1.0)
-click()
-print("RenderTextureTest finished!")
-
-#Texture2DTest
-print("Run Texture2DTest")
-click()
-common_test(1,36,0.5)
-click()
-print("Texture2DTest finished!")
-
-#Box2dTest
-print("Run Box2dTest")
-click()
-for i in range(1,6):
-    click()
-for i in range(1,6):
-    click()
-click()
-print("Box2dTest finished!")
-
-#Box2dTestBed
-print("Run Box2dTestBed")
-click()
-common_test(1,36,2.0)
-click()
-print("Box2dTestBed finished!")
-
-#EffectAdvancedTest
-print("Run EffectAdvancedTest")
-click()
-common_test(1,6,1.0)
-click()
-print("EffectAdvancedTest finished!")
-
-#Accelerometer
-print("Run Accelerometer")
-click()
-click()
-print("Accelerometer finished!")
-
-dragDrop(Pattern().targetOffset(120,2), Pattern().targetOffset(130,-9))
-
-#KeypadTest
-print("Run KeypadTest")
-click()
-click()
-print("KeypadTest finished!")
-
-#CocosDenshionTest
-print("Run CocosDenshionTest")
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-dragDrop(Pattern().targetOffset(-130,15), Pattern().targetOffset(-140,-15))
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-dragDrop(Pattern().targetOffset(-120,6), Pattern().targetOffset(-130,-9))
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-print("CocosDenshionTest finished!")
-
-#PerformanceTest
-print("Run PerformanceTest")
-click()
-click()
-click()
-common_test(1,6,0.5)
-click()
-click()
-click()
-common_test(1,5,0.5)
-click()
-click()
-common_test(1,5,0.5)
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-print("PerformanceTest finished!")
-
-#ZwoptexTest
-print("Run ZwoptexTest")
-click()
-click()
-print("ZwoptexTest finished!")
-
-#CurlTest
-print("Run CurlTest")
-click()
-click()
-click()
-print("CurlTest finished!")
-
-#UserDefaultTest
-print("Run UserDefaultTest")
-click()
-click()
-print("UserDefaultTest finished!")
-
-#BugsTest
-print("Run BugsTest")
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-dragDrop(Pattern().targetOffset(-103,16), Pattern().targetOffset(-100,-19))
-click()
-click()
-click()
-wait(0.5)
-click()
-click()
-print("BugsTest finished!")
-
-dragDrop(Pattern().targetOffset(-110,17), Pattern().targetOffset(-120,-9))
-
-#FontTest
-print("Run FontTest")
-click()
-common_test(1,6,0.5)
-click()
-print("FontTest finished!")
-
-#CurrentLauguageTest
-print("Run CurrentLauguageTest")
-click()
-click()
-print("CurrentLauguageTest finished!")
-
-#TextureCacheTest
-print("Run TextureCacheTest")
-click()
-click()
-print("TextureCacheTest finished!")
-
-#ExtensionsTest
-print("Run ExtensionsTest")
-click()
-click()
-click()
-click()
-click()
-wait(0.5)
-dragDrop(Pattern().targetOffset(-120,0),Pattern().targetOffset(120,0))
-click()
-click()
-click()
-click(Pattern().targetOffset(-19,0))
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-click()
-print("ExtensionsTest finished!")
-
-#ShaderTest
-print("Run ShaderTest")
-click()
-common_test(1,7,0.5)
-wait(0.5)
-dragDrop(Pattern().targetOffset(-44,0),Pattern().targetOffset(80,0))
-click()
-click()
-print("ShaderTest finished!")
-
-#MutiTouchTest
-print("Run MutiTouchTest")
-click()
-for i in range(1,3):
-    dragDrop(, )
-    dragDrop(, Pattern().targetOffset(-50,0))
-click()
-print("MutiTouchTest finished!")
-
-#Quit
-print("Quit")
-click()
-
- - diff --git a/tools/jenkins-scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.py b/tools/jenkins-scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.py deleted file mode 100644 index 899939d6b3..0000000000 --- a/tools/jenkins-scripts/mac/iOS_SikuliTest.sikuli/iOS_SikuliTest.py +++ /dev/null @@ -1,498 +0,0 @@ -setAutoWaitTimeout(10000) - -val = getFindFailedResponse() -if val == ABORT: - print "Abort" -if val == SKIP: - print "SKIP" -if val == PROMPT: - print "PROMPT" -if val == RETRY: - print "RETRY" - -def common_test(a,b,c): - for i in range(a,b): - wait(c) - if exists("Next.png"): - click("Next.png") - -#ActionTest -click("ActionsTest.png") -print("Run ActionsTest") -common_test(1,28,1.0) -click(Pattern("MainMenu_Common.png").targetOffset(-93,0)) -common_test(1,3,3.0) -common_test(1,6,1.0) -print("ActionsTest finished!") -click("MainMenu_Common.png") - -#TransitionsTest -click("TransitionsTest.png") -print("Run TransitionsTest") -common_test(1,27,1.0) -print("TransitionsTest finished!") -click(Pattern("1346297215212.png").targetOffset(49,0)) - -#ActionsProgressTest -click("ActionsProgressTest.png") -print("Run ActionsProgressTest") -common_test(1,8,1.0) -print("ActionsProgressTest finished!") -click("MainMenu_ActionsProgress.png") - - -#EffectsTest -click("EffectsTest.png") -print("Run EffectsTest") -common_test(1,22,3.0) -print("Effects finished!") -click("MainMenu_Effects.png") - -#ClickAndMoveTest -print("Run ClickAndMoveTest") -click("CickAndMoveTest.png") -wait(4) -click("ClickAndMove_Click.png") -click(Pattern("ClickAndMove_Click.png").targetOffset(200,-3)) -click("MainMenu_ClickAndMove.png") - -print("ClickAndMoveTest finished!") - -#RotateWorldTest -print("Run RotateWorldTest") -click("RotateWorldTest.png") -wait(4) -click("MainMenu_ActionsProgress.png") -print("RotateWorldTest finished!") - -#ParticleTest -print("Run ParticleTest") -click("ParticleTest.png") -common_test(1,43,2.0) -print("ParticleTest finished!") -click("MainMenu_Common.png") - -dragDrop(Pattern("ParticleTest-1.png").targetOffset(91,17), Pattern("Acti0nsTest.png").targetOffset(93,-19)) - -#ActionEaseTest -print("Run ActionEaseTest") -click("ActionsEaseTest.png") -common_test(1,14,2.0) -click("MainMenu_Common.png") -print("ActionEaseTest finished!") - -#MotionStreakTest -print("Run MotionStreakTest") -click("MotionStreakTest.png") -wait(1.0) -click(Pattern("MotionStreak_ChangeFastMode.png").targetOffset(20,0)) -wait(1.0) -click("Next.png") -dragDrop("Motion_Drag1.png", "Motion_Drag2.png") -click(Pattern("MotionStreak_ChangeFastMode.png").targetOffset(20,0)) -dragDrop("Motion_Drag1.png", "Motion_Drag2.png") -click("Next.png") -click(Pattern("MotionStreak_ChangeFastMode.png").targetOffset(20,0)) -wait(1.0) -click("MainMenu_Common.png") -print("MotionStreakTest finished!") - -#DrawPimitivesTest -print("Run DrawPimitivesTest") -click("DrawPrimitivesTest.png") -if exists("DrawPrimitives.png"): - print("DrawPrimitivesTest success!") -print("DrawPimitivesTest finished!") -click("MainMenu_DrawPimitives.png") - -#NodeTest -print("Run NodeTest") -click("NodeTest.png") -common_test(1,14,1.0) -click("MainMenu_Common.png") -print("NodeTest finished!") - -#TouchesTest -print("Run TouchesTest") -click("TouchesTest.png") -wait(1.0) -click("MainMenu_Common.png") -print("TouchesTest finished!") - -#MenuTest -print("Run MenuTest") -click("MenuTest.png") -click("MenuTest_AtlasSprite.png") -click("MenuTest_HighScores.png") -click("MenuTest_Play.png") -click("MenuTest_Eitems.png") -click("MenuTest_Config.png") -click("MenuTest_Back.png") -click("MenuTest_Quit.png") -click("MainMenu_Common.png") -print("MenuTest finished!") - -#ActionManagerTest -print("Run ActionManagerTest") -click("ActionManaerTest.png") -common_test(1,5,3.0) -click("MainMenu_Common.png") -print("ActionManagerTest finished!") - -#LayerTest -print("Run LayerTest") -click("LayerTest.png") -dragDrop("Layer_Drag1.png", "Layer_Drag2.png") -click("Next.png") -wait(1.0) -click("Next.png") -wait(1.0) -click("Next.png") -dragDrop("Layer_Drag3.png", "Layer_Drag4.png") -common_test(1,3,1.0) -click("MainMenu_Common.png") -print("LayerTest finished!") - -dragDrop(Pattern("LaverTest-1.png").targetOffset(98,6), Pattern("Acti0nsEaseT.png").targetOffset(106,-11)) - -#SceneTest -print("Run SceneTest") -click("SceneTest.png") -click("Scene_pushScene.png") -click("Scene_relaceScene.png") -click("Scene_popToRoot.png") -click("Scene_Quit.png") -click("MainMenu_Common.png") -print("SceneTest finished!") - -#ParallaxTest -print("Run ParallaxTest") -click("ParaIIaxTest.png") -wait(3.0) -click("Next.png") -dragDrop("Parallax_Drag1.png", "Parallax_Drag2.png") -click("MainMenu_Parallax.png") -print("ParallaxTest finished!") - -#TileMapTest -print("Run TileMapTest") -click("TileMapTest.png") -common_test(1,21,2.0) -click("MainMenu_TileMap.png") -print("TileMapTest finished!") - -#IntervalTest -print("Run IntervalTest") -click("IntervaITest.png") -wait(2.0) -click("Interval_pause.png") -wait(1.0) -click("Interval_pause.png") -click("MainMenu_Common.png") -print("IntervalTest finished!") - -#ChipmunkAccelTouchTest -print("Run ChipmunkAccelTouchTest") -click("ChipmunkAccelTouchTest.png") -for i in range(1,3): - click("ChipmunkAccelTouchTest_Click.png") -for i in range(1,3): - click("it.png") -wait(3.0) -click("MainMenu_Common.png") -print("ChipmunkAccelTouchTest finished!") - -#LabelTest -print("Run LabelTest") -click("LabeITest.png") -wait(1.0) -common_test(1,26,0.5) -click("MainMenu_Common.png") -print("LabelTest finished!") - -#TextInputTest -print("Run TextInputTest") -click("TextInputTest.png") -type("TextInput_herefor.png", "1q~ tmp.txt - -#Get sdk's numbers -sdk_num=`grep "Simulator - iOS" tmp.txt|wc -l` -grep "Simulator - iOS" tmp.txt > tmp1.txt -sed 's/Simulator - iOS [4-5].[0-9]//' tmp1.txt> tmp.txt - -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/TestCpp/proj.ios -cd TestCpp/proj.ios -echo $sdk_num > sdk_num.txt -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build debug version - xcodebuild -configuration Debug $a - compileresult=$[$compileresult+$?] - if [ $? == 0 ]; then - var1=build/Debug-iphonesimulator - var2=${a:(-3):3} - var3=${var1}${var2} - echo 'Debug-iphonesimulator'${var2} >> directory_name.txt - mv build/Debug-iphonesimulator $var3 - fi - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloCpp/proj.ios -cd HelloCpp/proj.ios -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - - -#Build debug version - xcodebuild -configuration Debug $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloLua/proj.ios -cd HelloLua/proj.ios -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build debug version - xcodebuild -configuration Debug $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - echo Error. - echo $compilesult -# git checkout -f -# git clean -df -x - exit 1 -else - echo Success. - echo $compileresult -# git checkout -f -# git clean -df -x -fi \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/ios/build-ios-release.sh b/tools/jenkins-scripts/mac/ios/build-ios-release.sh deleted file mode 100755 index ae1bb19af1..0000000000 --- a/tools/jenkins-scripts/mac/ios/build-ios-release.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -#This script is used to finish a ios automated compiler. - -compileresult=0 -cd ../../../../samples -#List simulator sdks -xcodebuild -showsdks > tmp.txt - -#Get sdk's numbers -sdk_num=`grep "Simulator - iOS" tmp.txt|wc -l` -grep "Simulator - iOS" tmp.txt > tmp1.txt -sed 's/Simulator - iOS [4-5].[0-9]//' tmp1.txt> tmp.txt - -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/TestCpp/proj.ios -cd TestCpp/proj.ios -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build release version - xcodebuild -configuration Release $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloCpp/proj.ios -cd HelloCpp/proj.ios -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - - -#Build release version - xcodebuild -configuration Release $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloLua/proj.ios -cd HelloLua/proj.ios -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build release version - xcodebuild -configuration Release $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - echo Error. - echo $compilesult -# git checkout -f -# git clean -df -x - exit 1 -else - echo Success. - echo $compileresult -# git checkout -f -# git clean -df -x -fi \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/ios/iphonesim b/tools/jenkins-scripts/mac/ios/iphonesim deleted file mode 100755 index f42101837419b847e047b25bd4c568cd668138ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57124 zcmeHw4|rWgnfFPXNMKVEpp~K(E|6-A&;)3pgaS8hZ%HL7p=qE3e99ApS7<4x<2R^Tq=R35T(*S%1Uur={~X&rO1g^w<1FIQ~UjX@66nL za&nW_MRwQkxs%M9fA9OwJMX+RXU^Pn=Kb~`9(~+#oGE#Zb4st{Om&e!}m^eoIWQcEjb6*YWQfhuIl>8t&tTsO7@rw_6|h#n*@R&y^>jI4DuhIsbQGT&ww-0>rY0biSFduL^>-- z@4$RbuiQY`v_&X1^xkGNG`(m`tgSQFg}flWV}{-u1J5+&o_6E-Yf5x?wRWsG06}`I zDl~sl-30W=U-#zD@%$Y%^nPTBFzt8a=_NbvZtZA}wsx$G12D+nv)5?;>I@O4 zCv(wgtR=dxi=q=3q&MeUP4AEy6il10$x2qn7Zf}iT~f8O$_EnGbYwe@*+`4y_8gqq zm`fK&qn%yx_24VIv9Sy4JQ2M)8eQm(85cI+gwbe6TQsq`eQmrg+S%PTj^3QG=FhO> zFzs(A$3vl^#UL78ANLL0ar731H9a$I9j1fyP9q`XqS3a-$@r@aYkCO8G3}>E`C*z% zJ2NgskK0-k-9h;cgf%_eCZ_%LK*)+hXc~Ixl&n%EG>q%z44BObW4!lZs1de4;npY`Xu;E#M-)I>$2$IrbVVd3_Yg(^e_an z$*(=JK0CeP#hTt4@JPq>%`6v1yy#t2ch>;)Dlhc#-wqiEO%HQs#y1lkhOixZP-PEk~h73L1 zUZy9f*A#DWk9Sxh1lwD9z2+}u0TBA>88M_wGwYO^Wy^1fELpbF6oDau4Q0}d-8)^U zIS=@0U4Z3JIg5bDTi*hNo^K$9>K$hY`G*j8B4iQgtTm{w1>yYLa1X{}18Gr=4A|orn*%dlfv}DBV%kg(h6$l+|xe zbjRAuYFgKJHFj+-TgqGW-SMssiL$EB&Kp|0=gG~QIb}D;x)QCJ@X8jOGSDJj_G6l^ zN`03|;2C2M^&OmRp$mT7Y2mNVXi()v+VGN#g7&&9{ zIHSy~@?&W{>V3LBGd_s!`P<3*WpTVKmf<;Do2tsj!hk-;Oz!|f(f@`7da~?J^mL-B zCDu{4B$n9F9q%k#)f8`z&1>xJ1b#<1`Y3^-jj^^k*5YM#=)raIuJ%N*kLGon5+ATt zr@Ai8pxv>IR)Ga^M5*FB}?4jZvAH7H-0>|I`7qL z_t~H2S8x4BVfEIloaF0_dH0;PN#;BVwtZoo-(~;qNAV zs$pk!Dm4@7Wka$TM`+apA{DrV9W|cC(~0Q!*u8vWq3xONpkW_K-}q+CiLZl_J10cNo2}<4kma z-=`#7x1)f&x`1J8s;@c#;fyfmiX4hR^fM-WGR@jW6?cffNZ$Z+065;m=x@_MD#aWW zXv(RBNEP>OXPzo}Da7j8++(P|xQ`pSQeX9!ebmO)PkPlLWyVW+dW5(QUbS00B6w;> z0d%r=;TcZxwwY{Bs$eCxQzb{xCusI^j=snX)mwT-Pz)$;@;UICeTD6Uo*Bx>4L^my;WLS%vrIe1n2hqWK1&?AqH zE~S2Ayt6<}`<}?GVlh?3MF)S=BPIsTK~Ow|@Br9709qh|W zphguG2$keujr$a&vK!dDplCb2OG#4I0<7Yv=bMTm1Kv9%yW&M=DGU?TFIrkVSfe5X z%iM2(>(?POpgpN!KvH-dVQ#A6E27xb&OMJX4J5CG{PU=}9~|_04-0y2Z?!rDeSog$ zKR)Ab;WBby^a6}=P$^5dr=r<%_f4;dm~LbkO{2{|#}#(VL$ zcd(JV@*%)&&%oWO;f4W#(cps{2Hag4xJ86Z6Mp=E2n@9I+YnU?gy5Z> zW@<**5Kwzqa(spZ^o6MB*QgEL9YTQa=Py;D{Z6gJn7pNz??qDgGJjdJXG0P0j#V8oPjx_QzG(M_nG^J_Ok;Y6-Bcf?A%g{KE8``7jcDCgemZqj1 z6rhS_BqX{CMyi3~?pT8B@fm}<{K0pze80CB6c9q)2y}eLXIbnBU1Q`66&aG0f=}l0#@-AmZ=o848J$BU`x+IaGX&M)^iZ`d^l6jdk8m# z8pOR?U3}4Sb*gqiSIs+gMWY7xevdvwXY}EgLLq!K#43{mx?=Ulw6|Sx5g6pd=Iv4ZJFJwJOsT{L2l-qEa6V#TT!|ea!)LdNU4h0S=vhU!R z6nF1qawFaEy&pU(NqOanVj>A?eTH6cD)i zz#WH(zeb)xtSxjLa5Gi7c^|HT{f@vETq*1?fPOy$c*7-Ets!AnI80tu#mg8~WVw}Cn5*|k9w0+1^1#)R!^Np< z@KZ6^x`k{tMIJz}qZtdo;mrfMX@=a5^;o5TJ(XXWH~Kn$-38j*Ale)FmCB%vq8A<) zo*oS|fU8dR$vAl=U#A__^T3w<9BFRP1GopD3YKe{Y7uQXbfYTzc8!`b5A4^t`(0U& z)wtiUc4bLcBhwI9W!?a)M8lwe1&^?;s^T>C7@NFNmq3;K2#KsQ%Q|lf%TqgqrIf6x z{HtaTwTk`hCyYe5Zzt<2C5E&QIb4zzZ&P63zr0HcIlF4!v4-PJ7S4JFx1(P;+0!dQ zYLf(goeY!-Qc|XNNSQ301xFUnEgEeNg7m_foUyrEFu!87-OtvWNlon#1Xc7bMg~SI zeZ^F1lgx#{^y-LamgGvWXt|P+>1P!Hj?Y*Gikw?#vJ0`g(NoZjAIMidNHh9Ds3zN(AgA+Xec#cV&PXTM`d_q&~59hBcor!k~6&?W)8U4#8Z@Cao?lN z(~5c>dE0`;BwTUd`=zc5zHJIE`Dd=H)q;$=Pv>IoQcySJP$t+ffB|=Jja2gtW@|*e z*?>`!=k_gO#_OlzcJWirNU4hVk-C2f{S1X>EL;HwFycfwE=Sq4bJ+<^4T$1Kr>1`& z{c;1FjOVf^fCq&>IJ#XE{tcDRPxxb#5&jmbj3xZ4JW4*}t5&;Rp`QffJz#u39$T;Zn9$$5KxFki9-4G)Pq}2EX*+Z*HHR`AL8qX#F(N6+ zGWVhVEZ}N#OV1!`N59qM3dv3-pQ>Q0EV+aIwi#IdetQ{DaqiwysT%zjVwLTHQIh8^ zL3DHh$84(N->CV1!Cr;J345%K438D;-|>kNJvI$^;Cy)WMa}TGAmI_*;wB_~)_B5U zL---!f$-4ihc)5LgM>elA&jZmuVbT48s%+7Q3X%QvNR~Xg+TWUZ#Ra9yLXlq-b@Ow z9571qyi*v>sPX8-zu|x@cptb`wTItZ`#^Qmv*_B7ae!e$dY$(cw{I9!?CnNIqLM5O zf^*o+u_9e6xSX6ySouGZgsSM3u1_(`D9a~M;AiENGSA9_axpbDJ@)Yw%l7}h4El=W zBm~xO6S}Vt81^e6M5qr8R1YE?!w$2waVHdufUH z5N@+>-w_~;n)Sm?9K)*M4c>Sa*AJTk;$J_!jE6gSuP1fr^}}Jry*mM>B-^V(6eJ!H z5{Q{?0}zJT_HliM9fP+6h`VeVXZ8=mLx98RnYNIUNzEu=ds79!K(%HKXCL)dMXLz! z4SA$)IOIm2!(9juj*;QxGalzNsH%8EKUjI+!HS^TjdIm$N+H=%|iN{=+w_MCpGQg0qaH%gSLLu`R?%<9LEY-!eF-b@d)O&ZNtTL_c$C8 z&^u^g@m#Ydl{zG;Pm8X)sUb;yWfubI>P|_?Ewy;=-cHGs^+WO89d$_6=(}L?+%J?9 za$7U>pm>gf?+c^4;yF?es^cQ4c#fa}n~R|0IZ|u!+)sB(N)wqI>n)xm3>438A1Iz9 zTo=zx?kb)m92C#(!5Hf!qZoqn(4tbj7gxKfa?ruOg-yb!nj@(_Et1+3l9b-+RI+xf zQPUp99lBPXirtH2H7Sf?7t@8?<5j0*3wD{ixdi*EB?t?v_E+VXqj^>P^EjVu-}3^k2CrLW2KCJkFm=cJHS{KV~;a-BV!LS7H90sjBR6V7h(+w zyr^FpYVG9vqlwn`(872pU*Sw#8(PRWpBp=xuMN$cH}5oOu}&o_Pjf<{L`(ecMDvCO z<86(}j;5B-LcGt|*4iX5fQI-|>b0TUF4-9CS{qNqRwD}V&_Z00#kX6pW!}2R_SUw| zsJ*e7$z-y%Ikb>hDUEe(3@yZ^wJYAyj<+O3>ss4lnzRt?ZjL9rLkn3~s5>4?=rn-@ z9qCwC*O+pq)8&m_>l2}cU9tAY)((8Q6hb=5Y7(d-k%%>ix?8&9$@M~8w-I^1Mqa!6 zG$;MWZK!_94WSkBcz2@GdC%g=#nA4{;kp=Pu#*3lfgyA|w$k$6|g zSDNTHns zow26Yb+%{lYH4V8!of?&p?VZl3KNERNvv$`ZtQ4Hwx{1nb+mFg$pod;9NXC16bqT2 zL*48=U-iOk2%4ndL=Gi%^M$n48b^!MscnU5DEWZqq`TrY$7+y6{c##PHgv@A?g*g` z$&N&_volViiR_J9p&lruQ7lI^%DDtO*l>GQ;IG=e8x0MGe=l7EXj;(F+G%+R?pebEE@W)`elxvHljQ zLVY*h+pWYa%dsZtj=)qpXzP;J1m5@EyqsTfA!*(TXOz_Hpz}^+S6Aa^(zsEuE1kA@ zQ)3$$#EZsFU9B>Z(QUD=W&Eg2f3`vRrFgx#vAfb~Y;LxwngJBt5Zhb{R@*x3GzA-61Bvfi_r|8%5*`Z^pW1wL~EtRRT(&>sNAo}J6qy*_T zL5P)3Ya()2vatYjqba>(F9a0^s%3q%pGeaaFf$iIg>9c4aMhC1Z(h5kGqp z@1d`2U0>PV+8)E4S}F5PrPGNII=kf#;c)0;ic2`ntxdc?;2Q>?LM=9o#X9h2I}{r= z38y68uyW}F%XbFZR4OmO-?(lm=4@z>)#t^HosCVc-B85l*t*7KTQ{}AOd4oX<=xa_ zEic|IDt&{wQV(9~AU%F1$|20=%T!#6sW{TnOcv0W6tJ&AYb0whWnIY*LPCFb+l|h~%P$L;S1t%&dPVrM z`RUXJ6X9I|xC@ro3(FS>!W9O+>9YCZ%NBrw&X|k>K{G^v1ES!;X|>^%KAys0aDI7s z{(^AD72zwu;$;g64A?s^x~$v@XQ@cOfMHi&;56Zrjm!r|*lrWY5D$3zU-=MjDQ!teb8kc^_EeYB9VOI53%Th>$3<|r3XPy0i-KLL*$I`d?HYA_a z`Q+6auG`dGH%q5`P5wP5f5hYm+trI7CCO{BT}Ms+RMW0)hR&|@HT(xm{%1{o_}w}` z1X`5e;8LBw*T4-LI8Fh4LbKn6-fzmEG36){e)!-`ILgcKteonqG@O-_XVQLH#_c%+ zPcG2#zcAtNO;~u9&Yy0=*(R(s;bIdun6Sfy{U&_CgnLc+LleGk!qQ4j|9TVNWy1SS z_^=6|G2!W^-`-`yi%huGgg2Vd_Pgz8*W}-C!a);0Wx~TIe8YscUu{2r%Jjo-6Fy|Z zpgh-@cG>(d2GS1((xawb7XJ5v^aB&rW8weU(2nbq#Va&=W51)G2(NsR?nhgG;1nJE z_!UNfY=H@F`2(gL8%1NBEq~OMziUh>ZkvYwAydwsB)_xeo+-cBUx>IZpK+z;k7LR2 zZ27sSJkMWr6RzX~sBkdr`80yzof zB#@K9pQQxOxWH+M+`4E*75_RzorRsDHD^}USJf|BxoFLtMZE=uoz zl+U?|4Lvg)y>Zd|7DpG?RMpok> zIw7S~f)2CmXw(o!)*w zH!SBba-GgVm?r|siH6a&IP?w@_cv|^XyNyWrf96avwL&2sj;ag27tncAT58v#_q!xI<)7y(*)5YZt7ZeV>Jz8CUwR^+CK3QI0o0OWW zxIgXm^5<1eY&@j?ImPMSG``605cdv`!>^63tg;Hayx!0l0EuXH@lq%aotVXqx+4-cO{a{zkYRTt=ib&aiU&VbXk3i+{3_(2BoHHfd1P5pIDwjkLa zYsb$ROm!lKUHhhX^pDfE37w$(!2Vnn@1PjC_s{a)JPTk%&CLEhh<5Q(!zq4e>yB~j zT>sou)zOSSbo~n}fUTPnb&Alwu5KsdOpQ9{FJA>H=Y3{N-?_t?(%ymw#F~=bF&tOf zNM)&#Lj>hq$YyR9O?3va9W$lLS+UVsmGAWbb)J*&49In-TzBEB-N1tIK;Eu`&cUg> zPVGIbcgn83L2fC@o>Q}dVSw!@$Ddw{^t!2e&X+I0S{}(rZyqjozbu4!sV~j)Qh3`? zrkCU5PZQtnt6hsY@ogGW!MFR*OcURqCcfQ&yA^Tb+cctr--(cpY2y3S#JBr&A4Z(` zHjSv@4>AJBfcXA2@$G)z9>j@n(}-&R&4V-3#NXvh6W{LporZoSzD*OJ^0WKfOcURx z%K#rjo^>|`((yq0{y>`ant3q}#bf&W5o9#mLWF!xH(UP?V`GD4J`F7*|2EA$@^AOo znI`}K^knsa4)px>A3{27{pGs;`|?fwCT;8Ag?j01{ktTk)0F?3OLhE{2H&PFzQ4c8 zzdud<61;Ij*e@D!ZTnv^Y1^KkFg?R@>^@&1Hk6pQ`-Sgj`s~cU^bIC$ z_pv*XE<vWplUY$VekhQBLZ{J-+I=sO{z(A-NFe>|K>GIq{Il^p9QaGqpB+f^ z<#?2*`K=11Zv$Iv;2YuB!mopGf^UYefnN^~7p}$ScKFrsC&CFiWfPr1mww-?>||i- zSe>QRz5|i9Y=Tz{P5>Kx+aMdbep%{Gy!VieDBe>T z`&PqhM?Wa}*P;RO7zn#k&0f0f=BgEV&I%OHv+qjiN+tlZFIJp{+8UMQs~7YBy!235 zjyq9?;|GvEA~HQl%1lc;5_;kOXV%&@+h}n|VxxWfK-?EKk0iPA=zGfu<54u^gi`z8 zGi;;s?AGMyaHE6AS045*&uP)<_{X@YeaO?#e<%0kn0?>lzp}}50vx-&b8=v2Yv)A3 zncbYRkmEOJg5|y~ieS;0?TKKa+0O}Pn@xsbw%w!%=9?WKo$bFxq_-A!T7nh)IG%;*}-vz`W#8$R!?Ap!U6WR7VikESJhu;E@;-%g6hA)ZbJG~6(@ME|( zT1K;ek{)Ys@Cd#$APYxk%f2yD#1$538r*n4kqy6Dc(<2(#k1b++vq11LxWM+bHb0l z_+gm|xS%XHfyQ;%tKI|}ewY5?KyW6vUH9;H=qtcI9DE7bN05DSQ2JuLeYtdhpfA}M z)B(1i?quxA$+s{N=9s?F=!VARHsq#n3f>&Dn5RdLvB!frgiYd3U)JX{PO zh5&hScrqIJk{!kvVPTIp9>?)<7&NF?hXXW_<>N!l>NVk28*xECju{%qCZ$0>C=+30 z93Mq^%ZU{hp-=qsK$edW;5LE?UL7GLK|W@IMmh3lO-h5ZXv8}w+Hhl#Mh$4-r%0#f zgfvV;vhdLY8W4%oGAWI8GXOchEkmX)LzB|bbFT;^3k?r6C_H`>G>J^(&B?Y{#$G31 zGb2aZ9W#6!o0Nu_Nwg%!^~;}vioeufqiLj z3Br?gyl-c7lS_Z6WVm+)R3ktR=VCAn{I5w8h>4HfjzhRe)=b2&y75d!8r+A zZp3Nv*Yg(Ial04wu)Ya@j{I-3hF(BQs& z%gtMllzVK@Dpgyg8VXZ`S3}L!&@1NywBa?k_NXd$i%Q+@(tMb7@U{a})gDQ0=OLBq zK|-l3-1(*MN|t-xUADY4Tlrz{CR=__w(=40Qk3Hm{H^=S?}&~+pV)o5{+64!9C-ok z`gvA^WtxxV(bV8pVf=_&>#6?YOTpg2)wr?=WN{CVXV(Xjd;jrv)^%9Pk?j;q8!{fD zEFKNvl1dJvVf&Yq$|DiNLguQWdM|mez$-`>zCKRa8 zT*sQpnHlysf2Lujuz6`!-KcIn?U0lWa2EsHAok4RPw2hH$BBT#L7H38Cc7 zZ#Mj2pchI`XHWJ24MjO{Ij_lmIEs}-=0ENxM^HH~I~TJ}=y0|u#j~~D9bsI(`$(g9 z1c&Mp<7?L&p;K@A780OiEWizZfCU7oB|wVA&|CUsZT6YkLv$!$q1sD0_ny)s$g;%i z!Lx-c=UXdjo1FcMv+DqJ)d5$8pv6-Bp_lM(yOn0Dq4#m=CtoM2z3c_sQ8nnOmA;PJ z!*lT5zKe17cB4}1D3xMbpLXu*)A;)CK{Z;As$W#{RGe9O)w9KYtWWCSvX9DpNAxxv zQg;Q+tsJ8!t zbbz7fGYmMWL7~Dt&|QjN7=q@NfbMkfa~9!ML3qqgfEeN4M_3j)sQMqrN*TvWszIsE zw5s+YZ=E1Nq|Q*ugX;0u$x41HNawRMuNtLj?C9xGE|Jeh+sNM%(kGmA1@bwZrO6>Y zcn0P!e-GCV;uvJ_2gu&KuT2z=^S#WUpMn5wm(EcQr79UxJ+sv6nK%bmMW(xvhg75l z#{{cL5ooALA!dG@1dI7yML_kiiaZ46a#z3L_8fAP&$$f;-P)&B?U363gZEN^ht(tR zy;w8LW?|%dcYzOB3$eyR=I2E9$zGn50)7QIX^`{n0PI%)EAoFy7HP^KP?`e;zSTLHm?&QC)RTSGT} zMZzOG_E#W`sU+RwdU`{_R2fSnw#T2Oae&B9VdgAdqz0P;%=`gBtZD_Q5Al&y)$Wsa zy+j3gbUnc_(4nD}I|1C<`&}5G`4$i}O-SDFAKm|mve8;nq>4^TQFOTWUf4+S5@RXe z>!)}N%7!i!VvyP^875;0FNMkqnI)KXQO#|C3Mr9(1 z2SpIN6DbI?;zoMCCkRNWI4G!Oub=17p=?Xf3xG^(4Jf`K6(#}|-VInWY4IwoS)?M5 zsoG)Hunz}1tHR8A*-XWeegZH9h?Bf=!o|r@~3aL-YUfP0wvXdHg0IDVMMKv847E4uLh;pkn7?; zQ3A}gDWSUkuSnI*M3(`IvwV?{*4%Nl_#kd*y^4t>Z5U$}$XgD|i8b&mw)9L6UGnhQ zUzmG`YB-|yNbQeHn^4Za(aStJf7sg%SlhC{WIQ5jus?E$jo2TNsl=Gh&~>W*pJ7R$ z2DTb0ab{f$Oq}k!KXPCyd5atnOBoNp4RKk@rTRBW>ke?qIsI=fqvrw5G!RV%-jS!m zFqIMa;dN)jd*!q=-cby6xfeVV0tHxedz{OA7^t#VG7gwE?`NJT*F6XH>J>{6l|N*P zp7;oxf;9$(gCT=qQ$#B69$BBJ=5t}VgNsIQGir8mtB_Wy{%1rI{})%Q$*TllSoO&o zGk@IkhFC;MMRulSJ!>8?hAofBNonE-3|XP>nL|d7;`b>L9ga;#x_BEGU?K>ZptBDc zyZC^?Vw~#F>z-M>inTj;$8^M%j9tJT7;7S0 zmC9#sN@UkZ85Q?^n~wyMBU?66K`_WS2z#t1)xX0x7I82+tO%<44;x*VRTDn|l0}_w zV9K;$2c{!j{0?<^#elV|d$IKAy?6@lRrMHPc1-QfHa5NkC^M$6C2x@f#)ifLtF$r@ z@bD=^Q4K0~gIPTDmj1UOfai%(TBETw{UBRSjc>N5i>0PRqkrYA=||aWdgE>BHvKSr zoAi_$*W**DO zL!O;)v-a_IKo0h?fAST(k#6b;S$QvD?c|$>_-GP?*w!?UHQ8>mGv?3no8O!2-60Tw zS%J~N@YQrhwwkuS*_xJ1O$SFm>yzHK*=jl`QxjIYevKVX`f!(=Nb=vpkepQV9{V|U zn38`GuvYRPLEJY?Mz4X54m(!<_1)}*!|z2u4E_z2#XnHmfoJw<%nh$q*sa4LwhA^@ zBOeKBq*$l)xFcl|&J&Fs325Y$0E>!M_-3Kfw4Cfc>Eni3-ktYx&XCy@IJP3q*@)U$ zsK&GP0%epEG^_#-spQkD=Q*|dpxZ~=0eV}??R!q*GR5|OlJ$xGPSrGnO1o7> zx>%<7Z^dJe8sJl{Srzc`V)RYhTR5I_MNs_x8ki`pX z`*}WbbCrPBz!*q+LpozG&wUx&=cU*tQP_E}J?2JUgQ*1Aynw+Mg}w8ixJwJ&oAce% zy)${AjvU##uk;STJy4Brn@^Wgt zN4Qw7<#L@b*9CH2DA%xDm*CnmQ=-#xHTDsH3ZArmgb~Il-_h?gb~$5DGgigeHyOK; zu_4CdjD3}{t&Dvhv7CK`H)S7T+;KaZ)7>54(fC=-DEtxU<&U+vfX_%z;`Ds;eb-6a zWe6MsW0Aq*iOn>m&o$Q{T~#{i6LiFS11&K8$xiM+ZIZM5$8|>5vyUb};eT<^@mi3%7Zn5a)_l)xTs z&(roZ)*gH+_+PP5kWokZhI9hEBbm?o#f|~yheXDp!O7bq8FNll#*{(8Mu~o%mLJ!T zw~Am*g`BMYk_@ekErCkERg(-CQehmYCBSHhHK>r0&Y#-mNqS0K{1%yNu#!p}RY^>6 zz=E+-Fh2}i374f4S*#Ce{0kOjOdJ5-M>Tj911uVp!=eEQH(h!e>@cL$lh7t)+JXX5 zCK?ZREI1o!G-1BeY63CRpqnC=AIf3;0oEH}Yk`I(#va&U+uFL|j*HNe^oO{ClNZv~ zDo$XL!5+}igmZevofNmc-hLR&Z_;fXETwH-_-)=~bX8u#!-`X!Kg3dAUXP!TkpAbh z1;l6NArG(gVdcTq7bD)2CrGD3!IZU6sAoI>P(<_k1!+b_Cm)o z@;6YqASZ#G1acC{NgyYIoCIc6$Aer@E5_~3I9v@ zH{gERb`01$cVtCq9>w*6`{1fm`!+Y?*gue#-+yuWJ{>$*M z!=HVPrb8KB6BK&@s z?tI|Vv;A~a@K>&*=_|hzwvP2w0(KER_W>Faw!+&z3GN-R4bP+A@^f`teu(%8;+DVR z^D{iwU7*|aGGIdZt&MFv3qCX#-*Tc}KW};9je8mVUYOte()oGQIiP_EzvadDgnZk% z0rdD?u0KuKV48V3my$z8&Gt*BbDc+HH(unai8vv9?t&Z3*nJpUIr^qw-MGp}>X zO%oZ*yQyo|0F0iEw_7Kc*CsPocLZ;Sip!%hxf5GyyM6fdBG^Zp6R6GFXuBBs)<#=7 z;?^_*Q0609hIooF~TMR<4zERy z$IB63j;_Tv#n4u62>>oUm^V@|kauuu?`cP;@0v247iK=GG&2H+?-bJUwTN50StKwI z7w&1$78H*QV4V5bwvh9#7+;RdAVS6o&wY=D2njEHAjl{D2r4BE;ccAo+#6YiknoHn z5cmOvj1%6*3D5nLZ3qd^I0Av^d5DY?-o^t67LJ zPTp)h8~rPQYw2%5JV<{KZwrO;HGRe{{bA6y^lhAN@2tRnoq=cE!iRnEHct3Kz+7qR z`{1!1mZopxmj5cipAKB=Qq;t$Cm%F%>cE#woc;TK6KCJO7kx%t?v>RcPQ9euZZ>hY zajl7y|8|>?_}z#X7X{x*1SXRd~a3-inT2KbxdPlS`R(Xy!wi@l(OL3Jj$Aq~;_jXY5mr10MfYcoqVgDL1yNvXmHeRar{x%jj8(>h;0qZ_2LN37_r8JU*U`RV#VWOF!b-hr5$DS7jdm IvYDp(f20HT%>V!Z diff --git a/tools/jenkins-scripts/mac/ios/test-ios-debug.sh b/tools/jenkins-scripts/mac/ios/test-ios-debug.sh deleted file mode 100755 index 87fdfe0596..0000000000 --- a/tools/jenkins-scripts/mac/ios/test-ios-debug.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!bin/bash -#This script is used to finish a ios test automation. - -compileresult=0 - -cd .. -cp -r iOS_SikuliTest.sikuli ../../../samples/Cpp/TestCpp/proj.ios -cd ../../../samples/Cpp/TestCpp/proj.ios -sdk_num=$(sed -n '1p' sdk_num.txt) - -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' directory_name.txt) - echo $a - ./iphonesim launch $(pwd)/build/${a}/TestCpp.app & - $SIKULI_HOME/sikuli-ide.sh -r $(pwd)/iOS_SikuliTest.sikuli -done - -#Sikuli Test success! -echo Sikuli Test Success! -#git checkout -f -#git clean -df -x -exit 0 - -#End \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/ios/test-ios-release.sh b/tools/jenkins-scripts/mac/ios/test-ios-release.sh deleted file mode 100755 index 87fdfe0596..0000000000 --- a/tools/jenkins-scripts/mac/ios/test-ios-release.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!bin/bash -#This script is used to finish a ios test automation. - -compileresult=0 - -cd .. -cp -r iOS_SikuliTest.sikuli ../../../samples/Cpp/TestCpp/proj.ios -cd ../../../samples/Cpp/TestCpp/proj.ios -sdk_num=$(sed -n '1p' sdk_num.txt) - -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' directory_name.txt) - echo $a - ./iphonesim launch $(pwd)/build/${a}/TestCpp.app & - $SIKULI_HOME/sikuli-ide.sh -r $(pwd)/iOS_SikuliTest.sikuli -done - -#Sikuli Test success! -echo Sikuli Test Success! -#git checkout -f -#git clean -df -x -exit 0 - -#End \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/mac/build-mac-all.sh b/tools/jenkins-scripts/mac/mac/build-mac-all.sh deleted file mode 100755 index 4696701751..0000000000 --- a/tools/jenkins-scripts/mac/mac/build-mac-all.sh +++ /dev/null @@ -1,15 +0,0 @@ -# cpp -xcodebuild clean build -project ../../../../samples/Cpp/HelloCpp/proj.mac/HelloCpp.xcodeproj -alltargets -configuration Debug -xcodebuild clean build -project ../../../../samples/Cpp/HelloCpp/proj.mac/HelloCpp.xcodeproj -alltargets -configuration Release - -xcodebuild clean build -project ../../../../samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj -alltargets -configuration Debug -xcodebuild clean build -project ../../../../samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj -alltargets -configuration Release - -# lua -# TBD - -# javascript -# TBD - -# other sample games -# TBD diff --git a/tools/jenkins-scripts/mac/mac/build-mac-debug.sh b/tools/jenkins-scripts/mac/mac/build-mac-debug.sh deleted file mode 100755 index 1a2492e196..0000000000 --- a/tools/jenkins-scripts/mac/mac/build-mac-debug.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -#This script is used to finish a mac automated compiler. - -compileresult=0 -cd ../../../../samples/Cpp -#List simulator sdks -xcodebuild -showsdks > tmp.txt - -#Get sdk's numbers -sdk_num=`grep "Mac OS X 10" tmp.txt|wc -l` -grep "Mac OS X 10" tmp.txt > tmp1.txt -sed 's/Mac OS X 10.[0-9]//' tmp1.txt> tmp.txt - -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/TestCpp/proj.mac -cd TestCpp/proj.mac -echo $sdk_num > sdk_num.txt -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build debug version - xcodebuild -configuration Debug $a - compileresult=$[$compileresult+$?] - if [ $? == 0 ]; then - var1=build/Debug - var2=${a:(-4):4} - var3=${var1}${var2} - echo 'Debug'${var2} >> directory_name.txt - mv build/Debug $var3 - fi - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloCpp/proj.mac -cd HelloCpp/proj.mac -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build debug version - xcodebuild -configuration Debug $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - echo Error. - echo $compilesult -# git checkout -f -# git clean -df -x - exit 1 -else - echo Success. - echo $compileresult -# git checkout -f -# git clean -df -x -fi \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/mac/build-mac-release.sh b/tools/jenkins-scripts/mac/mac/build-mac-release.sh deleted file mode 100755 index 51d6d26282..0000000000 --- a/tools/jenkins-scripts/mac/mac/build-mac-release.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -#This script is used to finish a mac automated compiler. - -compileresult=0 -cd ../../../../samples/Cpp -#List simulator sdks -xcodebuild -showsdks > tmp.txt - -#Get sdk's numbers -sdk_num=`grep "Mac OS X 10" tmp.txt|wc -l` -grep "Mac OS X 10" tmp.txt > tmp1.txt -sed 's/Mac OS X 10.[0-9]//' tmp1.txt> tmp.txt - -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/TestCpp/proj.mac -cd TestCpp/proj.mac -echo $sdk_num > sdk_num.txt -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build release version - xcodebuild -configuration Release $a - compileresult=$[$compileresult+$?] - if [ $? == 0 ]; then - var1=build/Debug - var2=${a:(-4):4} - var3=${var1}${var2} - echo 'Debug'${var2} >> directory_name.txt - mv build/Debug $var3 - fi - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloCpp/proj.mac -cd HelloCpp/proj.mac -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build release version - xcodebuild -configuration Release $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - echo Error. - echo $compilesult -# git checkout -f -# git clean -df -x - exit 1 -else - echo Success. - echo $compileresult -# git checkout -f -# git clean -df -x -fi \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/mac/test-mac-debug.sh b/tools/jenkins-scripts/mac/mac/test-mac-debug.sh deleted file mode 100755 index ff2afb7e12..0000000000 --- a/tools/jenkins-scripts/mac/mac/test-mac-debug.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!bin/bash -#This script is used to finish a ios test automation. - -compileresult=0 - -cd .. -cp -r iOS_SikuliTest.sikuli ../../../samples/Cpp/TestCpp/proj.mac -cd ../../../samples/Cpp/TestCpp/proj.mac -sdk_num=$(sed -n '1p' sdk_num.txt) - -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' directory_name.txt) - echo $a - $(pwd)/build/${a}/TestCpp.app/Contents/MacOS/TestCpp & - $SIKULI_HOME/sikuli-ide.sh -r $(pwd)/iOS_SikuliTest.sikuli -done - -#Sikuli Test success! -echo Sikuli Test Success! -#git checkout -f -#git clean -df -x -exit 0 - -#End \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/mac/test-mac-release.sh b/tools/jenkins-scripts/mac/mac/test-mac-release.sh deleted file mode 100755 index e22e439910..0000000000 --- a/tools/jenkins-scripts/mac/mac/test-mac-release.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!bin/bash -#This script is used to finish a ios test automation. - -compileresult=0 - -cd .. -cp -r iOS_SikuliTest.sikuli ../../../samples/Cpp/TestCpp/proj.mac -cd ../../../samples/TestCpp/Cpp/proj.mac -sdk_num=$(sed -n '1p' sdk_num.txt) - -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' directory_name.txt) - echo $a - $(pwd)/build/${a}/TestCpp.app/Contents/MacOS/TestCpp & - $SIKULI_HOME/sikuli-ide.sh -r $(pwd)/iOS_SikuliTest.sikuli -done - -#Sikuli Test success! -echo Sikuli Test Success! -#git checkout -f -#git clean -df -x -exit 0 - -#End \ No newline at end of file diff --git a/tools/jenkins-scripts/mac/rootconfig-mac.sh b/tools/jenkins-scripts/mac/rootconfig-mac.sh deleted file mode 100644 index f675a76fcd..0000000000 --- a/tools/jenkins-scripts/mac/rootconfig-mac.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -#get params for build_native.sh -CUR=$(pwd) -cd ../../.. -#COCOS2DX=$(pwd) - -#var1=NDK_ROOT_LOCAL= -#_NDK_ROOT=${var1}${ANDROID_NDK} - -#var2=COCOS2DX_ROOT_LOCAL= -#_COCOS2DX_ROOT=${var2}${COCOS2DX} -#echo $_NDK_ROOT -#echo $_COCOS2DX_ROOT - -#Modify the configuration files -#sed -i '' '3,4d' $CUR/build_native.sh -sed -i '' '13d' $CUR/project.properties -#gsed -i "3 i\\$_NDK_ROOT" $CUR/build_native.sh -#gsed -i "4 i\\$_COCOS2DX_ROOT" $CUR/build_native.sh - -#Modify the xml file -if [ $1 = TestCpp ]; then - gsed -i '2d' $CUR/build.xml - gsed -i '2 i\' $CUR/build.xml -elif [ $1 = HelloCpp ]; then - gsed -i '2d' $CUR/build.xml - gsed -i '2 i\' $CUR/build.xml -else - gsed -i '2d' $CUR/build.xml - gsed -i '2 i\' $CUR/build.xml -fi diff --git a/tools/jenkins-scripts/windows/android/androidtestcommon.bat b/tools/jenkins-scripts/windows/android/androidtestcommon.bat deleted file mode 100755 index 3a1d23a756..0000000000 --- a/tools/jenkins-scripts/windows/android/androidtestcommon.bat +++ /dev/null @@ -1,89 +0,0 @@ -echo off -rem =========Basic parameters============ -rem jdk path -set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_31 -rem jdk version -set JDK_Version=1.6 -rem sdk path -set AndroidHome=D:\Windows7\android-sdk-windows -rem android version path -set AndroidVersion=\platforms\android-8 -rem android project path -set AndroidProject=D:\cocos2d-x\samples\Cpp\TestCpp\proj.android -rem unsigned apk name -set unsign_apk=Tests.apk -rem signed apk name -set sign_apk=Tests-sign.apk -rem sign keystore -set apk_key=cdykeystore -set apk_keypass=123456 -set apk_keystore=D:\cdykeystore - -for %%x in ("%AndroidProject%") do set AndroidProject=%%~sx -for %%x in ("%JAVA_HOME%") do set JAVA_HOME=%%~sx -for %%x in ("%AndroidHome%") do set AndroidHome=%%~sx - -rem jdk kit -set EXE_JAVA=%JAVA_HOME%\bin\java -set JAVAC=%JAVA_HOME%\bin\javac -set JAR=%JAVA_HOME%\bin\jar -set KeyTool=%JAVA_HOME%\bin\keytool -set Jarsigner=%JAVA_HOME%\bin\jarsigner - -rem sdk kit -set AndroidAAPT=%AndroidHome%\platform-tools\aapt.exe -set AndroidDx=%AndroidHome%\platform-tools\dx.bat -set AndroidApkBuilder=%AndroidHome%\tools\apkbuilder.bat -set AndroidJar=%AndroidHome%%AndroidVersion%\android.jar - -rem android project directory -set AndroidProjectDrive=D: -set AndroidProjectRes=%AndroidProject%\res -set AndroidProjectGen=%AndroidProject%\gen -set AndroidProjectBin=%AndroidProject%\bin -set AndroidProjectAsset=%AndroidProject%\assets -set AndroidProjectLibs=%AndroidProject%\libs -set AndroidProjectAndroidMainfest=%AndroidProject%\AndroidManifest.xml -set AndroidProjectSrc=%AndroidProject%\src\org\cocos2dx\tests\*.java -set AndroidProjectSrc=%AndroidProjectSrc% %AndroidProject%\src\org\cocos2dx\lib\*.java -set AndroidProjectSrc=%AndroidProjectSrc% %AndroidProject%\gen\org\cocos2dx\tests\*.java - -rem output file -set AndroidProjectClassDex=%AndroidProject%\bin\classes.dex -set AndroidProjectResources=%AndroidProject%\bin\resources.ap_ -set AndroidProjectApk="%AndroidProject%\bin\%unsign_apk%" -set AndroidProjectSignApk="%AndroidProject%\bin\%sign_apk%" - -mkdir %AndroidProject%\gen -mkdir %AndroidProject%\src\org\cocos2dx\lib -mkdir %AndroidProject%\bin -::mkdir %AndroidProject%\bin\classes -xcopy D:\cocos2d-x\cocos2dx\platform\android\java\src\org\cocos2dx\lib %AndroidProject%\src\org\cocos2dx\lib /s - -echo generate R.java file -%AndroidAAPT% package -f -m -J %AndroidProjectGen% -S %AndroidProjectRes% -I %AndroidJar% -M %AndroidProjectAndroidMainfest% - -echo generate class file -%JAVAC% -encoding UTF-8 -target %JDK_Version% -bootclasspath %AndroidJar% -d %AndroidProjectBin% %AndroidProjectSrc% %AndroidProjectGen%\org\cocos2dx\tests\R.java - -echo generate dex file -echo on -%AndroidProjectDrive% -cd %AndroidProjectBin% -rem packaging the *.class file into *.jar file -%JAR% cvf %AndroidProjectBin%\classes.jar *.* -cd %AndroidProject% -rem generate *.dex file -call %AndroidDx% --dex --output=%AndroidProjectClassDex% %AndroidProjectBin%\classes.jar - -echo package resources files -%AndroidAAPT% package -f -M %AndroidProjectAndroidMainfest% -S %AndroidProjectRes% -A %AndroidProjectAsset% -I %AndroidJar% -F %AndroidProjectResources% - -echo generate unsigned apk file -call %AndroidApkBuilder% %AndroidProjectApk% -v -u -z %AndroidProjectResources% -f %AndroidProjectClassDex% -rf %AndroidProject%\src -nf %AndroidProjectLibs% -rj %AndroidProjectLibs% - -echo generate signed apk file -%Jarsigner% -verbose -keystore %apk_keystore% -keypass %apk_keypass% -storepass %apk_keypass% -signedjar %AndroidProjectSignApk% %AndroidProjectApk% cdykeystore - -echo sign success! -pause \ No newline at end of file diff --git a/tools/jenkins-scripts/windows/android/build-android-2.2-3.2-debug.bat b/tools/jenkins-scripts/windows/android/build-android-2.2-3.2-debug.bat deleted file mode 100755 index f95720db38..0000000000 --- a/tools/jenkins-scripts/windows/android/build-android-2.2-3.2-debug.bat +++ /dev/null @@ -1,156 +0,0 @@ -::This script is used to accomplish a android automated compile. -::You should make sure have accomplished the environment settings. -:: Don't change it until you know what you do. - -::Here are the environment variables you should set. -::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %ANDROID_NDK% -echo off -if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set it like this "C:\cygwin"& pause & exit 1 -if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set it like this "D:\xx\android-sdk-windows"& pause & exit 2 -if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set it like this "D:\xx\android-ndk-r8"& pause & exit 3 -if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set it like it this "C:\xx\jdk1.7.0_05"& pause & exit 4 -if not exist "%ANT_HOME%" echo Couldn't find Ant at "%ANT_HOME%" and you should set it like this "D:\xx\apache-ant-1.8.4" $ pause $ exit 5 - -set _PROJECTNAME=TestCpp -set _LANGUAGE_=Cpp -set _ROOT_=%cd%\..\..\..\.. -cd %_ROOT_% - -:project -::Copy build Configuration files to target directory -copy %_ROOT_%\tools\jenkins_scripts\ant.properties %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android /Y -copy %_ROOT_%\tools\jenkins_scripts\build.xml %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android /Y -copy %_ROOT_%\tools\jenkins_scripts\windows\android\rootconfig.sh %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android /Y - -::Modify the configuration files -cd %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -rootconfig.sh %_PROJECTNAME% -cd .. -set _PROJECTLOCATION=%cd% - -::A command line that make the current user get the ownrship of project. -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F - -::Use cygwin compile the source code. -cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -call android update project -p proj.android -cd proj.android - -::Make sure the original android build target is android-8 -for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a -echo %xx% -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:8). -call ant debug -set result8=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto API_10 -if %result8% NEQ 0 goto API_10 -cd bin -ren TestCpp-debug.apk TestCpp-debug-8.apk -cd .. - -:API_10 -::Change API level.(API level:10) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-8" (echo/target=android-10)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:10). -call ant debug -set result10=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto API_11 -if %result10% NEQ 0 goto API_11 -cd bin -ren TestCpp-debug.apk TestCpp-debug-10.apk -cd .. - -:API_11 -::Change API level.(API level:11) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-10" (echo/target=android-11)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:11). -call ant debug -set result11=%ERRORlEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto API_12 -if %result11% NEQ 0 goto API_12 -cd bin -ren TestCpp-debug.apk TestCpp-debug-11.apk -cd .. - -:API_12 -::Change API level.(API level:12) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-11" (echo/target=android-12)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:12). -call ant debug -set result12=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto API_13 -if %result12% NEQ 0 goto API_13 -cd bin -ren TestCpp-debug.apk TestCpp-debug-12.apk -cd .. - -:API_13 -::Change API level.(API level:13) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-12" (echo/target=android-13)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:13). -call ant debug -set result13=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto NEXTPROJ -if %result13% NEQ 0 goto NEXTPROJ -cd bin -ren TestCpp-debug.apk TestCpp-debug-13.apk -cd .. - -:NEXTPROJ -::After all test versions completed,changed current API level to the original.(API level:8) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-13" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Calculate the errorlevel and change build target. -cd %_ROOT_% -if "%_PROJECTNAME%"=="TestCpp" set /a TestCpp_Result=(result8+result10+result11+result12+result13) && set _PROJECTNAME=HelloCpp&& goto project -if "%_PROJECTNAME%"=="HelloCpp" set /a HelloCpp_Result=(result8+result10+result11+result12+result13) && set _LANGUAGE_=Lua&& set _PROJECTNAME=HelloLua&& goto project -if "%_PROJECTNAME%"=="HelloLua" set /a HelloLua_Result=(result8+result10+result11+result12+result13) -set /a Compile_Result=(TestCpp_Result+HelloCpp_Result+HelloLua_Result) -if %Compile_Result% NEQ 0 goto error - -goto success - -:error -echo Compile Error! -echo %Compile_Result% -::git checkout -f -::git clean -df -x -exit 1 - -:success -echo Compile Success! -echo %Compile_Result% -::git checkout -f -::git clean -df -x -exit 0 - -::End. \ No newline at end of file diff --git a/tools/jenkins-scripts/windows/android/build-android-2.2-3.2-release.bat b/tools/jenkins-scripts/windows/android/build-android-2.2-3.2-release.bat deleted file mode 100755 index b15aa3f036..0000000000 --- a/tools/jenkins-scripts/windows/android/build-android-2.2-3.2-release.bat +++ /dev/null @@ -1,179 +0,0 @@ -::This script is used to accomplish a android automated compile. -::You should make sure have accomplished the environment settings. -:: Don't change it until you know what you do. - -::Here are the environment variables you should set. -::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %ANDROID_NDK% -if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set it like this "C:\cygwin"& pause & exit 1 -if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set it like this "D:\xx\android-sdk-windows"& pause & exit 2 -if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set it like this "D:\xx\android-ndk-r8"& pause & exit 3 -if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set it like it this "C:\xx\jdk1.7.0_05"& pause & exit 4 -if not exist "%ANT_HOME%" echo Couldn't find Ant at "%ANT_HOME%" and you should set it like this "D:\xx\apache-ant-1.8.4" $ pause $ exit 5 - -set _PROJECTNAME=TestCpp -set _LANGUAGE_=Cpp -set _ROOT_=%cd%\..\..\..\.. -cd %_ROOT_% - -:project -::Copy build Configuration files to target directory -copy %_ROOT_%\tools\jenkins_scripts\ant.properties %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -copy %_ROOT_%\tools\jenkins_scripts\build.xml %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -copy %_ROOT_%\tools\jenkins_scripts\windows\android\rootconfig.sh %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android - -::Modify the configuration files -cd %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -rootconfig.sh %_PROJECTNAME% -cd .. -set _PROJECTLOCATION=%cd% - -::A command line that make the current user get the ownrship of project. -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F - -::Use cygwin compile the source code. -cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -call android update project -p proj.android -cd proj.android - -::Make sure the original android build target is android-8 -for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a -echo %xx% -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:8). -call ant release -set result8=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto API_10 -if %result8% NEQ 0 goto API_10 -cd bin -ren TestCpp-release.apk TestCpp-release-8.apk -cd .. - -:API_10 -::Change API level.(API level:10) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-8" (echo/target=android-10)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:10). -call ant release -set result10=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto API_11 -if %result10% NEQ 0 goto API_11 -cd bin -ren TestCpp-release.apk TestCpp-release-10.apk -cd .. - -:API_11 -::Change API level.(API level:11) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-10" (echo/target=android-11)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:11). -call ant release -set result11=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto API_12 -if %result11% NEQ 0 goto API_12 -cd bin -ren TestCpp-release.apk TestCpp-release-11.apk -cd .. - -:API_12 -::Change API level.(API level:12) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-11" (echo/target=android-12)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:12). -call ant release -set result12=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto API_13 -if %result12% NEQ 0 goto API_13 -cd bin -ren TestCpp-release.apk TestCpp-release-12.apk -cd .. - -:API_13 -::Change API level.(API level:13) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-12" (echo/target=android-13)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:13). -call ant release -set result13=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto NEXTPROJ -if %result13% NEQ 0 goto NEXTPROJ -cd bin -ren TestCpp-release.apk TestCpp-release-13.apk -cd .. - -:NEXTPROJ -::After all test versions completed,changed current API level to the original.(API level:8) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-13" (echo/target=android-8)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Calculate the errorlevel and change build target. -cd %_ROOT_% -if "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result8+result10+result11+result12+result13) && set _PROJECTNAME=HelloCpp&& goto project -if "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result8+result10+result11+result12+result13) && set _LANGUAGE_=Lua&& set _PROJECTNAME=HelloLua&& goto project -if "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result8+result10+result11+result12+result13) -set /a testresult=(testresult1+testresult2+testresult3) -if %testresult% NEQ 0 goto error - -goto success - -:lis -if "%num%"=="" goto :eof -if "%num:~-1%"==" " set num=%num:~0,-1%&goto lis -echo %num%>>ant1.properties -goto :eof - -:error -echo Compile Error! -echo %Compile_Result% -::git checkout -f -::git clean -df -x -exit 1 - -:success -echo Compile Success! -echo %Compile_Result% -::git checkout -f -::git clean -df -x -exit 0 - -::End. \ No newline at end of file diff --git a/tools/jenkins-scripts/windows/android/build-android-4.x-debug.bat b/tools/jenkins-scripts/windows/android/build-android-4.x-debug.bat deleted file mode 100755 index 08e1cdba24..0000000000 --- a/tools/jenkins-scripts/windows/android/build-android-4.x-debug.bat +++ /dev/null @@ -1,112 +0,0 @@ -::This script is used to accomplish a android automated compile. -::You should make sure have accomplished the environment settings. -:: Don't change it until you know what you do. - -::Here are the environment variables you should set. -::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %ANDROID_NDK% -if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set it like this "C:\cygwin"& pause & exit 1 -if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set it like this "D:\xx\android-sdk-windows"& pause & exit 2 -if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set it like this "D:\xx\android-ndk-r8"& pause & exit 3 -if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set it like it this "C:\xx\jdk1.7.0_05"& pause & exit 4 -if not exist "%ANT_HOME%" echo Couldn't find Ant at "%ANT_HOME%" and you should set it like this "D:\xx\apache-ant-1.8.4" $ pause $ exit 5 - -set _PROJECTNAME=TestCpp -set _LANGUAGE_=CPP -set _ROOT_=%cd%\..\..\..\.. -cd _ROOT_ - -:project -::Copy build Configuration files to target directory -copy %_ROOT_%\tools\jenkins_scripts\ant.properties %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -copy %_ROOT_%\tools\jenkins_scripts\build.xml %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -copy %_ROOT_%\tools\jenkins_scripts\windows\android\rootconfig.sh %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android - -::Modify the configuration files -cd %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -rootconfig.sh %_PROJECTNAME% -cd .. -set _PROJECTLOCATION=%cd% - -::A command line that make the current user get the ownrship of project. -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F - -::Use cygwin compile the source code. -cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -call android update project -p proj.android -cd proj.android - -for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a -echo %xx% -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Change API level.(API level:14) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-8" (echo/target=android-14)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:14). -call ant debug -set result14=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto API_15 -if %result14% NEQ 0 goto API_15 -cd bin -ren TestCpp-debug.apk TestCpp-debug-14.apk -cd .. - -:API_15 -::Change API level.(API level:15) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-14" (echo/target=android-15)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:15). -call ant debug -set result15=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto NEXTPROJ -if %result15% NEQ 0 goto NEXTPROJ -cd bin -ren TestCpp-debug.apk TestCpp-debug-15.apk -cd .. - -:NEXTPROJ -::After all test versions completed,changed current API level to the original.(API level:8) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-15" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Calculate the errorlevel and change build target. -cd %_ROOT_% -IF "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result14+result15) && set _PROJECTNAME=HelloCpp&& goto project -IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result14+result15) && set _LANGUAGE_=Lua&& set _PROJECTNAME=HelloLua&& goto project -IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result14+result15) -set /a testresult=(testresult1+testresult2+testresult3) -IF %testresult% NEQ 0 goto error - -goto success - -:error -echo Compile Error! -echo %Compile_Result% -::git checkout -f -::git clean -df -x -exit 1 - -:success -echo Compile Success! -echo %Compile_Result% -::git checkout -f -::git clean -df -x -exit 0 - -::End. \ No newline at end of file diff --git a/tools/jenkins-scripts/windows/android/build-android-4.x-release.bat b/tools/jenkins-scripts/windows/android/build-android-4.x-release.bat deleted file mode 100755 index 3fb2c39088..0000000000 --- a/tools/jenkins-scripts/windows/android/build-android-4.x-release.bat +++ /dev/null @@ -1,127 +0,0 @@ -::This script is used to accomplish a android automated compile. -::You should make sure have accomplished the environment settings. -:: Don't change it until you know what you do. - -::Here are the environment variables you should set. -::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %ANDROID_NDK% -if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set it like this "C:\cygwin"& pause & exit 1 -if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set it like this "D:\xx\android-sdk-windows"& pause & exit 2 -if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set it like this "D:\xx\android-ndk-r8"& pause & exit 3 -if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set it like it this "C:\xx\jdk1.7.0_05"& pause & exit 4 -if not exist "%ANT_HOME%" echo Couldn't find Ant at "%ANT_HOME%" and you should set it like this "D:\xx\apache-ant-1.8.4" $ pause $ exit 5 - -set _PROJECTNAME=TestCpp -set _LANGUAGE=Cpp -set _ROOT_=%cd%\..\..\..\.. -cd %_ROOT_% - -:project -::Copy build Configuration files to target directory -copy %_ROOT_%\tools\jenkins_scripts\ant.properties %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -copy %_ROOT_%\tools\jenkins_scripts\build.xml %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -copy %_ROOT_%\tools\jenkins_scripts\windows\android\rootconfig.sh %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android - -::Modify the configuration files -cd %_ROOT_%\samples\%_PROJECTNAME%\proj.android -rootconfig.sh %_PROJECTNAME% -cd .. -set _PROJECTLOCATION=%cd% - -::A command line that make the current user get the ownrship of project. -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F - -::Use cygwin compile the source code. -cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -call android update project -p proj.android -cd proj.android - -for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a -echo %xx% -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Change API level.(API level:14) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-8" (echo/target=android-14)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:14). -call ant release -set result14=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto API_15 -if %result14% NEQ 0 goto API_15 -cd bin -ren TestCpp-release.apk TestCpp-release-14.apk -cd .. - -:API_15 -::Change API level.(API level:15) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-14" (echo/target=android-15)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:15). -call ant release -set result15=%ERRORLEVEL% -if "%_PROJECTNAME%" NEQ "TestCpp" goto NEXTPROJ -if %result15% NEQ 0 goto NEXTPROJ -cd bin -ren TestCpp-release.apk TestCpp-release-15.apk -cd .. - -:NEXTPROJ -::After all test versions completed,changed current API level to the original.(API level:8) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-15" (echo/target=android-8)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Calculate the errorlevel and change build target. -cd %_ROOT_% -IF "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result14+result15) && set _PROJECTNAME=HelloCpp&& goto project -IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result14+result15) && set _LANGUAGE_=Lua&& set _PROJECTNAME=HelloLua&& goto project -IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result14+result15) -set /a testresult=(testresult1+testresult2+testresult3) -IF %testresult% NEQ 0 goto error - -goto success - -:lis -if "%num%"=="" goto :eof -if "%num:~-1%"==" " set num=%num:~0,-1%&goto lis -echo %num%>>ant1.properties -goto :eof - -:error -echo Compile Error! -echo %Compile_Result% -::git checkout -f -::git clean -df -x -exit 1 - -:success -echo Compile Success! -echo %Compile_Result% -::git checkout -f -::git clean -df -x -exit 0 - -::End. \ No newline at end of file diff --git a/tools/jenkins-scripts/windows/android/rootconfig.sh b/tools/jenkins-scripts/windows/android/rootconfig.sh deleted file mode 100755 index c69604e104..0000000000 --- a/tools/jenkins-scripts/windows/android/rootconfig.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -#This script is used to modify parameters in profile,so it will be convenient for ant to build different project. - -#Change the path expression of current path to cygwin path. -#NDK_ROOT=$($CYGWIN/bin/cygpath.exe $ANDROID_NDK) -#echo $NDK_ROOT -CUR=$(pwd) -#tmp=$(pwd) -#COCOS2DX=$($CYGWIN/bin/cygpath.exe $tmp) -#echo $COCOS2DX - -#var1=NDK_ROOT_LOCAL= -#_NDK_ROOT=${var1}${NDK_ROOT} - -#var2=COCOS2DX_ROOT_LOCAL= -#_COCOS2DX_ROOT=${var2}${COCOS2DX} -#echo $_NDK_ROOT -#echo $_COCOS2DX_ROOT - -#Modify the configuration files -#sed -i '3,4d' $CUR/build_native.sh -sed -i '13d' $CUR/project.properties -#sed -i "3 i\\$_NDK_ROOT" $CUR/build_native.sh -#sed -i "4 i\\$_COCOS2DX_ROOT" $CUR/build_native.sh - -#Modify the project name -if [ $1 = TestCpp ]; then - sed -i '2d' $CUR/build.xml - sed -i '2 i\' $CUR/build.xml -elif [ $1 = HelloCpp ]; then - sed -i '2d' $CUR/build.xml - sed -i '2 i\' $CUR/build.xml -elif [ $1 = HelloLua ]; then - sed -i '2d' $CUR/build.xml - sed -i '2 i\' $CUR/build.xml -elif [ $1 = TestLua ]; then - sed -i '2d' $CUR/build.xml - sed -i '2 i\' $CUR/build.xml -elif [ $1 = TestJavascript ]; then - sed -i '2d' $CUR/build.xml - sed -i '2 i\' $CUR/build.xml -elif [ $1 = SimpleGame ]; then - sed -i '2d' $CUR/build.xml - sed -i '2 i\' $CUR/build.xml -fi \ No newline at end of file diff --git a/tools/jenkins-scripts/windows/android/test-android-2.2-3.2-debug.bat b/tools/jenkins-scripts/windows/android/test-android-2.2-3.2-debug.bat deleted file mode 100644 index 6b0c5bf4e4..0000000000 --- a/tools/jenkins-scripts/windows/android/test-android-2.2-3.2-debug.bat +++ /dev/null @@ -1,73 +0,0 @@ -::This script is used to accomplish a android automated compiler. -::You should make sure have accomplished the environment setting. -::You should add %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools to the environment variable of Path. - -::Copy monkeyrunner python script to android sdk tools directory. -cd ..\.. -copy %cd%\Monkeyrunner_TestCpp.py %ANDROID_HOME%\tools -copy %cd%\ReportManager.py %ANDROID_HOME%\tools - -cd ..\.. -set PROJECT_HOME=%cd% -cd samples\Cpp\TestCpp\proj.android\bin - -::Copy test apk to android sdk tools directory. -copy %cd%\TestCpp-debug-8.apk %ANDROID_HOME%\tools -copy %cd%\TestCpp-debug-10.apk %ANDROID_HOME%\tools -copy %cd%\TestCpp-debug-11.apk %ANDROID_HOME%\tools -copy %cd%\TestCpp-debug-12.apk %ANDROID_HOME%\tools -copy %cd%\TestCpp-debug-13.apk %ANDROID_HOME%\tools - -::Enter android sdk tools directory. -set ANDROID_ROOT=%ANDROID_HOME:~0,2% -%ANDROID_ROOT% -cd %ANDROID_HOME%\tools - -::If monkeyrunner test failed,it automatically exit and make ERRORLEVEL nonzero. - -::Running monkeyrunner test(debug,API level:8). -ren TestCpp-debug-8.apk TestCpp-debug.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-debug.apk - -::Running monkeyrunner test(debug,API level:10). -ren TestCpp-debug-10.apk TestCpp-debug.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-debug.apk - -::Running monkeyrunner test(debug,API level:11). -ren TestCpp-debug-11.apk TestCpp-debug.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-debug.apk - -::Running monkeyrunner test(debug,API level:12). -ren TestCpp-debug-12.apk TestCpp-debug.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-debug.apk - -::Running monkeyrunner test(debug,API level:13). -ren TestCpp-debug-13.apk TestCpp-debug.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-debug.apk - -rm Monkeyrunner_TestCpp.py -rm ReportManager.py - -::Monkeyrunner success! -echo Monkeyrunner Test Success! - -::Clean project files. -set PROJECT_ROOT=%PROJECT_HOME:~0,2% -%PROJECT_ROOT% -cd %PROJECT_HOME% - -git checkout -f -git clean -df -x -exit 0 - -::End \ No newline at end of file diff --git a/tools/jenkins-scripts/windows/android/test-android-2.2-3.2-release.bat b/tools/jenkins-scripts/windows/android/test-android-2.2-3.2-release.bat deleted file mode 100644 index d583f491a4..0000000000 --- a/tools/jenkins-scripts/windows/android/test-android-2.2-3.2-release.bat +++ /dev/null @@ -1,73 +0,0 @@ -::This script is used to accomplish a android automated compiler. -::You should make sure have accomplished the environment setting. -::You should add %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools to the environment variable of Path. - -::Copy monkeyrunner python script to android sdk tools directory. -cd ..\.. -copy %cd%\Monkeyrunner_TestCpp.py %ANDROID_HOME%\tools -copy %cd%\ReportManager.py %ANDROID_HOME%\tools - -cd ..\.. -set PROJECT_HOME=%cd% -cd samples\Cpp\TestCpp\proj.android\bin - -::Copy test apk to android sdk tools directory. -copy %cd%\TestCpp-release-8.apk %ANDROID_HOME%\tools -copy %cd%\TestCpp-release-10.apk %ANDROID_HOME%\tools -copy %cd%\TestCpp-release-11.apk %ANDROID_HOME%\tools -copy %cd%\TestCpp-release-12.apk %ANDROID_HOME%\tools -copy %cd%\TestCpp-release-13.apk %ANDROID_HOME%\tools - -::Enter android sdk tools directory. -set ANDROID_ROOT=%ANDROID_HOME:~0,2% -%ANDROID_ROOT% -cd %ANDROID_HOME%\tools - -::If monkeyrunner test failed,it automatically exit and make ERRORLEVEL nonzero. - -::Running monkeyrunner test(release,API level:8). -ren TestCpp-release-8.apk TestCpp-release.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-release.apk - -::Running monkeyrunner test(release,API level:10). -ren TestCpp-release-10.apk TestCpp-release.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-release.apk - -::Running monkeyrunner test(release,API level:11). -ren TestCpp-release-11.apk TestCpp-release.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-release.apk - -::Running monkeyrunner test(release,API level:12). -ren TestCpp-release-12.apk TestCpp-release.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-release.apk - -::Running monkeyrunner test(release,API level:13). -ren TestCpp-release-13.apk TestCpp-release.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-release.apk - -rm Monkeyrunner_TestCpp.py -rm ReportManager.py - -::Monkeyrunner success! -echo Monkeyrunner Test Success! - -::Clean project files. -set PROJECT_ROOT=%PROJECT_HOME:~0,2% -%PROJECT_ROOT% -cd %PROJECT_HOME% - -git checkout -f -git clean -df -x -exit 0 - -::End \ No newline at end of file diff --git a/tools/jenkins-scripts/windows/android/test-android-4.x-debug.bat b/tools/jenkins-scripts/windows/android/test-android-4.x-debug.bat deleted file mode 100644 index f668e891d5..0000000000 --- a/tools/jenkins-scripts/windows/android/test-android-4.x-debug.bat +++ /dev/null @@ -1,52 +0,0 @@ -::This script is used to accomplish a android automated compiler. -::You should make sure have accomplished the environment setting. -::You should add %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools to the environment variable of Path. - -::Copy monkeyrunner python script to android sdk tools directory. -cd ..\.. -copy %cd%\Monkeyrunner_TestCpp.py %ANDROID_HOME%\tools -copy %cd%\ReportManager.py %ANDROID_HOME%\tools - -cd ..\.. -set PROJECT_HOME=%cd% -cd samples\Cpp\TestCpp\proj.android\bin - -::Copy test apk to android sdk tools directory. -copy %cd%\TestCpp-debug-14.apk %ANDROID_HOME%\tools -copy %cd%\TestCpp-debug-15.apk %ANDROID_HOME%\tools - -::Enter android sdk tools directory. -set ANDROID_ROOT=%ANDROID_HOME:~0,2% -%ANDROID_ROOT% -cd %ANDROID_HOME%\tools - -::If monkeyrunner test failed,it automatically exit and make ERRORLEVEL nonzero. - -::Running monkeyrunner test(debug,API level:14). -ren TestCpp-debug-14.apk TestCpp-debug.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-debug.apk - -::Running monkeyrunner test(debug,API level:15). -ren TestCpp-debug-15.apk TestCpp-debug.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-debug.apk - -rm Monkeyrunner_TestCpp.py -rm ReportManager.py - -::Monkeyrunner success! -echo Monkeyrunner Test Success! - -::Clean project files. -set PROJECT_ROOT=%PROJECT_HOME:~0,2% -%PROJECT_ROOT% -cd %PROJECT_HOME% - -git checkout -f -git clean -df -x -exit 0 - -::End \ No newline at end of file diff --git a/tools/jenkins-scripts/windows/android/test-android-4.x-release.bat b/tools/jenkins-scripts/windows/android/test-android-4.x-release.bat deleted file mode 100644 index c93c6d30b5..0000000000 --- a/tools/jenkins-scripts/windows/android/test-android-4.x-release.bat +++ /dev/null @@ -1,52 +0,0 @@ -::This script is used to accomplish a android automated compiler. -::You should make sure have accomplished the environment setting. -::You should add %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools to the environment variable of Path. - -::Copy monkeyrunner python script to android sdk tools directory. -cd ..\.. -copy %cd%\Monkeyrunner_TestCpp.py %ANDROID_HOME%\tools -copy %cd%\ReportManager.py %ANDROID_HOME%\tools - -cd ..\.. -set PROJECT_HOME=%cd% -cd samples\Cpp\TestCpp\proj.android\bin - -::Copy test apk to android sdk tools directory. -copy %cd%\TestCpp-release-14.apk %ANDROID_HOME%\tools -copy %cd%\TestCpp-release-15.apk %ANDROID_HOME%\tools - -::Enter android sdk tools directory. -set ANDROID_ROOT=%ANDROID_HOME:~0,2% -%ANDROID_ROOT% -cd %ANDROID_HOME%\tools - -::If monkeyrunner test failed,it automatically exit and make ERRORLEVEL nonzero. - -::Running monkeyrunner test(release,API level:14). -ren TestCpp-release-14.apk TestCpp-release.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-release.apk - -::Running monkeyrunner test(release,API level:15). -ren TestCpp-release-15.apk TestCpp-release.apk -call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk -if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1 -rm TestCpp-release.apk - -rm Monkeyrunner_TestCpp.py -rm ReportManager.py - -::Monkeyrunner success! -echo Monkeyrunner Test Success! - -::Clean project files. -set PROJECT_ROOT=%PROJECT_HOME:~0,2% -%PROJECT_ROOT% -cd %PROJECT_HOME% - -git checkout -f -git clean -df -x -exit 0 - -::End \ No newline at end of file diff --git a/tools/jenkins-scripts/windows/win32/qtp_win32/Action0/ObjectRepository.bdb.REMOVED.git-id b/tools/jenkins-scripts/windows/win32/qtp_win32/Action0/ObjectRepository.bdb.REMOVED.git-id deleted file mode 100644 index 60a18c6b19..0000000000 --- a/tools/jenkins-scripts/windows/win32/qtp_win32/Action0/ObjectRepository.bdb.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7cda137d3b8d286470f2b504faaa77d981947cbf \ No newline at end of file diff --git a/tools/jenkins-scripts/windows/win32/qtp_win32/Action0/Resource.mtr b/tools/jenkins-scripts/windows/win32/qtp_win32/Action0/Resource.mtr deleted file mode 100644 index cb618ad25186b62a10146ed003fe473b818e15e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6656 zcmeI0%Wqpn6vmH}l+psFp-`X{aLW6UhZ6^<2pZXOS|S3m(x{sjRf&_7pv1BKKq(bn z!Vdlh7OW8)7HsH0fMCIjMO7puwn&H_H2l7~v3+e{Th~d52+CZ2zBhB{%$zy%%{S-f z#~*s{eDU?EU#y{=vu?Y)dBpDV)kk<1Tsdym#e@F7yScgPRhsd5Q1(#-{>Imytu;Kf zb=R672KRy^;3&8cXq^wr|0@Esw$4?us7+dqd%>==(&5WVJ5=5C(t~#8_gmkbxLN!@ z(oLgV$Gnzln`hMdc4lqg9ks5Ae?{6h_PrG6Ro=2CMqlK&;8k?^dyMg=ftr*22xG4H zm$n*Saw8XQg;mIfF>Yvcd~5!iPuTJ0Yi0i0(^@y(1!+L5{eM629spXp2LVTb^@4}M z3Ggs@1e^qqg2%w);1qZQoCZ&Vr@+%73i`kq@C@pT< zOWGW`Y&YQO5LX7~^TwKDPI`G{zvd z{xL6DnHaYke~d9lT>qm1bD3gB%gilYIZgchtO{c#?fFbXvP-4Y@poz1YB&3N{5Txz zhYfK{xu-acm~{M0!7;J4AAOBE{w4Swp;dx630nF2=V#ozoTzK;p&<6x@BbQq{WfWA zi|9lF4(F?C5!74FzO_w~y->3EVRRwTqY1p#UeWn`jqGRM-D^EJ+NWumrBBUJ8Pgm# z`4F?M_1Lb53A|KBQqf2+KU!jxm6kEB^&H0f9sFOUw`Gvs_DG%dGR11nGOIH8d0RlK zg1Ir|)3a7KQ$$9&nwK?(?JL-3j!3NIjh}msYF&$MQ0q!veHPcAsjY2ltGC1orQlVi zZ8#6Z*|%=h$t*hQO&N-^lc4C;_}ko*+FxV_3jtYx zH$$nav@Hi8^_yiSqi#m)uD&vIw5o!t83s|Vx7}(lI{#vr zOO=L~+{`7*6NN&U&fD4?sn{=j!p^U?R_)iGR@`(Iqyf$L|6M%08yp4-A4h<7gL}b! z;C}D`I0_yF4}pilG4KdD4ju)MfyY4p5Hj6|*Lqi-K0 z!}A>D%1UKTGh|I`AuO(s*lL6{b1N&U>ZF$=Eiy~KsbA|Ohw1$a>tA5BC6L?kOzn&^ ziEpQ|YMtwx&7)Sq{21_gy;+}0JfnQg%N(1J)xTw|;65{WVwKhS`L|uM>%I+YU9H=i z$+c!{^FHXHsVw+&Y3#l&e{=9_;K1)V?~i8%L72v)DBskRy0jOLL`q1(>Su9FdGVi&kBIb>?VIA5{|vQ9dub zXfL?+4G=BWUcduyQZG$fc286*<^)?L?^REUUbIo%Q8pB`GT9SUe`{CVOD6dm{?G|m z=3Xma+Y@V+@0N(mI+4-JH@My^Zx8K=9iFeJ+}`ps67LKsv3hZ(_#gMXG@!(eSZAeD ziM_Gvizvq1tXA)NvOw=i`hTO$RsSya@_Yg8{yz0svRzqrrYln9HMC55W#d9CT59iP&{_qgJt6RZ 10000 Then - Milliseconds = 10000 - Setting("DefaultTimeout") = Milliseconds -End If - -Err.Clear -On Error Resume Next -call CaseFunctionName - -If Err.Number <> 0 Then - - If Dialog("TestCpp.exe").Exist(3) Then - Dialog("TestCpp.exe").Activate - Dialog("TestCpp.exe").Move 872,177 - Dialog("TestCpp.exe").WinObject("DirectUIHWND").Click 21,235 - Wait 1 - End If - - If DIalog("Microsoft Visual C++ Runtime").Exist(3) Then - Dialog("Microsoft Visual C++ Runtime").Activate - Dialog("Microsoft Visual C++ Runtime").Move 872,177 - Wait 1 - End If - - WriteLog Err.Number - WriteLog Err.Description - WriteLog Err.Source - - Dim FileName ,TimeNow, ResPath - ResPath = Environment.Value("TestDir") - ResPath = ResPath & "\" - TestNameNow=environment.Value("TestName") - FileName = ResPath & ""&TestNameNow & ".png" - - desktop.CaptureBitmap filename,True - Systemutil.closedescendentprocesses - - If Dialog("TestCpp.exe").Exist(3) Then - Dialog("TestCpp.exe").WinObject("关闭程åº").Click - End If - - If Dialog("Microsoft Visual C++ Runtime").Exist(3) Then - Dialog("Microsoft Visual C++ Runtime").WinButton("中止(A)").Click - End If - -End If -Err.Clear -On Error goto 0 - -Function common_test(a,b,c) - For i = a To b - Window("Cocos2dxWin32").Click 338,291 - Wait c - Next -End Function - -Function random_click(a,b,c) - Dim touch_x,touch_y - Randomize - For Response = a To b - touch_x = Int((400 * Rnd + 0)) - touch_y = Int((250 * Rnd + 0)) - Window("Cocos2dxWin32").Click touch_x,touch_y - Wait c - Next -End Function - -Function random_drag(a,b,c) - Dim drag_x,drag_y,drop_x,drop_y - Randomize - For Response = a To b - drag_x = Int((400 * Rnd + 0)) - drag_y = Int((250 * Rnd + 0)) - drop_x = Int((400 * Rnd + 0)) - drop_y = Int((250 * Rnd + 0)) - Window("Cocos2dxWin32").Drag drag_x,drag_y - Window("Cocos2dxWin32").Drop drop_x,drop_y - Wait c - Next -End Function - -Function CaseFunctionName() - 'SystemUtil.BlockInput - Window("Cocos2dxWin32").Activate - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'ActionsTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 241,43 - Wait 2 - - Call common_test(1,27,1) - - Window("Cocos2dxWin32").Click 338,291 - Wait 5 - Window("Cocos2dxWin32").Click 338,291 - Wait 2 - - Call common_test(1,5,1) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - Wait 2 - - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'TransitionsTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 236,77 - Wait 2 - - Call common_test(1,26,1) - Wait 1 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - Wait 2 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'ActionsProgressTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 287,113 - Wait 2 - - Call common_test(1,7,2) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - Wait 2 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'EffectsTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 236,163 - Wait 3 - - Call common_test(1,21,4) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - Wait 2 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'ClickAndMoveTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 228,199 - Wait 3 - - Call random_click(1,10,2) - - Call random_click(1,100,0) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - Wait 2 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'RotateWorldTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 237,235 - Wait 3.5 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - Wait 2 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'ParticleTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 236,276 - Wait 3 - - Call common_test(1,42,2) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - Wait 2 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'ActionEaseTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Drag 363,307 - Window("Cocos2dxWin32").Drop 363,10 - Wait 1 - Window("Cocos2dxWin32").Click 237,19 - Wait 2 - - Call common_test(1,13,2) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - Wait 2 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'MotionStreakTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 240,61 - Wait 2 - - Window("Cocos2dxWin32").Click 230,239 - Window("Cocos2dxWin32").Click 338,291 - - Call random_drag(1,10,0) - Window("Cocos2dxWin32").Click 230,239 - Call random_drag(1,10,0) - - Window("Cocos2dxWin32").Click 338,291 - Wait 2 - - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'DrawPrimitivesTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 235,101 - Wait 1 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'NodeTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 237,139 - Wait 1 - - Call common_test(1,13,1) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'TouchesTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 238,183 - Window("Cocos2dxWin32").Drag 236,221 - Window("Cocos2dxWin32").Drop 175,226 - - Wait 5 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'MenuTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 234,220 - Window("Cocos2dxWin32").Click 238,63 - Window("Cocos2dxWin32").Click 158,132 - - Window("Cocos2dxWin32").Click 238,155 - Window("Cocos2dxWin32").Click 236,180 - Window("Cocos2dxWin32").Click 158,188 - Window("Cocos2dxWin32").Click 313,184 - Window("Cocos2dxWin32").Click 190,217 - Window("Cocos2dxWin32").Click 235,216 - Window("Cocos2dxWin32").Click 205,144 - Window("Cocos2dxWin32").Click 218,143 - Window("Cocos2dxWin32").Click 237,247 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'ActionManagerTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 234,261 - - Call common_test(1,4,3) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'LayerTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 240,302 - - Call random_drag(1,10,0) - Window("Cocos2dxWin32").Click 338,291 - Wait 2 - Window("Cocos2dxWin32").Click 338,291 - Wait 2 - Window("Cocos2dxWin32").Click 338,291 - Call random_drag(1,10,0) - Window("Cocos2dxWin32").Click 338,291 - Wait 1 - Window("Cocos2dxWin32").Click 242,164 - Wait 1 - Window("Cocos2dxWin32").Click 338,291 - Wait 1 - Window("Cocos2dxWin32").Click 254,163 - Wait 1 - Window("Cocos2dxWin32").Click 338,291 - Wait 1 - Window("Cocos2dxWin32").Click 231,164 - Wait 1 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'SceneTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Drag 370,306 - Window("Cocos2dxWin32").Drop 370,-20 - Wait 1 - Window("Cocos2dxWin32").Click 234,17 - Wait 1 - Window("Cocos2dxWin32").Click 230,111 - Window("Cocos2dxWin32").Click 230,111 - Window("Cocos2dxWin32").Click 230,111 - Window("Cocos2dxWin32").Click 233,163 - Window("Cocos2dxWin32").Click 226,218 - Window("Cocos2dxWin32").Click 226,218 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'ParallaxTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 232,55 - Wait 5 - Window("Cocos2dxWin32").Click 338,291 - - Call random_drag(1,10,0) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'TileMapTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 233,99 - Wait 2 - Window("Cocos2dxWin32").Click 338,291 - Wait 2 - - Call random_drag(1,10,0) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'IntervalTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 235,139 - Wait 3 - Window("Cocos2dxWin32").Click 224,48 - Wait 1 - Window("Cocos2dxWin32").Click 231,52 - Window("Cocos2dxWin32").Click 228,56 - Window("Cocos2dxWin32").Click 228,56 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'ChipmunkAccelTouchTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 235,178 - - Call random_click(1,20,2) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'LabelTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 239,216 - Wait 3 - Call common_test(1,25,0.5) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'TextInputTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 236,255 - - Window("Cocos2dxWin32").Click 238,161 - Const constring = "0123456789abcdefgchijklmnopqrstuvwxyz" - Dim TextInput_i,TextInput_j,randstring - Randomize - For TextInput_i=1 To 8 - randstring = randstring & Mid(constring, Int(Len(constring)*Rnd)+1, 1) - Next - Window("Cocos2dxWin32").Type randstring - Window("Cocos2dxWin32").Click 338,291 - Window("Cocos2dxWin32").Click 238,161 - Randomize - For TextInput_j=1 To 8 - randstring = randstring & Mid(constring, Int(Len(constring)*Rnd)+1, 1) - Next - Window("Cocos2dxWin32").Type randstring - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'SpriteTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 238,294 - - Call random_click(1,15,0.2) - Window("Cocos2dxWin32").Click 338,291 - Call random_click(1,15,0.2) - Window("Cocos2dxWin32").Click 338,291 - Call common_test(1,108,0.5) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'SchdulerTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Drag 359,309 - Window("Cocos2dxWin32").Drop 359,-11 - Wait 1 - 'Schedule with delay of 3sec,repeat 4 - Window("Cocos2dxWin32").Click 236,15 - Window("Cocos2dxWin32").Click 338,291 - 'Scheduler timeScale Test - Window("Cocos2dxWin32").Drag 260,212 - Window("Cocos2dxWin32").Drop 301,212 - Wait 1 - Window("Cocos2dxWin32").Drag 301,212 - Window("Cocos2dxWin32").Drop 209,214 - Wait 1 - Window("Cocos2dxWin32").Drag 209,214 - Window("Cocos2dxWin32").Drop 100,208 - Wait 2 - Window("Cocos2dxWin32").Click 338,291 - 'Two custom schedulers - Window("Cocos2dxWin32").Drag 126,16 - Window("Cocos2dxWin32").Drop 81,22 - Wait 1 - Window("Cocos2dxWin32").Drag 361,19 - Window("Cocos2dxWin32").Drop 422,22 - Wait 3 - Window("Cocos2dxWin32").Click 338,291 - 'Self -remove an scheduler - Window("Cocos2dxWin32").Click 338,291 - 'Pause/Resume - Window("Cocos2dxWin32").Click 338,291 - 'Pause/Resume - Wait 3 - Window("Cocos2dxWin32").Click 338,291 - 'Unschedule All selectors - Window("Cocos2dxWin32").Click 338,291 - 'Unschedule All selectors(HARD) - Wait 2 - Window("Cocos2dxWin32").Click 338,291 - 'Unschedule All selectors - Wait 4 - Window("Cocos2dxWin32").Click 338,291 - 'Schedule from Schedule - Window("Cocos2dxWin32").Click 338,291 - 'Schedule update with priority - Window("Cocos2dxWin32").Click 338,291 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'RenderTextureTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 240,59 - 'Save Image - - Call random_drag(1,10,0) - Window("Cocos2dxWin32").Click 388,17 - Window("Cocos2dxWin32").Click 398,41 - Wait 1 - Window("Cocos2dxWin32").Click 338,291 - 'Testing issue #937 - Window("Cocos2dxWin32").Click 338,291 - 'Testing Z Buffer in Render Texture - Call random_click(1,10,0) - Window("Cocos2dxWin32").Click 338,291 - 'Testing depthStencil attachment - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'Texture2DTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 234,97 - Call common_test(1,35,0.5) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'Box2dTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 235,134 - Call random_click(1,30,2) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'Box2dTestBed - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 236,176 - Call common_test(1,35,2) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'EffectAdvancedTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 237,217 - Call common_test(1,5,1) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'AccelerometerTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 244,255 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'KeypadTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 240,298 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'CocosDenshionTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Drag 377,314 - Window("Cocos2dxWin32").Drop 377,0 - Wait 1 - Window("Cocos2dxWin32").Click 243,20 - - Window("Cocos2dxWin32").Click 248,38 - Wait 1 - Window("Cocos2dxWin32").Click 248,78 - Wait 1 - Window("Cocos2dxWin32").Click 247,121 - Wait 1 - Window("Cocos2dxWin32").Click 246,158 - Wait 1 - Window("Cocos2dxWin32").Click 251,202 - Wait 1 - Window("Cocos2dxWin32").Click 246,238 - Wait 1 - Window("Cocos2dxWin32").Click 241,282 - Wait 1 - Window("Cocos2dxWin32").Drag 427,260 - Window("Cocos2dxWin32").Drop 427,6 - Window("Cocos2dxWin32").Click 232,18 - Wait 1 - Window("Cocos2dxWin32").Click 245,56 - Wait 1 - Window("Cocos2dxWin32").Click 242,109 - Wait 1 - Window("Cocos2dxWin32").Click 242,144 - Wait 1 - Window("Cocos2dxWin32").Click 243,189 - Wait 1 - Window("Cocos2dxWin32").Click 243,230 - Wait 1 - Window("Cocos2dxWin32").Click 254,275 - Wait 1 - Window("Cocos2dxWin32").Click 248,304 - Wait 1 - Window("Cocos2dxWin32").Drag 412,272 - Window("Cocos2dxWin32").Drop 412,-13 - Window("Cocos2dxWin32").Click 235,124 - Wait 1 - Window("Cocos2dxWin32").Click 238,158 - Wait 1 - Window("Cocos2dxWin32").Click 229,200 - Wait 1 - Window("Cocos2dxWin32").Click 239,243 - Wait 1 - Window("Cocos2dxWin32").Click 246,277 - Wait 1 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'PerformanceTest - ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 237,64 - Window("Cocos2dxWin32").Click 238,37 - - 'PerformanceNodeChildrenTest - Window("Cocos2dxWin32").Click 238,38 - Dim Performance_i - For Performance_i = 1 To 4 - Window("Cocos2dxWin32").Click 273,145 - Window("Cocos2dxWin32").Click 338,291 - Wait 1 - Next - 'Back - Window("Cocos2dxWin32").Click 427,290 - - 'PerformanceParticeTest - Window("Cocos2dxWin32").Click 237,78 - - For Performance_j = 1 To 4 - Window("Cocos2dxWin32").Click 273,145 - Window("Cocos2dxWin32").Click 338,291 - Wait 1 - Next - 'Back - Window("Cocos2dxWin32").Click 427,290 - 'PerformanceSpriteTest - Window("Cocos2dxWin32").Click 233,120 - Dim Performance_k - For Performance_k = 1 To 5 - Window("Cocos2dxWin32").Click 271,64 - Window("Cocos2dxWin32").Click 338,291 - Wait 1 - Next - 'Back - Window("Cocos2dxWin32").Click 427,290 - - 'PerformanceTextureTest - Window("Cocos2dxWin32").Click 229,159 - 'Back - Window("Cocos2dxWin32").Click 427,290 - - 'PerformanceTouchesTest - Window("Cocos2dxWin32").Click 234,200 - Call random_drag(1,10,0) - Window("Cocos2dxWin32").Click 338,291 - Call random_drag(1,10,0) - 'Back - Window("Cocos2dxWin32").Click 427,290 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'ZwoptexTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 233,104 - Wait 1 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'CurlTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 239,141 - Window("Cocos2dxWin32").Click 242,160 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'UserDefaultTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 238,184 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'BugsTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 240,222 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'FontTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 237,261 - Call common_test(1,4,0.5) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'CurrentLanguageTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 244,301 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'TextureCacheTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Drag 385,309 - Window("Cocos2dxWin32").Drop 385,33 - Wait 1 - Window("Cocos2dxWin32").Click 241,159 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'ExtensionsTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 241,197 - Wait 1 - 'NotificationCenterTest - Window("Cocos2dxWin32").Click 235,41 - Window("Cocos2dxWin32").Click 339,166 - Window("Cocos2dxWin32").Click 339,166 - Window("Cocos2dxWin32").Click 113,189 - 'Back - Window("Cocos2dxWin32").Click 429,289 - Wait 1 - 'CCControlButtonTest - Window("Cocos2dxWin32").Click 238,79 - Window("Cocos2dxWin32").Drag 118,181 - Window("Cocos2dxWin32").Drop 374,189 - Wait 1 - Window("Cocos2dxWin32").Drag 367,179 - Window("Cocos2dxWin32").Drop 76,183 - Wait 1 - 'Back - Window("Cocos2dxWin32").Click 422,293 - 'CocosBuilderTest - Window("Cocos2dxWin32").Click 237,119 - 'Menus_Items - Window("Cocos2dxWin32").Click 137,158 - Window("Cocos2dxWin32").Click 242,157 - Window("Cocos2dxWin32").Click 113,147 - Window("Cocos2dxWin32").Click 23,20 - 'Button - Window("Cocos2dxWin32").Click 132,209 - Window("Cocos2dxWin32").Click 240,149 - Window("Cocos2dxWin32").Drag 255,150 - Window("Cocos2dxWin32").Drop 259,233 - Window("Cocos2dxWin32").Click 23,20 - 'Particle Systems - Window("Cocos2dxWin32").Click 131,261 - Window("Cocos2dxWin32").Click 23,20 - 'Sprites_9 Slice - Window("Cocos2dxWin32").Click 341,161 - Window("Cocos2dxWin32").Click 23,20 - 'Labels - Window("Cocos2dxWin32").Click 345,210 - Window("Cocos2dxWin32").Click 23,20 - 'ScrollViewTest - Window("Cocos2dxWin32").Click 347,259 - Call random_drag(1,10,0) - Window("Cocos2dxWin32").Click 23,20 - - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'SharderTest - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 242,239 - Dim Sharder_i - Call common_test(1,6,0.5) - Window("Cocos2dxWin32").Drag 197,235 - Window("Cocos2dxWin32").Drop 358,236 - Wait 1 - Window("Cocos2dxWin32").Drag 358,236 - Window("Cocos2dxWin32").Drop 78,221 - - Window("Cocos2dxWin32").Click 338,291 - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'MutiTouchTest - ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 240,279 - Call random_drag(1,5,0) - 'MainMenu - Window("Cocos2dxWin32").Click 441,296 - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - 'Quit - '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - Window("Cocos2dxWin32").Click 461,22 - 'SystemUtil.UnblockInput -End function diff --git a/tools/jenkins-scripts/windows/win32/qtp_win32/Default.xls b/tools/jenkins-scripts/windows/win32/qtp_win32/Default.xls deleted file mode 100644 index 3320733acfa1d578c80db6541f4b8216ad2b38bd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4608 zcmeHKJ8u&~5T0``i5(ts9s~&FIL?WQore<9AX#t@B0z%_!c)S?N=OtUEP{ZB0x$w3 z3JN4DB#KZ_01Y&Vf&w}U5D5N&=_rE)Qi_n{o4Gst?Dz}{4?&c%zJ1Kj&dkm3&aU6R zZOGkw()y7~Xa`l%ycMDv4_`r>ArvMGpuzol%d%`H5t_^NA4T9BeC73Hs93~mfY-bh zVBRt1XD)6OBRnDbnF*%7uQ>i{l!@-KkHZQ^O|uU=QSxk|3UCLOm)Bt zU?s2$SPj$zxB{pFXat&oW?&7_0;~nr0qcQQU<0rbXah806QBc|0RxBt?LY^xoOiq{ z`e)mrAXc%anm&YIbIO<8pQ1C|)c+>!#4dcSu9v;oB;|J5S44LQXKS~yKX_{#4Hz=E z8l^)0*iEm%w=Un3)T3Z`?wdTJA2>Ol$>_T>69s|iyvH%6tU%yL8d#vBh6+At>N=!I z91r8Z5$TRZ`VwfQdZekTZ3sAyNq+3u@c7tquYiV|7-z^8=9q^cabxrfL*pyK&w2xgZwT9f_^fO})hm9q;nO`M#(% zO;#MGEsYcN`Iz z^6EgB)pS6KULsSh$r0R7NyJYv=%H>PlscuU2U)8dh)^FTkj31Ql@{8HvC zyq)so#l{t@?$>y0Uv(ShaW1-=L>zt!u7njVE1-FrEs>&;<_PQBXwg|mAWZg zD>Y?F>gH^)>HeE|J1BIR=8%hAvhZ#Q zQh54VU3l7lL)dpsxah7~CHZ_M$}y-TNjNq%GBK`4hpx(mYf?t@j(sw>c-o!$_KX?xwC~}VDsV}WpZ8C2 z&a^);XDYa$*rh`#@!0`>7J2ESJeVwshWNvFQ!u~}CMNrpnpEm(N1&0OdezH#8$!Vk tG7uk8rfEcY48KQkOcze2;tmW(L;P-Aj=2-3l9(@u-fxWg0^R>G<2w{Lt1kcm diff --git a/tools/jenkins-scripts/windows/win32/qtp_win32/Error_Sub.vbs b/tools/jenkins-scripts/windows/win32/qtp_win32/Error_Sub.vbs deleted file mode 100644 index a3921e93641d66bebcea1cae13db97f930980b85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2392 zcmdT`U2hUm5IwJG{0|!*YE9}ULQIWGA1Fd>B5l>$z8D)^wiKlc*0eOK znagFnfJBHdhAixzJ9j?LoSDn7pKVN#AVQ7-MtlqK1~JzoT=O@@E#@_9*v1h);*;s+ z*x{KD-*a5@RL|B8p6t`|73B$cGLxpJb&4*Ac!USI$CK{Uq@+u&4CgqZ))mGk$@!j9 zXOGV@HRR)hktXz`=t8`r&&YOS##KdODOh4D#3}aimU_;A1ufd@n?-p#pLtowXW7Q0 zk2dWO8M`9h)JNIIq7PMVOf1r=pAIoe`1H-|W_hi)xfp{gDn!4~XT<6&V;6VK`W2N~ zR^!!Y%Lo_QtUgu7>~Bx4&bn;H`9B~h1H53B#q1F=7Zb(fj2JXomob?d8!lpAXc!G_ zcN=v|#MMh`B-RxbqPUK=#g9e&sGbn0LA?{P;+D?68=EM8ISId;hWHE{x- zKC!)+9!9va>7%-4v;KA#$}-pUiu5_&GcKp&>*%dJi+i+|5HaPXx#=gJxyHj-(w>sz+` zQ?Y9P%f4}U$wSL@$jAc5CN%#%7sJwiU=?c<6J=L5)>L_0C~Kiqr%c?clDX~<61M_s z=;oX7j5vBkUFGj}8(a&2O~914Gwbx;%>FUY#U>YXBinU-(4xNBmEtii>-N(vE6&HW zY8RC&?zHtfe|fiNuYY{M|MlC4`R;UVXfbA0)U7K28RD)Y!rHSp;QyIhqTi(~BEp`* Q1*Y>8$gk)B9l75A4dTm!bN~PV diff --git a/tools/jenkins-scripts/windows/win32/qtp_win32/Error_appcrash.qrs b/tools/jenkins-scripts/windows/win32/qtp_win32/Error_appcrash.qrs deleted file mode 100644 index 4f6c0d3259f37ce63f58be01163bae831ea40b85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4608 zcmeHK%}Z2K6hBW(QzAzp7cC^PS_H|U1SJs}j*vu%GhoF789&e=d5+_#xd==U{1aRV zDs5W0i6D29>#+J0>_2D|w8`oByS^iLWE|hai5Q(Tym#(9_k7%Y?)kX${afSS#)oS^ zJYT3`#NsUE!Fs{Ol>J}&t6arqBkG!L}zv#_LK#m`3a(K zL`LOxF~K5pm!-;~|Jj#_i?HTR-SWTUG7RgUBoX;3WJ0S%^Y~8sXhsL5UBU%0Z?7aD z?0k62|x z=PUSZdY}vOpEZ&1$+RC6VNgUIhxb0-1sOYqK;vGq&66;BHzs4q!i+r;a18s0@z1*Q zao2kjzqj>l_5I!7iC@pnmej6dTXhNY&(t4{4qNweW7eum{-o{yu(gLOn&5x6O`Vax z&xv<07rK|;-d^qgntenb-M3=W6g1C?Sp#^E99Q6cc)&sawBXER$i58vUq%Me3)A=w zW1K`y7}roKh$+v!JN#c*kn4CN(6WEC> zy{6Z{LcL?PWAA6zPlLym0Ye=D@0{VC0yPb9%o%zIG`e|Sipz`)Nt?{#%`$TXPe1f? q4YQ`2%}Wn>JW#a4wx4FJ|3vnG)Iau%PbJ)qov9^M8(392+y4vgD8qOF diff --git a/tools/jenkins-scripts/windows/win32/qtp_win32/Parameters.mtr b/tools/jenkins-scripts/windows/win32/qtp_win32/Parameters.mtr deleted file mode 100644 index a231386bc8842cf3a45d8ccd4ec12f4851a1489e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5120 zcmeHK-AWrl6h5o1nzsJkcu`7`UU*T0SnxWeP!+*eQR!_P>mp)xOAJC@!1w4Q^bNeW zR0S`+(FbYb_f2xLW3t(u{77h;6E-tBGqY#TcYbqqIeq){*ULMpql^qoshpA#i|=91 z$Iz6>5GMRxDwoR@rU<43`iBtsi@QFl+He%(Q#`c!Sd~ZH4yb<-*pvXDg3QX29AV5$ z5tetS8F-AMQ_Braj?a$Y{N6eJ;|+7&e2ILJ9Hi!C8_$k>7hgVNwvW4Pfgj*LIoSiZ z8NC(Hqu)-3uWZ=*_2SIP-8eWmqrKrX-kq0YNDLtJ3ueT?htxxRThsY#WI@%RW7Caw z3ye9^3Um&jc@ASE7Q`U_Hfb61n1}g3SNXJ)=5@w*D-UH1sDBVhidncyELFoec2C@5 zug^1fI-yR_Gj10;xIm})ts(n-i^)Do890p&P@{ppLlnj3-}jJSsAk`HQHK+FQ^dnVe*|FoIPXVpD{{&`b>4pDhnh23f&?=pw__W~pJe?~?G zY2C}tT|P$r^CDKt6lr6dvAzydzz$WZ_T`V$h;g7%Mk)*h5|7~yTb^Y(Pd>f1Zao&ahKPLZ9 q13cIGW1R})FV6pyBXY5g_+zco`0Iwvskc%$-q-3oR5r&}&)x&pZT!Ii diff --git a/tools/jenkins-scripts/windows/win32/qtp_win32/Test.tsp b/tools/jenkins-scripts/windows/win32/qtp_win32/Test.tsp deleted file mode 100644 index 08429fa18729eaac2e98cd3090e32dafe23e2bc0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33280 zcmeI5-)~$;701VRQ?{X$Hk43Gfo&*IO5)f_nx-ZFVaIW6(xf4F(@HhC_S&)CI*x0v zlbBzsgwzKfc;OMDig$#B1QMVk#4{jx;14Jg4+!zd13Wb0`jhlCv+hf-U^qFK|cN;UP52PD6 zZ{BnljnT*c>jT7r_k{IMb>6*7w<+yWqR&61R8YD@X|K|UmFVZ=`hS%3Vr+h$qx*K=WczzhyRm$4E`A06uHpHjOon+@CgCEEj2dcUOa zVK3-Y7kW69{$t8JQ{lfKE0n!eU*qD3=Y#)$tMFn-cD|L@o`i>xy{17)?j;$LlhVl7 zH4@gOiLNGe!jrNOqtf{!`v0_a_eoPbX6B67WA67gX_P6mXmdYkUQvk&GiGL#UNPS? z$EE8=WGTjU{fN>bGp_eBT|Fcla$3JUs!xxbNnPdFNtHgWPsfz|xUP?w6Z$-EzGJ?w zKPVp7uW_2sN~f$gpnu9drW&B|sA@YT>osCAK%d{BKQ5}17Sp87c|unvE$+wkeOxI{ zKTh$SnHMLQQd=J(j^~tIJO)XGwL^CT!G<%52nW-;8ZZIo30cN}m$KCDHdSp0J;nL}9fq2S+6Z zk4pkhsGp9gKaT2sRPRUCcO#X*s4XEB&Z>QjqIgNE)DoJb!gSo?aB}MKL};>5s^(kL zQWwRadGng>3e^jk$YH@uvhXlB{{nwo^R{_yjjqwNte@+SP#}K zGo^mRd!YZq>q;*(Bg9vPCO#^vW&dk-RF}-_k`KlUUekHezoMSwyZ2(|RZqn8w3_|3 zBu~@E+o&W8-52La{nC-NElHxrHBNlq_O~mHR{dQ0+McDpX|;b{BkH_*2$?Lahn%*q z_sgVum=ez`|3W2q@>qEISC5O=j_S6dc*6dY&{xjk=mNTF)evrkjGFxhj1us zuRkR(rzDQK+17|^z;mfCP0eXn<7G!1l*Kc^KCep$@m|t6ELu)pvDf{GK}ww^=Zdo) zMRP{zD9N>BN=1#vD|QrN8`tc0uGSxi(7&X-+g2Wjw7p0}gH`IzVyH{LG``DO=jk6L~v<)S{9<1&g?ZX_qkytCFX*^;bn zs~wE`VQJ7_Ym?(fec6wfZm9Y;F7*AcR;q!Rd*&y9*js@2$8az^v#taJDQ&EN;j!JqC~|Jge)o_qU` z@BM3hwQy$8oPWE#_Rh%m^S{0E-~aq>&(5!hY>bM?7qKcL%>#PB-F_pI9G6@oyVci- z^w!4rsH2q^G3k>U`7R3TZM*+w#Ai3tiF}J$X+LK}@e!aO|4zjGmm@!V_V+*h>pegC zjTsm`czlCEx@*0QwG7!(1^FM8UDO{IuQ8qL8q4IvHsI4?QNhHVID}>)!B3FCta1hO zoIZg8EuQCfm-^4I84xoIsbfr;HYyptUlUR;EzjOc{MEm{M>->Bz8N;n+Gg64J1t-Fg!l>$km$j8)~{ zM8;ZoZz2n`27Ywz<_HM01>HavW(m51EX)pc9@(n=j;$P4Ao4moX9v=-h1r1!UFXI@ zExIsE&>d`HwxB!M!mL4eu!Y%!?qCbE2;IRJW)r%DEzBz9#}=PE_CMcx90;BB6ML$* zzF~erB%5!_Uu_ic$~)&@(h3hzu{lKy+&qzWCZZBtiAR#N_{*L06}ZcTyB=EeWQd=& zgO@HAIb>rh5S^ zHGioE4nLQfQfo2heWK?hx(jLr=;>*!Shf~t<8z$uc#JOIS|hrz>DQ}Dd1P2st7Xpw zQ)rE|+=Kts3R>tgw+L%lHcnR4c`cYu^SE(Is}+kjX1s2tI*)datVuhOVL`ZOfpNEz z({6MI*`}iKto60SqP3G_*Mw+OcfvWpAfKg;IQC2vDNFYZ^4gu}b5Uz;{5~R@FWFTl zztU3F%Fl-NTatHuZYgI$Ym$w}cREM1jrIMaF>TjblE|RnsaV9kZF6hBPp3SybZos6 z#YscgD^Z*@Y`qf2NyFAFQJgevy%NPq!`3TNoHT5`62(cw*6Aot=qx@BTh>{8=PX0* zT?JvQypbQ#Im?iSt#>R#ExO*Z47J#L$1>Dn>mAEbi>(uuq59sQdeNz@vfinYn2s;2 zwC^sutn$9Q=(0-u?xM>o^Sg^Kt3R~6=(2i5yNfQXPqe$}dc`YRQ}m~#m{jlG`<9L@ z%uaOrUXe6xVK$;0$inPHH;{$dhHfAWvkToo7G@K=fh^1(bOTwKE$9ZaFgxIpeLGjw zw)x5l&la_7b=$4IUhNRl_N-SpjBj-aBhS$Al&_11w3n|~nMUh!JTIAVz0vW6y{kg% zZ*8@L-Hc}RjQg1W7xWxk7|m>}4@nyA!PBT+SM8G~+sd=1C!SeZX4NGBy6w4~^jhQV zeWH3X))Kc?O-tZ&v%amzgKT_njG>wQUX%PT-{=A`-EGxGV?SpBnx<+kA~X#}zl!jiBhv9^Zr`)xzGs;AT3 z4m4n7ZQnhm=AQAZM$I#CdG18;oLy-f?)KPD!I3U`wQZ<)8h$M&kKDavE0STJjebHq zFdSCTEa^$ZvSf&w*(rp3^e*c=J2sT{y`;~VP0_Za**ds;+L~u3H&uqd%zjsZ2#I6Q z>AjH!s-@JLj@m1F!`g4?v@9+3@qx3^&!(^TseZT4Klwhlpxa#IZ|IrS{CsU@)vif0 zsJ}ICI&FO3K2zP?WAQYzaWF}v8Q;X@nCWC=BDvgJ2}K9^J7_Z!jaI#d8TQI;Xa0=`B^O+L7C+ zb~Gl~TdBFATG?TFM*FKkfyii_!gXP1_hni#r_byM%6?1i!^rm)^(T@Z!lQ!Sm3&s^ zXI0Cr%0UsiM(4D5w9v1N(8#prdJyIz^A9Nvr{jEmP9wQ}?Xqd!1<^bu zAA8okC_HXgu31HJCS={Gze|7C?ylx`R-08%xm^RJPwaEIr9NV3 zKYF5Iih5tO{enIxj#jpI2#x1vu3`PPU-e9@{2QvB{fy9CXfkNPVQd?9ChcZ64zn|n zvuns!T-(DR(1uw^CtVX2gm^8WgyT-BN{{ zX&F=JwFG*Jh_KsBlCjL*#rTo*CsKoM+SJHKJ{hTupfJ7Uy@F%GH0Xsa6e6GN8A}7H z_SSV-V~d@Z@wd4)E8NS{tzO$ib7ge>j>?Dl41>z&qLmxsN;tJ-?hsmTMsh~TcN8;l zeQ-#+3(t%_tk^XRokgEHpC4q*V&Y@n_n_a?bJmvhK49p~!1*-eP3x|vhIbCqXa~`- zmcwOQgLH1$^2i*LiH&oyk`-GsZIAC8?IJeWs63QP1s%rx!t=fzb>e3;*0RkZJvZ=y zs=0w~kMwyY)9f<6s{A1`t!&~oy^AbG`(NP&G3wFz)q7(haf}<6W7T|9D6&aYF+tD8 zh?Dj%484<0JXz2$YLvqTZ~tFLUHkFJoDPi8xTNugU19dQV5Q1E*X(zN3&WqRnf)@^ zSsv}+_Ht&_u@hai+jBNqWe$=>Bi^R`MI{#*b=s=E^Lg(RFkao5Z#-U;8X=X znqK{iHnk=lq>t=rFea`8%8e)IWcRedqh< z@3;uMi;;z#2IS6!8c}?Wzhm-SPw0Q`X+URX6_`<=UE?#hG)n#Rclzh=G&)zP{z*9J zWUujC+&Lcj9_|d7CNhduApPv%LUe&f$tNxOPM z=$YgAn9j7mC8I2UFZYmqZv6GnY3ZNSa-hkXAwJqTEWf>fPRoqOF_Cl5>gk`;GA13w zoRN5B|D2ZEGoaAO%q`nsGuopKZ(iTzV;+D&2r4%?96<(voo8?%k#|Z!=v?v0BsJ-e~4?Mcd&~Sv=V%WMSQ`PT8N7;-)aZ& zE5z+4z*Xju{R^%pEf3=o`bDKMMgFOc16=A_KY^w6bxb1gm-WB-e*1KE*EhW1l(hc6 z3e@+{f7QQE*!j1-%xkg>m;WHr3%ALm$)w7GXM2WAX0Gnzqb*YniNF^nwpld* diff --git a/tools/jenkins-scripts/windows/win32/qtp_win32/qtp_win32.usr b/tools/jenkins-scripts/windows/win32/qtp_win32/qtp_win32.usr deleted file mode 100644 index c1473d2703..0000000000 --- a/tools/jenkins-scripts/windows/win32/qtp_win32/qtp_win32.usr +++ /dev/null @@ -1,54 +0,0 @@ -[General] -Type=Tulip -RunType=ActiveScript -DefaultCfg=default.cfg -DefaultRunLogic=default.usp -ParamRightBrace=> -ParamLeftBrace=< -NewFunctionHeader=1 -MinorVersion=0 -MajorVersion=6 -DevelopTool=AQT - -[Actions] -Action0=Action0\Script.mts -Action1=Action1\Script.mts - -[VuserProfiles] -Profiles=Default Profile - -[CfgFiles] -Default Profile=default.cfg - -[RunLogicFiles] -Default Profile=default.usp - -[Rendezvous] - -[Transactions] - -[ActiveScript] -Lang=none - -[TulipInfo] -ProductName=QuickTest Professional -Version=10.00 - -[TulipAddins] -ActiveX= -Database= -Windows Applications= -TEA= -Web= -XML= - -[ExtraFiles] -Test.tsp= -Default.xls= -Parameters.mtr= -Action0\Script.mts= -Action0\Resource.mtr= -Action0\ObjectRepository.bdb= -Action1\Script.mts= -Action1\Resource.mtr= -Action1\ObjectRepository.bdb= diff --git a/tools/jenkins-scripts/windows/win32/qtp_win32/qtrunner.vbs b/tools/jenkins-scripts/windows/win32/qtp_win32/qtrunner.vbs deleted file mode 100644 index 17aadc06960647dd35d6da8f7c097f6da339e2b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16314 zcmdU0`%hfQ6`o&RssF>4N@cB*jcFcD-8w48xN+lWAc-njvM|f50hX{(+y8vq@0;&_ z%*>rxSd4KUtrqUyJ9FOW%sFS~{`WtN;pRTS4!;8Q!OYL|a2k&BbR%qsDXs_MJ6s)y zNjSl;%VsCI%i&J=6yLA#_Ye5LjK7+Fv%Cq%I%qz{XFnW;UGQ)K`uTqccMkAu0FE~C zd=FQf7&9)O9pT;~MvcNS2$CT@=;l8Sufo5=z3}&l=TU^Ndqd1U0WSZ#6K=;3=_+AO zF>3%AgRqJj+mW8_Zr*m-0(HZ%fH_-ux(|BI%_x|P_3$?8XdBcDpXMz9Bk_qYj}|UT zg1AQ=^()|ozYoG0aBPQXk&?aeq>}=vpbbo+!xtS)|2OOrBzX!d4lq`@+j=+#FB3>k zbS8aFAq8t>6ls4JHD~zOq5Wr2b{t-Y*U=h2gB_0Wn|5JZ#oZaGKRxIEIv6c2!?!P4 zve$uan3klaCYT%1Rt{k~k09e6@H0I3WMf~7&yE^TZii38=i#$+d!-KBcoII{7x*T4QbV!@ zCLj48@}U2ZV9#f;08(t-^sy}A*+N*V=p$4?&b@XJeuSrf1BkgFE=9i@04L)p<#B+| z02DIakU2;_V8O+ zDBah%o8rePUOUoEK!-h%KHeWoc!Fh{>*E+9a-G5A7`;gSeel6+#xAZGZ$Uvz$E3T4 zb<*j?7GX}85OUKBGD*opw4j1Vu$h8|iTV=q`J> zI;=82D{d}!v6d_DQRJ6a`bqo@z||?_z?GObGQfy!=#3V|)ocqIqXlhZ-cNA^$1UJX zpSmB%(DLMA>B$E4M#+c|MXwV7YDW!M2}1BHLMo{70WfYxTjom2RX0H|xlGz4p3S)O z()UmBB@JAGP5_OT&b8tYSHx!fmvz`Sc|Ok~AK~n44@{ z+5Y@iIfShK25lRy zH{;9>;?5-Me<%Juh#tEgqwYz(vyTztbswHvLo$tmq$rT*39{7plilYW48p@G*(ac% zF<P?xA+AVJ1D_JD2rS#8yTf!gvGdjvj4!E30`B z{bq_8lz;z2ytlf$i^wbmKjnbDVxBd?S8FL_*FNqtGms^a7HNJP7R%>jJUK#qplq2V zIUm%@ecHvzl9v0J!yI!Du#^GpVB88|NcK;GlevkY(U<-bzQ$kHBWJ)+OR$7rdYb%( z7-(sXMvs7(xz4bVQyXdt>t3XR{yhZcf+9+_ewTFcmprK)OKw;XBp<2g@s2b`oh@b> zIE3a-V>WE4ZOYp)2}?9R1WeIBj5)EP=^iVV-{MP4VjNt?*B))irtcQ)N>s8I*^P2h zg`%E_AbD2(|7!G?^B1FsOd*lviK4jnzCrkX$BATHLYn_q!pRkZJW6J{b$kaY?BWS) z=DuWEO|xPy@3UTBhP-E4(tPwSc72%ET16il<3mlVAD3iCU-sRStE*{eUfY_&huBGB zv^t5o{t4`?ZEshjpp;V!kL`ngxL1nw@u>JJI=FSv{tT^ko;_nKek;f!Ot4PoF{vKK>^5~b>gV%i1$qD4RgI+K%pm0pHI8-I9jgFm*`9M* zCyLqSY@LyB;Ym3~@mH{Zv8&8(jyq9h zw|#(d6RdOWS>Nuem_Bau%G%FZYMHoNQw0PXGfqcw-kSO6PFms1#8Y{V0^~s!A zomlxMtNGUr{8MmADX{NKUHlVQ?D`D>+YndPXzrl|JPZqN(#F?g4K5bk-s zh}tZ7h$TnTLBC>$g}B!{`)Kc~E`&dWI>~@DDJ%Np4zMMC3*Hc2r8F|Pk<{hs&sV*d z`YFVb+rA|#T636wLTlixmStVNqn%{bf@eN#rKTb67_=mjIwK+kuytjlq}vmzpZm9A13O(=pw^1Y%$SgPo&qi@)$||s;jN?uogV;GUom;3%5GN zDYIhkov+@aEyqHwF$1zrTCr;b&uLBhJbD59>UA7D#n>{=EAOgLe0Yz%zeAqm$>}qV zYsjc2@4fU(BUrEo&J@ zYOWEAx1|&s@=QOog4QD1*^4VKa_t5?Rdmc@9K zb!a>GD6+TI}=#AS|ISs(pcQRE@8tfJ=89t&6PKudd|;;Y@Js?UfYzB zm9lY9C7r=IiB+}x8G>I+*q-*GPh8ZL$a3VFmz}_9$%MIu?5l=d%F3rZa-A_gl&20_ zIBLkY4ckhNsUF?Z$vs%H*ZboxyUL-Y>l&W5SKE-{l{s}aS##Nf5jG9TxE&oYR`+enkXr><2 z^=5x3KQGtkROhfb)+gwA)||fYSlv27*P__Ep8%5fKQ;kn8(C97PUd#rKS8yMbFELY z4wW!mJ0#oVRl>;Ji{~=m4VP#0yg+$2@?yLnB1XABHm}^T=L*BD;UYQa9WrG#>GarT z@0sLMrk9w8bS`%az52`m&(!N}BCa#CI-XTx>|>{m*mbU{?DcP=Z_13BI~LaZY)zDV z1ALR`AwKJvyAE67UPH?!CowB0esRyegfS$@jwers@chGFywUV2?s4swx3GI~2)egG zKRut7BF|B6;pz}$w*X@j|ECUXX*Yx?4`g*B`O}u}b#G1O5@tPTzCS#b_2~uCna(_n z;1wx`NCv8pJ{~TTHQE*}?JpYH{QqCx++mQ1aR0_T6nq+sO$m zeH{IT`TJj^m(WU5Cx3)rd|%_^vl>P#<~aHJ3-d)Dei?kohjku^oE*G^9gWa~K87^d zJ<++$I=gcZQGTDV24{%ne)ni8!eAeU5tZ+N=nb9guMTBS&|eX1di$A(dNh82qm0;E zQB!1?2igWKMDrHHAMu{upTd{n3tWAPD8CF(_!%Fs8g1JzIb!tpJ2G6~7x3$PzSW1n zj<}OFW!kypsOp#=%r#q8&py^Y$0l`g-4~Mu)G~72Ajr=4RSjJJUTT?lw$^iJL3!qN zS?{E_0-eEJfu;AYl Date: Tue, 31 Dec 2013 10:54:37 +0800 Subject: [PATCH 057/428] closed #2865: Deprecates CCNotificationCenter, uses EventDispatcher instead. --- cocos/2d/CCDeprecated.h | 3 +- cocos/2d/CCDirector.cpp | 2 - cocos/2d/CCDrawNode.cpp | 24 ++++-------- cocos/2d/CCDrawNode.h | 6 --- cocos/2d/CCEventType.h | 2 +- cocos/2d/CCNotificationCenter.cpp | 38 +++++++++--------- cocos/2d/CCNotificationCenter.h | 18 ++++----- cocos/2d/CCParticleSystemQuad.cpp | 15 +++---- cocos/2d/CCParticleSystemQuad.h | 3 +- cocos/2d/CCRenderTexture.cpp | 26 +++++-------- cocos/2d/CCRenderTexture.h | 6 ++- cocos/2d/CCScriptSupport.h | 1 - cocos/2d/CCTextureAtlas.cpp | 13 +++---- cocos/2d/CCTextureAtlas.h | 6 ++- .../Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp | 2 - cocos/2d/platform/android/nativeactivity.cpp | 19 +++++---- cocos/2d/renderer/CCRenderer.cpp | 24 ++++++------ cocos/2d/renderer/CCRenderer.h | 10 +++-- .../TestCpp/Classes/ShaderTest/ShaderTest.cpp | 39 ++++++++----------- .../TestCpp/Classes/ShaderTest/ShaderTest.h | 1 - .../Classes/ShaderTest/ShaderTest2.cpp | 18 ++++----- tools/tojs/cocos2dx.ini | 3 +- tools/tolua/cocos2dx.ini | 3 +- 23 files changed, 126 insertions(+), 156 deletions(-) diff --git a/cocos/2d/CCDeprecated.h b/cocos/2d/CCDeprecated.h index b2710848bf..c894f7988c 100644 --- a/cocos/2d/CCDeprecated.h +++ b/cocos/2d/CCDeprecated.h @@ -545,7 +545,8 @@ CC_DEPRECATED_ATTRIBUTE typedef IMEDelegate CCIMEDelegate; CC_DEPRECATED_ATTRIBUTE typedef IMEKeyboardNotificationInfo CCIMEKeyboardNotificationInfo; CC_DEPRECATED_ATTRIBUTE typedef TextFieldDelegate CCTextFieldDelegate; CC_DEPRECATED_ATTRIBUTE typedef TextFieldTTF CCTextFieldTTF; -CC_DEPRECATED_ATTRIBUTE typedef NotificationCenter CCNotificationCenter; +CC_DEPRECATED_ATTRIBUTE typedef __NotificationCenter CCNotificationCenter; +CC_DEPRECATED_ATTRIBUTE typedef __NotificationCenter NotificationCenter; //CC_DEPRECATED_ATTRIBUTE typedef TargetedTouchDelegate CCTargetedTouchDelegate; //CC_DEPRECATED_ATTRIBUTE typedef StandardTouchDelegate CCStandardTouchDelegate; //CC_DEPRECATED_ATTRIBUTE typedef TouchDelegate CCTouchDelegate; diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index b0ecc02c4a..097d89b433 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -37,7 +37,6 @@ THE SOFTWARE. #include "CCArray.h" #include "CCScheduler.h" #include "ccMacros.h" -#include "CCNotificationCenter.h" #include "CCTransition.h" #include "CCTextureCache.h" #include "CCSpriteFrameCache.h" @@ -768,7 +767,6 @@ void Director::purgeDirector() // cocos2d-x specific data structures UserDefault::destroyInstance(); - NotificationCenter::destroyInstance(); GL::invalidateStateCache(); diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index ee4f218337..1580d0af23 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -23,12 +23,13 @@ #include "CCDrawNode.h" #include "CCShaderCache.h" #include "CCGL.h" -#include "CCNotificationCenter.h" #include "CCEventType.h" #include "CCConfiguration.h" #include "CCCustomCommand.h" #include "CCDirector.h" #include "CCRenderer.h" +#include "CCEventListenerCustom.h" +#include "CCEventDispatcher.h" NS_CC_BEGIN @@ -124,10 +125,6 @@ DrawNode::~DrawNode() GL::bindVAO(0); _vao = 0; } - -#if CC_ENABLE_CACHE_TEXTURE_DATA - NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND); -#endif } DrawNode* DrawNode::create() @@ -196,10 +193,12 @@ bool DrawNode::init() #if CC_ENABLE_CACHE_TEXTURE_DATA // Need to listen the event only when not use batchnode, because it will use VBO - NotificationCenter::getInstance()->addObserver(this, - callfuncO_selector(DrawNode::listenBackToForeground), - EVNET_COME_TO_FOREGROUND, - nullptr); + auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){ + /** listen the event that coming to foreground on Android */ + this->init(); + }); + + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); #endif return true; @@ -472,11 +471,4 @@ void DrawNode::setBlendFunc(const BlendFunc &blendFunc) _blendFunc = blendFunc; } -/** listen the event that coming to foreground on Android - */ -void DrawNode::listenBackToForeground(Object *obj) -{ - init(); -} - NS_CC_END diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index e91f41e8ca..a5dbcfe76b 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -78,12 +78,6 @@ public: * @lua NA */ void setBlendFunc(const BlendFunc &blendFunc); - - /** listen the event that coming to foreground on Android - * @js NA - * @lua NA - */ - void listenBackToForeground(Object *obj); void onDraw(); diff --git a/cocos/2d/CCEventType.h b/cocos/2d/CCEventType.h index c00c62e456..46cb1a1985 100644 --- a/cocos/2d/CCEventType.h +++ b/cocos/2d/CCEventType.h @@ -9,7 +9,7 @@ // The application will come to foreground. // This message is used for reloading resources before come to foreground on Android. // This message is posted in main.cpp. -#define EVNET_COME_TO_FOREGROUND "event_come_to_foreground" +#define EVENT_COME_TO_FOREGROUND "event_come_to_foreground" // The application will come to background. // This message is used for doing something before coming to background, such as save RenderTexture. diff --git a/cocos/2d/CCNotificationCenter.cpp b/cocos/2d/CCNotificationCenter.cpp index 9e544f1ffd..081d699ea1 100644 --- a/cocos/2d/CCNotificationCenter.cpp +++ b/cocos/2d/CCNotificationCenter.cpp @@ -31,50 +31,50 @@ using namespace std; NS_CC_BEGIN -static NotificationCenter *s_sharedNotifCenter = nullptr; +static __NotificationCenter *s_sharedNotifCenter = nullptr; -NotificationCenter::NotificationCenter() +__NotificationCenter::__NotificationCenter() : _scriptHandler(0) { _observers = __Array::createWithCapacity(3); _observers->retain(); } -NotificationCenter::~NotificationCenter() +__NotificationCenter::~__NotificationCenter() { _observers->release(); } -NotificationCenter *NotificationCenter::getInstance() +__NotificationCenter *__NotificationCenter::getInstance() { if (!s_sharedNotifCenter) { - s_sharedNotifCenter = new NotificationCenter; + s_sharedNotifCenter = new __NotificationCenter; } return s_sharedNotifCenter; } -void NotificationCenter::destroyInstance() +void __NotificationCenter::destroyInstance() { CC_SAFE_RELEASE_NULL(s_sharedNotifCenter); } // XXX: deprecated -NotificationCenter *NotificationCenter::sharedNotificationCenter(void) +__NotificationCenter *__NotificationCenter::sharedNotificationCenter(void) { - return NotificationCenter::getInstance(); + return __NotificationCenter::getInstance(); } // XXX: deprecated -void NotificationCenter::purgeNotificationCenter(void) +void __NotificationCenter::purgeNotificationCenter(void) { - NotificationCenter::destroyInstance(); + __NotificationCenter::destroyInstance(); } // // internal functions // -bool NotificationCenter::observerExisted(Object *target, const std::string& name, Object *sender) +bool __NotificationCenter::observerExisted(Object *target, const std::string& name, Object *sender) { Object* obj = nullptr; CCARRAY_FOREACH(_observers, obj) @@ -92,7 +92,7 @@ bool NotificationCenter::observerExisted(Object *target, const std::string& name // // observer functions // -void NotificationCenter::addObserver(Object *target, +void __NotificationCenter::addObserver(Object *target, SEL_CallFuncO selector, const std::string& name, Object *sender) @@ -108,7 +108,7 @@ void NotificationCenter::addObserver(Object *target, _observers->addObject(observer); } -void NotificationCenter::removeObserver(Object *target, const std::string& name) +void __NotificationCenter::removeObserver(Object *target, const std::string& name) { Object* obj = nullptr; CCARRAY_FOREACH(_observers, obj) @@ -125,7 +125,7 @@ void NotificationCenter::removeObserver(Object *target, const std::string& name) } } -int NotificationCenter::removeAllObservers(Object *target) +int __NotificationCenter::removeAllObservers(Object *target) { Object *obj = nullptr; __Array *toRemove = __Array::create(); @@ -146,7 +146,7 @@ int NotificationCenter::removeAllObservers(Object *target) return static_cast(toRemove->count()); } -void NotificationCenter::registerScriptObserver( Object *target, int handler,const std::string& name) +void __NotificationCenter::registerScriptObserver( Object *target, int handler,const std::string& name) { if (this->observerExisted(target, name, nullptr)) @@ -161,7 +161,7 @@ void NotificationCenter::registerScriptObserver( Object *target, int handler,con _observers->addObject(observer); } -void NotificationCenter::unregisterScriptObserver(Object *target,const std::string& name) +void __NotificationCenter::unregisterScriptObserver(Object *target,const std::string& name) { Object* obj = nullptr; CCARRAY_FOREACH(_observers, obj) @@ -177,7 +177,7 @@ void NotificationCenter::unregisterScriptObserver(Object *target,const std::stri } } -void NotificationCenter::postNotification(const std::string& name, Object *sender) +void __NotificationCenter::postNotification(const std::string& name, Object *sender) { __Array* ObserversCopy = __Array::createWithCapacity(_observers->count()); ObserversCopy->addObjectsFromArray(_observers); @@ -198,12 +198,12 @@ void NotificationCenter::postNotification(const std::string& name, Object *sende } } -void NotificationCenter::postNotification(const std::string& name) +void __NotificationCenter::postNotification(const std::string& name) { this->postNotification(name,nullptr); } -int NotificationCenter::getObserverHandlerByName(const std::string& name) +int __NotificationCenter::getObserverHandlerByName(const std::string& name) { if (name.empty()) { diff --git a/cocos/2d/CCNotificationCenter.h b/cocos/2d/CCNotificationCenter.h index f2265b1518..8a1b8694ae 100644 --- a/cocos/2d/CCNotificationCenter.h +++ b/cocos/2d/CCNotificationCenter.h @@ -31,29 +31,29 @@ THE SOFTWARE. NS_CC_BEGIN class ScriptHandlerMgr; -class CC_DLL NotificationCenter : public Object +class CC_DLL __NotificationCenter : public Object { friend class ScriptHandlerMgr; public: - /** NotificationCenter constructor + /** __NotificationCenter constructor * @js ctor */ - NotificationCenter(); + __NotificationCenter(); - /** NotificationCenter destructor + /** __NotificationCenter destructor * @js NA * @lua NA */ - ~NotificationCenter(); + ~__NotificationCenter(); - /** Gets the single instance of NotificationCenter. */ - static NotificationCenter *getInstance(); + /** Gets the single instance of __NotificationCenter. */ + static __NotificationCenter *getInstance(); - /** Destroys the single instance of NotificationCenter. */ + /** Destroys the single instance of __NotificationCenter. */ static void destroyInstance(); /** @deprecated use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static NotificationCenter *sharedNotificationCenter(void); + CC_DEPRECATED_ATTRIBUTE static __NotificationCenter *sharedNotificationCenter(void); /** @deprecated use destroyInstance() instead */ CC_DEPRECATED_ATTRIBUTE static void purgeNotificationCenter(void); diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index 30a45644e0..bf589d85b9 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -35,7 +35,6 @@ THE SOFTWARE. #include "ccGLStateCache.h" #include "CCGLProgram.h" #include "TransformUtils.h" -#include "CCNotificationCenter.h" #include "CCEventType.h" #include "CCConfiguration.h" #include "CCRenderer.h" @@ -44,6 +43,8 @@ THE SOFTWARE. // extern #include "kazmath/GL/matrix.h" +#include "CCEventListenerCustom.h" +#include "CCEventDispatcher.h" NS_CC_BEGIN @@ -74,10 +75,8 @@ bool ParticleSystemQuad::initWithTotalParticles(int numberOfParticles) #if CC_ENABLE_CACHE_TEXTURE_DATA // Need to listen the event only when not use batchnode, because it will use VBO - NotificationCenter::getInstance()->addObserver(this, - callfuncO_selector(ParticleSystemQuad::listenBackToForeground), - EVNET_COME_TO_FOREGROUND, - nullptr); + auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(ParticleSystemQuad::listenBackToForeground, this)); + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); #endif return true; @@ -106,10 +105,6 @@ ParticleSystemQuad::~ParticleSystemQuad() GL::bindVAO(0); } } - -#if CC_ENABLE_CACHE_TEXTURE_DATA - NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND); -#endif } // implementation ParticleSystemQuad @@ -576,7 +571,7 @@ void ParticleSystemQuad::setupVBO() CHECK_GL_ERROR_DEBUG(); } -void ParticleSystemQuad::listenBackToForeground(Object *obj) +void ParticleSystemQuad::listenBackToForeground(EventCustom* event) { if (Configuration::getInstance()->supportsShareableVAO()) { diff --git a/cocos/2d/CCParticleSystemQuad.h b/cocos/2d/CCParticleSystemQuad.h index e5f54d0837..93e7a1f948 100644 --- a/cocos/2d/CCParticleSystemQuad.h +++ b/cocos/2d/CCParticleSystemQuad.h @@ -33,6 +33,7 @@ THE SOFTWARE. NS_CC_BEGIN class SpriteFrame; +class EventCustom; /** * @addtogroup particle_nodes @@ -81,7 +82,7 @@ public: * @js NA * @lua NA */ - void listenBackToForeground(Object *obj); + void listenBackToForeground(EventCustom* event); // Overrides /** diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 146c39e050..9d3078dbfa 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -34,7 +34,6 @@ THE SOFTWARE. #include "CCTextureCache.h" #include "platform/CCFileUtils.h" #include "CCGL.h" -#include "CCNotificationCenter.h" #include "CCEventType.h" #include "CCGrid.h" @@ -44,6 +43,8 @@ THE SOFTWARE. // extern #include "kazmath/GL/matrix.h" +#include "CCEventListenerCustom.h" +#include "CCEventDispatcher.h" NS_CC_BEGIN @@ -66,15 +67,11 @@ RenderTexture::RenderTexture() #if CC_ENABLE_CACHE_TEXTURE_DATA // Listen this event to save render texture before come to background. // Then it can be restored after coming to foreground on Android. - NotificationCenter::getInstance()->addObserver(this, - callfuncO_selector(RenderTexture::listenToBackground), - EVENT_COME_TO_BACKGROUND, - nullptr); - - NotificationCenter::getInstance()->addObserver(this, - callfuncO_selector(RenderTexture::listenToForeground), - EVNET_COME_TO_FOREGROUND, // this is misspelt - nullptr); + auto toBackgroundListener = EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, CC_CALLBACK_1(RenderTexture::listenToBackground, this)); + _eventDispatcher->addEventListenerWithSceneGraphPriority(toBackgroundListener, this); + + auto toForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(RenderTexture::listenToForeground, this)); + _eventDispatcher->addEventListenerWithSceneGraphPriority(toForegroundListener, this); #endif } @@ -89,14 +86,9 @@ RenderTexture::~RenderTexture() glDeleteRenderbuffers(1, &_depthRenderBufffer); } CC_SAFE_DELETE(_UITextureImage); - -#if CC_ENABLE_CACHE_TEXTURE_DATA - NotificationCenter::getInstance()->removeObserver(this, EVENT_COME_TO_BACKGROUND); - NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND); -#endif } -void RenderTexture::listenToBackground(cocos2d::Object *obj) +void RenderTexture::listenToBackground(EventCustom *event) { #if CC_ENABLE_CACHE_TEXTURE_DATA CC_SAFE_DELETE(_UITextureImage); @@ -124,7 +116,7 @@ void RenderTexture::listenToBackground(cocos2d::Object *obj) #endif } -void RenderTexture::listenToForeground(cocos2d::Object *obj) +void RenderTexture::listenToForeground(EventCustom *event) { #if CC_ENABLE_CACHE_TEXTURE_DATA // -- regenerate frame buffer object and attach the texture diff --git a/cocos/2d/CCRenderTexture.h b/cocos/2d/CCRenderTexture.h index fdf4910d4e..58b38787a5 100644 --- a/cocos/2d/CCRenderTexture.h +++ b/cocos/2d/CCRenderTexture.h @@ -34,6 +34,8 @@ THE SOFTWARE. NS_CC_BEGIN +class EventCustom; + /** * @addtogroup textures * @{ @@ -111,12 +113,12 @@ public: /** Listen "come to background" message, and save render texture. It only has effect on Android. */ - void listenToBackground(Object *obj); + void listenToBackground(EventCustom *event); /** Listen "come to foreground" message and restore the frame buffer object It only has effect on Android. */ - void listenToForeground(Object *obj); + void listenToForeground(EventCustom *event); /** Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw" is true. */ inline unsigned int getClearFlags() const { return _clearFlags; }; diff --git a/cocos/2d/CCScriptSupport.h b/cocos/2d/CCScriptSupport.h index 8fcfba4a11..c67e5350bc 100644 --- a/cocos/2d/CCScriptSupport.h +++ b/cocos/2d/CCScriptSupport.h @@ -41,7 +41,6 @@ NS_CC_BEGIN class Timer; class Layer; class MenuItem; -class NotificationCenter; class CallFunc; class Acceleration; diff --git a/cocos/2d/CCTextureAtlas.cpp b/cocos/2d/CCTextureAtlas.cpp index f4f6422bbe..bc686d0521 100644 --- a/cocos/2d/CCTextureAtlas.cpp +++ b/cocos/2d/CCTextureAtlas.cpp @@ -30,7 +30,6 @@ THE SOFTWARE. #include "ccMacros.h" #include "CCGLProgram.h" #include "ccGLStateCache.h" -#include "CCNotificationCenter.h" #include "CCEventType.h" #include "CCDirector.h" #include "CCGL.h" @@ -39,6 +38,8 @@ THE SOFTWARE. #include "CCTexture2D.h" #include "CCString.h" #include +#include "CCEventDispatcher.h" +#include "CCEventListenerCustom.h" //According to some tests GL_TRIANGLE_STRIP is slower, MUCH slower. Probably I'm doing something very wrong @@ -70,7 +71,7 @@ TextureAtlas::~TextureAtlas() CC_SAFE_RELEASE(_texture); #if CC_ENABLE_CACHE_TEXTURE_DATA - NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND); + Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundlistener); #endif } @@ -185,10 +186,8 @@ bool TextureAtlas::initWithTexture(Texture2D *texture, ssize_t capacity) #if CC_ENABLE_CACHE_TEXTURE_DATA // listen the event when app go to background - NotificationCenter::getInstance()->addObserver(this, - callfuncO_selector(TextureAtlas::listenBackToForeground), - EVNET_COME_TO_FOREGROUND, - nullptr); + _backToForegroundlistener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(TextureAtlas::listenBackToForeground, this)); + Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundlistener, -1); #endif this->setupIndices(); @@ -207,7 +206,7 @@ bool TextureAtlas::initWithTexture(Texture2D *texture, ssize_t capacity) return true; } -void TextureAtlas::listenBackToForeground(Object *obj) +void TextureAtlas::listenBackToForeground(EventCustom* event) { if (Configuration::getInstance()->supportsShareableVAO()) { diff --git a/cocos/2d/CCTextureAtlas.h b/cocos/2d/CCTextureAtlas.h index 2862b13eb0..a20a41542a 100644 --- a/cocos/2d/CCTextureAtlas.h +++ b/cocos/2d/CCTextureAtlas.h @@ -35,6 +35,8 @@ THE SOFTWARE. NS_CC_BEGIN class Texture2D; +class EventCustom; +class EventListenerCustom; /** * @addtogroup textures @@ -184,7 +186,7 @@ public: void drawQuads(); /** listen the event that coming to foreground on Android */ - void listenBackToForeground(Object *obj); + void listenBackToForeground(EventCustom* event); /** whether or not the array buffer of the VBO needs to be updated*/ inline bool isDirty(void) { return _dirty; } @@ -235,6 +237,8 @@ protected: Texture2D* _texture; /** Quads that are going to be rendered */ V3F_C4B_T2F_Quad* _quads; + + EventListenerCustom* _backToForegroundlistener; }; // end of textures group diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp index 5ed0fc7279..0e8f28a580 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp +++ b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp @@ -3,8 +3,6 @@ #include "CCDirector.h" #include "../CCApplication.h" #include "platform/CCFileUtils.h" -#include "CCEventType.h" -#include "CCNotificationCenter.h" #include using namespace cocos2d; diff --git a/cocos/2d/platform/android/nativeactivity.cpp b/cocos/2d/platform/android/nativeactivity.cpp index 7a0416188a..1ec481c9d2 100644 --- a/cocos/2d/platform/android/nativeactivity.cpp +++ b/cocos/2d/platform/android/nativeactivity.cpp @@ -17,7 +17,6 @@ #include "CCDirector.h" #include "CCApplication.h" #include "CCEventType.h" -#include "CCNotificationCenter.h" #include "CCFileUtilsAndroid.h" #include "jni/JniHelper.h" @@ -28,6 +27,7 @@ #include "CCEventDispatcher.h" #include "CCEventAcceleration.h" #include "CCEventKeyboard.h" +#include "CCEventCustom.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" @@ -140,7 +140,8 @@ static void cocos_init(cocos_dimensions d, struct android_app* app) { cocos2d::ShaderCache::getInstance()->reloadDefaultShaders(); cocos2d::DrawPrimitives::init(); cocos2d::VolatileTextureMgr::reloadAllTextures(); - cocos2d::NotificationCenter::getInstance()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); + cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND); + cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent); cocos2d::Director::getInstance()->setGLDefaultValues(); } } @@ -557,12 +558,14 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) { break; case APP_CMD_LOST_FOCUS: - cocos2d::Application::getInstance()->applicationDidEnterBackground(); - cocos2d::NotificationCenter::getInstance()->postNotification(EVENT_COME_TO_BACKGROUND, NULL); - - // Also stop animating. - engine->animating = 0; - engine_draw_frame(engine); + { + cocos2d::Application::getInstance()->applicationDidEnterBackground(); + cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND); + cocos2d::EventDispatcher::getInstance()->dispatchEvent(&backgroundEvent); + // Also stop animating. + engine->animating = 0; + engine_draw_frame(engine); + } break; } } diff --git a/cocos/2d/renderer/CCRenderer.cpp b/cocos/2d/renderer/CCRenderer.cpp index 8dbe93557e..9d621cad05 100644 --- a/cocos/2d/renderer/CCRenderer.cpp +++ b/cocos/2d/renderer/CCRenderer.cpp @@ -29,7 +29,9 @@ #include "renderer/CCQuadCommand.h" #include "CCGroupCommand.h" #include "CCConfiguration.h" -#include "CCNotificationCenter.h" +#include "CCDirector.h" +#include "CCEventDispatcher.h" +#include "CCEventListenerCustom.h" #include "CCEventType.h" #include // for std::stable_sort @@ -45,6 +47,7 @@ Renderer::Renderer() ,_lastCommand(0) ,_numQuads(0) ,_glViewAssigned(false) +,_cacheTextureListener(nullptr) { _commandGroupStack.push(DEFAULT_RENDER_QUEUE); @@ -66,18 +69,19 @@ Renderer::~Renderer() GL::bindVAO(0); } #if CC_ENABLE_CACHE_TEXTURE_DATA - NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND); + Director::getInstance()->getEventDispatcher()->removeEventListener(_cacheTextureListener); #endif } void Renderer::initGLView() { #if CC_ENABLE_CACHE_TEXTURE_DATA - // listen the event when app go to background - NotificationCenter::getInstance()->addObserver(this, - callfuncO_selector(Renderer::onBackToForeground), - EVNET_COME_TO_FOREGROUND, - nullptr); + _cacheTextureListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){ + /** listen the event that coming to foreground on Android */ + this->setupBuffer(); + }); + + Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_cacheTextureListener, -1); #endif setupIndices(); @@ -87,12 +91,6 @@ void Renderer::initGLView() _glViewAssigned = true; } -void Renderer::onBackToForeground(Object* obj) -{ - CC_UNUSED_PARAM(obj); - setupBuffer(); -} - void Renderer::setupIndices() { for( int i=0; i < VBO_SIZE; i++) diff --git a/cocos/2d/renderer/CCRenderer.h b/cocos/2d/renderer/CCRenderer.h index 7cfa3ac707..f6b317d917 100644 --- a/cocos/2d/renderer/CCRenderer.h +++ b/cocos/2d/renderer/CCRenderer.h @@ -35,6 +35,8 @@ NS_CC_BEGIN +class EventListenerCustom; + typedef std::vector RenderQueue; struct RenderStackElement @@ -43,7 +45,7 @@ struct RenderStackElement size_t currentIndex; }; -class Renderer : public Object +class Renderer { public: static const int VBO_SIZE = 65536 / 6; @@ -76,8 +78,6 @@ protected: //Draw the previews queued quads and flush previous context void flush(); - void onBackToForeground(Object* obj); - std::stack _commandGroupStack; std::stack _renderStack; @@ -96,6 +96,10 @@ protected: int _numQuads; bool _glViewAssigned; + +#if CC_ENABLE_CACHE_TEXTURE_DATA + EventListenerCustom* _cacheTextureListener; +#endif }; NS_CC_END diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp index 4f69133030..ba6c1f01c1 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp @@ -122,7 +122,6 @@ ShaderNode::ShaderNode() ShaderNode::~ShaderNode() { - NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND); } ShaderNode* ShaderNode::shaderNodeWithVertex(const char *vert, const char *frag) @@ -136,10 +135,14 @@ ShaderNode* ShaderNode::shaderNodeWithVertex(const char *vert, const char *frag) bool ShaderNode::initWithVertex(const char *vert, const char *frag) { - NotificationCenter::getInstance()->addObserver(this, - callfuncO_selector(ShaderNode::listenBackToForeground), - EVNET_COME_TO_FOREGROUND, - NULL); +#if CC_ENABLE_CACHE_TEXTURE_DATA + auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){ + this->setShaderProgram(NULL); + loadShaderVertex(_vertFileName.c_str(), _fragFileName.c_str()); + }); + + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); +#endif loadShaderVertex(vert, frag); @@ -157,12 +160,6 @@ bool ShaderNode::initWithVertex(const char *vert, const char *frag) return true; } -void ShaderNode::listenBackToForeground(Object *obj) -{ - this->setShaderProgram(NULL); - loadShaderVertex(_vertFileName.c_str(), _fragFileName.c_str()); -} - void ShaderNode::loadShaderVertex(const char *vert, const char *frag) { auto shader = new GLProgram(); @@ -437,7 +434,6 @@ public: bool initWithTexture(Texture2D* texture, const Rect& rect); void draw(); void initProgram(); - void listenBackToForeground(Object *obj); static SpriteBlur* create(const char *pszFileName); @@ -454,7 +450,6 @@ private: SpriteBlur::~SpriteBlur() { - NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND); } SpriteBlur* SpriteBlur::create(const char *pszFileName) @@ -472,20 +467,18 @@ SpriteBlur* SpriteBlur::create(const char *pszFileName) return pRet; } -void SpriteBlur::listenBackToForeground(Object *obj) -{ - setShaderProgram(NULL); - initProgram(); -} - bool SpriteBlur::initWithTexture(Texture2D* texture, const Rect& rect) { if( Sprite::initWithTexture(texture, rect) ) { - NotificationCenter::getInstance()->addObserver(this, - callfuncO_selector(SpriteBlur::listenBackToForeground), - EVNET_COME_TO_FOREGROUND, - NULL); +#if CC_ENABLE_CACHE_TEXTURE_DATA + auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){ + setShaderProgram(NULL); + initProgram(); + }); + + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); +#endif auto s = getTexture()->getContentSizeInPixels(); diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h index 9459bd584a..741b0bb66f 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h @@ -118,7 +118,6 @@ public: bool initWithVertex(const char *vert, const char *frag); void loadShaderVertex(const char *vert, const char *frag); - void listenBackToForeground(Object *obj); virtual void update(float dt); virtual void setPosition(const Point &newPosition); diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp index fd35fbfbcc..569bef3915 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp @@ -133,21 +133,17 @@ ShaderSprite::ShaderSprite() ShaderSprite::~ShaderSprite() { - NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND); -} - -void ShaderSprite::listenBackToForeground(Object *obj) -{ - setShaderProgram(NULL); - initShader(); } void ShaderSprite::setBackgroundNotification() { - NotificationCenter::getInstance()->addObserver(this, - callfuncO_selector(ShaderSprite::listenBackToForeground), - EVNET_COME_TO_FOREGROUND, - NULL); +#if CC_ENABLE_CACHE_TEXTURE_DATA + auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){ + this->setShaderProgram(nullptr); + this->initShader(); + }); + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); +#endif } void ShaderSprite::initShader() diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index e5dc054b3a..da6a3a0ae1 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -108,7 +108,8 @@ skip = Node::[^setPosition$ setGrid setGLServerState description getUserObject . Application::[^application.* ^run$], Camera::[getEyeXYZ getCenterXYZ getUpXYZ], ccFontDefinition::[*], - NewTextureAtlas::[*] + NewTextureAtlas::[*], + RenderTexture::[listenToBackground listenToForeground] rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame], MenuItemFont::[setFontNameObj=setFontName setFontSizeObj=setFontSize getFontSizeObj=getFontSize getFontNameObj=getFontName], diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index 65487bdcce..fbd9fbd161 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -112,7 +112,8 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS EGLViewProtocol::[setTouchDelegate], EGLView::[end swapBuffers], NewTextureAtlas::[*], - DisplayLinkDirector::[mainLoop setAnimationInterval startAnimation stopAnimation] + DisplayLinkDirector::[mainLoop setAnimationInterval startAnimation stopAnimation], + RenderTexture::[listenToBackground listenToForeground] rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame], ProgressTimer::[setReverseProgress=setReverseDirection], From 973adc6b2f571c9ff6f202b6c6c83011e88eb389 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 31 Dec 2013 10:55:59 +0800 Subject: [PATCH 058/428] Updates nativeactivity.cpp. --- cocos/2d/platform/android/nativeactivity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/platform/android/nativeactivity.cpp b/cocos/2d/platform/android/nativeactivity.cpp index 1ec481c9d2..8f6e7ce3e1 100644 --- a/cocos/2d/platform/android/nativeactivity.cpp +++ b/cocos/2d/platform/android/nativeactivity.cpp @@ -561,7 +561,7 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) { { cocos2d::Application::getInstance()->applicationDidEnterBackground(); cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND); - cocos2d::EventDispatcher::getInstance()->dispatchEvent(&backgroundEvent); + cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent); // Also stop animating. engine->animating = 0; engine_draw_frame(engine); From 8145bf903e37976cd4d37ec36c51c2d5c753fd43 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 31 Dec 2013 11:02:01 +0800 Subject: [PATCH 059/428] texture listener was enabled only when the macro CC_ENABLE_CACHE_TEXTURE_DATA was enabled. --- cocos/2d/CCTextureAtlas.cpp | 3 +++ cocos/2d/CCTextureAtlas.h | 2 ++ cocos/2d/renderer/CCRenderer.cpp | 2 ++ 3 files changed, 7 insertions(+) diff --git a/cocos/2d/CCTextureAtlas.cpp b/cocos/2d/CCTextureAtlas.cpp index bc686d0521..c687288d3d 100644 --- a/cocos/2d/CCTextureAtlas.cpp +++ b/cocos/2d/CCTextureAtlas.cpp @@ -52,6 +52,9 @@ TextureAtlas::TextureAtlas() ,_dirty(false) ,_texture(nullptr) ,_quads(nullptr) +#if CC_ENABLE_CACHE_TEXTURE_DATA + ,_backToForegroundlistener(nullptr) +#endif {} TextureAtlas::~TextureAtlas() diff --git a/cocos/2d/CCTextureAtlas.h b/cocos/2d/CCTextureAtlas.h index a20a41542a..09cc0769f5 100644 --- a/cocos/2d/CCTextureAtlas.h +++ b/cocos/2d/CCTextureAtlas.h @@ -238,7 +238,9 @@ protected: /** Quads that are going to be rendered */ V3F_C4B_T2F_Quad* _quads; +#if CC_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundlistener; +#endif }; // end of textures group diff --git a/cocos/2d/renderer/CCRenderer.cpp b/cocos/2d/renderer/CCRenderer.cpp index 9d621cad05..4b31b03650 100644 --- a/cocos/2d/renderer/CCRenderer.cpp +++ b/cocos/2d/renderer/CCRenderer.cpp @@ -47,7 +47,9 @@ Renderer::Renderer() ,_lastCommand(0) ,_numQuads(0) ,_glViewAssigned(false) +#if CC_ENABLE_CACHE_TEXTURE_DATA ,_cacheTextureListener(nullptr) +#endif { _commandGroupStack.push(DEFAULT_RENDER_QUEUE); From 2555318c139b16f0f82b331f9f2aa577930fd20e Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 31 Dec 2013 03:36:47 +0000 Subject: [PATCH 060/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 585cb56a4d..877d9825d3 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 585cb56a4dd030ad396867b712659c185d6d1f9e +Subproject commit 877d9825d3c0df8e6bf565c90c4cfa8634c71ffa From bf1f5dd0e0392286147975293651e6bf4a85dcbd Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 31 Dec 2013 11:48:51 +0800 Subject: [PATCH 061/428] fix rendertexture bug --- cocos/2d/CCRenderTexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 3acfe3bb74..25d3692e1b 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -506,7 +506,7 @@ void RenderTexture::onBegin() float heightRatio = size.height / texSize.height; // Adjust the orthographic projection and viewport - glViewport(0, 0, (GLsizei)texSize.width, (GLsizei)texSize.height); + glViewport(0, 0, (GLsizei)size.width, (GLsizei)size.height); kmMat4 orthoMatrix; From bc9f0311f4ff90c6168695e133eb432d315ff0b9 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 31 Dec 2013 11:49:46 +0800 Subject: [PATCH 062/428] migrate render texture test sample to new renderer --- .../RenderTextureTest/RenderTextureTest.cpp | 50 +++++++++++++++---- .../RenderTextureTest/RenderTextureTest.h | 7 +++ 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp index 3438a8a84e..6e6ca6189c 100644 --- a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -447,29 +447,61 @@ RenderTextureTestDepthStencil::RenderTextureTestDepthStencil() sprite->setScale(10); auto rend = RenderTexture::create(s.width, s.height, Texture2D::PixelFormat::RGBA4444, GL_DEPTH24_STENCIL8); - glStencilMask(0xFF); + _renderCmds[0].init(0, _vertexZ); + _renderCmds[0].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this); + Director::getInstance()->getRenderer()->addCommand(&_renderCmds[0]); + rend->beginWithClear(0, 0, 0, 0, 0, 0); - - //! mark sprite quad into stencil buffer - glEnable(GL_STENCIL_TEST); - glStencilFunc(GL_NEVER, 1, 0xFF); - glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); + + _renderCmds[1].init(0, _vertexZ); + _renderCmds[1].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this); + Director::getInstance()->getRenderer()->addCommand(&_renderCmds[1]); + sprite->visit(); //! move sprite half width and height, and draw only where not marked sprite->setPosition(sprite->getPosition() + Point(sprite->getContentSize().width * sprite->getScale() * 0.5, sprite->getContentSize().height * sprite->getScale() * 0.5)); - glStencilFunc(GL_NOTEQUAL, 1, 0xFF); + + _renderCmds[2].init(0, _vertexZ); + _renderCmds[2].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforDraw, this); + Director::getInstance()->getRenderer()->addCommand(&_renderCmds[2]); + sprite->visit(); rend->end(); - - glDisable(GL_STENCIL_TEST); + + _renderCmds[3].init(0, _vertexZ); + _renderCmds[3].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this); + Director::getInstance()->getRenderer()->addCommand(&_renderCmds[3]); rend->setPosition(Point(s.width * 0.5f, s.height * 0.5f)); this->addChild(rend); } +void RenderTextureTestDepthStencil::onBeforeClear() +{ + glStencilMask(0xFF); +} + +void RenderTextureTestDepthStencil::onBeforeStencil() +{ + //! mark sprite quad into stencil buffer + //glEnable(GL_STENCIL_TEST); + glStencilFunc(GL_NEVER, 1, 0xFF); + glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); +} + +void RenderTextureTestDepthStencil::onBeforDraw() +{ + glStencilFunc(GL_NOTEQUAL, 1, 0xFF); +} + +void RenderTextureTestDepthStencil::onAfterDraw() +{ + //glDisable(GL_STENCIL_TEST); +} + std::string RenderTextureTestDepthStencil::title() const { return "Testing depthStencil attachment"; diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h index ea7dbaa7f1..05dfe33559 100644 --- a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h +++ b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h @@ -4,6 +4,7 @@ #include "cocos2d.h" #include "../testBasic.h" #include "../BaseTest.h" +#include "renderer/CCCustomCommand.h" class RenderTextureTest : public BaseTest { @@ -84,6 +85,12 @@ public: RenderTextureTestDepthStencil(); virtual std::string title() const override; virtual std::string subtitle() const override; +private: + CustomCommand _renderCmds[4]; + void onBeforeClear(); + void onBeforeStencil(); + void onBeforDraw(); + void onAfterDraw(); }; class RenderTextureTargetNode : public RenderTextureTest From 06dba7fc69be67566e236d9b0ad520911f6e1dc1 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Tue, 31 Dec 2013 14:07:45 +0800 Subject: [PATCH 063/428] Update the JS binding code & samples for latest cocos2d engine. --- plugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin b/plugin index cb3fdd9903..47efb364e3 160000 --- a/plugin +++ b/plugin @@ -1 +1 @@ -Subproject commit cb3fdd990368b7bc3c67a0c94ad1f7b579828d73 +Subproject commit 47efb364e3b037ed7d9e529c1c2697582fa00c95 From b51efbd6544d20100cf7d658aa2580a2d61e9a7b Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 31 Dec 2013 14:13:26 +0800 Subject: [PATCH 064/428] fix align text error in label --- cocos/2d/CCLabelTextFormatter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp index 7967c6a80d..7c95dc8b13 100644 --- a/cocos/2d/CCLabelTextFormatter.cpp +++ b/cocos/2d/CCLabelTextFormatter.cpp @@ -240,10 +240,10 @@ bool LabelTextFormatter::alignText(LabelTextFormatProtocol *theLabel) continue; } int index = static_cast(i + lineLength - 1 + lineNumber); + if(currentChar == 0) + index -= 1; if (index < 0) continue; - if(currentChar == 0) - continue; LetterInfo* info = &leterInfo->at( index ); if(info->def.validDefinition == false) continue; From 8d9f62731e4a7308c500184f25952efd531d83cf Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 31 Dec 2013 14:48:07 +0800 Subject: [PATCH 065/428] fix RenderTextureTestDepthStencil test sample --- .../RenderTextureTest/RenderTextureTest.cpp | 52 ++++++++++++------- .../RenderTextureTest/RenderTextureTest.h | 7 +++ 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp index 6e6ca6189c..cae1676dd5 100644 --- a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -442,41 +442,57 @@ RenderTextureTestDepthStencil::RenderTextureTestDepthStencil() { auto s = Director::getInstance()->getWinSize(); - auto sprite = Sprite::create("Images/fire.png"); - sprite->setPosition(Point(s.width * 0.25f, 0)); - sprite->setScale(10); - auto rend = RenderTexture::create(s.width, s.height, Texture2D::PixelFormat::RGBA4444, GL_DEPTH24_STENCIL8); + _spriteDS = Sprite::create("Images/fire.png"); + _spriteDS->retain(); + _spriteDS->setPosition(Point(s.width * 0.25f, 0)); + _spriteDS->setScale(10); + + _spriteDraw = Sprite::create("Images/fire.png"); + _spriteDraw->retain(); + _spriteDraw->setPosition(Point(s.width * 0.25f, 0)); + _spriteDraw->setScale(10); + //! move sprite half width and height, and draw only where not marked + _spriteDraw->setPosition(_spriteDraw->getPosition() + Point(_spriteDraw->getContentSize().width * _spriteDraw->getScale() * 0.5, _spriteDraw->getContentSize().height * _spriteDraw->getScale() * 0.5)); + + _rend = RenderTexture::create(s.width, s.height, Texture2D::PixelFormat::RGBA4444, GL_DEPTH24_STENCIL8); + _rend->setPosition(Point(s.width * 0.5f, s.height * 0.5f)); + + this->addChild(_rend); +} + +RenderTextureTestDepthStencil::~RenderTextureTestDepthStencil() +{ + CC_SAFE_RELEASE(_spriteDraw); + CC_SAFE_RELEASE(_spriteDS); +} + +void RenderTextureTestDepthStencil::draw() +{ _renderCmds[0].init(0, _vertexZ); _renderCmds[0].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this); Director::getInstance()->getRenderer()->addCommand(&_renderCmds[0]); - rend->beginWithClear(0, 0, 0, 0, 0, 0); + _rend->beginWithClear(0, 0, 0, 0, 0, 0); _renderCmds[1].init(0, _vertexZ); _renderCmds[1].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeStencil, this); Director::getInstance()->getRenderer()->addCommand(&_renderCmds[1]); - sprite->visit(); - - //! move sprite half width and height, and draw only where not marked - sprite->setPosition(sprite->getPosition() + Point(sprite->getContentSize().width * sprite->getScale() * 0.5, sprite->getContentSize().height * sprite->getScale() * 0.5)); - + _spriteDS->visit(); + _renderCmds[2].init(0, _vertexZ); _renderCmds[2].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforDraw, this); Director::getInstance()->getRenderer()->addCommand(&_renderCmds[2]); - sprite->visit(); - - rend->end(); + _spriteDraw->visit(); + + _rend->end(); _renderCmds[3].init(0, _vertexZ); _renderCmds[3].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onAfterDraw, this); Director::getInstance()->getRenderer()->addCommand(&_renderCmds[3]); - rend->setPosition(Point(s.width * 0.5f, s.height * 0.5f)); - - this->addChild(rend); } void RenderTextureTestDepthStencil::onBeforeClear() @@ -487,7 +503,7 @@ void RenderTextureTestDepthStencil::onBeforeClear() void RenderTextureTestDepthStencil::onBeforeStencil() { //! mark sprite quad into stencil buffer - //glEnable(GL_STENCIL_TEST); + glEnable(GL_STENCIL_TEST); glStencilFunc(GL_NEVER, 1, 0xFF); glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); } @@ -499,7 +515,7 @@ void RenderTextureTestDepthStencil::onBeforDraw() void RenderTextureTestDepthStencil::onAfterDraw() { - //glDisable(GL_STENCIL_TEST); + glDisable(GL_STENCIL_TEST); } std::string RenderTextureTestDepthStencil::title() const diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h index 05dfe33559..793009e6e2 100644 --- a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h +++ b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h @@ -83,14 +83,21 @@ class RenderTextureTestDepthStencil : public RenderTextureTest public: CREATE_FUNC(RenderTextureTestDepthStencil); RenderTextureTestDepthStencil(); + virtual ~RenderTextureTestDepthStencil(); virtual std::string title() const override; virtual std::string subtitle() const override; + virtual void draw() override; private: CustomCommand _renderCmds[4]; void onBeforeClear(); void onBeforeStencil(); void onBeforDraw(); void onAfterDraw(); + +private: + RenderTexture* _rend; + Sprite* _spriteDS; + Sprite* _spriteDraw; }; class RenderTextureTargetNode : public RenderTextureTest From 6b5b49bb0b68c33731fe3b723b586d7cce52f15c Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Tue, 31 Dec 2013 15:08:21 +0800 Subject: [PATCH 066/428] solve linux can't build --- CMakeLists.txt | 17 ++++++++++++- .../multi-platform-cpp/proj.linux/build.sh | 24 +++++++++++++++++-- .../multi-platform-lua/proj.linux/build.sh | 24 +++++++++++++++++-- 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 55d599f781..086dd47286 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,4 +284,19 @@ add_subdirectory(cocos/scripting) endif(BUILD_LIBS_LUA) # build samples -add_subdirectory(samples) +if(BUILD_HelloCpp) +add_subdirectory(samples/Cpp/HelloCpp) +endif(BUILD_HelloCpp) + +if(BUILD_TestCpp) +add_subdirectory(samples/Cpp/TestCpp) +endif(BUILD_TestCpp) + +if(BUILD_HelloLua) +add_subdirectory(samples/Lua/HelloLua) +endif(BUILD_HelloLua) + +if(BUILD_TestLua) +add_subdirectory(samples/Lua/TestLua) +endif(BUILD_TestLua) + diff --git a/template/multi-platform-cpp/proj.linux/build.sh b/template/multi-platform-cpp/proj.linux/build.sh index 8392bd3363..99dcf294d3 100755 --- a/template/multi-platform-cpp/proj.linux/build.sh +++ b/template/multi-platform-cpp/proj.linux/build.sh @@ -1,6 +1,26 @@ #!/bin/bash -mkdir build +# Exit on error +set -e + +rm -rf ../bin +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +#make global libs +cd ../cocos2d +#install depend libs +sudo ./build/install-deps-linux.sh +mkdir -p linux-build +cd linux-build +cmake .. -DBUILD_LIBS_LUA=OFF -DBUILD_HelloCpp=OFF -DBUILD_TestCpp=OFF -DBUILD_HelloLua=OFF -DBUILD_TestLua=OFF +make -j4 + +#make bin +cd $DIR +rm -rf bin +mkdir -p build cd build cmake ../.. -make +make -j4 +cd .. +mv ../bin bin diff --git a/template/multi-platform-lua/proj.linux/build.sh b/template/multi-platform-lua/proj.linux/build.sh index 8392bd3363..99dcf294d3 100755 --- a/template/multi-platform-lua/proj.linux/build.sh +++ b/template/multi-platform-lua/proj.linux/build.sh @@ -1,6 +1,26 @@ #!/bin/bash -mkdir build +# Exit on error +set -e + +rm -rf ../bin +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +#make global libs +cd ../cocos2d +#install depend libs +sudo ./build/install-deps-linux.sh +mkdir -p linux-build +cd linux-build +cmake .. -DBUILD_LIBS_LUA=OFF -DBUILD_HelloCpp=OFF -DBUILD_TestCpp=OFF -DBUILD_HelloLua=OFF -DBUILD_TestLua=OFF +make -j4 + +#make bin +cd $DIR +rm -rf bin +mkdir -p build cd build cmake ../.. -make +make -j4 +cd .. +mv ../bin bin From 75d28a31148f9e0e6f88bd1e876698890deda503 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 31 Dec 2013 16:10:55 +0800 Subject: [PATCH 067/428] Adds execute permission for create_project.pyw --- tools/project-creator/create_project.pyw | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/project-creator/create_project.pyw diff --git a/tools/project-creator/create_project.pyw b/tools/project-creator/create_project.pyw old mode 100644 new mode 100755 From ebf3faadc3aa2cd99a8b48aebb43b6142fbacfbe Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 31 Dec 2013 16:32:16 +0800 Subject: [PATCH 068/428] fix crash related to not support the z length modifier for size_t on vs --- cocos/2d/CCSpriteBatchNode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 41d57735cf..049934f31c 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -378,8 +378,8 @@ void SpriteBatchNode::increaseAtlasCapacity(void) // this is likely computationally expensive ssize_t quantity = (_textureAtlas->getCapacity() + 1) * 4 / 3; - CCLOG("cocos2d: SpriteBatchNode: resizing TextureAtlas capacity from [%zd] to [%zd].", - _textureAtlas->getCapacity(), + CCLOG("cocos2d: SpriteBatchNode: resizing TextureAtlas capacity from [%d] to [%d].", + static_cast(_textureAtlas->getCapacity()), quantity); if (! _textureAtlas->resizeCapacity(quantity)) From 81bdfac795685aec948c7c3a720c1f24c17a90b0 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Tue, 31 Dec 2013 16:36:33 +0800 Subject: [PATCH 069/428] Modify class name Label LabelBMFont LabelAtlas --- .../project.pbxproj.REMOVED.git-id | 2 +- .../cocostudio/CCSGUIReader.cpp | 28 +++---- cocos/gui/Android.mk | 6 +- cocos/gui/CMakeLists.txt | 6 +- cocos/gui/CocosGUI.h | 6 +- cocos/gui/{UILabel.cpp => UIText.cpp} | 76 +++++++++---------- cocos/gui/{UILabel.h => UIText.h} | 8 +- .../gui/{UILabelAtlas.cpp => UITextAtlas.cpp} | 40 +++++----- cocos/gui/{UILabelAtlas.h => UITextAtlas.h} | 8 +- .../{UILabelBMFont.cpp => UITextBMFont.cpp} | 40 +++++----- cocos/gui/{UILabelBMFont.h => UITextBMFont.h} | 8 +- .../UIButtonTest/UIButtonTest.cpp | 16 ++-- .../UIButtonTest/UIButtonTest.h | 8 +- .../UICheckBoxTest/UICheckBoxTest.cpp | 4 +- .../UICheckBoxTest/UICheckBoxTest.h | 2 +- .../UIImageViewTest/UIImageViewTest.cpp | 4 +- .../UILabelAtlasTest/UILabelAtlasTest.cpp | 4 +- .../UILabelBMFontTest/UILabelBMFontTest.cpp | 4 +- .../UILabelTest/UILabelTest.cpp | 12 +-- .../UILayoutTest/UILayoutTest.cpp | 18 ++--- .../UIListViewTest/UIListViewTest.cpp | 8 +- .../UIListViewTest/UIListViewTest.h | 4 +- .../UILoadingBarTest/UILoadingBarTest.cpp | 8 +- .../UIPageViewTest/UIPageViewTest.cpp | 6 +- .../UIPageViewTest/UIPageViewTest.h | 2 +- .../CocoStudioGUITest/UIScene.cpp | 4 +- .../CocoStudioGUITest/UIScene.h | 2 +- .../UIScrollViewTest/UIScrollViewTest.cpp | 20 ++--- .../UIScrollViewTest/UIScrollViewTest.h | 10 +-- .../UISliderTest/UISliderTest.cpp | 8 +- .../UISliderTest/UISliderTest.h | 4 +- .../UITextFieldTest/UITextFieldTest.cpp | 12 +-- .../UITextFieldTest/UITextFieldTest.h | 6 +- .../UIWidgetAddNodeTest.cpp | 2 +- 34 files changed, 198 insertions(+), 198 deletions(-) rename cocos/gui/{UILabel.cpp => UIText.cpp} (76%) rename cocos/gui/{UILabel.h => UIText.h} (98%) rename cocos/gui/{UILabelAtlas.cpp => UITextAtlas.cpp} (81%) rename cocos/gui/{UILabelAtlas.h => UITextAtlas.h} (97%) rename cocos/gui/{UILabelBMFont.cpp => UITextBMFont.cpp} (79%) rename cocos/gui/{UILabelBMFont.h => UITextBMFont.h} (95%) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index a237fdc780..d17bbcb756 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -812ab716d10a52b752f0d15b2393b2b0a7c8e969 \ No newline at end of file +4b92c964454c54c1b5df9576f11365c53e253724 \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index b1b830b86c..16d00f8fc9 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -218,12 +218,12 @@ Widget* WidgetPropertiesReader0250::widgetFromJsonDictionary(const rapidjson::Va } else if (classname && strcmp(classname, "Label") == 0) { - widget = cocos2d::gui::Label::create(); + widget = cocos2d::gui::Text::create(); setPropsForLabelFromJsonDictionary(widget, uiOptions); } else if (classname && strcmp(classname, "LabelAtlas") == 0) { - widget = cocos2d::gui::LabelAtlas::create(); + widget = cocos2d::gui::TextAtlas::create(); setPropsForLabelAtlasFromJsonDictionary(widget, uiOptions); } else if (classname && strcmp(classname, "LoadingBar") == 0) @@ -236,7 +236,7 @@ Widget* WidgetPropertiesReader0250::widgetFromJsonDictionary(const rapidjson::Va } else if (classname && strcmp(classname, "TextArea") == 0) { - widget = cocos2d::gui::Label::create(); + widget = cocos2d::gui::Text::create(); setPropsForLabelFromJsonDictionary(widget, uiOptions); } else if (classname && strcmp(classname, "TextButton") == 0) @@ -266,7 +266,7 @@ Widget* WidgetPropertiesReader0250::widgetFromJsonDictionary(const rapidjson::Va } else if (classname && strcmp(classname, "LabelBMFont") == 0) { - widget = cocos2d::gui::LabelBMFont::create(); + widget = cocos2d::gui::TextBMFont::create(); setPropsForLabelBMFontFromJsonDictionary(widget, uiOptions); } else if (classname && strcmp(classname, "DragPanel") == 0) @@ -543,7 +543,7 @@ void WidgetPropertiesReader0250::setPropsForImageViewFromJsonDictionary(Widget*w void WidgetPropertiesReader0250::setPropsForLabelFromJsonDictionary(Widget*widget,const rapidjson::Value& options) { setPropsForWidgetFromJsonDictionary(widget, options); - cocos2d::gui::Label* label = static_cast(widget); + cocos2d::gui::Text* label = static_cast(widget); bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, "touchScaleEnable"); label->setTouchScaleChangeEnabled(touchScaleChangeAble); const char* text = DICTOOL->getStringValue_json(options, "text"); @@ -581,7 +581,7 @@ void WidgetPropertiesReader0250::setPropsForLabelFromJsonDictionary(Widget*widge void WidgetPropertiesReader0250::setPropsForLabelAtlasFromJsonDictionary(Widget*widget,const rapidjson::Value& options) { setPropsForWidgetFromJsonDictionary(widget, options); - cocos2d::gui::LabelAtlas* labelAtlas = static_cast(widget); + cocos2d::gui::TextAtlas* labelAtlas = static_cast(widget); bool sv = DICTOOL->checkObjectExist_json(options, "stringValue"); bool cmf = DICTOOL->checkObjectExist_json(options, "charMapFile"); bool iw = DICTOOL->checkObjectExist_json(options, "itemWidth"); @@ -837,7 +837,7 @@ void WidgetPropertiesReader0250::setPropsForLabelBMFontFromJsonDictionary(Widget setPropsForWidgetFromJsonDictionary(widget, options); - cocos2d::gui::LabelBMFont* labelBMFont = static_cast(widget); + cocos2d::gui::TextBMFont* labelBMFont = static_cast(widget); std::string tp_c = m_strFilePath; const char* cmf_tp = nullptr; @@ -917,12 +917,12 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va } else if (classname && strcmp(classname, "Label") == 0) { - widget = cocos2d::gui::Label::create(); + widget = cocos2d::gui::Text::create(); setPropsForLabelFromJsonDictionary(widget, uiOptions); } else if (classname && strcmp(classname, "LabelAtlas") == 0) { - widget = cocos2d::gui::LabelAtlas::create(); + widget = cocos2d::gui::TextAtlas::create(); setPropsForLabelAtlasFromJsonDictionary(widget, uiOptions); } else if (classname && strcmp(classname, "LoadingBar") == 0) @@ -935,7 +935,7 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va } else if (classname && strcmp(classname, "TextArea") == 0) { - widget = cocos2d::gui::Label::create(); + widget = cocos2d::gui::Text::create(); setPropsForLabelFromJsonDictionary(widget, uiOptions); } else if (classname && strcmp(classname, "TextButton") == 0) @@ -965,7 +965,7 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va } else if (classname && strcmp(classname, "LabelBMFont") == 0) { - widget = cocos2d::gui::LabelBMFont::create(); + widget = cocos2d::gui::TextBMFont::create(); setPropsForLabelBMFontFromJsonDictionary(widget, uiOptions); } else if (classname && strcmp(classname, "DragPanel") == 0) @@ -1434,7 +1434,7 @@ void WidgetPropertiesReader0300::setPropsForImageViewFromJsonDictionary(Widget*w void WidgetPropertiesReader0300::setPropsForLabelFromJsonDictionary(Widget*widget,const rapidjson::Value& options) { setPropsForWidgetFromJsonDictionary(widget, options); - cocos2d::gui::Label* label = static_cast(widget); + cocos2d::gui::Text* label = static_cast(widget); bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, "touchScaleEnable"); label->setTouchScaleChangeEnabled(touchScaleChangeAble); const char* text = DICTOOL->getStringValue_json(options, "text"); @@ -1472,7 +1472,7 @@ void WidgetPropertiesReader0300::setPropsForLabelFromJsonDictionary(Widget*widge void WidgetPropertiesReader0300::setPropsForLabelAtlasFromJsonDictionary(Widget*widget,const rapidjson::Value& options) { setPropsForWidgetFromJsonDictionary(widget, options); - cocos2d::gui::LabelAtlas* labelAtlas = static_cast(widget); + cocos2d::gui::TextAtlas* labelAtlas = static_cast(widget); bool sv = DICTOOL->checkObjectExist_json(options, "stringValue"); bool cmf = DICTOOL->checkObjectExist_json(options, "charMapFile"); bool iw = DICTOOL->checkObjectExist_json(options, "itemWidth"); @@ -1850,7 +1850,7 @@ void WidgetPropertiesReader0300::setPropsForLabelBMFontFromJsonDictionary(Widget { setPropsForWidgetFromJsonDictionary(widget, options); - cocos2d::gui::LabelBMFont* labelBMFont = static_cast(widget); + cocos2d::gui::TextBMFont* labelBMFont = static_cast(widget); const rapidjson::Value& cmftDic = DICTOOL->getSubDictionary_json(options, "fileNameData"); int cmfType = DICTOOL->getIntValue_json(cmftDic, "resourceType"); diff --git a/cocos/gui/Android.mk b/cocos/gui/Android.mk index f2fad8d7b3..b74d7316bf 100644 --- a/cocos/gui/Android.mk +++ b/cocos/gui/Android.mk @@ -18,9 +18,9 @@ UIScrollView.cpp \ UIButton.cpp \ UICheckBox.cpp \ UIImageView.cpp \ -UILabel.cpp \ -UILabelAtlas.cpp \ -UILabelBMFont.cpp \ +UIText.cpp \ +UITextAtlas.cpp \ +UITextBMFont.cpp \ UILoadingBar.cpp \ UISlider.cpp \ UITextField.cpp diff --git a/cocos/gui/CMakeLists.txt b/cocos/gui/CMakeLists.txt index 8154f3c757..5f28565527 100644 --- a/cocos/gui/CMakeLists.txt +++ b/cocos/gui/CMakeLists.txt @@ -11,9 +11,9 @@ set(GUI_SRC UIButton.cpp UICheckBox.cpp UIImageView.cpp - UILabel.cpp - UILabelAtlas.cpp - UILabelBMFont.cpp + UIText.cpp + UITextAtlas.cpp + UITextBMFont.cpp UILoadingBar.cpp UISlider.cpp UITextField.cpp diff --git a/cocos/gui/CocosGUI.h b/cocos/gui/CocosGUI.h index 5258625986..dbd73c21ef 100644 --- a/cocos/gui/CocosGUI.h +++ b/cocos/gui/CocosGUI.h @@ -31,14 +31,14 @@ #include "gui/UIButton.h" #include "gui/UICheckBox.h" #include "gui/UIImageView.h" -#include "gui/UILabel.h" -#include "gui/UILabelAtlas.h" +#include "gui/UIText.h" +#include "gui/UITextAtlas.h" #include "gui/UILoadingBar.h" #include "gui/UIScrollView.h" #include "gui/UIListView.h" #include "gui/UISlider.h" #include "gui/UITextField.h" -#include "gui/UILabelBMFont.h" +#include "gui/UITextBMFont.h" #include "gui/UIPageView.h" #include "gui/UIHelper.h" diff --git a/cocos/gui/UILabel.cpp b/cocos/gui/UIText.cpp similarity index 76% rename from cocos/gui/UILabel.cpp rename to cocos/gui/UIText.cpp index 7cb64733c0..a57c2c5b3b 100644 --- a/cocos/gui/UILabel.cpp +++ b/cocos/gui/UIText.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "gui/UILabel.h" +#include "gui/UIText.h" NS_CC_BEGIN @@ -30,7 +30,7 @@ namespace gui { #define LABELRENDERERZ (-1) -Label::Label(): +Text::Text(): _touchScaleChangeEnabled(false), _normalScaleValueX(1.0f), _normalScaleValueY(1.0f), @@ -41,14 +41,14 @@ _labelRenderer(nullptr) { } -Label::~Label() +Text::~Text() { } -Label* Label::create() +Text* Text::create() { - Label* widget = new Label(); + Text* widget = new Text(); if (widget && widget->init()) { widget->autorelease(); @@ -58,7 +58,7 @@ Label* Label::create() return nullptr; } -bool Label::init() +bool Text::init() { if (Widget::init()) { @@ -67,13 +67,13 @@ bool Label::init() return false; } -void Label::initRenderer() +void Text::initRenderer() { _labelRenderer = LabelTTF::create(); Node::addChild(_labelRenderer, LABELRENDERERZ, -1); } -void Label::setText(const std::string& text) +void Text::setText(const std::string& text) { if (text.size()==0) return; @@ -82,79 +82,79 @@ void Label::setText(const std::string& text) labelScaleChangedWithSize(); } -const std::string& Label::getStringValue() +const std::string& Text::getStringValue() { return _labelRenderer->getString(); } -size_t Label::getStringLength() +size_t Text::getStringLength() { return _labelRenderer->getString().size(); } -void Label::setFontSize(int size) +void Text::setFontSize(int size) { _fontSize = size; _labelRenderer->setFontSize(size); labelScaleChangedWithSize(); } -void Label::setFontName(const std::string& name) +void Text::setFontName(const std::string& name) { _fontName = name; _labelRenderer->setFontName(name); labelScaleChangedWithSize(); } -void Label::setTextAreaSize(const Size &size) +void Text::setTextAreaSize(const Size &size) { _labelRenderer->setDimensions(size); labelScaleChangedWithSize(); } -void Label::setTextHorizontalAlignment(TextHAlignment alignment) +void Text::setTextHorizontalAlignment(TextHAlignment alignment) { _labelRenderer->setHorizontalAlignment(alignment); labelScaleChangedWithSize(); } -void Label::setTextVerticalAlignment(TextVAlignment alignment) +void Text::setTextVerticalAlignment(TextVAlignment alignment) { _labelRenderer->setVerticalAlignment(alignment); labelScaleChangedWithSize(); } -void Label::setTouchScaleChangeEnabled(bool enable) +void Text::setTouchScaleChangeEnabled(bool enable) { _touchScaleChangeEnabled = enable; _normalScaleValueX = getScaleX(); _normalScaleValueY = getScaleY(); } -void Label::setScale(float fScale) +void Text::setScale(float fScale) { Widget::setScale(fScale); _normalScaleValueX = _normalScaleValueY = fScale; } -void Label::setScaleX(float fScaleX) +void Text::setScaleX(float fScaleX) { Widget::setScaleX(fScaleX); _normalScaleValueX = fScaleX; } -void Label::setScaleY(float fScaleY) +void Text::setScaleY(float fScaleY) { Widget::setScaleY(fScaleY); _normalScaleValueY = fScaleY; } -bool Label::isTouchScaleChangeEnabled() +bool Text::isTouchScaleChangeEnabled() { return _touchScaleChangeEnabled; } -void Label::onPressStateChangedToNormal() +void Text::onPressStateChangedToNormal() { if (!_touchScaleChangeEnabled) { @@ -163,7 +163,7 @@ void Label::onPressStateChangedToNormal() clickScale(_normalScaleValueX, _normalScaleValueY); } -void Label::onPressStateChangedToPressed() +void Text::onPressStateChangedToPressed() { if (!_touchScaleChangeEnabled) { @@ -172,60 +172,60 @@ void Label::onPressStateChangedToPressed() clickScale(_normalScaleValueX + _onSelectedScaleOffset, _normalScaleValueY + _onSelectedScaleOffset); } -void Label::onPressStateChangedToDisabled() +void Text::onPressStateChangedToDisabled() { } -void Label::clickScale(float scaleX, float scaleY) +void Text::clickScale(float scaleX, float scaleY) { setScaleX(scaleX); setScaleY(scaleY); } -void Label::setFlipX(bool flipX) +void Text::setFlipX(bool flipX) { _labelRenderer->setFlippedX(flipX); } -void Label::setFlipY(bool flipY) +void Text::setFlipY(bool flipY) { _labelRenderer->setFlippedY(flipY); } -bool Label::isFlipX() +bool Text::isFlipX() { return _labelRenderer->isFlippedX(); } -bool Label::isFlipY() +bool Text::isFlipY() { return _labelRenderer->isFlippedY(); } -void Label::setAnchorPoint(const Point &pt) +void Text::setAnchorPoint(const Point &pt) { Widget::setAnchorPoint(pt); _labelRenderer->setAnchorPoint(pt); } -void Label::onSizeChanged() +void Text::onSizeChanged() { Widget::onSizeChanged(); labelScaleChangedWithSize(); } -const Size& Label::getContentSize() const +const Size& Text::getContentSize() const { return _labelRenderer->getContentSize(); } -Node* Label::getVirtualRenderer() +Node* Text::getVirtualRenderer() { return _labelRenderer; } -void Label::labelScaleChangedWithSize() +void Text::labelScaleChangedWithSize() { if (_ignoreSize) { @@ -248,19 +248,19 @@ void Label::labelScaleChangedWithSize() } -std::string Label::getDescription() const +std::string Text::getDescription() const { return "Label"; } -Widget* Label::createCloneInstance() +Widget* Text::createCloneInstance() { - return Label::create(); + return Text::create(); } -void Label::copySpecialProperties(Widget *widget) +void Text::copySpecialProperties(Widget *widget) { - Label* label = dynamic_cast(widget); + Text* label = dynamic_cast(widget); if (label) { setFontName(label->_fontName.c_str()); diff --git a/cocos/gui/UILabel.h b/cocos/gui/UIText.h similarity index 98% rename from cocos/gui/UILabel.h rename to cocos/gui/UIText.h index 26773234dc..1134d441aa 100644 --- a/cocos/gui/UILabel.h +++ b/cocos/gui/UIText.h @@ -35,23 +35,23 @@ namespace gui { * @js NA * @lua NA */ -class Label : public Widget +class Text : public Widget { public: /** * Default constructor */ - Label(); + Text(); /** * Default destructor */ - virtual ~Label(); + virtual ~Text(); /** * Allocates and initializes. */ - static Label* create(); + static Text* create(); /** * Changes the string value of label. diff --git a/cocos/gui/UILabelAtlas.cpp b/cocos/gui/UITextAtlas.cpp similarity index 81% rename from cocos/gui/UILabelAtlas.cpp rename to cocos/gui/UITextAtlas.cpp index f558e31995..cd1d2c0609 100644 --- a/cocos/gui/UILabelAtlas.cpp +++ b/cocos/gui/UITextAtlas.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "gui/UILabelAtlas.h" +#include "gui/UITextAtlas.h" NS_CC_BEGIN @@ -76,7 +76,7 @@ void UICCLabelAtlas::draw() -LabelAtlas::LabelAtlas(): +TextAtlas::TextAtlas(): _labelAtlasRenderer(nullptr), _stringValue(""), _charMapFileName(""), @@ -87,14 +87,14 @@ _startCharMap("") } -LabelAtlas::~LabelAtlas() +TextAtlas::~TextAtlas() { } -LabelAtlas* LabelAtlas::create() +TextAtlas* TextAtlas::create() { - LabelAtlas* widget = new LabelAtlas(); + TextAtlas* widget = new TextAtlas(); if (widget && widget->init()) { widget->autorelease(); @@ -104,13 +104,13 @@ LabelAtlas* LabelAtlas::create() return nullptr; } -void LabelAtlas::initRenderer() +void TextAtlas::initRenderer() { _labelAtlasRenderer = UICCLabelAtlas::create(); Node::addChild(_labelAtlasRenderer, LABELATLASRENDERERZ, -1); } -void LabelAtlas::setProperty(const std::string& stringValue, const std::string& charMapFile, int itemWidth, int itemHeight, const std::string& startCharMap) +void TextAtlas::setProperty(const std::string& stringValue, const std::string& charMapFile, int itemWidth, int itemHeight, const std::string& startCharMap) { _stringValue = stringValue; _charMapFileName = charMapFile; @@ -122,41 +122,41 @@ void LabelAtlas::setProperty(const std::string& stringValue, const std::string& labelAtlasScaleChangedWithSize(); } -void LabelAtlas::setStringValue(const std::string& value) +void TextAtlas::setStringValue(const std::string& value) { _stringValue = value; _labelAtlasRenderer->setString(value); labelAtlasScaleChangedWithSize(); } -const std::string& LabelAtlas::getStringValue() const +const std::string& TextAtlas::getStringValue() const { return _labelAtlasRenderer->getString(); } -void LabelAtlas::setAnchorPoint(const Point &pt) +void TextAtlas::setAnchorPoint(const Point &pt) { Widget::setAnchorPoint(pt); _labelAtlasRenderer->setAnchorPoint(Point(pt.x, pt.y)); } -void LabelAtlas::onSizeChanged() +void TextAtlas::onSizeChanged() { Widget::onSizeChanged(); labelAtlasScaleChangedWithSize(); } -const Size& LabelAtlas::getContentSize() const +const Size& TextAtlas::getContentSize() const { return _labelAtlasRenderer->getContentSize(); } -Node* LabelAtlas::getVirtualRenderer() +Node* TextAtlas::getVirtualRenderer() { return _labelAtlasRenderer; } -void LabelAtlas::labelAtlasScaleChangedWithSize() +void TextAtlas::labelAtlasScaleChangedWithSize() { if (_ignoreSize) { @@ -178,19 +178,19 @@ void LabelAtlas::labelAtlasScaleChangedWithSize() } } -std::string LabelAtlas::getDescription() const +std::string TextAtlas::getDescription() const { - return "LabelAtlas"; + return "TextAtlas"; } -Widget* LabelAtlas::createCloneInstance() +Widget* TextAtlas::createCloneInstance() { - return LabelAtlas::create(); + return TextAtlas::create(); } -void LabelAtlas::copySpecialProperties(Widget *widget) +void TextAtlas::copySpecialProperties(Widget *widget) { - LabelAtlas* labelAtlas = dynamic_cast(widget); + TextAtlas* labelAtlas = dynamic_cast(widget); if (labelAtlas) { setProperty(labelAtlas->_stringValue, labelAtlas->_charMapFileName, labelAtlas->_itemWidth, labelAtlas->_itemHeight, labelAtlas->_startCharMap); diff --git a/cocos/gui/UILabelAtlas.h b/cocos/gui/UITextAtlas.h similarity index 97% rename from cocos/gui/UILabelAtlas.h rename to cocos/gui/UITextAtlas.h index 3c88e6d395..5f3b0025ce 100644 --- a/cocos/gui/UILabelAtlas.h +++ b/cocos/gui/UITextAtlas.h @@ -60,23 +60,23 @@ public: * @js NA * @lua NA */ -class LabelAtlas : public Widget +class TextAtlas : public Widget { public: /** * Default constructor */ - LabelAtlas(); + TextAtlas(); /** * Default destructor */ - virtual ~LabelAtlas(); + virtual ~TextAtlas(); /** * Allocates and initializes. */ - static LabelAtlas* create(); + static TextAtlas* create(); /** initializes the LabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas */ void setProperty(const std::string& stringValue,const std::string& charMapFile, int itemWidth, int itemHeight, const std::string& startCharMap); diff --git a/cocos/gui/UILabelBMFont.cpp b/cocos/gui/UITextBMFont.cpp similarity index 79% rename from cocos/gui/UILabelBMFont.cpp rename to cocos/gui/UITextBMFont.cpp index 64d93c0bb2..f062a884b8 100644 --- a/cocos/gui/UILabelBMFont.cpp +++ b/cocos/gui/UITextBMFont.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "gui/UILabelBMFont.h" +#include "gui/UITextBMFont.h" NS_CC_BEGIN @@ -30,7 +30,7 @@ namespace gui { #define LABELBMFONTRENDERERZ (-1) -LabelBMFont::LabelBMFont(): +TextBMFont::TextBMFont(): _labelBMFontRenderer(nullptr), _fntFileHasInit(false), _fntFileName(""), @@ -38,14 +38,14 @@ _stringValue("") { } -LabelBMFont::~LabelBMFont() +TextBMFont::~TextBMFont() { } -LabelBMFont* LabelBMFont::create() +TextBMFont* TextBMFont::create() { - LabelBMFont* widget = new LabelBMFont(); + TextBMFont* widget = new TextBMFont(); if (widget && widget->init()) { widget->autorelease(); @@ -55,13 +55,13 @@ LabelBMFont* LabelBMFont::create() return nullptr; } -void LabelBMFont::initRenderer() +void TextBMFont::initRenderer() { _labelBMFontRenderer = cocos2d::LabelBMFont::create(); Node::addChild(_labelBMFontRenderer, LABELBMFONTRENDERERZ, -1); } -void LabelBMFont::setFntFile(const char *fileName) +void TextBMFont::setFntFile(const char *fileName) { if (!fileName || strcmp(fileName, "") == 0) { @@ -75,7 +75,7 @@ void LabelBMFont::setFntFile(const char *fileName) setText(_stringValue.c_str()); } -void LabelBMFont::setText(const char* value) +void TextBMFont::setText(const char* value) { if (!value) { @@ -90,34 +90,34 @@ void LabelBMFont::setText(const char* value) labelBMFontScaleChangedWithSize(); } -const char* LabelBMFont::getStringValue() +const char* TextBMFont::getStringValue() { return _stringValue.c_str(); } -void LabelBMFont::setAnchorPoint(const Point &pt) +void TextBMFont::setAnchorPoint(const Point &pt) { Widget::setAnchorPoint(pt); _labelBMFontRenderer->setAnchorPoint(pt); } -void LabelBMFont::onSizeChanged() +void TextBMFont::onSizeChanged() { Widget::onSizeChanged(); labelBMFontScaleChangedWithSize(); } -const Size& LabelBMFont::getContentSize() const +const Size& TextBMFont::getContentSize() const { return _labelBMFontRenderer->getContentSize(); } -Node* LabelBMFont::getVirtualRenderer() +Node* TextBMFont::getVirtualRenderer() { return _labelBMFontRenderer; } -void LabelBMFont::labelBMFontScaleChangedWithSize() +void TextBMFont::labelBMFontScaleChangedWithSize() { if (_ignoreSize) { @@ -139,19 +139,19 @@ void LabelBMFont::labelBMFontScaleChangedWithSize() } } -std::string LabelBMFont::getDescription() const +std::string TextBMFont::getDescription() const { - return "LabelBMFont"; + return "TextBMFont"; } -Widget* LabelBMFont::createCloneInstance() +Widget* TextBMFont::createCloneInstance() { - return LabelBMFont::create(); + return TextBMFont::create(); } -void LabelBMFont::copySpecialProperties(Widget *widget) +void TextBMFont::copySpecialProperties(Widget *widget) { - LabelBMFont* labelBMFont = dynamic_cast(widget); + TextBMFont* labelBMFont = dynamic_cast(widget); if (labelBMFont) { setFntFile(labelBMFont->_fntFileName.c_str()); diff --git a/cocos/gui/UILabelBMFont.h b/cocos/gui/UITextBMFont.h similarity index 95% rename from cocos/gui/UILabelBMFont.h rename to cocos/gui/UITextBMFont.h index 5bfb276ead..18dceeb2f4 100644 --- a/cocos/gui/UILabelBMFont.h +++ b/cocos/gui/UITextBMFont.h @@ -35,23 +35,23 @@ namespace gui { * @js NA * @lua NA */ -class LabelBMFont : public Widget +class TextBMFont : public Widget { public: /** * Default constructor */ - LabelBMFont(); + TextBMFont(); /** * Default destructor */ - virtual ~LabelBMFont(); + virtual ~TextBMFont(); /** * Allocates and initializes. */ - static LabelBMFont* create(); + static TextBMFont* create(); /** init a bitmap font atlas with an initial string and the FNT file */ void setFntFile(const char* fileName); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 7e3d0302d4..55cafbf86c 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -21,7 +21,7 @@ bool UIButtonTest::init() Size widgetSize = _widget->getSize(); // Add a label in which the button events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("No Event"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -30,7 +30,7 @@ bool UIButtonTest::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Button"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -97,7 +97,7 @@ bool UIButtonTest_Scale9::init() Size widgetSize = _widget->getSize(); // Add a label in which the button events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("No Event"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -106,7 +106,7 @@ bool UIButtonTest_Scale9::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Button scale9 render"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -172,7 +172,7 @@ bool UIButtonTest_PressedAction::init() Size widgetSize = _widget->getSize(); // Add a label in which the button events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("No Event"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -181,7 +181,7 @@ bool UIButtonTest_PressedAction::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Button Pressed Action"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -247,7 +247,7 @@ bool UIButtonTest_Title::init() Size widgetSize = _widget->getSize(); // Add a label in which the text button events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("No Event"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -256,7 +256,7 @@ bool UIButtonTest_Title::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Button with title"); alert->setFontName("Marker Felt"); alert->setFontSize(30); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h index 834bdc9953..061e11f8b2 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h @@ -37,7 +37,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIButtonTest) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; class UIButtonTest_Scale9 : public UIScene @@ -50,7 +50,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIButtonTest_Scale9) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; class UIButtonTest_PressedAction : public UIScene @@ -63,7 +63,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIButtonTest_PressedAction) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; class UIButtonTest_Title : public UIScene @@ -76,7 +76,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIButtonTest_Title) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; #endif /* defined(__TestCpp__UIButtonTest__) */ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp index acfcaa31b3..1e049998a7 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp @@ -21,7 +21,7 @@ bool UICheckBoxTest::init() Size widgetSize = _widget->getSize();; // Add a label in which the checkbox events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("No Event"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -30,7 +30,7 @@ bool UICheckBoxTest::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("CheckBox"); alert->setFontName("Marker Felt"); alert->setFontSize(30); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h index 2090b5bea9..90a7003da8 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h @@ -37,7 +37,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UICheckBoxTest) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; #endif /* defined(__TestCpp__UICheckBoxTest__) */ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp index fcda435217..a06f00d592 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp @@ -11,7 +11,7 @@ bool UIImageViewTest::init() { Size widgetSize = _widget->getSize(); - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("ImageView"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -72,7 +72,7 @@ bool UIImageViewTest_Scale9::init() { Size widgetSize = _widget->getSize(); - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("ImageView scale9 render"); alert->setFontName("Marker Felt"); alert->setFontSize(26); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp index 5fafb31e59..155cb5fcc5 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp @@ -12,7 +12,7 @@ bool UILabelAtlasTest::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("LabelAtlas"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -21,7 +21,7 @@ bool UILabelAtlasTest::init() _uiLayer->addChild(alert); // Create the label atlas - gui::LabelAtlas* labelAtlas = gui::LabelAtlas::create(); + gui::TextAtlas* labelAtlas = gui::TextAtlas::create(); labelAtlas->setProperty("1234567890", "cocosgui/labelatlas.png", 17, 22, "0"); labelAtlas->setPosition(Point((widgetSize.width) / 2, widgetSize.height / 2.0f)); _uiLayer->addChild(labelAtlas); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp index d47185a68a..8a51b45cc8 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp @@ -11,7 +11,7 @@ bool UILabelBMFontTest::init() { Size widgetSize = _widget->getSize(); - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("LabelBMFont"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -20,7 +20,7 @@ bool UILabelBMFontTest::init() _uiLayer->addChild(alert); // Create the LabelBMFont - gui::LabelBMFont* labelBMFont = gui::LabelBMFont::create(); + gui::TextBMFont* labelBMFont = gui::TextBMFont::create(); labelBMFont->setFntFile("cocosgui/bitmapFontTest2.fnt"); labelBMFont->setText("BMFont"); labelBMFont->setPosition(Point(widgetSize.width / 2, widgetSize.height / 2.0f + labelBMFont->getSize().height / 8.0f)); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp index 25efa90330..d41bcf0542 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp @@ -11,7 +11,7 @@ bool UILabelTest::init() { Size widgetSize = _widget->getSize(); - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Label"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -20,7 +20,7 @@ bool UILabelTest::init() _uiLayer->addChild(alert); // Create the label - gui::Label* label = gui::Label::create(); + gui::Text* label = gui::Text::create(); label->setText("Label"); label->setFontName("AmericanTypewriter"); label->setFontSize(30); @@ -40,7 +40,7 @@ bool UILabelTest_LineWrap::init() { Size widgetSize = _widget->getSize(); - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Label line wrap"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -49,7 +49,7 @@ bool UILabelTest_LineWrap::init() _uiLayer->addChild(alert); // Create the line wrap - gui::Label* label = gui::Label::create(); + gui::Text* label = gui::Text::create(); label->setTextAreaSize(Size(280, 150)); label->setTextHorizontalAlignment(TextHAlignment::CENTER); label->setText("Label can line wrap"); @@ -170,7 +170,7 @@ bool UILabelTest_TTF::init() { Size widgetSize = _widget->getSize(); - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Label set TTF font"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -179,7 +179,7 @@ bool UILabelTest_TTF::init() _uiLayer->addChild(alert); // Create the label - gui::Label* label = gui::Label::create(); + gui::Text* label = gui::Text::create(); label->setText("Label"); label->setFontName("fonts/A Damn Mess.ttf"); label->setFontSize(30); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp index 0463da8521..71aa2c817f 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp @@ -20,7 +20,7 @@ bool UILayoutTest::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Layout"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -86,7 +86,7 @@ bool UILayoutTest_Color::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Layout color render"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -153,7 +153,7 @@ bool UILayoutTest_Gradient::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Layout gradient render"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -220,7 +220,7 @@ bool UILayoutTest_BackGroundImage::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Layout background image"); alert->setFontName("Marker Felt"); alert->setFontSize(20); @@ -287,7 +287,7 @@ bool UILayoutTest_BackGroundImage_Scale9::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Layout background image scale9"); alert->setFontName("Marker Felt"); alert->setFontSize(20); @@ -354,7 +354,7 @@ bool UILayoutTest_Layout_Linear_Vertical::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Layout Linear Vertical"); alert->setFontName("Marker Felt"); alert->setFontSize(20); @@ -439,7 +439,7 @@ bool UILayoutTest_Layout_Linear_Horizontal::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Layout Linear Horizontal"); alert->setFontName("Marker Felt"); alert->setFontSize(20); @@ -524,7 +524,7 @@ bool UILayoutTest_Layout_Relative_Align_Parent::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Layout Relative Align Parent"); alert->setFontName("Marker Felt"); alert->setFontSize(20); @@ -673,7 +673,7 @@ bool UILayoutTest_Layout_Relative_Location::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Layout Relative Location"); alert->setFontName("Marker Felt"); alert->setFontSize(20); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp index 32b32c70cb..26ef4781b2 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp @@ -27,7 +27,7 @@ bool UIListViewTest_Vertical::init() { Size widgetSize = _widget->getSize(); - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("Move by vertical direction"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -36,7 +36,7 @@ bool UIListViewTest_Vertical::init() _uiLayer->addChild(_displayValueLabel); - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("ListView vertical"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -200,7 +200,7 @@ bool UIListViewTest_Horizontal::init() { Size widgetSize = _widget->getSize(); - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("Move by horizontal direction"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -209,7 +209,7 @@ bool UIListViewTest_Horizontal::init() _uiLayer->addChild(_displayValueLabel); - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("ListView horizontal"); alert->setFontName("Marker Felt"); alert->setFontSize(30); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h index 5efd46d704..5424c905cb 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h @@ -37,7 +37,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIListViewTest_Vertical) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; std::vector _array; }; @@ -52,7 +52,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIListViewTest_Horizontal) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; std::vector _array; }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp index 5057a13150..ffb6f081b5 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp @@ -25,7 +25,7 @@ bool UILoadingBarTest_Left::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("LoadingBar left"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -107,7 +107,7 @@ bool UILoadingBarTest_Right::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label *alert = gui::Label::create(); + gui::Text *alert = gui::Text::create(); alert->setText("LoadingBar right"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -190,7 +190,7 @@ bool UILoadingBarTest_Left_Scale9::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("LoadingBar left scale9 render"); alert->setFontName("Marker Felt"); alert->setFontSize(20); @@ -275,7 +275,7 @@ bool UILoadingBarTest_Right_Scale9::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label *alert = gui::Label::create(); + gui::Text *alert = gui::Text::create(); alert->setText("LoadingBar right scale9 render"); alert->setFontName("Marker Felt"); alert->setFontSize(20); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index 18ee92cd67..1ba703a1bd 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -21,7 +21,7 @@ bool UIPageViewTest::init() Size widgetSize = _widget->getSize(); // Add a label in which the dragpanel events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("Move by horizontal direction"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -30,7 +30,7 @@ bool UIPageViewTest::init() _uiLayer->addChild(_displayValueLabel); // Add the black background - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("PageView"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -65,7 +65,7 @@ bool UIPageViewTest::init() imageView->setPosition(Point(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); layout->addChild(imageView); - gui::Label* label = gui::Label::create(); + gui::Text* label = gui::Text::create(); label->setText(CCString::createWithFormat("page %d", (i + 1))->getCString()); label->setFontName("Marker Felt"); label->setFontSize(30); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h index 20bab13100..5c48851768 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h @@ -38,7 +38,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIPageViewTest) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; #endif /* defined(__TestCpp__UIPageViewTest__) */ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp index 00773ee5eb..527d8526a1 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp @@ -32,9 +32,9 @@ bool UIScene::init() Layout* root = static_cast(_uiLayer->getChildByTag(81)); - _sceneTitle = dynamic_cast(root->getChildByName("UItest")); + _sceneTitle = dynamic_cast(root->getChildByName("UItest")); - gui::Label* back_label = dynamic_cast(root->getChildByName("back")); + gui::Text* back_label = dynamic_cast(root->getChildByName("back")); back_label->addTouchEventListener(this, toucheventselector(UIScene::toCocosGUITestScene)); Button* left_button = dynamic_cast(root->getChildByName("left_Button")); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h index 71c4e67cdb..32d073c97b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h @@ -65,7 +65,7 @@ public: virtual void nextCallback(Object* sender, TouchEventType type); /** Title label of the scene. */ - CC_SYNTHESIZE_READONLY(gui::Label*, _sceneTitle, SceneTitle) + CC_SYNTHESIZE_READONLY(gui::Text*, _sceneTitle, SceneTitle) UI_SCENE_CREATE_FUNC(UIScene); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp index f09f8f2804..922b25a2cb 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp @@ -21,7 +21,7 @@ bool UIScrollViewTest_Vertical::init() Size widgetSize = _widget->getSize(); // Add a label in which the scrollview alert will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("Move by vertical direction"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -30,7 +30,7 @@ bool UIScrollViewTest_Vertical::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("ScrollView vertical"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -109,7 +109,7 @@ bool UIScrollViewTest_Horizontal::init() Size widgetSize = _widget->getSize(); // Add a label in which the scrollview alert will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("Move by horizontal direction"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -117,7 +117,7 @@ bool UIScrollViewTest_Horizontal::init() _displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f)); _uiLayer->addChild(_displayValueLabel); - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("ScrollView horizontal"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -203,7 +203,7 @@ bool UIScrollViewTest_Both::init() Size widgetSize = _widget->getSize();; // Add a label in which the dragpanel events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("Move by any direction"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -212,7 +212,7 @@ bool UIScrollViewTest_Both::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("ScrollView both"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -272,7 +272,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init() Size widgetSize = _widget->getSize(); // Add a label in which the dragpanel events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); // _displayValueLabel->setText("No Event"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -281,7 +281,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("ScrollView scroll to percent both directrion"); alert->setFontName("Marker Felt"); alert->setFontSize(20); @@ -334,7 +334,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init() Size widgetSize = _widget->getSize(); // Add a label in which the dragpanel events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); // _displayValueLabel->setText("No Event"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -343,7 +343,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("ScrollView scroll to percent both directrion bounce"); alert->setFontName("Marker Felt"); alert->setFontSize(20); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h index c6bea01434..ffa0d7401a 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h @@ -36,7 +36,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIScrollViewTest_Vertical) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; class UIScrollViewTest_Horizontal : public UIScene @@ -48,7 +48,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIScrollViewTest_Horizontal) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; class UIScrollViewTest_Both : public UIScene @@ -60,7 +60,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIScrollViewTest_Both) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; class UIScrollViewTest_ScrollToPercentBothDirection : public UIScene @@ -72,7 +72,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIScrollViewTest_ScrollToPercentBothDirection) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; class UIScrollViewTest_ScrollToPercentBothDirection_Bounce : public UIScene @@ -84,7 +84,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UIScrollViewTest_ScrollToPercentBothDirection_Bounce) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; #endif /* defined(__TestCpp__UIScrollViewTest__) */ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp index 0fda6ac340..1723200de6 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp @@ -22,7 +22,7 @@ bool UISliderTest::init() Size widgetSize = _widget->getSize(); // Add a label in which the slider alert will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("Move the slider thumb"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -31,7 +31,7 @@ bool UISliderTest::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Slider"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -97,7 +97,7 @@ bool UISliderTest_Scale9::init() Size widgetSize = _widget->getSize(); // Add a label in which the slider alert will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("Move the slider thumb"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -106,7 +106,7 @@ bool UISliderTest_Scale9::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label *alert = gui::Label::create(); + gui::Text *alert = gui::Text::create(); alert->setText("Slider scale9 render"); alert->setFontName("Marker Felt"); alert->setFontSize(30); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.h index 2cd9bfc383..f86ad7f440 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.h @@ -37,7 +37,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UISliderTest) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; class UISliderTest_Scale9 : public UIScene @@ -50,7 +50,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UISliderTest_Scale9) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; #endif /* defined(__TestCpp__UISliderTest__) */ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index 5c4a710067..0862a7dc52 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp @@ -20,7 +20,7 @@ bool UITextFieldTest::init() Size widgetSize = _widget->getSize(); // Add a label in which the textfield events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("No Event"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -29,7 +29,7 @@ bool UITextFieldTest::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("TextField"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -106,7 +106,7 @@ bool UITextFieldTest_MaxLength::init() Size screenSize = CCDirector::getInstance()->getWinSize(); // Add a label in which the textfield events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("No Event"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -115,7 +115,7 @@ bool UITextFieldTest_MaxLength::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label *alert = gui::Label::create(); + gui::Text *alert = gui::Text::create(); alert->setText("TextField max length"); alert->setFontName("Marker Felt"); alert->setFontSize(30); @@ -200,7 +200,7 @@ bool UITextFieldTest_Password::init() Size screenSize = CCDirector::getInstance()->getWinSize(); // Add a label in which the textfield events will be displayed - _displayValueLabel = gui::Label::create(); + _displayValueLabel = gui::Text::create(); _displayValueLabel->setText("No Event"); _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(32); @@ -209,7 +209,7 @@ bool UITextFieldTest_Password::init() _uiLayer->addChild(_displayValueLabel); // Add the alert - gui::Label *alert = gui::Label::create(); + gui::Text *alert = gui::Text::create(); alert->setText("TextField password"); alert->setFontName("Marker Felt"); alert->setFontSize(30); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h index 02bb60a612..e568d9f400 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h @@ -37,7 +37,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UITextFieldTest) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; class UITextFieldTest_MaxLength : public UIScene @@ -50,7 +50,7 @@ public: protected: UI_SCENE_CREATE_FUNC(UITextFieldTest_MaxLength) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; class UITextFieldTest_Password : public UIScene @@ -63,6 +63,6 @@ public: protected: UI_SCENE_CREATE_FUNC(UITextFieldTest_Password) - gui::Label* _displayValueLabel; + gui::Text* _displayValueLabel; }; #endif /* defined(__TestCpp__UITextFieldTest__) */ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp index 43ab1182c5..d0570b57d9 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp @@ -21,7 +21,7 @@ bool UIWidgetAddNodeTest::init() Size widgetSize = _widget->getSize(); // Add the alert - gui::Label* alert = gui::Label::create(); + gui::Text* alert = gui::Text::create(); alert->setText("Widget Add Node"); alert->setFontName("Marker Felt"); alert->setFontSize(30); From 7f2dc5197e23e4802c3c61e14a49794ec07cc692 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 31 Dec 2013 16:37:05 +0800 Subject: [PATCH 070/428] Updates travis-script, don't build template proj. Since we are supporting create project anywhere, to test template projects, projects should be created firstly.Therefore, disable building template for travis-ci. --- tools/travis-scripts/run-script.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/travis-scripts/run-script.sh b/tools/travis-scripts/run-script.sh index b609c7cc43..84cec56874 100755 --- a/tools/travis-scripts/run-script.sh +++ b/tools/travis-scripts/run-script.sh @@ -76,12 +76,6 @@ elif [ "$PLATFORM"x = "linux"x ]; then cd linux-build cmake ../.. make -j10 - cd ../../template/multi-platform-cpp - cmake . - make -j10 - cd ../multi-platform-lua - cmake . - make -j10 elif [ "$PLATFORM"x = "emscripten"x ]; then # Generate binding glue codes From c8c37ac63c4be7a2766f7faddbceb30468a64084 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 31 Dec 2013 17:25:14 +0800 Subject: [PATCH 071/428] Updates JS-Test submodule --- samples/Javascript/Shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index ff3a95b059..b713823559 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit ff3a95b059be8421677ed6817b73ae2ac577781d +Subproject commit b713823559af852d3591958f4e0b28122a337e22 From 74a7f68dc1c16ea6c32411ae41eb094fb0b0bf71 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 31 Dec 2013 18:12:42 +0800 Subject: [PATCH 072/428] [JSB] Adds cc.VisibleRect. --- .../javascript/script/jsb_cocos2d.js | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/cocos/scripting/javascript/script/jsb_cocos2d.js b/cocos/scripting/javascript/script/jsb_cocos2d.js index 02622d4d44..22d3830f84 100644 --- a/cocos/scripting/javascript/script/jsb_cocos2d.js +++ b/cocos/scripting/javascript/script/jsb_cocos2d.js @@ -626,3 +626,108 @@ var __onParseConfig = function(type, str) { } }; +cc.VisibleRect = { + _topLeft:cc.p(0,0), + _topRight:cc.p(0,0), + _top:cc.p(0,0), + _bottomLeft:cc.p(0,0), + _bottomRight:cc.p(0,0), + _bottom:cc.p(0,0), + _center:cc.p(0,0), + _left:cc.p(0,0), + _right:cc.p(0,0), + _width:0, + _height:0, + _isInitialized: false, + init:function(){ + var director = cc.Director.getInstance(); + var origin = director.getVisibleOrigin(); + var size = director.getVisibleSize(); + + this._width = size.width; + this._height = size.height; + + var x = origin.x; + var y = origin.y; + var w = this._width; + var h = this._height; + + var left = origin.x; + var right = origin.x + size.width; + var middle = origin.x + size.width/2; + + //top + this._top.y = this._topLeft.y = this._topRight.y = y + h; + this._topLeft.x = left; + this._top.x = middle; + this._topRight.x = right; + + //bottom + + this._bottom.y = this._bottomRight.y = this._bottomLeft.y = y; + this._bottomLeft.x = left + this._bottom.x = middle; + this._bottomRight.x = right; + + //center + this._right.y = this._left.y = this._center.y = y + h/2; + this._center.x = middle; + + //left + this._left.x = left; + + //right + this._right.x = right; + }, + + lazyInit: function(){ + if (!this._isInitialized) { + this.init(); + } + }, + getWidth:function(){ + this.lazyInit(); + return this._width; + }, + getHeight:function(){ + this.lazyInit(); + return this._height; + }, + topLeft:function(){ + this.lazyInit(); + return this._topLeft; + }, + topRight:function(){ + this.lazyInit(); + return this._topRight; + }, + top:function(){ + this.lazyInit(); + return this._top; + }, + bottomLeft:function(){ + this.lazyInit(); + return this._bottomLeft; + }, + bottomRight:function(){ + this.lazyInit(); + return this._bottomRight; + }, + bottom:function(){ + this.lazyInit(); + return this._bottom; + }, + center:function(){ + this.lazyInit(); + return this._center; + }, + left:function(){ + this.lazyInit(); + return this._left; + }, + right:function(){ + this.lazyInit(); + return this._right; + } +}; + From f793ff01b28cfc2d65368b3a3ab8e46e53d7ef14 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 31 Dec 2013 18:15:47 +0800 Subject: [PATCH 073/428] Updates JS-test submodule. --- samples/Javascript/Shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index b713823559..cc16ced11b 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit b713823559af852d3591958f4e0b28122a337e22 +Subproject commit cc16ced11b0327f58665d1dcb02f39e9d13d4fd8 From 8c1c9fef1549870d43e5debe8e788aab9311012d Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 31 Dec 2013 18:17:20 +0800 Subject: [PATCH 074/428] Bug fix in cc.VisibleRect --- cocos/scripting/javascript/script/jsb_cocos2d.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/scripting/javascript/script/jsb_cocos2d.js b/cocos/scripting/javascript/script/jsb_cocos2d.js index 22d3830f84..a79f189c8d 100644 --- a/cocos/scripting/javascript/script/jsb_cocos2d.js +++ b/cocos/scripting/javascript/script/jsb_cocos2d.js @@ -683,6 +683,7 @@ cc.VisibleRect = { lazyInit: function(){ if (!this._isInitialized) { this.init(); + this._isInitialized = true; } }, getWidth:function(){ From 1c0fc7859b949897d3a41f5c3bda53971e55e851 Mon Sep 17 00:00:00 2001 From: heliclei Date: Tue, 31 Dec 2013 18:29:32 +0800 Subject: [PATCH 075/428] 1.Add exception handling 2.Correct pull request action name 3.Enlarge description text --- tools/jenkins-scripts/ghprb.py | 58 +++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index ba6f03a39f..b079e5c396 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -20,27 +20,29 @@ print 'pr_num:' + str(pr_num) #build for pull request action 'open' and 'synchronize', skip 'close' action = payload['action'] print 'action: ' + action -if((action != 'open') and (action != 'synchronize')): - print 'pull request #' + str(pr_num) + 'is closed, no build triggered' +if((action != 'opened') and (action != 'synchronize')): + print 'pull request #' + str(pr_num) + ' is closed, no build triggered' exit(0) pr = payload['pull_request'] url = pr['html_url'] print "url:" + url -pr_desc = ' pr#' + str(pr_num) + '' +pr_desc = '

pr#' + str(pr_num) + '

' #set Jenkins build description using submitDescription to mock browser behavior #TODO: need to set parent build description def set_description(desc): req_data = urllib.urlencode({'description': desc}) req = urllib2.Request(os.environ['BUILD_URL'] + 'submitDescription', req_data) - print(os.environ['BUILD_URL']) + #print(os.environ['BUILD_URL']) req.add_header('Content-Type', 'application/x-www-form-urlencoded') base64string = base64.encodestring(os.environ['JENKINS_ADMIN']+ ":" + os.environ['JENKINS_ADMIN_PW']).replace('\n', '') req.add_header("Authorization", "Basic " + base64string) urllib2.urlopen(req) - -set_description(pr_desc) +try: + set_description(pr_desc) +except Exception as e: + print e #get statuses url statuses_url = pr['statuses_url'] @@ -53,22 +55,26 @@ target_url = os.environ['BUILD_URL'] data = {"state":"pending", "target_url":target_url} acccess_token = os.environ['GITHUB_ACCESS_TOKEN'] Headers = {"Authorization":"token " + acccess_token} -requests.post(statuses_url, data=json.dumps(data), headers=Headers) +try: + requests.post(statuses_url, data=json.dumps(data), headers=Headers) + + #reset path to workspace root + os.system("cd " + os.environ['WORKSPACE']); -#reset path to workspace root -os.system("cd " + os.environ['WORKSPACE']); + #fetch pull request to local repo + git_fetch_pr = "git fetch origin pull/" + str(pr_num) + "/head" + os.system(git_fetch_pr) -#fell pull request to local repo -git_fetch_pr = "git fetch origin pull/" + str(pr_num) + "/head" -os.system(git_fetch_pr) + #checkout + git_checkout = "git checkout -b " + "pull" + str(pr_num) + " FETCH_HEAD" + os.system(git_checkout) -#checkout -git_checkout = "git checkout -b " + "pull" + str(pr_num) + " FETCH_HEAD" -os.system(git_checkout) + #update submodule + git_update_submodule = "git submodule update --init --force" + os.system(git_update_submodule) +except Exception as e: + print e -#update submodule -git_update_submodule = "git submodule update --init --force" -os.system(git_update_submodule) #build #TODO: support android-mac build currently @@ -91,13 +97,15 @@ if ret == 0: else: exit_code = 1 data['state'] = "failure" +try: + #set commit status + requests.post(statuses_url, data=json.dumps(data), headers=Headers) -#set commit status -requests.post(statuses_url, data=json.dumps(data), headers=Headers) - -#clean workspace -os.system("cd " + os.environ['WORKSPACE']); -os.system("git checkout develop") -os.system("git branch -D pull" + str(pr_num)) + #clean workspace + os.system("cd " + os.environ['WORKSPACE']); + os.system("git checkout develop") + os.system("git branch -D pull" + str(pr_num)) +except Exception as e: + print e exit(exit_code) From 591740253d79408016eb68ca7a0b1746e946f3c0 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 1 Jan 2014 21:32:54 +0800 Subject: [PATCH 076/428] [GUI] Updates scripting binding configure file. --- tools/tojs/cocos2dx_gui.ini | 2 +- tools/tolua/cocos2dx_studio.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tojs/cocos2dx_gui.ini b/tools/tojs/cocos2dx_gui.ini index 3eddc48cd9..8f243985b1 100644 --- a/tools/tojs/cocos2dx_gui.ini +++ b/tools/tojs/cocos2dx_gui.ini @@ -30,7 +30,7 @@ headers = %(cocosdir)s/cocos/gui/CocosGUI.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = Helper Layout Widget Layer Button CheckBox ImageView Label LabelAtlas LabelBMFont LoadingBar Slider Switch TextField ScrollView PageView ListView LayoutParameter LinearLayoutParameter RelativeLayoutParameter +classes = Helper Layout Widget Layer Button CheckBox ImageView Text TextAtlas TextBMFont LoadingBar Slider Switch TextField ScrollView PageView ListView LayoutParameter LinearLayoutParameter RelativeLayoutParameter # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also diff --git a/tools/tolua/cocos2dx_studio.ini b/tools/tolua/cocos2dx_studio.ini index 177bf5718d..379f9768fd 100644 --- a/tools/tolua/cocos2dx_studio.ini +++ b/tools/tolua/cocos2dx_studio.ini @@ -30,7 +30,7 @@ headers = %(cocosdir)s/cocos/gui/CocosGUI.h %(cocosdir)s/cocos/editor-support/co # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ Widget Layout RootWidget Button CheckBox ImageView Label CCLabelAtlas LabelAtlas LoadingBar ScrollView Slider CCTextField TextField ListView LabelBMFont PageView Helper Layer LayoutParameter GReader LinearLayoutParameter RelativeLayoutParameter SceneReader ActionManagerEx ComAudio ComController ComAttribute ComRender BatchNode +classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ Widget Layout RootWidget Button CheckBox ImageView Text TextAtlas LoadingBar ScrollView Slider TextField ListView TextBMFont PageView Helper Layer LayoutParameter GReader LinearLayoutParameter RelativeLayoutParameter SceneReader ActionManagerEx ComAudio ComController ComAttribute ComRender BatchNode # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also From ff550bf8656dc4f948b7cf7b192f037afd16e665 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 1 Jan 2014 13:49:57 +0000 Subject: [PATCH 077/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 877d9825d3..96129ccc8c 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 877d9825d3c0df8e6bf565c90c4cfa8634c71ffa +Subproject commit 96129ccc8c55a5ad145581182e487da551e2103d From aff08adc669500f6533744e2763131a678c9df2a Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 1 Jan 2014 21:55:58 +0800 Subject: [PATCH 078/428] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index a15a536827..3c1cce2858 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,7 @@ cocos2d-x-3.0beta0 ?? 2013 [FIX] Sprites with PhysicsBody move to a wrong position when game resume from background. [FIX] Crash if connection breaks during download using AssetManager. [NEW] AngelCode binary file format support for LabelBMFont. + [FIX] OpenAL context isn't destroyed correctly on mac and ios. [Android] [NEW] build/android-build.sh: add supporting to generate .apk file [FIX] XMLHttpRequest receives wrong binary array. From 579f81fb61e5b9bdcda13defda3a005520b96ea5 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 1 Jan 2014 21:56:51 +0800 Subject: [PATCH 079/428] Update AUTHORS [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 4281304da3..77d3d8823e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -688,6 +688,9 @@ Developers: SBKarr AngelCode binary file format support for LabelBMFont. + zarelaky + OpenAL context isn't destroyed correctly on mac and ios. + Retired Core Developers: WenSheng Yang Author of windows port, CCTextField, From 3f4236dda0cc76f7fe89a4fedc1620562ea52f56 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 09:57:21 +0800 Subject: [PATCH 080/428] Update AUTHORS [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 77d3d8823e..62e12d81d6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -668,6 +668,7 @@ Developers: zhiqiangxu Fixed a logic error in ControlUtils::RectUnion. + Fixed an issue that there is an useless conversion in ScrollView::onTouchBegan. yinkaile (2youyouo2) Maintainer of Armature Bone Animation. From 13cf67747a8e23c391c927e142902024f397a3ea Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 09:58:05 +0800 Subject: [PATCH 081/428] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 3c1cce2858..7a2dd173b2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,6 +20,7 @@ cocos2d-x-3.0beta0 ?? 2013 [FIX] Crash if connection breaks during download using AssetManager. [NEW] AngelCode binary file format support for LabelBMFont. [FIX] OpenAL context isn't destroyed correctly on mac and ios. + [FIX] Useless conversion in ScrollView::onTouchBegan. [Android] [NEW] build/android-build.sh: add supporting to generate .apk file [FIX] XMLHttpRequest receives wrong binary array. From e944dae3380da0dee87bc53ec2add17b7bc3eae6 Mon Sep 17 00:00:00 2001 From: heliclei Date: Thu, 2 Jan 2014 10:19:48 +0800 Subject: [PATCH 082/428] update exception catch clause --- tools/jenkins-scripts/ghprb.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index b079e5c396..3e7c2f6f7c 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -7,6 +7,7 @@ import urllib2 import urllib import base64 import requests +import sys #get payload from os env payload_str = os.environ['payload'] @@ -41,7 +42,8 @@ def set_description(desc): urllib2.urlopen(req) try: set_description(pr_desc) -except Exception as e: +except: + e = sys.exc_info()[0] print e #get statuses url @@ -72,7 +74,8 @@ try: #update submodule git_update_submodule = "git submodule update --init --force" os.system(git_update_submodule) -except Exception as e: +except: + e = sys.exc_info()[0] print e @@ -105,7 +108,8 @@ try: os.system("cd " + os.environ['WORKSPACE']); os.system("git checkout develop") os.system("git branch -D pull" + str(pr_num)) -except Exception as e: - print e +except: + e = sys.exc_info()[0] + print e exit(exit_code) From 1f38fc28a69ec1123f1909f4a890be0aa5c5204e Mon Sep 17 00:00:00 2001 From: yinkaile Date: Thu, 2 Jan 2014 11:07:31 +0800 Subject: [PATCH 083/428] change interface --- cocos/editor-support/cocostudio/CCArmature.cpp | 4 ++-- .../cocostudio/CCArmatureAnimation.cpp | 2 +- cocos/editor-support/cocostudio/CCBone.cpp | 17 +++++++++++++---- cocos/editor-support/cocostudio/CCBone.h | 7 +++++-- .../cocostudio/CCDisplayManager.cpp | 10 +++++----- .../cocostudio/CCDisplayManager.h | 11 ++++++++--- cocos/editor-support/cocostudio/CCTween.cpp | 2 +- .../CocoStudioArmatureTest/ArmatureScene.cpp | 8 ++++---- 8 files changed, 39 insertions(+), 22 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index 9f0e909e25..684b98eeb9 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -155,7 +155,7 @@ bool Armature::init(const std::string& name) CC_BREAK_IF(!frameData); bone->getTweenData()->copy(frameData); - bone->changeDisplayByIndex(frameData->displayIndex, false); + bone->changeDisplayWithIndex(frameData->displayIndex, false); } while (0); } @@ -222,7 +222,7 @@ Bone *Armature::createBone(const std::string& boneName) } bone->setBoneData(boneData); - bone->getDisplayManager()->changeDisplayByIndex(-1, false); + bone->getDisplayManager()->changeDisplayWithIndex(-1, false); return bone; } diff --git a/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp index fb7ff59299..90549e3042 100644 --- a/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp @@ -236,7 +236,7 @@ void ArmatureAnimation::play(const std::string& animationName, int durationTo, if(!bone->isIgnoreMovementBoneData()) { //! this bone is not include in this movement, so hide it - bone->getDisplayManager()->changeDisplayByIndex(-1, false); + bone->getDisplayManager()->changeDisplayWithIndex(-1, false); tween->stop(); } diff --git a/cocos/editor-support/cocostudio/CCBone.cpp b/cocos/editor-support/cocostudio/CCBone.cpp index a6b46b3bef..ecf13a5bf8 100644 --- a/cocos/editor-support/cocostudio/CCBone.cpp +++ b/cocos/editor-support/cocostudio/CCBone.cpp @@ -418,13 +418,22 @@ void Bone::removeDisplay(int index) void Bone::changeDisplayByIndex(int index, bool force) { - _displayManager->changeDisplayByIndex(index, force); + changeDisplayWithIndex(index, force); } - -void Bone::changeDisplayByName(const std::string& name, bool force) +void Bone::changeDisplayByName(const std::string &name, bool force) { - _displayManager->changeDisplayByName(name, force); + changeDisplayWithName(name, force); +} + +void Bone::changeDisplayWithIndex(int index, bool force) +{ + _displayManager->changeDisplayWithIndex(index, force); +} + +void Bone::changeDisplayWithName(const std::string& name, bool force) +{ + _displayManager->changeDisplayWithName(name, force); } ColliderDetector* Bone::getColliderDetector() const diff --git a/cocos/editor-support/cocostudio/CCBone.h b/cocos/editor-support/cocostudio/CCBone.h index 6d469eb965..a5afb8641f 100644 --- a/cocos/editor-support/cocostudio/CCBone.h +++ b/cocos/editor-support/cocostudio/CCBone.h @@ -91,8 +91,11 @@ public: void removeDisplay(int index); - void changeDisplayByIndex(int index, bool force); - void changeDisplayByName(const std::string& name, bool force); + CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); + CC_DEPRECATED_ATTRIBUTE void changeDisplayByName(const std::string& name, bool force); + + void changeDisplayWithIndex(int index, bool force); + void changeDisplayWithName(const std::string& name, bool force); /** * Add a child to this bone, and it will let this child call setParent(Bone *parent) function to set self to it's parent diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.cpp b/cocos/editor-support/cocostudio/CCDisplayManager.cpp index aa59698679..f05ccb1675 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayManager.cpp @@ -108,7 +108,7 @@ void DisplayManager::addDisplay(DisplayData *displayData, int index) if(index == _displayIndex) { _displayIndex = -1; - changeDisplayByIndex(index, false); + changeDisplayWithIndex(index, false); } } @@ -193,7 +193,7 @@ void DisplayManager::addDisplay(Node *display, int index) if(index == _displayIndex) { _displayIndex = -1; - changeDisplayByIndex(index, false); + changeDisplayWithIndex(index, false); } } @@ -213,7 +213,7 @@ const cocos2d::Vector& DisplayManager::getDecorativeDisplayL return _decoDisplayList; } -void DisplayManager::changeDisplayByIndex(int index, bool force) +void DisplayManager::changeDisplayWithIndex(int index, bool force) { CCASSERT( index < (int)_decoDisplayList.size(), "the _index value is out of range"); @@ -243,13 +243,13 @@ void DisplayManager::changeDisplayByIndex(int index, bool force) setCurrentDecorativeDisplay(decoDisplay); } -void CCDisplayManager::changeDisplayByName(const std::string& name, bool force) +void CCDisplayManager::changeDisplayWithName(const std::string& name, bool force) { for (int i = 0; i<_decoDisplayList.size(); i++) { if (_decoDisplayList.at(i)->getDisplayData()->displayName == name) { - changeDisplayByIndex(i, force); + changeDisplayWithIndex(i, force); break; } } diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.h b/cocos/editor-support/cocostudio/CCDisplayManager.h index 75ba93b455..6b3f188236 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.h +++ b/cocos/editor-support/cocostudio/CCDisplayManager.h @@ -74,6 +74,12 @@ public: const cocos2d::Vector& getDecorativeDisplayList() const; + /* + * @deprecated, please use changeDisplayWithIndex and changeDisplayWithName + */ + CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); + CC_DEPRECATED_ATTRIBUTE void changeDisplayByName(const std::string& name, bool force); + /** * Change display by index. You can just use this method to change display in the display list. * The display list is just used for this bone, and it is the displays you may use in every frame. @@ -83,9 +89,8 @@ public: * @param index The index of the display you want to change * @param force If true, then force change display to specified display, or current display will set to display index edit in the flash every key frame. */ - void changeDisplayByIndex(int index, bool force); - - void changeDisplayByName(const std::string& name, bool force); + void changeDisplayWithIndex(int index, bool force); + void changeDisplayWithName(const std::string& name, bool force); cocos2d::Node *getDisplayRenderNode() const; DisplayType getDisplayRenderNodeType() const; diff --git a/cocos/editor-support/cocostudio/CCTween.cpp b/cocos/editor-support/cocostudio/CCTween.cpp index ccd5a74eeb..282df8297e 100644 --- a/cocos/editor-support/cocostudio/CCTween.cpp +++ b/cocos/editor-support/cocostudio/CCTween.cpp @@ -330,7 +330,7 @@ void Tween::arriveKeyFrame(FrameData *keyFrameData) if (!displayManager->isForceChangeDisplay()) { - displayManager->changeDisplayByIndex(displayIndex, false); + displayManager->changeDisplayWithIndex(displayIndex, false); } //! Update bone zorder, bone's zorder is determined by frame zorder and bone zorder diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index 0baa0e306d..35865b7813 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -635,7 +635,7 @@ void TestParticleDisplay::onEnter() Bone *bone = Bone::create("p1"); bone->addDisplay(p1, 0); - bone->changeDisplayByIndex(0, true); + bone->changeDisplayWithIndex(0, true); bone->setIgnoreMovementBoneData(true); bone->setZOrder(100); bone->setScale(1.2f); @@ -643,7 +643,7 @@ void TestParticleDisplay::onEnter() bone = Bone::create("p2"); bone->addDisplay(p2, 0); - bone->changeDisplayByIndex(0, true); + bone->changeDisplayWithIndex(0, true); bone->setIgnoreMovementBoneData(true); bone->setZOrder(100); bone->setScale(1.2f); @@ -727,7 +727,7 @@ void TestUseMutiplePicture::onTouchesEnded(const std::vector& touches, { ++displayIndex; displayIndex = (displayIndex) % 8; - armature->getBone("weapon")->changeDisplayByIndex(displayIndex, true); + armature->getBone("weapon")->changeDisplayWithIndex(displayIndex, true); } TestColliderDetector::~TestColliderDetector() @@ -1230,7 +1230,7 @@ void Hero::changeMount(Armature *armature) //Add hero as a display to this bone bone->addDisplay(this, 0); //Change this bone's display - bone->changeDisplayByIndex(0, true); + bone->changeDisplayWithIndex(0, true); bone->setIgnoreMovementBoneData(true); setPosition(Point(0,0)); From 0a06d93328db5cb03898228c2da6f0ebcf771dca Mon Sep 17 00:00:00 2001 From: boyu0 Date: Thu, 2 Jan 2014 11:45:11 +0800 Subject: [PATCH 084/428] issue #3401: physical lua banding script and auto script --- .../project.pbxproj.REMOVED.git-id | 2 +- cocos/physics/CCPhysicsShape.cpp | 33 +- cocos/physics/CCPhysicsShape.h | 6 +- cocos/scripting/lua/bindings/CCLuaStack.cpp | 6 + .../lua/bindings/LuaBasicConversions.cpp | 53 +++ .../lua/bindings/LuaBasicConversions.h | 2 + .../bindings/lua_cocos2dx_physics_manual.cpp | 390 ++++++++++++++++++ .../bindings/lua_cocos2dx_physics_manual.hpp | 21 + tools/tolua/cocos2dx.ini | 2 +- tools/tolua/genbindings.sh | 3 + 10 files changed, 510 insertions(+), 8 deletions(-) create mode 100644 cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp create mode 100644 cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.hpp diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index a237fdc780..c49fd7c11d 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -812ab716d10a52b752f0d15b2393b2b0a7c8e969 \ No newline at end of file +a3e4511d559fcc89e5789f2cc4fe2afafad3aec9 \ No newline at end of file diff --git a/cocos/physics/CCPhysicsShape.cpp b/cocos/physics/CCPhysicsShape.cpp index 543bbf0333..a34684df2b 100644 --- a/cocos/physics/CCPhysicsShape.cpp +++ b/cocos/physics/CCPhysicsShape.cpp @@ -229,7 +229,7 @@ void PhysicsShape::setFriction(float friction) } -Point* PhysicsShape::recenterPoints(Point* points, int count, const Point& center) +void PhysicsShape::recenterPoints(Point* points, int count, const Point& center) { cpVect* cpvs = new cpVect[count]; cpRecenterPoly(count, PhysicsHelper::points2cpvs(points, cpvs, count)); @@ -243,8 +243,6 @@ Point* PhysicsShape::recenterPoints(Point* points, int count, const Point& cente points[i] += center; } } - - return points; } Point PhysicsShape::getPolyonCenter(const Point* points, int count) @@ -655,6 +653,15 @@ bool PhysicsShapeEdgeBox::init(const Size& size, const PhysicsMaterial& material return false; } +void PhysicsShapeEdgeBox::getPoints(cocos2d::Point *outPoints) const +{ + int i = 0; + for(auto shape : _info->getShapes()) + { + outPoints[i++] = PhysicsHelper::cpv2point(((cpSegmentShape*)shape)->a); + } +} + // PhysicsShapeEdgeBox PhysicsShapeEdgePolygon* PhysicsShapeEdgePolygon::create(const Point* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) { @@ -712,6 +719,15 @@ Point PhysicsShapeEdgePolygon::getCenter() return _center; } +void PhysicsShapeEdgePolygon::getPoints(cocos2d::Point *outPoints) const +{ + int i = 0; + for(auto shape : _info->getShapes()) + { + outPoints[i++] = PhysicsHelper::cpv2point(((cpSegmentShape*)shape)->a); + } +} + int PhysicsShapeEdgePolygon::getPointsCount() const { return static_cast(_info->getShapes().size() + 1); @@ -773,6 +789,17 @@ Point PhysicsShapeEdgeChain::getCenter() return _center; } +void PhysicsShapeEdgeChain::getPoints(Point* outPoints) const +{ + int i = 0; + for(auto shape : _info->getShapes()) + { + outPoints[i++] = PhysicsHelper::cpv2point(((cpSegmentShape*)shape)->a); + } + + outPoints[i++] = PhysicsHelper::cpv2point(((cpSegmentShape*)_info->getShapes().back())->a); +} + int PhysicsShapeEdgeChain::getPointsCount() const { return static_cast(_info->getShapes().size() + 1); diff --git a/cocos/physics/CCPhysicsShape.h b/cocos/physics/CCPhysicsShape.h index 1146b2d291..49398fbbe2 100644 --- a/cocos/physics/CCPhysicsShape.h +++ b/cocos/physics/CCPhysicsShape.h @@ -114,7 +114,7 @@ public: bool containsPoint(const Point& point) const; /** move the points to the center */ - static Point* recenterPoints(Point* points, int count, const Point& center = Point::ZERO); + static void recenterPoints(Point* points, int count, const Point& center = Point::ZERO); /** get center of the polyon points */ static Point getPolyonCenter(const Point* points, int count); @@ -282,8 +282,8 @@ class PhysicsShapeEdgeBox : public PhysicsShape public: static PhysicsShapeEdgeBox* create(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 0, const Point& offset = Point::ZERO); virtual Point getOffset() override { return _offset; } - void getPoints(const Point* outPoints) const; - int getPointsCount() const; + void getPoints(Point* outPoints) const; + int getPointsCount() const { return 4; } protected: bool init(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1, const Point& offset = Point::ZERO); diff --git a/cocos/scripting/lua/bindings/CCLuaStack.cpp b/cocos/scripting/lua/bindings/CCLuaStack.cpp index 82e4e28dd3..47f5eb1310 100644 --- a/cocos/scripting/lua/bindings/CCLuaStack.cpp +++ b/cocos/scripting/lua/bindings/CCLuaStack.cpp @@ -58,6 +58,8 @@ extern "C" { #include "lua_cocos2dx_coco_studio_manual.hpp" #include "lua_cocos2dx_spine_auto.hpp" #include "lua_cocos2dx_spine_manual.hpp" +#include "lua_cocos2dx_physics_auto.hpp" +#include "lua_cocos2dx_physics_manual.hpp" namespace { int lua_print(lua_State * luastate) @@ -156,6 +158,10 @@ bool LuaStack::init(void) register_all_cocos2dx_spine(_state); register_all_cocos2dx_spine_manual(_state); register_glnode_manual(_state); +#if CC_USE_PHYSICS + register_all_cocos2dx_physics(_state); + register_all_cocos2dx_physics_manual(_state); +#endif #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) LuaObjcBridge::luaopen_luaoc(_state); #endif diff --git a/cocos/scripting/lua/bindings/LuaBasicConversions.cpp b/cocos/scripting/lua/bindings/LuaBasicConversions.cpp index 84c013968c..f5629705e6 100644 --- a/cocos/scripting/lua/bindings/LuaBasicConversions.cpp +++ b/cocos/scripting/lua/bindings/LuaBasicConversions.cpp @@ -307,6 +307,43 @@ bool luaval_to_point(lua_State* L,int lo,Point* outValue) return ok; } +bool luaval_to_physics_material(lua_State* L,int lo,PhysicsMaterial* outValue) +{ + if (NULL == L || NULL == outValue) + return false; + + bool ok = true; + + tolua_Error tolua_err; + if (!tolua_istable(L, lo, 0, &tolua_err) ) + { +#if COCOS2D_DEBUG >=1 + luaval_to_native_err(L,"#ferror:",&tolua_err); +#endif + ok = false; + } + + + if (ok) + { + lua_pushstring(L, "density"); + lua_gettable(L, lo); + outValue->density = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushstring(L, "restitution"); + lua_gettable(L, lo); + outValue->restitution = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushstring(L, "friction"); + lua_gettable(L, lo); + outValue->friction = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + } + return ok; +} + bool luaval_to_ssize(lua_State* L,int lo, ssize_t* outValue) { return luaval_to_long(L, lo, reinterpret_cast(outValue)); @@ -1515,6 +1552,22 @@ void point_to_luaval(lua_State* L,const Point& pt) lua_rawset(L, -3); /* table[key] = value, L: table */ } +void physics_material_to_luaval(lua_State* L,const PhysicsMaterial& pm) +{ + if (NULL == L) + return; + lua_newtable(L); /* L: table */ + lua_pushstring(L, "density"); /* L: table key */ + lua_pushnumber(L, (lua_Number) pm.density); /* L: table key value*/ + lua_rawset(L, -3); /* table[key] = value, L: table */ + lua_pushstring(L, "restitution"); /* L: table key */ + lua_pushnumber(L, (lua_Number) pm.restitution); /* L: table key value*/ + lua_rawset(L, -3); /* table[key] = value, L: table */ + lua_pushstring(L, "friction"); /* L: table key */ + lua_pushnumber(L, (lua_Number) pm.friction); /* L: table key value*/ + lua_rawset(L, -3); /* table[key] = value, L: table */ +} + void size_to_luaval(lua_State* L,const Size& sz) { if (NULL == L) diff --git a/cocos/scripting/lua/bindings/LuaBasicConversions.h b/cocos/scripting/lua/bindings/LuaBasicConversions.h index ed46e80a29..5eb00223fd 100644 --- a/cocos/scripting/lua/bindings/LuaBasicConversions.h +++ b/cocos/scripting/lua/bindings/LuaBasicConversions.h @@ -41,6 +41,7 @@ extern bool luaval_to_rect(lua_State* L,int lo,Rect* outValue); extern bool luaval_to_color3b(lua_State* L,int lo,Color3B* outValue); extern bool luaval_to_color4b(lua_State* L,int lo,Color4B* outValue); extern bool luaval_to_color4f(lua_State* L,int lo,Color4F* outValue); +extern bool luaval_to_physics_material(lua_State* L,int lo, cocos2d::PhysicsMaterial* outValue); extern bool luaval_to_affinetransform(lua_State* L,int lo, AffineTransform* outValue); extern bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue ); extern bool luaval_to_array(lua_State* L,int lo, Array** outValue); @@ -177,6 +178,7 @@ extern void rect_to_luaval(lua_State* L,const Rect& rt); extern void color3b_to_luaval(lua_State* L,const Color3B& cc); extern void color4b_to_luaval(lua_State* L,const Color4B& cc); extern void color4f_to_luaval(lua_State* L,const Color4F& cc); +extern void physics_material_to_luaval(lua_State* L,const PhysicsMaterial& pm); extern void affinetransform_to_luaval(lua_State* L,const AffineTransform& inValue); extern void fontdefinition_to_luaval(lua_State* L,const FontDefinition& inValue); extern void array_to_luaval(lua_State* L,Array* inValue); diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp new file mode 100644 index 0000000000..492bd1d5ef --- /dev/null +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp @@ -0,0 +1,390 @@ +#include "lua_cocos2dx_manual.hpp" + +#if CC_USE_PHYSICS + +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua_fix.h" +#ifdef __cplusplus +} +#endif + +#include "LuaBasicConversions.h" +#include "CCLuaValue.h" +#include "CCLuaEngine.h" + +int lua_cocos2dx_physics_PhysicsBody_getJoints(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsBody* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"PhysicsBody",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getJoints'", NULL); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + do { + + if(!ok) + return 0; + auto& ret = cobj->getJoints(); + + lua_newtable(tolua_S); + + if (ret.empty()) + return 1; + + auto iter = ret.begin(); + int indexTable = 1; + for (; iter != ret.end(); ++iter) + { + if (nullptr == *iter) + continue; + + std::string hashName = typeid(*iter).name(); + auto name = g_luaType.find(hashName); + std::string className = ""; + if(name != g_luaType.end()){ + className = name->second.c_str(); + } else { + className = "PhysicsJoint"; + } + + lua_pushnumber(tolua_S, (lua_Number)indexTable); + tolua_pushusertype(tolua_S,(void*)(*iter), className.c_str()); + lua_rawset(tolua_S, -3); + ++indexTable; + } + } while (0); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getJoints",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getJoints'.",&tolua_err); +#endif + + return 0; +} + +int lua_cocos2dx_physics_PhysicsWorld_getScene(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getScene'", NULL); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Scene& ret = cobj->getScene(); + do { + + std::string hashName = typeid(ret).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "Scene"; + } + + int ID = (int)(ret._ID); + int* luaID = &(ret._luaID); + toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)(&ret),className.c_str()); + + }while (0); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getScene",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getScene'.",&tolua_err); +#endif + + return 0; +} + + +int lua_cocos2dx_physics_PhysicsWorld_rayCast(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_rayCast'", NULL); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 4) + { + std::function arg0; + cocos2d::Point arg1; + cocos2d::Point arg2; + do { + arg0 = [tolua_S](cocos2d::PhysicsWorld &world, const cocos2d::PhysicsRayCastInfo &info, void * data) -> bool + { + LuaStack* stack = LuaStack::create(); + std::string hashName = typeid(&world).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsWorld"; + } + + tolua_pushusertype(tolua_S, (void*)(&world), className.c_str()); + tolua_pushusertype(tolua_S, (void*)(&info), "PhysicsRayCastInfo"); + bool ret = stack->executeFunction(2); + stack->clean(); + return ret; + }; + } while(0) + ; + ok &= luaval_to_point(tolua_S, 3, &arg1); + ok &= luaval_to_point(tolua_S, 4, &arg2); +#pragma warning NO CONVERSION TO NATIVE FOR void*; + if(!ok) + return 0; + cobj->rayCast(arg0, arg1, arg2, nullptr); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "rayCast",argc, 4); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_rayCast'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_physics_PhysicsWorld_queryRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_queryRect'", NULL); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 3) + { + std::function arg0; + cocos2d::Rect arg1; + do { + arg0 = [tolua_S](cocos2d::PhysicsWorld &world, cocos2d::PhysicsShape &shape, void * data) -> bool + { + LuaStack* stack = LuaStack::create(); + std::string hashName = typeid(&world).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsWorld"; + } + + tolua_pushusertype(tolua_S, (void*)(&world), className.c_str()); + stack->pushObject(&shape, "PhysicsShape"); + bool ret = stack->executeFunction(2); + stack->clean(); + return ret; + }; + } while(0); + + ok &= luaval_to_rect(tolua_S, 3, &arg1); +#pragma warning NO CONVERSION TO NATIVE FOR void*; + if(!ok) + return 0; + cobj->queryRect(arg0, arg1, nullptr); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "queryRect",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_queryRect'.",&tolua_err); +#endif + + return 0; +} + + +int lua_cocos2dx_physics_PhysicsWorld_queryPoint(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsWorld* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"PhysicsWorld",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_queryPoint'", NULL); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 3) + { + std::function arg0; + cocos2d::Point arg1; + do { + arg0 = [tolua_S](cocos2d::PhysicsWorld &world, cocos2d::PhysicsShape &shape, void * data) -> bool + { + LuaStack* stack = LuaStack::create(); + std::string hashName = typeid(&world).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsWorld"; + } + + tolua_pushusertype(tolua_S, (void*)(&world), className.c_str()); + stack->pushObject(&shape, "PhysicsShape"); + bool ret = stack->executeFunction(2); + stack->clean(); + return ret; + }; + assert(false); + } while(0) + ; + ok &= luaval_to_point(tolua_S, 3, &arg1); +#pragma warning NO CONVERSION TO NATIVE FOR void*; + if(!ok) + return 0; + cobj->queryPoint(arg0, arg1, nullptr); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "queryPoint",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_queryPoint'.",&tolua_err); +#endif + + return 0; +} + +int register_all_cocos2dx_physics_manual(lua_State* tolua_S) +{ + lua_pushstring(tolua_S, "PhysicsBody"); + lua_rawget(tolua_S, LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + lua_pushstring(tolua_S,"getJoints"); + lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsBody_getJoints ); + lua_rawset(tolua_S,-3); + } + lua_pop(tolua_S, 1); + + lua_pushstring(tolua_S, "PhysicsWorld"); + lua_rawget(tolua_S, LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + lua_pushstring(tolua_S,"getScene"); + lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_getScene ); + lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S,"queryPoint"); + lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_queryPoint ); + lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S,"queryRect"); + lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_queryRect ); + lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S,"rayCast"); + lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_rayCast ); + lua_rawset(tolua_S,-3); + } + lua_pop(tolua_S, 1); + return 0; +} + +#endif \ No newline at end of file diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.hpp b/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.hpp new file mode 100644 index 0000000000..bc9f32b165 --- /dev/null +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.hpp @@ -0,0 +1,21 @@ +#ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H +#define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H + +#if CC_USE_PHYSICS + +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua++.h" +#ifdef __cplusplus +} +#endif + +#include "cocos2d.h" +#include "LuaScriptHandlerMgr.h" + +int register_all_cocos2dx_physics_manual(lua_State* tolua_S); + +#endif // CC_USE_PHYSICS + +#endif // #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index 65487bdcce..8afc4c60fd 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/Simpl # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Object$ UserDefault EGLViewProtocol EGLView Image Event.* +classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Object$ UserDefault EGLViewProtocol EGLView Image Event(?!.*(Physics).*).* # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also diff --git a/tools/tolua/genbindings.sh b/tools/tolua/genbindings.sh index 9870d0f364..23738c19be 100755 --- a/tools/tolua/genbindings.sh +++ b/tools/tolua/genbindings.sh @@ -90,3 +90,6 @@ LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py echo "Generating bindings for cocos2dx_spine..." LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_spine.ini -s cocos2dx_spine -t lua -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/lua-bindings -n lua_cocos2dx_spine_auto + +echo "Generating bindings for cocos2dx_physics..." +LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_physics.ini -s cocos2dx_physics -t lua -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/lua-bindings -n lua_cocos2dx_physics_auto From c44dea5eb827fe25f27aa5f4106e643c727ec2b9 Mon Sep 17 00:00:00 2001 From: "Lee, Jae-Hong" Date: Thu, 2 Jan 2014 12:45:41 +0900 Subject: [PATCH 085/428] [Win32] Update project files. - lIbGUI --- cocos/gui/proj.win32/libGUI.vcxproj | 12 +++---- cocos/gui/proj.win32/libGUI.vcxproj.filters | 36 ++++++++++----------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cocos/gui/proj.win32/libGUI.vcxproj b/cocos/gui/proj.win32/libGUI.vcxproj index caf83df195..3cec8f360e 100644 --- a/cocos/gui/proj.win32/libGUI.vcxproj +++ b/cocos/gui/proj.win32/libGUI.vcxproj @@ -16,9 +16,6 @@ - - - @@ -28,6 +25,9 @@ + + + @@ -37,9 +37,6 @@ - - - @@ -48,6 +45,9 @@ + + + diff --git a/cocos/gui/proj.win32/libGUI.vcxproj.filters b/cocos/gui/proj.win32/libGUI.vcxproj.filters index 148977b79d..038a4925ef 100644 --- a/cocos/gui/proj.win32/libGUI.vcxproj.filters +++ b/cocos/gui/proj.win32/libGUI.vcxproj.filters @@ -39,15 +39,6 @@ UIWidgets - - UIWidgets - - - UIWidgets - - - UIWidgets - UIWidgets @@ -75,6 +66,15 @@ Layouts + + UIWidgets + + + UIWidgets + + + UIWidgets + @@ -95,15 +95,6 @@ UIWidgets - - UIWidgets - - - UIWidgets - - - UIWidgets - UIWidgets @@ -131,5 +122,14 @@ Layouts + + UIWidgets + + + UIWidgets + + + UIWidgets +
\ No newline at end of file From b8d4010ae50cd5f929f6e21eb067d17db702f504 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 2 Jan 2014 12:00:37 +0800 Subject: [PATCH 086/428] Develop branch adds lua trigger for CocoStudio --- .../project.pbxproj.REMOVED.git-id | 2 +- cocos/scripting/lua/bindings/CCLuaEngine.cpp | 14 +- .../scripting/lua/script}/extern.lua | 0 cocos/scripting/lua/script/lua_cocos2d.lua | 13 + .../lua/script/lua_cocos2d_studio.lua | 373 ++++++++++++++++++ .../CocoStudioSceneTest.lua | 53 ++- .../CocoStudioSceneTest/TriggerCode/acts.lua | 122 ++++++ .../CocoStudioSceneTest/TriggerCode/cons.lua | 1 + .../TriggerCode/eventDef.lua | 12 + .../Resources/luaScript/TouchesTest/Ball.lua | 2 +- .../luaScript/TouchesTest/Paddle.lua | 2 +- .../Resources/luaScript/VisibleRect.lua | 2 +- .../TestLua/Resources/luaScript/mainMenu.lua | 3 +- 13 files changed, 589 insertions(+), 10 deletions(-) rename {samples/Lua/TestLua/Resources/luaScript => cocos/scripting/lua/script}/extern.lua (100%) create mode 100644 cocos/scripting/lua/script/lua_cocos2d.lua create mode 100644 cocos/scripting/lua/script/lua_cocos2d_studio.lua create mode 100644 samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua create mode 100644 samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/cons.lua create mode 100644 samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/eventDef.lua diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index 2d497c5e0b..4186b716ce 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -b83c3a0fd60d6b1b1a032495615afd77fccd5050 \ No newline at end of file +ab749c10e473dbc8a0ae687363de08a217f3a07a \ No newline at end of file diff --git a/cocos/scripting/lua/bindings/CCLuaEngine.cpp b/cocos/scripting/lua/bindings/CCLuaEngine.cpp index 4005c83462..b064774b2a 100644 --- a/cocos/scripting/lua/bindings/CCLuaEngine.cpp +++ b/cocos/scripting/lua/bindings/CCLuaEngine.cpp @@ -188,8 +188,18 @@ int LuaEngine::reallocateScriptHandler(int nHandler) bool LuaEngine::parseConfig(ConfigType type, const std::string& str) { - // FIXME: TO IMPLEMENT - return false; + lua_getglobal(_stack->getLuaState(), "__onParseConfig"); + if (!lua_isfunction(_stack->getLuaState(), -1)) + { + CCLOG("[LUA ERROR] name '%s' does not represent a Lua function", "__onParseConfig"); + lua_pop(_stack->getLuaState(), 1); + return false; + } + + _stack->pushInt((int)type); + _stack->pushString(str.c_str()); + + return _stack->executeFunction(2); } int LuaEngine::sendEvent(ScriptEvent* evt) diff --git a/samples/Lua/TestLua/Resources/luaScript/extern.lua b/cocos/scripting/lua/script/extern.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/extern.lua rename to cocos/scripting/lua/script/extern.lua diff --git a/cocos/scripting/lua/script/lua_cocos2d.lua b/cocos/scripting/lua/script/lua_cocos2d.lua new file mode 100644 index 0000000000..bcf5f9d979 --- /dev/null +++ b/cocos/scripting/lua/script/lua_cocos2d.lua @@ -0,0 +1,13 @@ +require "lua_cocos2d_studio" + +local ConfigType = +{ + NONE = 0, + COCOSTUDIO = 1, +} + +function __onParseConfig(configType,jasonStr) + if configType == ConfigType.COCOSTUDIO then + ccs.TriggerMng.getInstance():parse(jasonStr) + end +end diff --git a/cocos/scripting/lua/script/lua_cocos2d_studio.lua b/cocos/scripting/lua/script/lua_cocos2d_studio.lua new file mode 100644 index 0000000000..33cda6970c --- /dev/null +++ b/cocos/scripting/lua/script/lua_cocos2d_studio.lua @@ -0,0 +1,373 @@ +require "json" +require "extern" + +ccs = ccs or {} + +function ccs.sendTriggerEvent(event) + local triggerObjArr = ccs.TriggerMng.getInstance():get(event) + + if nil == triggerObjArr then + return + end + + for i = 1, table.getn(triggerObjArr) do + local triObj = triggerObjArr[i] + if nil ~= triObj and triObj.detect then + triObj:done() + end + end +end + +function ccs.registerTriggerClass(className, createFunc) + ccs.TInfo.new(className,createFunc) +end + +ccs.TInfo = class("TInfo") +ccs.TInfo._className = "" +ccs.TInfo._fun = nil + +function ccs.TInfo:ctor(c,f) + -- @param {String|ccs.TInfo}c + -- @param {Function}f + if nil ~= f then + self._className = c + self._fun = f + else + self._className = c._className + self._fun = c._fun + end + + ccs.ObjectFactory.getInstance():registerType(self) +end + +ccs.ObjectFactory = class("ObjectFactory") +ccs.ObjectFactory._typeMap = nil +ccs.ObjectFactory._instance = nil + +function ccs.ObjectFactory:ctor() + self._typeMap = {} +end + +function ccs.ObjectFactory.getInstance() + if nil == ccs.ObjectFactory._instance then + ccs.ObjectFactory._instance = ccs.ObjectFactory.new() + end + + return ccs.ObjectFactory._instance +end + +function ccs.ObjectFactory.destroyInstance() + ccs.ObjectFactory._instance = nil +end + +function ccs.ObjectFactory:createObject(classname) + local obj = nil + local t = self._typeMap[classname] + if nil ~= t then + obj = t._fun() + end + + return obj +end + +function ccs.ObjectFactory:registerType(t) + self._typeMap[t._className] = t +end + +ccs.TriggerObj = class("TriggerObj") +ccs.TriggerObj._cons = {} +ccs.TriggerObj._acts = {} +ccs.TriggerObj._enable = false +ccs.TriggerObj._id = 0 +ccs.TriggerObj._vInt = {} + +function ccs.TriggerObj.extend(target) + local t = tolua.getpeer(target) + if not t then + t = {} + tolua.setpeer(target, t) + end + setmetatable(t, TriggerObj) + return target +end + +function ccs.TriggerObj:ctor() + self:init() +end + +function ccs.TriggerObj:init() + self._id = 0 + self._enable = true + self._cons = {} + self._acts = {} + self._vInt = {} +end + +function ccs.TriggerObj:detect() + if (not self._enable) or (table.getn(self._cons) == 0) then + return true + end + + local ret = true + local obj = nil + for i = 1 , table.getn(self._cons) do + obj = self._cons[i] + if nil ~= obj and obj.detect then + ret = ret and obj:detect() + end + end + return ret +end + +function ccs.TriggerObj:done() + if (not self._enable) or (table.getn(self._acts) == 0) then + return + end + + local obj = nil + for i = 1, table.getn(self._acts) do + obj = self._acts[i] + if nil ~= obj and obj.done then + obj:done() + end + end +end + +function ccs.TriggerObj:removeAll() + local obj = nil + for i=1, table.getn(self._cons) do + obj = self._cons[i] + if nil ~= obj then + obj:removeAll() + end + end + self._cons = {} + + for i=1, table.getn(self._acts) do + obj = self._acts[i] + if nil ~= obj then + obj:removeAll() + end + end + self._acts = {} +end + +function ccs.TriggerObj:serialize(jsonValue) + self._id = jsonValue["id"] + local count = 0 + + --condition + local cons = jsonValue["conditions"] + if nil ~= cons then + count = table.getn(cons) + for i = 1, count do + local subDict = cons[i] + local className = subDict["classname"] + if nil ~= className then + local obj = ObjectFactory.getInstance():createObject(className) + assert(nil ~= obj, string.format("class named %s can not implement!",className)) + obj:serialize(subDict) + obj:init() + table.insert(self._cons, obj) + end + end + end + + local actions = jsonValue["actions"] + if nil ~= actions then + count = table.getn(actions) + for i = 1,count do + local subAction = actions[i] + local className = subAction["classname"] + if nil ~= className then + local act = ccs.ObjectFactory.getInstance():createObject(className) + assert(nil ~= act ,string.format("class named %s can not implement!",className)) + act:serialize(subAction) + act:init() + table.insert(self._acts,act) + end + end + end + + local events = jsonValue["events"] + if nil ~= events then + count = table.getn(events) + for i = 1, count do + local subEveent = events[i] + local eventID = subEveent["id"] + if eventID >= 0 then + table.insert(self._vInt,eventID) + end + end + end +end + +function ccs.TriggerObj:getId() + return self._id +end + +function ccs.TriggerObj:setEnable(enable) + self._enable = enable +end + +function ccs.TriggerObj:getEvents() + return self._vInt +end + +ccs.TriggerMng = class("TriggerMng") +ccs.TriggerMng._eventTriggers = nil +ccs.TriggerMng._triggerObjs = nil +ccs.TriggerMng._movementDispatches = nil +ccs.TriggerMng._instance = nil + +function ccs.TriggerMng:ctor() + self._triggerObjs = {} + self._movementDispatches = {} + self._eventTriggers = {} +end + +function ccs.TriggerMng.getInstance() + if ccs.TriggerMng._instance == nil then + ccs.TriggerMng._instance = ccs.TriggerMng.new() + end + + return ccs.TriggerMng._instance +end + +function ccs.TriggerMng.destroyInstance() + if ccs.TriggerMng._instance ~= nil then + ccs.TriggerMng._instance:removeAll() + ccs.TriggerMng._instance = nil + end +end + +function ccs.TriggerMng:triggerMngVersion() + return "1.0.0.0" +end + +function ccs.TriggerMng:parse(jsonStr) + local parseTable = json.decode(jsonStr,1) + if nil == parseTable then + return + end + + local count = table.getn(parseTable) + for i = 1, count do + local subDict = parseTable[i] + local triggerObj = ccs.TriggerObj.new() + triggerObj:serialize(subDict) + local events = triggerObj:getEvents() + for j = 1, table.getn(events) do + local event = events[j] + self:add(event, triggerObj) + end + + self._triggerObjs[triggerObj:getId()] = triggerObj + end +end + +function ccs.TriggerMng:get(event) + return self._eventTriggers[event] +end + +function ccs.TriggerMng:getTriggerObj(id) + return self._triggerObjs[id] +end + +function ccs.TriggerMng:add(event,triggerObj) + local eventTriggers = self._eventTriggers[event] + if nil == eventTriggers then + eventTriggers = {} + end + + local exist = false + for i = 1, table.getn(eventTriggers) do + if eventTriggers[i] == triggers then + exist = true + break + end + end + + if not exist then + table.insert(eventTriggers,triggerObj) + self._eventTriggers[event] = eventTriggers + end +end + +function ccs.TriggerMng:removeAll( ) + for k in pairs(self._eventTriggers) do + local triObjArr = self._eventTriggers[k] + for j = 1, table.getn(triObjArr) do + local obj = triObjArr[j] + obj:removeAll() + end + end + self._eventTriggers = {} +end + +function ccs.TriggerMng:remove(event, obj) + + if nil ~= obj then + return self:removeObjByEvent(event, obj) + end + + assert(event >= 0,"event must be larger than 0") + if nil == self._eventTriggers then + return false + end + + local triObjects = self._eventTriggers[event] + if nil == triObjects then + return false + end + + for i = 1, table.getn(triObjects) do + local triObject = triggers[i] + if nil ~= triObject then + triObject:remvoeAll() + end + end + + self._eventTriggers[event] = nil + return true +end + +function ccs.TriggerMng:removeObjByEvent(event, obj) + assert(event >= 0,"event must be larger than 0") + if nil == self._eventTriggers then + return false + end + + local triObjects = self._eventTriggers[event] + if nil == triObjects then + return false + end + + for i = 1,table.getn(triObjects) do + local triObject = triObjects[i] + if nil ~= triObject and triObject == obj then + triObject:remvoeAll() + table.remove(triObjects, i) + return true + end + end +end + +function ccs.TriggerMng:removeTriggerObj(id) + local obj = self.getTriggerObj(id) + + if nil == obj then + return false + end + + local events = obj:getEvents() + for i = 1, table.getn(events) do + self:remove(events[i],obj) + end + + return true +end + +function ccs.TriggerMng:isEmpty() + return (not (nil == self._eventTriggers)) or table.getn(self._eventTriggers) <= 0 +end diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua index c7f557b0be..9d9fb3f504 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua @@ -1,3 +1,7 @@ +require "luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts" +require "luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/cons" +require "luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/eventDef" + local SceneEditorTestLayer = class("SceneEditorTestLayer") SceneEditorTestLayer._curNode = nil @@ -19,8 +23,9 @@ function SceneEditorTestLayer:createGameScene() self._curNode = node local function menuCloseCallback( sender ) - ccs.SceneReader:getInstance():destroySceneReader() - ccs.ActionManagerEx:destroyActionManager() + ccs.SceneReader:destroyInstance() + ccs.ActionManagerEx:destroyInstance() + ccs.TriggerMng.destroyInstance() local scene = CocoStudioTestMain() if scene ~= nil then cc.Director:getInstance():replaceScene(scene) @@ -42,9 +47,53 @@ function SceneEditorTestLayer:createGameScene() ccs.ActionManagerEx:getInstance():playActionByName("startMenu_1.json","Animation1") + local function onNodeEvent(event) + if event == "enter" then + self:onEnter() + elseif event == "exit" then + self:onExit() + end + end + + self:registerScriptHandler(onNodeEvent) + + local listener = cc.EventListenerTouchOneByOne:create() + listener:setSwallowTouches(true) + listener:registerScriptHandler(self.onTouchBegan,cc.Handler.EVENT_TOUCH_BEGAN ) + listener:registerScriptHandler(self.onTouchMoved,cc.Handler.EVENT_TOUCH_MOVED ) + listener:registerScriptHandler(self.onTouchEnded,cc.Handler.EVENT_TOUCH_ENDED ) + listener:registerScriptHandler(self.onTouchCancelled,cc.Handler.EVENT_TOUCH_CANCELLED ) + local eventDispatcher = self:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(listener, self) + return node end +function SceneEditorTestLayer:onEnter() + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_ENTERSCENE) +end + +function SceneEditorTestLayer:onExit() + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_LEAVESCENE) +end + +function SceneEditorTestLayer:onTouchBegan(touch,event) + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_TOUCHBEGAN) + return true +end + +function SceneEditorTestLayer:onTouchMoved(touch,event) + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_TOUCHMOVED) +end + +function SceneEditorTestLayer:onTouchEnded(touch,event) + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_TOUCHENDED) +end + +function SceneEditorTestLayer:onTouchCancelled(touch,event) + sendTriggerEvent(triggerEventDef.TRIGGEREVENT_TOUCHCANCELLED) +end + function SceneEditorTestLayer.create() local scene = cc.Scene:create() local layer = SceneEditorTestLayer.extend(cc.LayerColor:create()) diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua new file mode 100644 index 0000000000..b0a79acd2a --- /dev/null +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua @@ -0,0 +1,122 @@ +require "lua_cocos2d_studio" + +local TMoveBy = class("TMoveBy") +TMoveBy._tag = -1 +TMoveBy._duration = 0 +TMoveBy._x = 0 +TMoveBy._y = 0 +TMoveBy._reverse = false +function TMoveBy:ctor() + self._tag = -1 + self._duration = 0.0 + self._x = 0 + self._y = 0 + self._reverse = false +end + +function TMoveBy:init() + return true +end + +function TMoveBy:done() + local node = ccs.SceneReader:getInstance():getNodeByTag(self._tag) + if nil == node then + return + end + + local actionBy = cc.MoveBy:create(self._duration, cc.p(self._x, self._y)) + if nil == actionBy then + return + end + + if false == self._reverse then + local actionByBack = actionBy:reverse() + node:runAction(cc.Sequence:create(actionBy, actionByBack)) + else + node:runAction(actionBy) + end +end + +function TMoveBy:serialize(value) + local dataItems = value["dataitems"] + if nil ~= dataItems then + local count = table.getn(dataItems) + for i = 1, count do + local subDict = dataItems[i] + local key = subDict["key"] + if key == "Tag" then + self._tag = subDict["value"] + elseif key == "Duration" then + self._duration = subDict["value"] + elseif key == "x" then + self._x = subDict["value"] + elseif key == "y" then + self._y = subDict["value"] + elseif key == "IsReverse" then + self._reverse = subDict["value"] + end + end + end +end + +function TMoveBy:removeAll() + print("TMoveBy::removeAll") +end + +local TScaleTo = class("TScaleTo") +TScaleTo._tag = -1 +TScaleTo._duration = 0 +TScaleTo._scaleX = 0 +TScaleTo._scaleY = 0 + +function TScaleTo:ctor() + self._tag = -1 + self._duration = 0 + self._scaleX = 0 + self._scaleY = 0 +end + +function TScaleTo:init() + return true +end + +function TScaleTo:done() + local node = ccs.SceneReader:getInstance():getNodeByTag(self._tag) + if nil == node then + return + end + + local actionTo = cc.ScaleTo:create(self._duration, self._scaleX, self._scaleY) + if nil == actionTo then + return + end + + node:runAction(actionTo) +end + +function TScaleTo:serialize(value) + local dataItems = value["dataitems"] + if nil ~= dataItems then + local count = table.getn(dataItems) + for i = 1, count do + local subDict = dataItems[i] + local key = subDict["key"] + if key == "Tag" then + self._tag = subDict["value"] + elseif key == "Duration" then + self._duration = subDict["value"] + elseif key == "ScaleX" then + self._scaleX = subDict["value"] + elseif key == "ScaleY" then + self._scaleY = subDict["value"] + end + end + end +end + +function TScaleTo:removeAll() + print("TScaleTo::removeAll") +end + +ccs.registerTriggerClass("TScaleTo",TScaleTo.new) +ccs.registerTriggerClass("TMoveBy",TMoveBy.new) diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/cons.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/cons.lua new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/cons.lua @@ -0,0 +1 @@ + diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/eventDef.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/eventDef.lua new file mode 100644 index 0000000000..a973745b38 --- /dev/null +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/eventDef.lua @@ -0,0 +1,12 @@ + +triggerEventDef = +{ + TRIGGEREVENT_ENTERSCENE = 0, + TRIGGEREVENT_LEAVESCENE = 1, + TRIGGEREVENT_INITSCENE = 2, + TRIGGEREVENT_UPDATESCENE = 3, + TRIGGEREVENT_TOUCHBEGAN = 4, + TRIGGEREVENT_TOUCHMOVED = 5, + TRIGGEREVENT_TOUCHENDED = 6, + TRIGGEREVENT_TOUCHCANCELLED = 7, +} diff --git a/samples/Lua/TestLua/Resources/luaScript/TouchesTest/Ball.lua b/samples/Lua/TestLua/Resources/luaScript/TouchesTest/Ball.lua index 06c967b2a6..60cb715089 100644 --- a/samples/Lua/TestLua/Resources/luaScript/TouchesTest/Ball.lua +++ b/samples/Lua/TestLua/Resources/luaScript/TouchesTest/Ball.lua @@ -1,5 +1,5 @@ -require "luaScript/extern" +require "extern" require "luaScript/VisibleRect" require "luaScript/TouchesTest/Paddle" diff --git a/samples/Lua/TestLua/Resources/luaScript/TouchesTest/Paddle.lua b/samples/Lua/TestLua/Resources/luaScript/TouchesTest/Paddle.lua index 050d587ed5..61da0a5171 100644 --- a/samples/Lua/TestLua/Resources/luaScript/TouchesTest/Paddle.lua +++ b/samples/Lua/TestLua/Resources/luaScript/TouchesTest/Paddle.lua @@ -1,4 +1,4 @@ -require "luaScript/extern" +require "extern" require "luaScript/VisibleRect" Paddle = class("Paddle", function(texture) diff --git a/samples/Lua/TestLua/Resources/luaScript/VisibleRect.lua b/samples/Lua/TestLua/Resources/luaScript/VisibleRect.lua index 7d00240f8a..5d53b1f8e5 100644 --- a/samples/Lua/TestLua/Resources/luaScript/VisibleRect.lua +++ b/samples/Lua/TestLua/Resources/luaScript/VisibleRect.lua @@ -1,4 +1,4 @@ -require "luaScript/extern" +require "extern" require "Cocos2d" VisibleRect = class("VisibleRect") diff --git a/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua b/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua index bba1c79a98..cdb4c57d83 100644 --- a/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua +++ b/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua @@ -1,5 +1,4 @@ - - +require "lua_cocos2d" require "Cocos2d" require "Cocos2dConstants" require "Opengl" From efc7effac58d3accad583fb4203abf026b133bb1 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 14:20:52 +0800 Subject: [PATCH 087/428] Adds override keyword for some override methods in gui::Widget class. --- cocos/gui/UIWidget.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/gui/UIWidget.h b/cocos/gui/UIWidget.h index 379fc04003..f48210038e 100644 --- a/cocos/gui/UIWidget.h +++ b/cocos/gui/UIWidget.h @@ -315,7 +315,7 @@ public: */ virtual Widget* getChildByName(const char* name); - virtual void visit(); + virtual void visit() override; /** * Sets the touch event target/selector of the menu item @@ -333,7 +333,7 @@ public: * * @param position The position (x,y) of the widget in OpenGL coordinates */ - void setPosition(const Point &pos); + virtual void setPosition(const Point &pos) override; /** * Changes the position (x,y) of the widget in OpenGL coordinates @@ -618,8 +618,8 @@ public: Widget* clone(); - virtual void onEnter(); - virtual void onExit(); + virtual void onEnter() override; + virtual void onExit() override; void updateSizeAndPosition(); From dd54e906f002389397453f9627697dcdb7b0a1f4 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 14:21:24 +0800 Subject: [PATCH 088/428] =?UTF-8?q?ccs.XXX=20=E2=80=94>=20ccui.XXX=20for?= =?UTF-8?q?=20gui=20js=20bindings.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javascript/script/jsb_cocos2d_gui.js | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/cocos/scripting/javascript/script/jsb_cocos2d_gui.js b/cocos/scripting/javascript/script/jsb_cocos2d_gui.js index 7c607082b4..c9cc826a75 100644 --- a/cocos/scripting/javascript/script/jsb_cocos2d_gui.js +++ b/cocos/scripting/javascript/script/jsb_cocos2d_gui.js @@ -4,73 +4,73 @@ // This helper file should be required after jsb_cocos2d.js // -var ccs = ccs || {}; +var ccui = ccui || {}; -ccs.BrightStyle = { +ccui.BrightStyle = { none: -1, normal: 0, highlight: 1 }; -ccs.WidgetType = { +ccui.WidgetType = { widget: 0, //control container: 1 //container }; -ccs.TextureResType = { +ccui.TextureResType = { local: 0, plist: 1 }; -ccs.TouchEventType = { +ccui.TouchEventType = { began: 0, moved: 1, ended: 2, canceled: 3 }; -ccs.SizeType = { +ccui.SizeType = { absolute: 0, percent: 1 }; -ccs.PositionType = { +ccui.PositionType = { absolute: 0, percent: 1 }; -ccs.CheckBoxEventType = { +ccui.CheckBoxEventType = { selected: 0, unselected: 1 }; -ccs.TextFiledEventType = { +ccui.TextFiledEventType = { attach_with_me: 0, detach_with_ime: 1, insert_text: 2, delete_backward: 3 }; -ccs.LayoutBackGroundColorType = { +ccui.LayoutBackGroundColorType = { none: 0, solid: 1, gradient: 2 }; -ccs.LayoutType = { +ccui.LayoutType = { absolute: 0, linearVertical: 1, linearHorizontal: 2, relative: 3 }; -ccs.UILayoutParameterType = { +ccui.LayoutParameterType = { none: 0, linear: 1, relative: 2 }; -ccs.UILinearGravity = { +ccui.LinearGravity = { none: 0, left: 1, top: 2, @@ -80,7 +80,7 @@ ccs.UILinearGravity = { centerHorizontal: 6 }; -ccs.UIRelativeAlign = { +ccui.RelativeAlign = { alignNone: 0, alignParentTopLeft: 1, alignParentTopCenterHorizontal: 2, @@ -105,18 +105,18 @@ ccs.UIRelativeAlign = { locationBelowRightAlign: 21 }; -ccs.SliderEventType = {percent_changed: 0}; +ccui.SliderEventType = {percent_changed: 0}; -ccs.LoadingBarType = { left: 0, right: 1}; +ccui.LoadingBarType = { left: 0, right: 1}; -ccs.ScrollViewDir = { +ccui.ScrollViewDir = { none: 0, vertical: 1, horizontal: 2, both: 3 }; -ccs.ScrollviewEventType = { +ccui.ScrollviewEventType = { scrollToTop: 0, scrollToBottom: 1, scrollToLeft: 2, @@ -128,30 +128,30 @@ ccs.ScrollviewEventType = { bounceRight: 8 }; -ccs.ListViewEventType = { +ccui.ListViewEventType = { init_child: 0, update_child: 1 }; -ccs.PageViewEventType = { +ccui.ListViewGravity = { + left: 0, + right: 1, + centerHorizontal: 2, + top: 3, + bottom: 4, + centerVertical: 5 +}; + +ccui.PageViewEventType = { turning: 0 }; -ccs.PVTouchDir = { +ccui.PVTouchDir = { touchLeft: 0, touchRight: 1 }; -ccs.UIPanel = ccs.UILayout; -ccs.UITextArea = ccs.UILabel; -ccs.UIContainerWidget = ccs.UILayout; -ccs.UITextButton = ccs.UIButton; -ccs.UINodeContainer = ccs.UIWidget; -ccs.PanelColorType = ccs.LayoutBackGroundColorType; - -ccs.UILayout = ccs.Layout; - -ccs.UIMargin = cc.Class.extend({ +ccui.Margin = cc.Class.extend({ left: 0, top: 0, right: 0, From 3e044cf90e76e3c8553b7bb645848d4e3eee0115 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 14:22:00 +0800 Subject: [PATCH 089/428] Updates tools/tojs/cocos2dx_gui.ini. target_namespace from ccs to ccii. --- tools/tojs/cocos2dx_gui.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tojs/cocos2dx_gui.ini b/tools/tojs/cocos2dx_gui.ini index 8f243985b1..0659c3469f 100644 --- a/tools/tojs/cocos2dx_gui.ini +++ b/tools/tojs/cocos2dx_gui.ini @@ -5,7 +5,7 @@ prefix = cocos2dx_gui # create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`) # all classes will be embedded in that namespace -target_namespace = ccs +target_namespace = ccui # the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as "cocos2d::Label" <-> "cocos2d::gui::Label". cpp_namespace = cocos2d::gui From e2887a2b6446c437c7a9e0d2dd02d50f7240043a Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 14:22:22 +0800 Subject: [PATCH 090/428] Updates JS-Test submodule reference. --- samples/Javascript/Shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index cc16ced11b..88c672ca3a 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit cc16ced11b0327f58665d1dcb02f39e9d13d4fd8 +Subproject commit 88c672ca3ac79ae6f0e8695fe2ae683d73d98234 From cc2e6aef63764907429e0bc4a5305e8e5079de44 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 2 Jan 2014 14:25:15 +0800 Subject: [PATCH 091/428] =?UTF-8?q?Add=20missis=20=E2=80=9Cccs.=E2=80=9D?= =?UTF-8?q?=20prefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua index 9d9fb3f504..019809580c 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua @@ -91,7 +91,7 @@ function SceneEditorTestLayer:onTouchEnded(touch,event) end function SceneEditorTestLayer:onTouchCancelled(touch,event) - sendTriggerEvent(triggerEventDef.TRIGGEREVENT_TOUCHCANCELLED) + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_TOUCHCANCELLED) end function SceneEditorTestLayer.create() From ada5eb82eceb4e94de1e578bbbd0367827889b3c Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 2 Jan 2014 06:49:06 +0000 Subject: [PATCH 092/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 96129ccc8c..d44b30c76a 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 96129ccc8c55a5ad145581182e487da551e2103d +Subproject commit d44b30c76a4a65795709802063b9530ea36fb0b0 From c6425172b7273c4df75bffaf0b01c3c94d0d54b3 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 2 Jan 2014 06:58:15 +0000 Subject: [PATCH 093/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index d44b30c76a..b4cfb39999 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit d44b30c76a4a65795709802063b9530ea36fb0b0 +Subproject commit b4cfb39999c217125bd0426cc4f132b414f88828 From a2b706c87c1d98efb1f3a49460448b7bb922e418 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 2 Jan 2014 15:18:32 +0800 Subject: [PATCH 094/428] Rename some common script files to keep consistent --- .../project.pbxproj.REMOVED.git-id | 2 +- cocos/scripting/lua/script/Cocos2d.lua | 14 ++++++++++++++ .../{lua_cocos2d_studio.lua => Cocos2dStudio.lua} | 0 cocos/scripting/lua/script/lua_cocos2d.lua | 13 ------------- .../CocoStudioSceneTest/TriggerCode/acts.lua | 2 +- 5 files changed, 16 insertions(+), 15 deletions(-) rename cocos/scripting/lua/script/{lua_cocos2d_studio.lua => Cocos2dStudio.lua} (100%) delete mode 100644 cocos/scripting/lua/script/lua_cocos2d.lua diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index 4186b716ce..0c41a8573f 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -ab749c10e473dbc8a0ae687363de08a217f3a07a \ No newline at end of file +90acba349f3d22116230302d3bfd39867d820e8a \ No newline at end of file diff --git a/cocos/scripting/lua/script/Cocos2d.lua b/cocos/scripting/lua/script/Cocos2d.lua index 1445a271fe..eda99eaf95 100644 --- a/cocos/scripting/lua/script/Cocos2d.lua +++ b/cocos/scripting/lua/script/Cocos2d.lua @@ -1,3 +1,5 @@ +require "Cocos2dStudio" + cc = cc or {} cc.DIRECTOR_PROJECTION_2D = 0 @@ -360,3 +362,15 @@ end function cc.AnimationFrameData( _texCoords, _delay, _size) return { texCoords = _texCoords, delay = _delay, size = _size } end + +local ConfigType = +{ + NONE = 0, + COCOSTUDIO = 1, +} + +function __onParseConfig(configType,jasonStr) + if configType == ConfigType.COCOSTUDIO then + ccs.TriggerMng.getInstance():parse(jasonStr) + end +end diff --git a/cocos/scripting/lua/script/lua_cocos2d_studio.lua b/cocos/scripting/lua/script/Cocos2dStudio.lua similarity index 100% rename from cocos/scripting/lua/script/lua_cocos2d_studio.lua rename to cocos/scripting/lua/script/Cocos2dStudio.lua diff --git a/cocos/scripting/lua/script/lua_cocos2d.lua b/cocos/scripting/lua/script/lua_cocos2d.lua deleted file mode 100644 index bcf5f9d979..0000000000 --- a/cocos/scripting/lua/script/lua_cocos2d.lua +++ /dev/null @@ -1,13 +0,0 @@ -require "lua_cocos2d_studio" - -local ConfigType = -{ - NONE = 0, - COCOSTUDIO = 1, -} - -function __onParseConfig(configType,jasonStr) - if configType == ConfigType.COCOSTUDIO then - ccs.TriggerMng.getInstance():parse(jasonStr) - end -end diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua index b0a79acd2a..3b1618809a 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua @@ -1,4 +1,4 @@ -require "lua_cocos2d_studio" +require "Cocos2dStudio" local TMoveBy = class("TMoveBy") TMoveBy._tag = -1 From 75d68ee966eb8e070f08f9a0afcbe25393754414 Mon Sep 17 00:00:00 2001 From: Zhe Wang Date: Thu, 2 Jan 2014 15:25:42 +0800 Subject: [PATCH 095/428] Delete LICENSE_bada_pthread.txt --- licenses/LICENSE_bada_pthread.txt | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 licenses/LICENSE_bada_pthread.txt diff --git a/licenses/LICENSE_bada_pthread.txt b/licenses/LICENSE_bada_pthread.txt deleted file mode 100644 index 0cab2d908f..0000000000 --- a/licenses/LICENSE_bada_pthread.txt +++ /dev/null @@ -1,22 +0,0 @@ -/* - Bada pthread - Copyright (c) 2010 Markovtsev Vadim - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ From 4252a5501d024d7a0947c18842e9b14df8e7ad4d Mon Sep 17 00:00:00 2001 From: Zhe Wang Date: Thu, 2 Jan 2014 15:28:01 +0800 Subject: [PATCH 096/428] Delete LICENSE_iconv.txt --- licenses/LICENSE_iconv.txt | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 licenses/LICENSE_iconv.txt diff --git a/licenses/LICENSE_iconv.txt b/licenses/LICENSE_iconv.txt deleted file mode 100644 index e4442fb14b..0000000000 --- a/licenses/LICENSE_iconv.txt +++ /dev/null @@ -1,16 +0,0 @@ -Copyright (C) 1999-2003 Free Software Foundation, Inc. - -The GNU LIBICONV Library is free software; you can redistribute it -and/or modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -The GNU LIBICONV Library is distributed in the hope that it will be -useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU LIBICONV Library; see the file COPYING.LIB. -If not, write to the Free Software Foundation, Inc., 59 Temple Place - -Suite 330, Boston, MA 02111-1307, USA. \ No newline at end of file From 911aafe3db05e99bebac3983e9c1089f2864b015 Mon Sep 17 00:00:00 2001 From: Zhe Wang Date: Thu, 2 Jan 2014 15:28:24 +0800 Subject: [PATCH 097/428] Delete LICENSE_sigslot.txt --- licenses/LICENSE_sigslot.txt | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 licenses/LICENSE_sigslot.txt diff --git a/licenses/LICENSE_sigslot.txt b/licenses/LICENSE_sigslot.txt deleted file mode 100644 index 40501fa1a2..0000000000 --- a/licenses/LICENSE_sigslot.txt +++ /dev/null @@ -1,9 +0,0 @@ -License - -The sigslot library has been placed in the public domain. This means that you are free to use it however you like. - -The author takes no responsibility or liability of any kind for any use that you may make of this library. - -If you screw up, it's your fault. - -If the library screws up, you got it for free, so you should have tested it better - it's still your responsibility. \ No newline at end of file From 210aae9243a51ae0be14d83a13e5818a8fb8e126 Mon Sep 17 00:00:00 2001 From: Zhe Wang Date: Thu, 2 Jan 2014 15:29:09 +0800 Subject: [PATCH 098/428] Delete LICENSE_FontLabel.txt --- licenses/LICENSE_FontLabel.txt | 79 ---------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 licenses/LICENSE_FontLabel.txt diff --git a/licenses/LICENSE_FontLabel.txt b/licenses/LICENSE_FontLabel.txt deleted file mode 100644 index a45b29a380..0000000000 --- a/licenses/LICENSE_FontLabel.txt +++ /dev/null @@ -1,79 +0,0 @@ -FontLabel ---------- - -Copyright © 2009 Zynga Game Networks. - - -License -------- - -Apache License, Version 2.0 - -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - - 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and - 2. You must cause any modified files to carry prominent notices stating that You changed the files; and - 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - -You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS From 7abeacd86e57b97fab0fb2b46372f229b8075ca6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 15:47:38 +0800 Subject: [PATCH 099/428] HttpClient don't have to be inherited from Object, its a singeton, ok? --- cocos/network/HttpClient.cpp | 23 +++++++++++------------ cocos/network/HttpClient.h | 4 +--- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index 3fc6f2bb90..81e2d1f8d2 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -52,7 +52,7 @@ static bool s_need_quit = false; static Vector* s_requestQueue = nullptr; static Vector* s_responseQueue = nullptr; -static HttpClient *s_pHttpClient = NULL; // pointer to singleton +static HttpClient *s_pHttpClient = nullptr; // pointer to singleton static char s_errorBuffer[CURL_ERROR_SIZE] = {0}; @@ -97,7 +97,7 @@ static int processDeleteTask(HttpRequest *request, write_callback callback, void // Worker thread void HttpClient::networkThread() { - HttpRequest *request = NULL; + HttpRequest *request = nullptr; auto scheduler = Director::getInstance()->getScheduler(); @@ -109,7 +109,7 @@ void HttpClient::networkThread() } // step 1: send http request if the requestQueue isn't empty - request = NULL; + request = nullptr; s_requestQueueMutex.lock(); @@ -123,7 +123,7 @@ void HttpClient::networkThread() s_requestQueueMutex.unlock(); - if (NULL == request) + if (nullptr == request) { // Wait for http request tasks from main thread std::unique_lock lk(s_SleepMutex); @@ -263,7 +263,7 @@ class CURLRaii public: CURLRaii() : _curl(curl_easy_init()) - , _headers(NULL) + , _headers(nullptr) { } @@ -387,7 +387,7 @@ static int processDeleteTask(HttpRequest *request, write_callback callback, void // HttpClient implementation HttpClient* HttpClient::getInstance() { - if (s_pHttpClient == NULL) { + if (s_pHttpClient == nullptr) { s_pHttpClient = new HttpClient(); } @@ -396,8 +396,7 @@ HttpClient* HttpClient::getInstance() void HttpClient::destroyInstance() { - CCASSERT(s_pHttpClient, ""); - s_pHttpClient->release(); + CC_SAFE_DELETE(s_pHttpClient); } void HttpClient::enableCookies(const char* cookieFile) { @@ -419,17 +418,17 @@ HttpClient::~HttpClient() { s_need_quit = true; - if (s_requestQueue != NULL) { + if (s_requestQueue != nullptr) { s_SleepCondition.notify_one(); } - s_pHttpClient = NULL; + s_pHttpClient = nullptr; } //Lazy create semaphore & mutex & thread bool HttpClient::lazyInitThreadSemphore() { - if (s_requestQueue != NULL) { + if (s_requestQueue != nullptr) { return true; } else { @@ -473,7 +472,7 @@ void HttpClient::dispatchResponseCallbacks() { // log("CCHttpClient::dispatchResponseCallbacks is running"); - HttpResponse* response = NULL; + HttpResponse* response = nullptr; s_responseQueueMutex.lock(); diff --git a/cocos/network/HttpClient.h b/cocos/network/HttpClient.h index 1304f4b168..0f21d68413 100644 --- a/cocos/network/HttpClient.h +++ b/cocos/network/HttpClient.h @@ -43,7 +43,7 @@ namespace network { /** @brief Singleton that handles asynchrounous http requests * Once the request completed, a callback will issued in main thread when it provided during make request */ -class HttpClient : public cocos2d::Object +class HttpClient { public: /** Return the shared instance **/ @@ -106,8 +106,6 @@ private: private: int _timeoutForConnect; int _timeoutForRead; - - // std::string reqId; }; // end of Network group From d8025184130e4aba04a527ba4b5f25bf7b40a869 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 2 Jan 2014 15:51:25 +0800 Subject: [PATCH 100/428] Rename Cocos2dStudio.lua to CocoStudio.lua --- build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- .../scripting/lua/script/{Cocos2dStudio.lua => CocoStudio.lua} | 0 cocos/scripting/lua/script/Cocos2d.lua | 2 +- samples/Lua/TestLua/Resources/luaScript/mainMenu.lua | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) rename cocos/scripting/lua/script/{Cocos2dStudio.lua => CocoStudio.lua} (100%) diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index 0c41a8573f..bfb69a92ea 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -90acba349f3d22116230302d3bfd39867d820e8a \ No newline at end of file +7cc2be4e284d9095dd8fa56a092a98562f132776 \ No newline at end of file diff --git a/cocos/scripting/lua/script/Cocos2dStudio.lua b/cocos/scripting/lua/script/CocoStudio.lua similarity index 100% rename from cocos/scripting/lua/script/Cocos2dStudio.lua rename to cocos/scripting/lua/script/CocoStudio.lua diff --git a/cocos/scripting/lua/script/Cocos2d.lua b/cocos/scripting/lua/script/Cocos2d.lua index eda99eaf95..adbf4f91fe 100644 --- a/cocos/scripting/lua/script/Cocos2d.lua +++ b/cocos/scripting/lua/script/Cocos2d.lua @@ -1,4 +1,4 @@ -require "Cocos2dStudio" +require "CocoStudio" cc = cc or {} diff --git a/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua b/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua index cdb4c57d83..9f33902d66 100644 --- a/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua +++ b/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua @@ -1,4 +1,3 @@ -require "lua_cocos2d" require "Cocos2d" require "Cocos2dConstants" require "Opengl" From 57b0426994ad4f1f4051dc1eb32045a5685e3fdf Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Thu, 2 Jan 2014 16:19:23 +0800 Subject: [PATCH 101/428] fix bug clippingNodetest on mobile --- cocos/2d/CCClippingNode.cpp | 29 ++++++++++++++++++----------- cocos/2d/CCShaderCache.cpp | 2 +- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index d1f9c236e4..c2936fb4ce 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -217,7 +217,24 @@ void ClippingNode::visit() _beforeVisitCmd.init(0,_vertexZ); _beforeVisitCmd.func = CC_CALLBACK_0(ClippingNode::onBeforeVisit, this); renderer->addCommand(&_beforeVisitCmd); + if (_alphaThreshold < 1) + { +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WINDOWS || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#else + // since glAlphaTest do not exists in OES, use a shader that writes + // pixel only if greater than an alpha threshold + GLProgram *program = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST); + GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE); + // set our alphaThreshold + program->use(); + program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold); + // we need to recursively apply this shader to all the nodes in the stencil node + // XXX: we should have a way to apply shader to all nodes without having to do this + setProgram(_stencil, program); + +#endif + } _stencil->visit(); _afterDrawStencilCmd.init(0,_vertexZ); @@ -380,17 +397,7 @@ void ClippingNode::onBeforeVisit() // pixel will be drawn only if greater than an alpha threshold glAlphaFunc(GL_GREATER, _alphaThreshold); #else - // since glAlphaTest do not exists in OES, use a shader that writes - // pixel only if greater than an alpha threshold - GLProgram *program = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST); - GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE); - // set our alphaThreshold - program->use(); - program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold); - // we need to recursively apply this shader to all the nodes in the stencil node - // XXX: we should have a way to apply shader to all nodes without having to do this - setProgram(_stencil, program); - + #endif } diff --git a/cocos/2d/CCShaderCache.cpp b/cocos/2d/CCShaderCache.cpp index 5c751aa843..c727294e30 100644 --- a/cocos/2d/CCShaderCache.cpp +++ b/cocos/2d/CCShaderCache.cpp @@ -275,7 +275,7 @@ void ShaderCache::loadDefaultShader(GLProgram *p, int type) break; case kShaderType_PositionTextureColorAlphaTest: - p->initWithVertexShaderByteArray(ccPositionTextureColor_vert, ccPositionTextureColorAlphaTest_frag); + p->initWithVertexShaderByteArray(ccPositionTextureColor_noMVP_vert, ccPositionTextureColorAlphaTest_frag); p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION); p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR); From 80df88d2cffb654272b775f4526550e3037e504c Mon Sep 17 00:00:00 2001 From: Kenneth Chan Date: Wed, 20 Nov 2013 15:51:41 -0800 Subject: [PATCH 102/428] Add missing bindings to setBlendFunc for various classes Conflicts: cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp --- .../lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id index 368292552d..f74669824f 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id @@ -1 +1 @@ -c3e1d45b75519a265427c1b2479e2bf43305fc1d \ No newline at end of file +70b5d2e935546fbbd7ead2be713b560f03de1348 \ No newline at end of file From 67c5ba8dfb1d2eacc92bcc68ca2398430b510038 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 16:18:44 +0800 Subject: [PATCH 103/428] closed #3565: Adds missing `lua_pop`to prevent lua stack issues. --- .../lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id index f74669824f..d38d577d06 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id @@ -1 +1 @@ -70b5d2e935546fbbd7ead2be713b560f03de1348 \ No newline at end of file +31ce7e2d174b3b02eb3a30cbc999f1302c70b685 \ No newline at end of file From be383a944a6772f645409217e85f9d88d06f5b0f Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 16:24:20 +0800 Subject: [PATCH 104/428] Update AUTHORS [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 62e12d81d6..8366737586 100644 --- a/AUTHORS +++ b/AUTHORS @@ -692,6 +692,9 @@ Developers: zarelaky OpenAL context isn't destroyed correctly on mac and ios. + kicktheken (Kenneth Chan) + Fixed a bug that the setBlendFunc method of some classes wasn't exposed to LUA. + Retired Core Developers: WenSheng Yang Author of windows port, CCTextField, From 5bd580c1753a213b57cb33ea0e7f72850bcb8428 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 16:25:06 +0800 Subject: [PATCH 105/428] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 7a2dd173b2..a949380950 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -33,6 +33,7 @@ cocos2d-x-3.0beta0 ?? 2013 [FIX] Don't bind override functions for JSB and LuaBining since they aren't needed at all. [NEW] Adds spine JS binding support. [FIX] The order of onEnter and onExit is wrong. + [FIX] The setBlendFunc method of some classes wasn't exposed to LUA. cocos2d-x-3.0alpha1 Nov.19 2013 [all platforms] From 07600bd46b950e2502f7e6b539bc9fa2c1f9344d Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 2 Jan 2014 16:25:35 +0800 Subject: [PATCH 106/428] network -> cocos2d::network --- cocos/network/HttpClient.cpp | 4 +++- cocos/network/HttpClient.h | 4 ++++ cocos/network/HttpRequest.h | 4 ++++ cocos/network/HttpResponse.h | 4 ++++ cocos/network/SocketIO.cpp | 6 ++++-- cocos/network/SocketIO.h | 4 ++++ cocos/network/WebSocket.cpp | 6 ++++-- cocos/network/WebSocket.h | 4 ++++ .../NetworkTest/HttpClientTest.cpp | 2 +- .../ExtensionsTest/NetworkTest/HttpClientTest.h | 2 +- .../ExtensionsTest/NetworkTest/SocketIOTest.cpp | 2 +- .../ExtensionsTest/NetworkTest/SocketIOTest.h | 16 ++++++++-------- .../ExtensionsTest/NetworkTest/WebSocketTest.cpp | 11 +++++------ .../ExtensionsTest/NetworkTest/WebSocketTest.h | 16 ++++++++-------- 14 files changed, 55 insertions(+), 30 deletions(-) diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index 3fc6f2bb90..8f240153de 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -32,7 +32,7 @@ #include "platform/CCFileUtils.h" -using namespace cocos2d; +NS_CC_BEGIN namespace network { @@ -502,4 +502,6 @@ void HttpClient::dispatchResponseCallbacks() } +NS_CC_END + diff --git a/cocos/network/HttpClient.h b/cocos/network/HttpClient.h index 1304f4b168..18e18276a4 100644 --- a/cocos/network/HttpClient.h +++ b/cocos/network/HttpClient.h @@ -32,6 +32,8 @@ #include "network/HttpResponse.h" #include "network/HttpClient.h" +NS_CC_BEGIN + namespace network { /** @@ -115,4 +117,6 @@ private: } +NS_CC_END + #endif //__CCHTTPREQUEST_H__ diff --git a/cocos/network/HttpRequest.h b/cocos/network/HttpRequest.h index 7264daeba3..dd30f74455 100644 --- a/cocos/network/HttpRequest.h +++ b/cocos/network/HttpRequest.h @@ -27,6 +27,8 @@ #include "cocos2d.h" +NS_CC_BEGIN + namespace network { class HttpClient; @@ -231,4 +233,6 @@ protected: } +NS_CC_END + #endif //__HTTP_REQUEST_H__ diff --git a/cocos/network/HttpResponse.h b/cocos/network/HttpResponse.h index 9f4bd10028..25e7d43540 100644 --- a/cocos/network/HttpResponse.h +++ b/cocos/network/HttpResponse.h @@ -28,6 +28,8 @@ #include "cocos2d.h" #include "network/HttpRequest.h" +NS_CC_BEGIN + namespace network { /** @@ -179,4 +181,6 @@ protected: } +NS_CC_END + #endif //__HTTP_RESPONSE_H__ diff --git a/cocos/network/SocketIO.cpp b/cocos/network/SocketIO.cpp index 74bfbafa1a..da25ff015c 100644 --- a/cocos/network/SocketIO.cpp +++ b/cocos/network/SocketIO.cpp @@ -32,7 +32,7 @@ #include "HttpClient.h" #include -using namespace cocos2d; +NS_CC_BEGIN namespace network { @@ -687,4 +687,6 @@ void SocketIO::removeSocket(const std::string& uri) _sockets.erase(uri); } -} \ No newline at end of file +} + +NS_CC_END diff --git a/cocos/network/SocketIO.h b/cocos/network/SocketIO.h index 0e79f41984..6759c1cac7 100644 --- a/cocos/network/SocketIO.h +++ b/cocos/network/SocketIO.h @@ -61,6 +61,8 @@ in the onClose method the pointer should be set to NULL or used to connect to a #include "cocos2d.h" +NS_CC_BEGIN + namespace network { //forward declarations @@ -185,4 +187,6 @@ public: } +NS_CC_END + #endif /* defined(__CC_JSB_SOCKETIO_H__) */ diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 2e91b54bc0..6f12bd79ef 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -37,7 +37,7 @@ #include "libwebsockets.h" -using namespace cocos2d; +NS_CC_BEGIN namespace network { @@ -52,7 +52,7 @@ public: /** * @brief Websocket thread helper, it's used for sending message between UI thread and websocket thread. */ -class WsThreadHelper : public cocos2d::Object +class WsThreadHelper : public Object { public: WsThreadHelper(); @@ -648,3 +648,5 @@ void WebSocket::onUIThreadReceiveMessage(WsMessage* msg) } } + +NS_CC_END diff --git a/cocos/network/WebSocket.h b/cocos/network/WebSocket.h index 9a354d47a4..a561900894 100644 --- a/cocos/network/WebSocket.h +++ b/cocos/network/WebSocket.h @@ -37,6 +37,8 @@ struct libwebsocket; struct libwebsocket_context; struct libwebsocket_protocols; +NS_CC_BEGIN + namespace network { class WsThreadHelper; @@ -163,4 +165,6 @@ private: } +NS_CC_END + #endif /* defined(__CC_JSB_WEBSOCKET_H__) */ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp index d085c2ce91..22658d5fb0 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp @@ -4,7 +4,7 @@ USING_NS_CC; USING_NS_CC_EXT; -using namespace network; +using namespace cocos2d::network; HttpClientTest::HttpClientTest() : _labelStatusCode(NULL) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h index 9f7d1d3fa3..774793e660 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h @@ -20,7 +20,7 @@ public: void onMenuDeleteTestClicked(cocos2d::Object *sender); //Http Response Callback - void onHttpRequestCompleted(network::HttpClient *sender, network::HttpResponse *response); + void onHttpRequestCompleted(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response); private: cocos2d::LabelTTF* _labelStatusCode; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp index 58e9650a12..3f40ff4b5d 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp @@ -12,7 +12,7 @@ USING_NS_CC; USING_NS_CC_EXT; -using namespace network; +using namespace cocos2d::network; SocketIOTestLayer::SocketIOTestLayer(void) : _sioClient(NULL) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h index 56695bb6a4..ee4f4540d5 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h @@ -14,16 +14,16 @@ class SocketIOTestLayer : public cocos2d::Layer - , public network::SocketIO::SIODelegate + , public cocos2d::network::SocketIO::SIODelegate { public: SocketIOTestLayer(void); virtual ~SocketIOTestLayer(void); - virtual void onConnect(network::SIOClient* client); - virtual void onMessage(network::SIOClient* client, const std::string& data); - virtual void onClose(network::SIOClient* client); - virtual void onError(network::SIOClient* client, const std::string& data); + virtual void onConnect(cocos2d::network::SIOClient* client); + virtual void onMessage(cocos2d::network::SIOClient* client, const std::string& data); + virtual void onClose(cocos2d::network::SIOClient* client); + virtual void onError(cocos2d::network::SIOClient* client, const std::string& data); void toExtensionsMainLayer(cocos2d::Object *sender); @@ -38,10 +38,10 @@ public: void onMenuTestEndpointDisconnectClicked(cocos2d::Object *sender); - void testevent(network::SIOClient *client, const std::string& data); - void echotest(network::SIOClient *client, const std::string& data); + void testevent(cocos2d::network::SIOClient *client, const std::string& data); + void echotest(cocos2d::network::SIOClient *client, const std::string& data); - network::SIOClient *_sioClient, *_sioEndpoint; + cocos2d::network::SIOClient *_sioClient, *_sioEndpoint; cocos2d::LabelTTF *_sioClientStatus; }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp index 39a3ec5cc1..d04259101b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp @@ -11,7 +11,6 @@ USING_NS_CC; USING_NS_CC_EXT; -using namespace network; WebSocketTestLayer::WebSocketTestLayer() : _wsiSendText(NULL) @@ -74,9 +73,9 @@ WebSocketTestLayer::WebSocketTestLayer() menuBack->setPosition(Point::ZERO); addChild(menuBack); - _wsiSendText = new WebSocket(); - _wsiSendBinary = new WebSocket(); - _wsiError = new WebSocket(); + _wsiSendText = new network::WebSocket(); + _wsiSendBinary = new network::WebSocket(); + _wsiError = new network::WebSocket(); if (!_wsiSendText->init(*this, "ws://echo.websocket.org")) { @@ -202,7 +201,7 @@ void WebSocketTestLayer::toExtensionsMainLayer(cocos2d::Object *sender) // Menu Callbacks void WebSocketTestLayer::onMenuSendTextClicked(cocos2d::Object *sender) { - if (_wsiSendText->getReadyState() == WebSocket::State::OPEN) + if (_wsiSendText->getReadyState() == network::WebSocket::State::OPEN) { _sendTextStatus->setString("Send Text WS is waiting..."); _wsiSendText->send("Hello WebSocket, I'm a text message."); @@ -217,7 +216,7 @@ void WebSocketTestLayer::onMenuSendTextClicked(cocos2d::Object *sender) void WebSocketTestLayer::onMenuSendBinaryClicked(cocos2d::Object *sender) { - if (_wsiSendBinary->getReadyState() == WebSocket::State::OPEN) + if (_wsiSendBinary->getReadyState() == network::WebSocket::State::OPEN) { _sendBinaryStatus->setString("Send Binary WS is waiting..."); char buf[] = "Hello WebSocket,\0 I'm\0 a\0 binary\0 message\0."; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h index fcec4ec724..ce1529eef0 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h @@ -15,16 +15,16 @@ class WebSocketTestLayer : public cocos2d::Layer -, public network::WebSocket::Delegate +, public cocos2d::network::WebSocket::Delegate { public: WebSocketTestLayer(); virtual ~WebSocketTestLayer(); - virtual void onOpen(network::WebSocket* ws); - virtual void onMessage(network::WebSocket* ws, const network::WebSocket::Data& data); - virtual void onClose(network::WebSocket* ws); - virtual void onError(network::WebSocket* ws, const network::WebSocket::ErrorCode& error); + virtual void onOpen(cocos2d::network::WebSocket* ws); + virtual void onMessage(cocos2d::network::WebSocket* ws, const cocos2d::network::WebSocket::Data& data); + virtual void onClose(cocos2d::network::WebSocket* ws); + virtual void onError(cocos2d::network::WebSocket* ws, const cocos2d::network::WebSocket::ErrorCode& error); void toExtensionsMainLayer(cocos2d::Object *sender); @@ -33,9 +33,9 @@ public: void onMenuSendBinaryClicked(cocos2d::Object *sender); private: - network::WebSocket* _wsiSendText; - network::WebSocket* _wsiSendBinary; - network::WebSocket* _wsiError; + cocos2d::network::WebSocket* _wsiSendText; + cocos2d::network::WebSocket* _wsiSendBinary; + cocos2d::network::WebSocket* _wsiError; cocos2d::LabelTTF* _sendTextStatus; cocos2d::LabelTTF* _sendBinaryStatus; From b1714d74e5e69018cbc3157f31bc4fb376e1da69 Mon Sep 17 00:00:00 2001 From: heliclei Date: Thu, 2 Jan 2014 17:09:49 +0800 Subject: [PATCH 107/428] refining exception handling --- tools/jenkins-scripts/ghprb.py | 156 ++++++++++++++++----------------- 1 file changed, 76 insertions(+), 80 deletions(-) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index 3e7c2f6f7c..d5019971d0 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -8,28 +8,8 @@ import urllib import base64 import requests import sys +import traceback -#get payload from os env -payload_str = os.environ['payload'] -#parse to json obj -payload = json.loads(payload_str) - -#get pull number -pr_num = payload['number'] -print 'pr_num:' + str(pr_num) - -#build for pull request action 'open' and 'synchronize', skip 'close' -action = payload['action'] -print 'action: ' + action -if((action != 'opened') and (action != 'synchronize')): - print 'pull request #' + str(pr_num) + ' is closed, no build triggered' - exit(0) - - -pr = payload['pull_request'] -url = pr['html_url'] -print "url:" + url -pr_desc = '

pr#' + str(pr_num) + '

' #set Jenkins build description using submitDescription to mock browser behavior #TODO: need to set parent build description def set_description(desc): @@ -39,77 +19,93 @@ def set_description(desc): req.add_header('Content-Type', 'application/x-www-form-urlencoded') base64string = base64.encodestring(os.environ['JENKINS_ADMIN']+ ":" + os.environ['JENKINS_ADMIN_PW']).replace('\n', '') req.add_header("Authorization", "Basic " + base64string) - urllib2.urlopen(req) -try: + try: + urllib2.urlopen(req) + raise(12345) + except: + traceback.format_exc() +def main(): + #get payload from os env + payload_str = os.environ['payload'] + #parse to json obj + payload = json.loads(payload_str) + + #get pull number + pr_num = payload['number'] + print 'pr_num:' + str(pr_num) + + #build for pull request action 'open' and 'synchronize', skip 'close' + action = payload['action'] + print 'action: ' + action + if((action != 'opened') and (action != 'synchronize')): + print 'pull request #' + str(pr_num) + ' is closed, no build triggered' + exit(0) + + + pr = payload['pull_request'] + url = pr['html_url'] + print "url:" + url + pr_desc = '

pr#' + str(pr_num) + '

' set_description(pr_desc) -except: - e = sys.exc_info()[0] - print e -#get statuses url -statuses_url = pr['statuses_url'] + #get statuses url + statuses_url = pr['statuses_url'] -#get pr target branch -branch = pr['head']['ref'] + #get pr target branch + branch = pr['head']['ref'] -#set commit status to pending -target_url = os.environ['BUILD_URL'] -data = {"state":"pending", "target_url":target_url} -acccess_token = os.environ['GITHUB_ACCESS_TOKEN'] -Headers = {"Authorization":"token " + acccess_token} -try: - requests.post(statuses_url, data=json.dumps(data), headers=Headers) - - #reset path to workspace root - os.system("cd " + os.environ['WORKSPACE']); + #set commit status to pending + target_url = os.environ['BUILD_URL'] + data = {"state":"pending", "target_url":target_url} + acccess_token = os.environ['GITHUB_ACCESS_TOKEN'] + Headers = {"Authorization":"token " + acccess_token} - #fetch pull request to local repo - git_fetch_pr = "git fetch origin pull/" + str(pr_num) + "/head" - os.system(git_fetch_pr) + try: + requests.post(statuses_url, data=json.dumps(data), headers=Headers) + raise(test123) + except: + traceback.format_exc() - #checkout - git_checkout = "git checkout -b " + "pull" + str(pr_num) + " FETCH_HEAD" - os.system(git_checkout) + #build + #TODO: support android-mac build currently + #TODO: add android-windows7 build + #TODO: add android-linux build + #TODO: add ios build + #TODO: add mac build + #TODO: add win32 build + if(branch == 'develop'): + ret = os.system("python build/android-build.py -n -j5 testcpp") + elif(branch == 'master'): + ret = os.system("samples/Cpp/TestCpp/proj.android/build_native.sh") - #update submodule - git_update_submodule = "git submodule update --init --force" - os.system(git_update_submodule) -except: - e = sys.exc_info()[0] - print e + #get build result + print "build finished and return " + str(ret) + if ret == 0: + exit_code = 0 + data['state'] = "success" + + else: + exit_code = 1 + data['state'] = "failure" - -#build -#TODO: support android-mac build currently -#TODO: add android-windows7 build -#TODO: add android-linux build -#TODO: add ios build -#TODO: add mac build -#TODO: add win32 build -if(branch == 'develop'): - ret = os.system("python build/android-build.py -n -j5 testcpp") -elif(branch == 'master'): - ret = os.system("samples/Cpp/TestCpp/proj.android/build_native.sh") - -#get build result -print "build finished and return " + str(ret) -if ret == 0: - exit_code = 0 - data['state'] = "success" - -else: - exit_code = 1 - data['state'] = "failure" -try: #set commit status - requests.post(statuses_url, data=json.dumps(data), headers=Headers) + try: + requests.post(statuses_url, data=json.dumps(data), headers=Headers) + raise(test123) + except: + traceback.format_exc() #clean workspace os.system("cd " + os.environ['WORKSPACE']); os.system("git checkout develop") os.system("git branch -D pull" + str(pr_num)) -except: - e = sys.exc_info()[0] - print e -exit(exit_code) + exit(exit_code) + +# -------------- main -------------- +if __name__ == '__main__': + try: + main() + except: + traceback.format_exc() + exit(1) From dd0b22be8d4dab55814d9047be5a8620ef365a41 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 2 Jan 2014 17:18:40 +0800 Subject: [PATCH 108/428] resolved ui animation easing error for develop branch --- cocos/editor-support/cocostudio/CCActionEaseEx.cpp | 13 +++++++------ cocos/editor-support/cocostudio/CCActionFrame.cpp | 12 +++--------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCActionEaseEx.cpp b/cocos/editor-support/cocostudio/CCActionEaseEx.cpp index 1f6881248a..5a823242fe 100644 --- a/cocos/editor-support/cocostudio/CCActionEaseEx.cpp +++ b/cocos/editor-support/cocostudio/CCActionEaseEx.cpp @@ -196,7 +196,7 @@ EaseQuadraticActionInOut* EaseQuadraticActionInOut::clone() const void EaseQuadraticActionInOut::update(float time) { float resultTime = time; - time = time*0.5f; + time = time*2; if (time < 1) { resultTime = time * time * 0.5f; @@ -331,7 +331,7 @@ EaseQuarticActionInOut* EaseQuarticActionInOut::clone() const void EaseQuarticActionInOut::update(float time) { - float tempTime = time * 0.5f; + float tempTime = time * 2; if (tempTime < 1) tempTime = powf(tempTime,4.0f) * 0.5f; else @@ -464,7 +464,7 @@ EaseQuinticActionInOut* EaseQuinticActionInOut::clone() const void EaseQuinticActionInOut::update(float time) { - float tempTime = time * 0.5f; + float tempTime = time * 2; if (tempTime < 1) tempTime = powf(tempTime,5.0f) * 0.5f; else @@ -597,13 +597,13 @@ EaseCircleActionInOut* EaseCircleActionInOut::clone() const void EaseCircleActionInOut::update(float time) { - float tempTime = time * 0.5f; + float tempTime = time * 2; if (tempTime < 1) tempTime = (1- sqrt(1 - powf(tempTime,2.0f))) * 0.5f; else { tempTime -= 2; - tempTime = (1+ sqrt(1 - powf(tempTime,2.0f))); + tempTime = (1+ sqrt(1 - powf(tempTime,2.0f))) * 0.5f; } _inner->update(time); @@ -688,6 +688,7 @@ EaseCubicActionOut* EaseCubicActionOut::clone() const void EaseCubicActionOut::update(float time) { + time -= 1; _inner->update(1+powf(time,3.0f)); } @@ -729,7 +730,7 @@ EaseCubicActionInOut* EaseCubicActionInOut::clone() const void EaseCubicActionInOut::update(float time) { - float tempTime = time * 0.5f; + float tempTime = time * 2; if (tempTime < 1) tempTime = powf(tempTime,3.0f) * 0.5f; else diff --git a/cocos/editor-support/cocostudio/CCActionFrame.cpp b/cocos/editor-support/cocostudio/CCActionFrame.cpp index 0dcade248d..1a67511c9a 100644 --- a/cocos/editor-support/cocostudio/CCActionFrame.cpp +++ b/cocos/editor-support/cocostudio/CCActionFrame.cpp @@ -182,23 +182,17 @@ ActionInterval* ActionFrame::getEasingAction(ActionInterval* action) break; case FrameEaseType::ELASTIC_EASEIN: { - EaseElasticIn* cAction = EaseElasticIn::create(action); - cAction->setPeriod(_Parameter[0]); - return cAction; + return EaseElasticIn::create(action); } break; case FrameEaseType::ELASTIC_EASEOUT: { - EaseElasticOut* cAction = EaseElasticOut::create(action); - cAction->setPeriod(_Parameter[0]); - return cAction; + return EaseElasticOut::create(action); } break; case FrameEaseType::ELASTIC_EASEINOUT: { - EaseElasticInOut* cAction = EaseElasticInOut::create(action); - cAction->setPeriod(_Parameter[0]); - return cAction; + return EaseElasticInOut::create(action); } break; case FrameEaseType::BACK_EASEIN: From 8eeb32c98c180706745cd243ddb2307903008c57 Mon Sep 17 00:00:00 2001 From: heliclei Date: Thu, 2 Jan 2014 17:22:23 +0800 Subject: [PATCH 109/428] remove debug code --- tools/jenkins-scripts/Monkeyrunner_TestCpp.py | 839 ------------------ tools/jenkins-scripts/build.xml | 95 -- 2 files changed, 934 deletions(-) delete mode 100644 tools/jenkins-scripts/Monkeyrunner_TestCpp.py delete mode 100644 tools/jenkins-scripts/build.xml diff --git a/tools/jenkins-scripts/Monkeyrunner_TestCpp.py b/tools/jenkins-scripts/Monkeyrunner_TestCpp.py deleted file mode 100644 index 40c9e8f7f5..0000000000 --- a/tools/jenkins-scripts/Monkeyrunner_TestCpp.py +++ /dev/null @@ -1,839 +0,0 @@ -# Imports the monkeyrunner modules used by this program -import sys -import subprocess -import random -import os -from com.android.monkeyrunner import MonkeyRunner as mr -from com.android.monkeyrunner import MonkeyDevice as md -from com.android.monkeyrunner import MonkeyImage as mi - -#Define test functions. -def common_test(a,b,c): - for i in range(a,b): - mr.sleep(c) - device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') - -def random_click(a,b,c): - for i in range(a,b): - touch_x = random.randint(0,s_width/20*19) - touch_y = random.randint(0,s_height) - device.touch(touch_x,touch_y,'DOWN_AND_UP') - mr.sleep(c) - -def random_drag(a,b,c): - for i in range(a,b): - drag_x = random.randint(0,s_width/20*18) - drag_y = random.randint(0,s_height) - drop_x = random.randint(0,s_width/20*18) - drop_y = random.randint(0,s_height) - device.drag((drag_x,drag_y),(drop_x,drop_y)) - -def check_activity(a): - print "get running activities..." - subprocess.call("adb shell ps > running_activities.txt",shell=True) - #subprocess.call("adb pull running_activities.txt",shell=True) - - f1 = open('running_activities.txt') - while True: - line = f1.readline() - if not line.find('org.cocos2dx.testcpp') == -1: - break; - if len(line) == 0: - str = "TestCpp wasn't running,maybe it has crashes,please checkout:" - f2 = file('monkeyrunner_Error.log','w') - print "get logcat information..." - f2.write(str) - f2.write(a) - #subprocess.call("adb shell logcat | $ANDROID_NDK/ndk-stack -sym $ANDROID_HOME/tools/obj/local/armeabi > monkeyrunner_Error.log",shell=True); - f2.close() - sys.exit(1) - print "subprocess has finished!" - f1.close() - -# Connects to the current device, returning a MonkeyDevice object -device = mr.waitForConnection() -if not device: - print >> sys.stderr,"fail" - check_activity("is there a device connect to the testing machine.") - sys.exit(1) -else: - print "Start......" - -# Installs the Android package. Notice that this method returns a boolean, so you can test -# to see if the installation worked. -if device.installPackage(sys.argv[1]): - print "Install success!" -else: - print "Install failed,please make sure you have put apk in the right places" - check_activity("you have put apk in the right place") - sys.exit(1) - -# sets a variable with the package's internal name -package = 'org.cocos2dx.testcpp' -print "Package name: "+ package - -# sets a variable with the name of an Activity in the package -activity = 'org.cocos2dx.testcpp.TestCpp' -print "Activity name: " + activity - -# sets the name of the component to start -runComponent = package + '/' + activity - -# Runs the component -device.startActivity(component=runComponent) -print "Running activity......" - -#Set Screen's Length and Width -s_width = 800 -s_height = 480 - -#Set boolean variable of Acticity_IsRunning -Acticity_IsRunning = 1 - -#----------------ActionsTest---------------- -print "Run ActionsTest" -mr.sleep(2.0) -device.touch(s_width/2,s_height/48*5,'DOWN_AND_UP') -#Last Test -#device.touch(s_width/8*3,s_height/16*15,'DOWN_AND_UP') -common_test(1,28,1.0) -common_test(1,3,3.0) -common_test(1,6,1.0) -mr.sleep(1.0) -#Next Test -#device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -print "ActionsTest finished!" -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("ActionsTest") - -#----------------TransitionsTest---------------- -print "Run TransitionsTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/6,'DOWN_AND_UP') -common_test(1,27,1.0) -mr.sleep(1.0) -print "TransitionsTest finished!" -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("TransitionsTest") - -#----------------ActionsProgressTest---------------- -print "Run ActionsProgressTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/48*11,'DOWN_AND_UP') -common_test(1,8,2.0) -mr.sleep(1.0) -print "ActionsProgressTest finished!" -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("ActionsProgressTest") - -#----------------EffectsTest---------------- -mr.sleep(1.0) -print "Run EffectsTest" -device.touch(s_width/2,s_height/3,'DOWN_AND_UP') -common_test(1,22,3.0) -mr.sleep(1.0) -print "EffectsTest finished!" -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("EffectsTest") - -#----------------ClickAndMoveTest---------------- -print "Run ClickAndMoveTest" -mr.sleep(5.0) -device.touch(s_width/2,s_height/12*5,'DOWN_AND_UP') -mr.sleep(1.0) -random_click(1,11,2.0) -mr.sleep(1.0) -random_click(1,101,0.0) -mr.sleep(1.0) -print "ClickAndMoveTest finished!" -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("ClickAndMoveTest") - -#----------------RotateWorldTest---------------- -print "Run RotateWorldTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/2,'DOWN_AND_UP') -mr.sleep(5.0) -print "RotateWorldTest finished!" -mr.sleep(3.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("RotateWorldTest") - -#----------------ParticleTest---------------- -print "Run ParticleTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/12*7,'DOWN_AND_UP') -common_test(1,43,2.0) -print "ParticleTest finished!" -mr.sleep(2.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("ParticleTest") - -#----------------ActionsEaseTest---------------- -print "Run ActionsEaseTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/3*2,'DOWN_AND_UP') -mr.sleep(2.0) -common_test(1,14,2.0) -print "ActionsEaseTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("ActionsEaseTest") - -#----------------MotionStreakTest---------------- -print "Run MontionStreakTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/4*3,'DOWN_AND_UP') -mr.sleep(1.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -random_drag(1,11,0.5) -mr.sleep(1.0) -device.touch(s_width/2,s_height/4*3,'DOWN_AND_UP') -mr.sleep(1.0) -random_drag(1,11,0.5) -print "MontionStreakTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("MontionStreakTest") - -#----------------DrawPrimitivesTest---------------- -print "Run DrawprimitivesTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/6*5,'DOWN_AND_UP') -mr.sleep(1.0) -print "DrawPrimitivesTest finished!" -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("DrawPrimitivesTest") - -#----------------NodeTest---------------- -print "Run NodeTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/12*11,'DOWN_AND_UP') -mr.sleep(1.0) -common_test(1,14,1.0) -print "NodeTest finished!" -mr.sleep(3.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("NodeTest") -mr.sleep(1.0) -device.drag((s_width/4*3,s_height/16*15),(s_width/4*3,0)) - -#----------------TouchesTest---------------- -print "Run TouchesTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/12,'DOWN_AND_UP') -print "TouchesTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("TouchesTest") - -#----------------MenuTest---------------- -print "Run MenuTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/6,'DOWN_AND_UP') -mr.sleep(1.0) -#Atlas Sprite -device.touch(s_width/2,s_height/48*13,'DOWN_AND_UP') -mr.sleep(1.0) -#Play -device.touch(s_width/8*3,s_height/24*11,'DOWN_AND_UP') -mr.sleep(1.0) -#items -device.touch(s_width/2,s_height/24*11,'DOWN_AND_UP') -device.touch(s_width/2,s_height/24*11,'DOWN_AND_UP') -mr.sleep(1.0) -#Configuration -device.touch(400,260,'DOWN_AND_UP') -mr.sleep(1.0) -print "MenuTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("MenuTest") - -#----------------ActionManagerTest---------------- -print "Run ActionManagerTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/48*11,'DOWN_AND_UP') -common_test(1,5,3.0) -print "ActionManagerTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("ActionManagerTest") - -#----------------LayerTest---------------- -print "Run LayerTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/3,'DOWN_AND_UP') -random_drag(1,11,0.5) -mr.sleep(1.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -mr.sleep(2.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -mr.sleep(2.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -random_drag(1,11,0.5) -print "LayerTest finished!" -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("LayerTest") - -#----------------SceneTest---------------- -print "Run SceneTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/12*5,'DOWN_AND_UP') -mr.sleep(1.0) -device.touch(s_width/2,s_height/12*5,'DOWN_AND_UP') -mr.sleep(1.0) -device.touch(s_width/2,s_height/12*5,'DOWN_AND_UP') -mr.sleep(1.0) -device.touch(s_width/2,s_height/12*5,'DOWN_AND_UP') -mr.sleep(1.0) -device.touch(s_width/2,s_height/12*7,'DOWN_AND_UP') -mr.sleep(1.0) -device.touch(s_width/2,s_height/2,'DOWN_AND_UP') -mr.sleep(1.5) -device.touch(s_width/2,s_height/2,'DOWN_AND_UP') -mr.sleep(1.5) -device.touch(s_width/2,s_height/2,'DOWN_AND_UP') -print "SceneTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("SceneTest") - -#----------------ParallaxTest---------------- -print "Run ParallaxTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/2,'DOWN_AND_UP') -mr.sleep(5.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -random_drag(1,11,0.5) -print "ParallaxTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("ParallaxTest") - -#----------------TileMapTest---------------- -print "Run TileMapTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/12*7,'DOWN_AND_UP') -mr.sleep(2.0) -for TileMap_i in range(1,20): - random_drag(1,5,2.0) - #Next Test - device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') - -mr.sleep(2.0) -print "TileMapTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("TileMapTest") - -#----------------IntervalTest---------------- -print "Run IntervalTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/3*2,'DOWN_AND_UP') -mr.sleep(3.0) -device.touch(s_width/2,s_height/12,'DOWN_AND_UP') -mr.sleep(1.0) -device.touch(s_width/2,s_height/12,'DOWN_AND_UP') -print "IntervalTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("IntervalTest") - -#----------------ChipmunkAccelTouchTest---------------- -print "Run ChipmunkAccelTouchTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/4*3,'DOWN_AND_UP') -random_click(1,21,0.1) -print "ChipmunkAccelTouchTest finished!" -mr.sleep(2.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("ChipmunkAccelTouchTest") - -#----------------LabelTest---------------- -print "Run LabelTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/6*5,'DOWN_AND_UP') -mr.sleep(3.0) -common_test(1,26,0.5) -mr.sleep(1.0) -print "LableTest finished!" -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("LabelTest") - -#----------------TestInputTest---------------- -print "Run TestInputTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/12*11,'DOWN_AND_UP') -print "TestInputTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("TestInputTest") -mr.sleep(1.0) -device.drag((s_width/4*3,s_height/16*15),(s_width/4*3,0)) - -#----------------SpriteTest---------------- -print "Run SpriteTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/16,'DOWN_AND_UP') -mr.sleep(1.0) -random_click(1,11,0.1) -mr.sleep(2.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -random_click(1,11,0.1) -mr.sleep(1.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -mr.sleep(1.0) -common_test(1,109,0.5) -print "SpriteTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("SpriteTest") - -#----------------SchdulerTest---------------- -print "Run SchdulerTest" -mr.sleep(2.0) -device.touch(s_width/2,s_height/48*7,'DOWN_AND_UP') -mr.sleep(1.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -#Scheduler timeScale Test -mr.sleep(1.0) -device.drag((s_width/16*9,s_height/8*5),(s_width/16*7,s_height/8*5)) -mr.sleep(1.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -#Two custom schedulers -mr.sleep(1.0) -device.drag((s_width/16*5,s_height/24),(s_width/16*3,s_height/24)) -mr.sleep(1.0) -common_test(1,11,1) -print "SchdulerTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("SchdulerTest") - -#----------------RenderTextureTest---------------- -print "Run RenderTextureTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/48*11,'DOWN_AND_UP') -mr.sleep(1.0) -random_drag(1,11,0.5) -mr.sleep(1.0) -device.touch(s_width/8*7,s_height/24,'DOWN_AND_UP') -mr.sleep(1.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -mr.sleep(1.0) -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -mr.sleep(1.0) -#Testing Z Buffer in Render Texture -random_click(1,11,0.1) -mr.sleep(1.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -print "RenderTextureTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("RenderTextureTest") - -#----------------Testure2DTest---------------- -print "Run Testure2DTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/16*5,'DOWN_AND_UP') -common_test(1,36,0.5) -print "Testure2DTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("Testure2DTest") - -#----------------Box2dTest---------------- -print "Run Box2dTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/48*19,'DOWN_AND_UP') -random_click(1,31,0.1) -print "Box2dTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("Box2dTest") - -#----------------Box2dTestBed---------------- -print "Run Box2dTestBed" -mr.sleep(1.0) -device.touch(s_width/2,s_height/48*23,'DOWN_AND_UP') -common_test(1,36,2.0) -print "Box2dTestBed finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("Box2dTestBed") - -#----------------EffectAdvancedTest---------------- -print "Run EffectAdvancedTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/16*9,'DOWN_AND_UP') -common_test(1,6,1.0) -print "EffectAdvancedTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("EffectAdvancedTest") - -#----------------Accelerometer---------------- -print "Run Accelerometer" -mr.sleep(5.0) -device.touch(s_width/2,s_height/48*31,'DOWN_AND_UP') -mr.sleep(1.0) -print "Accelerometer finished!" -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -mr.sleep(3.0) -check_activity("Accelerometer") - -#----------------KeypadTest---------------- -print "Run KeypadTest" -mr.sleep(3.0) -device.touch(s_width/2,s_height/48*35,'DOWN_AND_UP') -mr.sleep(1.0) -device.press('KEYCODE_BACK','DOWN_AND_UP') -print "KeypadTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("KeypadTest") - -#----------------CocosDenshionTest---------------- -print "Run CocosDenshionTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/48*39,'DOWN_AND_UP') -#device.touch(400,30,'DOWN_AND_UP') -#device.touch(400,100,'DOWN_AND_UP') -print "CocosDenshionTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("CocosDenshionTest") - -#----------------PerformanceTest---------------- -print "Run PerformanceTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/48*43,'DOWN_AND_UP') -mr.sleep(1.0) -#PerformanceNodeChildrenTest -device.touch(s_width/2,s_height/12,'DOWN_AND_UP') -mr.sleep(1.0) -common_test(1,6,1.0) -#Back -device.touch(s_width/20*19,s_height/96*91,'DOWN_AND_UP') -mr.sleep(1.0) -#PerformanceParticleTest -device.touch(s_width/2,s_height/6,'DOWN_AND_UP') -mr.sleep(1.0) -#for NodeChildren_i in range(1,5): -# device.touch(450,240,'DOWN_AND_UP') -# mr.sleep(1.0) -# device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -# mr.sleep(1.0) -common_test(1,5,1.0) -#Back -device.touch(s_width/20*19,s_height/96*91,'DOWN_AND_UP') -mr.sleep(1.0) -#PerformanceSpriteTest -device.touch(s_width/2,s_height/4,'DOWN_AND_UP') -mr.sleep(1.0) -#for NodeChildren_i in range(1,8): -# device.touch(430,80,'DOWN_AND_UP') -# mr.sleep(1.0) -# device.touch(370,80,'DOWN_AND_UP') -# mr.sleep(1.0) -common_test(1,8,1.0) -#Back -device.touch(s_width/20*19,s_height/96*91,'DOWN_AND_UP') -mr.sleep(1.0) -#PerformanceTextureTest -#device.touch(s_width/2,s_height/3,'DOWN_AND_UP') -#mr.sleep(1.0) -#Back -#device.touch(s_width/20*19,s_height/96*91,'DOWN_AND_UP') -#mr.sleep(1.0) -#PerformanceTouchesTest -device.touch(s_width/2,s_height/12*5,'DOWN_AND_UP') -mr.sleep(1.0) -random_drag(1,11,0.2) -#Next Test -mr.sleep(1.0) -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -mr.sleep(1.0) -random_drag(1,11,0.2) -mr.sleep(1.0) -#Back -device.touch(s_width/20*19,s_height/96*91,'DOWN_AND_UP') -print "PerformanceTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("PerformanceTest") - -#----------------ZwoptexTest---------------- -print "Run ZwoptexTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/48*47,'DOWN_AND_UP') -print "ZwoptexTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("ZwoptexTest") -mr.sleep(1.0) -device.drag((s_width/4*3,s_height/16*15),(s_width/4*3,0)) - -#----------------CurlTest---------------- -print "Run CurlTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/4,'DOWN_AND_UP') -mr.sleep(1.0) -random_click(1,2,1.0) -print "CurlTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("CurlTest") -mr.sleep(1.0) -device.drag((s_width/4*3,s_height/16*15),(s_width/4*3,0)) - -#----------------UserDefaultTest---------------- -print "Run UserDefaultTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/3,'DOWN_AND_UP') -print "UserDefaultTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("UserDefaultTest") -mr.sleep(1.0) -device.drag((s_width/4*3,s_height/16*15),(s_width/4*3,0)) - -#----------------BugsTest---------------- -print "Run BugsTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/12*5,'DOWN_AND_UP') -print "BugsTest is finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("BugsTest") -mr.sleep(1.0) -device.drag((s_width/4*3,s_height/16*15),(s_width/4*3,0)) - -#----------------FontTest---------------- -print "Run FontTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/2,'DOWN_AND_UP') -mr.sleep(1.0) -common_test(1,6,0.5) -mr.sleep(1.0) -print "FontTest finished!" -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("FontTest") -mr.sleep(1.0) -device.drag((s_width/4*3,s_height/16*15),(s_width/4*3,0)) - -#----------------CurrentLanguageTest---------------- -print "Run CurrentLanguageTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/12*7,'DOWN_AND_UP') -print "CurrentLanguageTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("CurrentLanguageTest") -mr.sleep(1.0) -device.drag((s_width/4*3,s_height/16*15),(s_width/4*3,0)) - -#----------------TextureCacheTest---------------- -print "Run TextureCacheTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/3*2,'DOWN_AND_UP') -print "TextureCacheTest is finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("TextureCacheTest") -mr.sleep(1.0) -device.drag((s_width/4*3,s_height/16*15),(s_width/4*3,0)) - -#----------------ExtensionsTest---------------- -print "Run ExtensionsTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/4*3,'DOWN_AND_UP') -#NotificationCenterTest -mr.sleep(1.0) -device.touch(s_width/2,s_height/12,'DOWN_AND_UP') -mr.sleep(1.0) -device.touch(s_width/40*23,s_height/2,'DOWN_AND_UP') -mr.sleep(1.0) -device.touch(s_width/40*23,s_height/2,'DOWN_AND_UP') -#Back -mr.sleep(1.0) -device.touch(s_width/20*19,s_height/96*91,'DOWN_AND_UP') -#CCControlButtonTest -mr.sleep(1.5) -device.touch(s_width/2,s_height/6,'DOWN_AND_UP') -mr.sleep(1.5) -device.drag((s_width/2,s_height/48*25),(s_width/20*13,s_height/48*25)) -mr.sleep(1.5) -device.drag((s_width/20*13,s_height/48*25),(s_width/20*7,s_height/48*25)) - #Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -mr.sleep(1.5) -device.touch(s_width/16*7,s_height/2,'DOWN_AND_UP') -mr.sleep(1.5) -device.touch(s_width/40*19,s_height/2,'DOWN_AND_UP') -mr.sleep(1.5) - #Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -mr.sleep(1.5) - #Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -mr.sleep(1.5) -random_click(1,10,0.1) - #Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -mr.sleep(1.5) -random_click(1,10,0.1) -mr.sleep(1.5) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -mr.sleep(1.5) -random_click(1,10,0.1) -mr.sleep(1.5) - #Back -device.touch(s_width/20*19,s_height/96*91,'DOWN_AND_UP') -mr.sleep(1.5) -#CocosBuilderTest -device.touch(s_width/2,s_height/4,'DOWN_AND_UP') -mr.sleep(1.5) - #Menus & Items -device.touch(s_width/4,s_height/2,'DOWN_AND_UP') -mr.sleep(1.5) -device.touch(s_width/4,s_height/24*11,'DOWN_AND_UP') -mr.sleep(1.5) -device.touch(s_width/2,s_height/24*11,'DOWN_AND_UP') -mr.sleep(1.5) - #ItemBack -device.touch(s_width/40,s_height/24,'DOWN_AND_UP') -mr.sleep(1.5) - #Sprite & 9 Slice -device.touch(s_width/4*3,s_height/2,'DOWN_AND_UP') -mr.sleep(1.5) - #ItemBack -device.touch(s_width/40,s_height/24,'DOWN_AND_UP') -mr.sleep(1.5) - #Button -device.touch(s_width/4,s_height/8*5,'DOWN_AND_UP') -mr.sleep(1.5) -device.touch(s_width/2,s_height/24*11,'DOWN_AND_UP') -mr.sleep(1.5) -device.drag((s_width/2,s_height/24*11),(s_width/2,s_height/8*5)) -mr.sleep(1.5) - #ItemBack -device.touch(s_width/40,s_height/24,'DOWN_AND_UP') -mr.sleep(1.5) - #Labels -device.touch(s_width/4*3,s_height/8*5,'DOWN_AND_UP') -mr.sleep(1.5) - #ItemBack -device.touch(s_width/40,s_height/24,'DOWN_AND_UP') -mr.sleep(1.5) - #Particle Systems -device.touch(s_width/40,s_height/4*3,'DOWN_AND_UP') -mr.sleep(1.5) - #ItemBack -device.touch(s_width/40,s_height/24,'DOWN_AND_UP') -mr.sleep(1.5) - #Scroll Views -device.touch(s_width/4*3,s_height/4*3,'DOWN_AND_UP') -mr.sleep(1.5) -random_drag(1,10,0.2) -mr.sleep(1.5) - #ItemBack -device.touch(s_width/40,s_height/24,'DOWN_AND_UP') -mr.sleep(1.5) -print "ExtensionsTest finished!" -mr.sleep(1.5) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("ExtensionsTest") -mr.sleep(1.0) -device.drag((s_width/4*3,s_height/16*15),(s_width/4*3,0)) - -#----------------ShaderTest---------------- -print "Run ShaderTest" -mr.sleep(1.0) -device.touch(s_width/2,s_height/6*5,'DOWN_AND_UP') -mr.sleep(7.0) -common_test(1,7,1.0) -mr.sleep(2.0) -device.drag((s_width/2,s_height/3*2),(s_width/80*51,s_height/3*2)) -mr.sleep(1.0) -device.drag((s_width/80*51,s_height/3*2),(s_width/80*29,s_height/3*2)) -mr.sleep(1.0) -#Next Test -device.touch(s_width/8*5,s_height/16*15,'DOWN_AND_UP') -print "ShaderTest finished!" -mr.sleep(3.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("ShaderTest") -mr.sleep(1.0) -device.drag((s_width/4*3,s_height/16*15),(s_width/4*3,0)) - -#----------------MutiTouchTest---------------- -print "Run MutiTouchTest" -mr.sleep(3.0) -device.touch(s_width/2,s_height/12*11,'DOWN_AND_UP') -mr.sleep(1.0) -random_drag(1,10,0.1) -print "MutiTouchTest finished!" -mr.sleep(1.0) -#MainMenu -device.touch(s_width/40*39,s_height/96*91,'DOWN_AND_UP') -check_activity("MutiTouchTest") - -#----------------Quit---------------- -mr.sleep(1.0) -device.touch(s_width/80*77,s_height/12,'DOWN_AND_UP') diff --git a/tools/jenkins-scripts/build.xml b/tools/jenkins-scripts/build.xml deleted file mode 100644 index dd45cdcb55..0000000000 --- a/tools/jenkins-scripts/build.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From ded3e753f3041d29e3b7469564bc7d69bd9b0149 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 2 Jan 2014 17:23:00 +0800 Subject: [PATCH 110/428] use std::function for call back --- cocos/2d/CCTextureCache.cpp | 21 +++------- cocos/2d/CCTextureCache.h | 8 ++-- .../Classes/Texture2dTest/Texture2dTest.cpp | 19 ++++----- .../Classes/Texture2dTest/Texture2dTest.h | 2 +- .../TextureCacheTest/TextureCacheTest.cpp | 42 +++++++++---------- .../TextureCacheTest/TextureCacheTest.h | 2 +- 6 files changed, 41 insertions(+), 53 deletions(-) diff --git a/cocos/2d/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp index 83a5d7fad2..686f1ef760 100644 --- a/cocos/2d/CCTextureCache.cpp +++ b/cocos/2d/CCTextureCache.cpp @@ -92,7 +92,7 @@ std::string TextureCache::getDescription() const return StringUtils::format("", _textures.size()); } -void TextureCache::addImageAsync(const std::string &path, Object *target, SEL_CallFuncO selector) +void TextureCache::addImageAsync(const std::string &path, std::function callback) { Texture2D *texture = nullptr; @@ -102,9 +102,9 @@ void TextureCache::addImageAsync(const std::string &path, Object *target, SEL_Ca if( it != _textures.end() ) texture = it->second; - if (texture != nullptr && target && selector) + if (texture != nullptr) { - (target->*selector)(texture); + callback(texture); return; } @@ -127,13 +127,8 @@ void TextureCache::addImageAsync(const std::string &path, Object *target, SEL_Ca ++_asyncRefCount; - if (target) - { - target->retain(); - } - // generate async struct - AsyncStruct *data = new AsyncStruct(fullpath, target, selector); + AsyncStruct *data = new AsyncStruct(fullpath, callback); // add async struct into queue _asyncStructQueueMutex.lock(); @@ -243,8 +238,6 @@ void TextureCache::addImageAsyncCallBack(float dt) AsyncStruct *asyncStruct = imageInfo->asyncStruct; Image *image = imageInfo->image; - Object *target = asyncStruct->target; - SEL_CallFuncO selector = asyncStruct->selector; const std::string& filename = asyncStruct->filename; Texture2D *texture = nullptr; @@ -272,11 +265,7 @@ void TextureCache::addImageAsyncCallBack(float dt) texture = it->second; } - if (target && selector) - { - (target->*selector)(texture); - target->release(); - } + asyncStruct->callback(texture); if(image) { image->release(); diff --git a/cocos/2d/CCTextureCache.h b/cocos/2d/CCTextureCache.h index df94ff16a9..5b5c9ac95e 100644 --- a/cocos/2d/CCTextureCache.h +++ b/cocos/2d/CCTextureCache.h @@ -34,6 +34,7 @@ THE SOFTWARE. #include #include #include +#include #include "CCObject.h" #include "CCTexture2D.h" @@ -115,7 +116,7 @@ public: * Supported image extensions: .png, .jpg * @since v0.8 */ - virtual void addImageAsync(const std::string &filepath, Object *target, SEL_CallFuncO selector); + virtual void addImageAsync(const std::string &filepath, std::function callback); /** Returns a Texture2D object given an Image. * If the image was not previously loaded, it will create a new Texture2D object and it will return it. @@ -175,11 +176,10 @@ public: struct AsyncStruct { public: - AsyncStruct(const std::string& fn, Object *t, SEL_CallFuncO s) : filename(fn), target(t), selector(s) {} + AsyncStruct(const std::string& fn, std::function f) : filename(fn), callback(f) {} std::string filename; - Object *target; - SEL_CallFuncO selector; + std::function callback; }; protected: diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp index 3373be2eaf..7a096c25cb 100644 --- a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp +++ b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp @@ -1511,21 +1511,20 @@ void TextureAsync::loadImages(float dt) for( int j=0;j < 8; j++) { char szSpriteName[100] = {0}; sprintf(szSpriteName, "Images/sprites_test/sprite-%d-%d.png", i, j); - Director::getInstance()->getTextureCache()->addImageAsync(szSpriteName,this, callfuncO_selector(TextureAsync::imageLoaded)); + Director::getInstance()->getTextureCache()->addImageAsync(szSpriteName, CC_CALLBACK_1(TextureAsync::imageLoaded, this)); } } - Director::getInstance()->getTextureCache()->addImageAsync("Images/background1.jpg",this, callfuncO_selector(TextureAsync::imageLoaded)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/background2.jpg",this, callfuncO_selector(TextureAsync::imageLoaded)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/background.png",this, callfuncO_selector(TextureAsync::imageLoaded)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/atlastest.png",this, callfuncO_selector(TextureAsync::imageLoaded)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_atlas.png",this, callfuncO_selector(TextureAsync::imageLoaded)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/background1.jpg", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/background2.jpg", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/background.png", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/atlastest.png", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_atlas.png", CC_CALLBACK_1(TextureAsync::imageLoaded, this)); } -void TextureAsync::imageLoaded(Object* pObj) +void TextureAsync::imageLoaded(Texture2D* texture) { - auto tex = static_cast(pObj); auto director = Director::getInstance(); //CCASSERT( [NSThread currentThread] == [director runningThread], @"FAIL. Callback should be on cocos2d thread"); @@ -1534,7 +1533,7 @@ void TextureAsync::imageLoaded(Object* pObj) // This test just creates a sprite based on the Texture - auto sprite = Sprite::createWithTexture(tex); + auto sprite = Sprite::createWithTexture(texture); sprite->setAnchorPoint(Point(0,0)); addChild(sprite, -1); @@ -1544,7 +1543,7 @@ void TextureAsync::imageLoaded(Object* pObj) _imageOffset++; - log("Image loaded: %p", tex); + log("Image loaded: %p", texture); } std::string TextureAsync::title() const diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h index 5b8f9207ab..cafc812e77 100644 --- a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h +++ b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h @@ -387,7 +387,7 @@ public: CREATE_FUNC(TextureAsync); virtual ~TextureAsync(); void loadImages(float dt); - void imageLoaded(Object* pObj); + void imageLoaded(cocos2d::Texture2D* texture); virtual std::string title() const override; virtual std::string subtitle() const override; virtual void onEnter(); diff --git a/samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.cpp b/samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.cpp index 698a2935fd..31c4beaef9 100644 --- a/samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.cpp @@ -21,29 +21,29 @@ TextureCacheTest::TextureCacheTest() this->addChild(_labelPercent); // load textrues - Director::getInstance()->getTextureCache()->addImageAsync("Images/HelloWorld.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_01.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_02.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_03.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_04.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_05.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_06.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_07.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_08.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_09.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_10.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_11.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_12.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_13.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_14.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/background1.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/background2.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/background3.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); - Director::getInstance()->getTextureCache()->addImageAsync("Images/blocks.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/HelloWorld.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_01.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_02.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_03.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_04.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_05.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_06.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_07.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_08.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_09.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_10.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_11.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_12.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_13.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/grossini_dance_14.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/background1.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/background2.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/background3.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); + Director::getInstance()->getTextureCache()->addImageAsync("Images/blocks.png", CC_CALLBACK_1(TextureCacheTest::loadingCallBack, this)); } -void TextureCacheTest::loadingCallBack(Object *obj) +void TextureCacheTest::loadingCallBack(cocos2d::Texture2D *texture) { ++_numberOfLoadedSprites; char tmp[10]; diff --git a/samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.h b/samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.h index fed36cad2d..b2dfdf7d2e 100644 --- a/samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.h +++ b/samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.h @@ -10,7 +10,7 @@ class TextureCacheTest : public Layer public: TextureCacheTest(); void addSprite(); - void loadingCallBack(cocos2d::Object *obj); + void loadingCallBack(cocos2d::Texture2D *texture); private: cocos2d::LabelTTF *_labelLoading; From 48579fe3ace172cdc1819e583aa974bfabc0d68a Mon Sep 17 00:00:00 2001 From: heliclei Date: Thu, 2 Jan 2014 17:25:29 +0800 Subject: [PATCH 111/428] remove debug code --- tools/jenkins-scripts/ghprb.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index d5019971d0..8404c96a7a 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -21,7 +21,6 @@ def set_description(desc): req.add_header("Authorization", "Basic " + base64string) try: urllib2.urlopen(req) - raise(12345) except: traceback.format_exc() def main(): @@ -62,7 +61,6 @@ def main(): try: requests.post(statuses_url, data=json.dumps(data), headers=Headers) - raise(test123) except: traceback.format_exc() @@ -91,7 +89,6 @@ def main(): #set commit status try: requests.post(statuses_url, data=json.dumps(data), headers=Headers) - raise(test123) except: traceback.format_exc() From 80adda2ce81979d425dbe65106c901b4c37d87c0 Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 2 Jan 2014 17:54:52 +0800 Subject: [PATCH 112/428] fixed self assignment error and provide move semantics to pushBack of Vector --- cocos/base/CCMap.h | 16 +++-- cocos/base/CCString.cpp | 4 +- cocos/base/CCValue.cpp | 156 ++++++++++++++++++++-------------------- cocos/base/CCVector.h | 25 +++++-- 4 files changed, 111 insertions(+), 90 deletions(-) diff --git a/cocos/base/CCMap.h b/cocos/base/CCMap.h index 44c7846076..3f42bdc847 100644 --- a/cocos/base/CCMap.h +++ b/cocos/base/CCMap.h @@ -316,18 +316,22 @@ public: /** Copy assignment operator */ Map& operator= ( const Map& other ) { - CCLOGINFO("In the copy assignment operator of Map!"); - clear(); - _data = other._data; - addRefForAllObjects(); + if (this != &other) { + CCLOGINFO("In the copy assignment operator of Map!"); + clear(); + _data = other._data; + addRefForAllObjects(); + } return *this; } /** Move assignment operator */ Map& operator= ( Map&& other ) { - CCLOGINFO("In the move assignment operator of Map!"); - _data = std::move(other._data); + if (this != &other) { + CCLOGINFO("In the move assignment operator of Map!"); + _data = std::move(other._data); + } return *this; } diff --git a/cocos/base/CCString.cpp b/cocos/base/CCString.cpp index a8643372a0..8714861da4 100644 --- a/cocos/base/CCString.cpp +++ b/cocos/base/CCString.cpp @@ -58,7 +58,9 @@ __String::~__String() __String& __String::operator= (const __String& other) { - _string = other._string; + if (this != &other) { + _string = other._string; + } return *this; } diff --git a/cocos/base/CCValue.cpp b/cocos/base/CCValue.cpp index ac63402a50..e2a6112716 100644 --- a/cocos/base/CCValue.cpp +++ b/cocos/base/CCValue.cpp @@ -178,89 +178,93 @@ Value::~Value() Value& Value::operator= (const Value& other) { - switch (other._type) { - case Type::BYTE: - _baseData.byteVal = other._baseData.byteVal; - break; - case Type::INTEGER: - _baseData.intVal = other._baseData.intVal; - break; - case Type::FLOAT: - _baseData.floatVal = other._baseData.floatVal; - break; - case Type::DOUBLE: - _baseData.doubleVal = other._baseData.doubleVal; - break; - case Type::BOOLEAN: - _baseData.boolVal = other._baseData.boolVal; - break; - case Type::STRING: - _strData = other._strData; - break; - case Type::VECTOR: - if (_vectorData == nullptr) - _vectorData = new ValueVector(); - *_vectorData = *other._vectorData; - break; - case Type::MAP: - if (_mapData == nullptr) - _mapData = new ValueMap(); - *_mapData = *other._mapData; - break; - case Type::INT_KEY_MAP: - if (_intKeyMapData == nullptr) - _intKeyMapData = new ValueMapIntKey(); - *_intKeyMapData = *other._intKeyMapData; - break; - default: - break; + if (this != &other) { + switch (other._type) { + case Type::BYTE: + _baseData.byteVal = other._baseData.byteVal; + break; + case Type::INTEGER: + _baseData.intVal = other._baseData.intVal; + break; + case Type::FLOAT: + _baseData.floatVal = other._baseData.floatVal; + break; + case Type::DOUBLE: + _baseData.doubleVal = other._baseData.doubleVal; + break; + case Type::BOOLEAN: + _baseData.boolVal = other._baseData.boolVal; + break; + case Type::STRING: + _strData = other._strData; + break; + case Type::VECTOR: + if (_vectorData == nullptr) + _vectorData = new ValueVector(); + *_vectorData = *other._vectorData; + break; + case Type::MAP: + if (_mapData == nullptr) + _mapData = new ValueMap(); + *_mapData = *other._mapData; + break; + case Type::INT_KEY_MAP: + if (_intKeyMapData == nullptr) + _intKeyMapData = new ValueMapIntKey(); + *_intKeyMapData = *other._intKeyMapData; + break; + default: + break; + } + _type = other._type; } - _type = other._type; return *this; } Value& Value::operator= (Value&& other) { - switch (other._type) { - case Type::BYTE: - _baseData.byteVal = other._baseData.byteVal; - break; - case Type::INTEGER: - _baseData.intVal = other._baseData.intVal; - break; - case Type::FLOAT: - _baseData.floatVal = other._baseData.floatVal; - break; - case Type::DOUBLE: - _baseData.doubleVal = other._baseData.doubleVal; - break; - case Type::BOOLEAN: - _baseData.boolVal = other._baseData.boolVal; - break; - case Type::STRING: - _strData = other._strData; - break; - case Type::VECTOR: - CC_SAFE_DELETE(_vectorData); - _vectorData = other._vectorData; - break; - case Type::MAP: - CC_SAFE_DELETE(_mapData); - _mapData = other._mapData; - break; - case Type::INT_KEY_MAP: - CC_SAFE_DELETE(_intKeyMapData); - _intKeyMapData = other._intKeyMapData; - break; - default: - break; + if (this != &other) { + switch (other._type) { + case Type::BYTE: + _baseData.byteVal = other._baseData.byteVal; + break; + case Type::INTEGER: + _baseData.intVal = other._baseData.intVal; + break; + case Type::FLOAT: + _baseData.floatVal = other._baseData.floatVal; + break; + case Type::DOUBLE: + _baseData.doubleVal = other._baseData.doubleVal; + break; + case Type::BOOLEAN: + _baseData.boolVal = other._baseData.boolVal; + break; + case Type::STRING: + _strData = other._strData; + break; + case Type::VECTOR: + CC_SAFE_DELETE(_vectorData); + _vectorData = other._vectorData; + break; + case Type::MAP: + CC_SAFE_DELETE(_mapData); + _mapData = other._mapData; + break; + case Type::INT_KEY_MAP: + CC_SAFE_DELETE(_intKeyMapData); + _intKeyMapData = other._intKeyMapData; + break; + default: + break; + } + _type = other._type; + + other._vectorData = nullptr; + other._mapData = nullptr; + other._intKeyMapData = nullptr; + other._type = Type::NONE; } - _type = other._type; - - other._vectorData = nullptr; - other._mapData = nullptr; - other._intKeyMapData = nullptr; - other._type = Type::NONE; return *this; } diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index 5fd07e4dc7..bbf578930b 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -107,18 +107,22 @@ public: /** Copy assignment operator */ Vector& operator=(const Vector& other) { - CCLOGINFO("In the copy assignment operator!"); - clear(); - _data = other._data; - addRefForAllObjects(); + if (this != &other) { + CCLOGINFO("In the copy assignment operator!"); + clear(); + _data = other._data; + addRefForAllObjects(); + } return *this; } /** Move assignment operator */ Vector& operator=(Vector&& other) { - CCLOGINFO("In the move assignment operator!"); - _data = std::move(other._data); + if (this != &other) { + CCLOGINFO("In the move assignment operator!"); + _data = std::move(other._data); + } return *this; } @@ -260,7 +264,14 @@ public: * which causes an automatic reallocation of the allocated storage space * if -and only if- the new vector size surpasses the current vector capacity. */ - void pushBack(T object) + void pushBack(const T& object) + { + CCASSERT(object != nullptr, "The object should not be nullptr"); + _data.push_back( object ); + object->retain(); + } + + void pushBack(const T&& object) { CCASSERT(object != nullptr, "The object should not be nullptr"); _data.push_back( object ); From 75d5bcfb42a72a7ad661339ddab3efad6aa59fbc Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 2 Jan 2014 18:05:22 +0800 Subject: [PATCH 113/428] remove const modifier of move semantic --- cocos/base/CCVector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index bbf578930b..ebafd8b199 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -271,7 +271,7 @@ public: object->retain(); } - void pushBack(const T&& object) + void pushBack(T&& object) { CCASSERT(object != nullptr, "The object should not be nullptr"); _data.push_back( object ); From 8a7228049ac140416ee4a12502e88618618f9fe4 Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 2 Jan 2014 17:54:52 +0800 Subject: [PATCH 114/428] fixed self assignment error and provide move semantics to pushBack of Vector --- cocos/base/CCMap.h | 16 +++-- cocos/base/CCString.cpp | 4 +- cocos/base/CCValue.cpp | 156 ++++++++++++++++++++-------------------- cocos/base/CCVector.h | 25 +++++-- 4 files changed, 111 insertions(+), 90 deletions(-) diff --git a/cocos/base/CCMap.h b/cocos/base/CCMap.h index 44c7846076..3f42bdc847 100644 --- a/cocos/base/CCMap.h +++ b/cocos/base/CCMap.h @@ -316,18 +316,22 @@ public: /** Copy assignment operator */ Map& operator= ( const Map& other ) { - CCLOGINFO("In the copy assignment operator of Map!"); - clear(); - _data = other._data; - addRefForAllObjects(); + if (this != &other) { + CCLOGINFO("In the copy assignment operator of Map!"); + clear(); + _data = other._data; + addRefForAllObjects(); + } return *this; } /** Move assignment operator */ Map& operator= ( Map&& other ) { - CCLOGINFO("In the move assignment operator of Map!"); - _data = std::move(other._data); + if (this != &other) { + CCLOGINFO("In the move assignment operator of Map!"); + _data = std::move(other._data); + } return *this; } diff --git a/cocos/base/CCString.cpp b/cocos/base/CCString.cpp index a8643372a0..8714861da4 100644 --- a/cocos/base/CCString.cpp +++ b/cocos/base/CCString.cpp @@ -58,7 +58,9 @@ __String::~__String() __String& __String::operator= (const __String& other) { - _string = other._string; + if (this != &other) { + _string = other._string; + } return *this; } diff --git a/cocos/base/CCValue.cpp b/cocos/base/CCValue.cpp index ac63402a50..e2a6112716 100644 --- a/cocos/base/CCValue.cpp +++ b/cocos/base/CCValue.cpp @@ -178,89 +178,93 @@ Value::~Value() Value& Value::operator= (const Value& other) { - switch (other._type) { - case Type::BYTE: - _baseData.byteVal = other._baseData.byteVal; - break; - case Type::INTEGER: - _baseData.intVal = other._baseData.intVal; - break; - case Type::FLOAT: - _baseData.floatVal = other._baseData.floatVal; - break; - case Type::DOUBLE: - _baseData.doubleVal = other._baseData.doubleVal; - break; - case Type::BOOLEAN: - _baseData.boolVal = other._baseData.boolVal; - break; - case Type::STRING: - _strData = other._strData; - break; - case Type::VECTOR: - if (_vectorData == nullptr) - _vectorData = new ValueVector(); - *_vectorData = *other._vectorData; - break; - case Type::MAP: - if (_mapData == nullptr) - _mapData = new ValueMap(); - *_mapData = *other._mapData; - break; - case Type::INT_KEY_MAP: - if (_intKeyMapData == nullptr) - _intKeyMapData = new ValueMapIntKey(); - *_intKeyMapData = *other._intKeyMapData; - break; - default: - break; + if (this != &other) { + switch (other._type) { + case Type::BYTE: + _baseData.byteVal = other._baseData.byteVal; + break; + case Type::INTEGER: + _baseData.intVal = other._baseData.intVal; + break; + case Type::FLOAT: + _baseData.floatVal = other._baseData.floatVal; + break; + case Type::DOUBLE: + _baseData.doubleVal = other._baseData.doubleVal; + break; + case Type::BOOLEAN: + _baseData.boolVal = other._baseData.boolVal; + break; + case Type::STRING: + _strData = other._strData; + break; + case Type::VECTOR: + if (_vectorData == nullptr) + _vectorData = new ValueVector(); + *_vectorData = *other._vectorData; + break; + case Type::MAP: + if (_mapData == nullptr) + _mapData = new ValueMap(); + *_mapData = *other._mapData; + break; + case Type::INT_KEY_MAP: + if (_intKeyMapData == nullptr) + _intKeyMapData = new ValueMapIntKey(); + *_intKeyMapData = *other._intKeyMapData; + break; + default: + break; + } + _type = other._type; } - _type = other._type; return *this; } Value& Value::operator= (Value&& other) { - switch (other._type) { - case Type::BYTE: - _baseData.byteVal = other._baseData.byteVal; - break; - case Type::INTEGER: - _baseData.intVal = other._baseData.intVal; - break; - case Type::FLOAT: - _baseData.floatVal = other._baseData.floatVal; - break; - case Type::DOUBLE: - _baseData.doubleVal = other._baseData.doubleVal; - break; - case Type::BOOLEAN: - _baseData.boolVal = other._baseData.boolVal; - break; - case Type::STRING: - _strData = other._strData; - break; - case Type::VECTOR: - CC_SAFE_DELETE(_vectorData); - _vectorData = other._vectorData; - break; - case Type::MAP: - CC_SAFE_DELETE(_mapData); - _mapData = other._mapData; - break; - case Type::INT_KEY_MAP: - CC_SAFE_DELETE(_intKeyMapData); - _intKeyMapData = other._intKeyMapData; - break; - default: - break; + if (this != &other) { + switch (other._type) { + case Type::BYTE: + _baseData.byteVal = other._baseData.byteVal; + break; + case Type::INTEGER: + _baseData.intVal = other._baseData.intVal; + break; + case Type::FLOAT: + _baseData.floatVal = other._baseData.floatVal; + break; + case Type::DOUBLE: + _baseData.doubleVal = other._baseData.doubleVal; + break; + case Type::BOOLEAN: + _baseData.boolVal = other._baseData.boolVal; + break; + case Type::STRING: + _strData = other._strData; + break; + case Type::VECTOR: + CC_SAFE_DELETE(_vectorData); + _vectorData = other._vectorData; + break; + case Type::MAP: + CC_SAFE_DELETE(_mapData); + _mapData = other._mapData; + break; + case Type::INT_KEY_MAP: + CC_SAFE_DELETE(_intKeyMapData); + _intKeyMapData = other._intKeyMapData; + break; + default: + break; + } + _type = other._type; + + other._vectorData = nullptr; + other._mapData = nullptr; + other._intKeyMapData = nullptr; + other._type = Type::NONE; } - _type = other._type; - - other._vectorData = nullptr; - other._mapData = nullptr; - other._intKeyMapData = nullptr; - other._type = Type::NONE; return *this; } diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index 5fd07e4dc7..bbf578930b 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -107,18 +107,22 @@ public: /** Copy assignment operator */ Vector& operator=(const Vector& other) { - CCLOGINFO("In the copy assignment operator!"); - clear(); - _data = other._data; - addRefForAllObjects(); + if (this != &other) { + CCLOGINFO("In the copy assignment operator!"); + clear(); + _data = other._data; + addRefForAllObjects(); + } return *this; } /** Move assignment operator */ Vector& operator=(Vector&& other) { - CCLOGINFO("In the move assignment operator!"); - _data = std::move(other._data); + if (this != &other) { + CCLOGINFO("In the move assignment operator!"); + _data = std::move(other._data); + } return *this; } @@ -260,7 +264,14 @@ public: * which causes an automatic reallocation of the allocated storage space * if -and only if- the new vector size surpasses the current vector capacity. */ - void pushBack(T object) + void pushBack(const T& object) + { + CCASSERT(object != nullptr, "The object should not be nullptr"); + _data.push_back( object ); + object->retain(); + } + + void pushBack(const T&& object) { CCASSERT(object != nullptr, "The object should not be nullptr"); _data.push_back( object ); From 961b27eacb9975b660c91aae9acaeb122327ad9b Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 2 Jan 2014 18:32:47 +0800 Subject: [PATCH 115/428] remove move semantic into another pr --- cocos/base/CCVector.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index bbf578930b..d9e5de5b6f 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -264,14 +264,7 @@ public: * which causes an automatic reallocation of the allocated storage space * if -and only if- the new vector size surpasses the current vector capacity. */ - void pushBack(const T& object) - { - CCASSERT(object != nullptr, "The object should not be nullptr"); - _data.push_back( object ); - object->retain(); - } - - void pushBack(const T&& object) + void pushBack(T object) { CCASSERT(object != nullptr, "The object should not be nullptr"); _data.push_back( object ); From e43ca98a94812fa49369a05ea33a393e5a73f9d8 Mon Sep 17 00:00:00 2001 From: heliclei Date: Thu, 2 Jan 2014 19:08:22 +0800 Subject: [PATCH 116/428] get the correct branch --- tools/jenkins-scripts/ghprb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index 8404c96a7a..e17413e505 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -51,7 +51,7 @@ def main(): statuses_url = pr['statuses_url'] #get pr target branch - branch = pr['head']['ref'] + branch = pr['base']['ref'] #set commit status to pending target_url = os.environ['BUILD_URL'] From bdb99c5aa1de0344f9a0e34103803ecbd8398990 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 19:33:07 +0800 Subject: [PATCH 117/428] Update AUTHORS [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 8366737586..e7e4c95105 100644 --- a/AUTHORS +++ b/AUTHORS @@ -695,6 +695,9 @@ Developers: kicktheken (Kenneth Chan) Fixed a bug that the setBlendFunc method of some classes wasn't exposed to LUA. + andyque + Fixed a bug that missing to check self assignment of Vector, Map, Value and String. + Retired Core Developers: WenSheng Yang Author of windows port, CCTextField, From 1c5638ad4fb92cce454fb7b7fdd1ff2c34d7348e Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 2 Jan 2014 11:36:25 +0000 Subject: [PATCH 118/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index b4cfb39999..a33de463dc 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit b4cfb39999c217125bd0426cc4f132b414f88828 +Subproject commit a33de463dcadbc7464bfaedb6178c7a4eda3e296 From 9124f189c326b9c248714c5dbb0d8150c3a03910 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 2 Jan 2014 19:44:46 +0800 Subject: [PATCH 119/428] fix compiling errors because of new namespace of network module --- .../javascript/bindings/network/XMLHTTPRequest.cpp | 10 +++++----- .../javascript/bindings/network/XMLHTTPRequest.h | 2 +- cocos/scripting/lua/bindings/Lua_web_socket.h | 2 +- cocos/scripting/lua/bindings/lua_xml_http_request.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.cpp b/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.cpp index 71657fe7e5..8201955869 100644 --- a/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.cpp +++ b/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.cpp @@ -167,7 +167,7 @@ void MinXmlHttpRequest::_setHttpRequestHeader() * @param sender Object which initialized callback * @param respone Response object */ -void MinXmlHttpRequest::handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response) +void MinXmlHttpRequest::handle_requestResponse(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response) { if (0 != strlen(response->getHttpRequest()->getTag())) { @@ -247,7 +247,7 @@ void MinXmlHttpRequest::handle_requestResponse(network::HttpClient *sender, netw void MinXmlHttpRequest::_sendRequest(JSContext *cx) { _httpRequest->setResponseCallback(this, httpresponse_selector(MinXmlHttpRequest::handle_requestResponse)); - network::HttpClient::getInstance()->send(_httpRequest); + cocos2d::network::HttpClient::getInstance()->send(_httpRequest); _httpRequest->release(); } @@ -264,7 +264,7 @@ MinXmlHttpRequest::MinXmlHttpRequest() _requestHeader.clear(); _withCredentialsValue = true; _cx = ScriptingCore::getInstance()->getGlobalContext(); - _httpRequest = new network::HttpRequest(); + _httpRequest = new cocos2d::network::HttpRequest(); } /** @@ -627,11 +627,11 @@ JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, open) if (_meth.compare("post") == 0 || _meth.compare("POST") == 0) { - _httpRequest->setRequestType(network::HttpRequest::Type::POST); + _httpRequest->setRequestType(cocos2d::network::HttpRequest::Type::POST); } else { - _httpRequest->setRequestType(network::HttpRequest::Type::GET); + _httpRequest->setRequestType(cocos2d::network::HttpRequest::Type::GET); } _httpRequest->setUrl(_url.c_str()); diff --git a/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.h b/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.h index e5e26c41b1..ba190608c8 100644 --- a/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.h +++ b/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.h @@ -80,7 +80,7 @@ public: JS_BINDED_FUNC(MinXmlHttpRequest, setRequestHeader); JS_BINDED_FUNC(MinXmlHttpRequest, overrideMimeType); - void handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response); + void handle_requestResponse(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response); private: diff --git a/cocos/scripting/lua/bindings/Lua_web_socket.h b/cocos/scripting/lua/bindings/Lua_web_socket.h index 98c9c73130..458705d779 100644 --- a/cocos/scripting/lua/bindings/Lua_web_socket.h +++ b/cocos/scripting/lua/bindings/Lua_web_socket.h @@ -12,7 +12,7 @@ extern "C" { #endif #include "network/WebSocket.h" -class LuaWebSocket: public network::WebSocket,public network::WebSocket::Delegate +class LuaWebSocket: public cocos2d::network::WebSocket,public cocos2d::network::WebSocket::Delegate { public: virtual ~LuaWebSocket(); diff --git a/cocos/scripting/lua/bindings/lua_xml_http_request.h b/cocos/scripting/lua/bindings/lua_xml_http_request.h index 900ec6db35..227e576740 100644 --- a/cocos/scripting/lua/bindings/lua_xml_http_request.h +++ b/cocos/scripting/lua/bindings/lua_xml_http_request.h @@ -34,7 +34,7 @@ public: LuaMinXmlHttpRequest(); ~LuaMinXmlHttpRequest(); - void handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response); + void handle_requestResponse(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response); inline void setResponseType(ResponseType type) { _responseType = type; } inline ResponseType getResponseType() {return _responseType; } @@ -48,7 +48,7 @@ public: inline void setReadyState(int readyState) { _readyState = readyState; } inline int getReadyState() { return _readyState ;} - inline network::HttpRequest* getHttpRequest() { return _httpRequest; } + inline cocos2d::network::HttpRequest* getHttpRequest() { return _httpRequest; } inline int getStatus() { return _status; } inline std::string getStatusText() { return _statusText ;} @@ -88,7 +88,7 @@ private: ResponseType _responseType; unsigned _timeout; bool _isAsync; - network::HttpRequest* _httpRequest; + cocos2d::network::HttpRequest* _httpRequest; bool _isNetwork; bool _withCredentialsValue; std::map _httpHeader; From 05b1be3aebac3841bb5b6d16f22dc374382e2c58 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 19:59:10 +0800 Subject: [PATCH 120/428] Fixes two memory leaks in EventDispatcher::removeEventListener(removeEventListeners). --- cocos/2d/CCEventDispatcher.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cocos/2d/CCEventDispatcher.cpp b/cocos/2d/CCEventDispatcher.cpp index 151a6c267c..96a4bda8dc 100644 --- a/cocos/2d/CCEventDispatcher.cpp +++ b/cocos/2d/CCEventDispatcher.cpp @@ -462,6 +462,7 @@ void EventDispatcher::removeEventListener(EventListener* listener) { if (*iter == listener) { + listener->release(); _toAddedListeners.erase(iter); break; } @@ -1070,10 +1071,11 @@ void EventDispatcher::removeEventListenersForListenerID(const EventListener::Lis } } - for(auto iter = _toAddedListeners.begin(); iter != _toAddedListeners.end();) + for (auto iter = _toAddedListeners.begin(); iter != _toAddedListeners.end();) { if ((*iter)->getListenerID() == listenerID) { + (*iter)->release(); iter = _toAddedListeners.erase(iter); } else From 1beb9921578eba010fe1eff78922eaa2a8811809 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 20:09:43 +0800 Subject: [PATCH 121/428] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index a949380950..472f6e09ee 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,6 +21,7 @@ cocos2d-x-3.0beta0 ?? 2013 [NEW] AngelCode binary file format support for LabelBMFont. [FIX] OpenAL context isn't destroyed correctly on mac and ios. [FIX] Useless conversion in ScrollView::onTouchBegan. + [FIX] Two memory leak fixes in EventDispatcher::removeEventListener(s). [Android] [NEW] build/android-build.sh: add supporting to generate .apk file [FIX] XMLHttpRequest receives wrong binary array. From 676e25d30475ccac303d3fb3e320c5e2b2dbe300 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 2 Jan 2014 20:17:11 +0800 Subject: [PATCH 122/428] 2d module don't denpend on spine --- cocos/2d/Android.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/cocos/2d/Android.mk b/cocos/2d/Android.mk index 4905f4d613..303a1da40f 100644 --- a/cocos/2d/Android.mk +++ b/cocos/2d/Android.mk @@ -205,7 +205,6 @@ LOCAL_EXPORT_LDLIBS := -lGLESv2 \ LOCAL_WHOLE_STATIC_LIBRARIES := cocos_freetype2_static LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static -LOCAL_WHOLE_STATIC_LIBRARIES += spine_static # define the macro to compile through support/zip_support/ioapi.c LOCAL_CFLAGS := -Wno-psabi -DUSE_FILE32API @@ -218,4 +217,3 @@ include $(BUILD_STATIC_LIBRARY) $(call import-module,freetype2/prebuilt/android) $(call import-module,chipmunk) $(call import-module,2d/platform/android) -$(call import-module,editor-support/spine) From 674b38beef91993ca352a09123f00bdd25e7c18e Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 2 Jan 2014 20:14:01 +0800 Subject: [PATCH 123/428] no in header file --- .../javascript/bindings/ScriptingCore.cpp | 2 ++ .../javascript/bindings/ScriptingCore.h | 26 +++++++------- .../cocos2d_specifics.cpp.REMOVED.git-id | 2 +- .../javascript/bindings/cocos2d_specifics.hpp | 34 +++++++++---------- .../bindings/gui/jsb_cocos2dx_gui_manual.cpp | 3 +- 5 files changed, 34 insertions(+), 33 deletions(-) diff --git a/cocos/scripting/javascript/bindings/ScriptingCore.cpp b/cocos/scripting/javascript/bindings/ScriptingCore.cpp index 75df216101..68ad517f8e 100644 --- a/cocos/scripting/javascript/bindings/ScriptingCore.cpp +++ b/cocos/scripting/javascript/bindings/ScriptingCore.cpp @@ -54,6 +54,8 @@ #define BYTE_CODE_FILE_EXT ".jsc" +using namespace cocos2d; + static std::string inData; static std::string outData; static std::vector g_queue; diff --git a/cocos/scripting/javascript/bindings/ScriptingCore.h b/cocos/scripting/javascript/bindings/ScriptingCore.h index 34f5c8021e..fcf08fef99 100644 --- a/cocos/scripting/javascript/bindings/ScriptingCore.h +++ b/cocos/scripting/javascript/bindings/ScriptingCore.h @@ -21,20 +21,18 @@ void js_log(const char *format, ...); -using namespace cocos2d; - typedef void (*sc_register_sth)(JSContext* cx, JSObject* global); void registerDefaultClasses(JSContext* cx, JSObject* global); -class SimpleRunLoop : public Object +class SimpleRunLoop : public cocos2d::Object { public: void update(float d); }; -class ScriptingCore : public ScriptEngineProtocol +class ScriptingCore : public cocos2d::ScriptEngineProtocol { JSRuntime *_rt; JSContext *_cx; @@ -54,13 +52,13 @@ public: return pInstance; }; - virtual ccScriptType getScriptType() { return kScriptTypeJavascript; }; + virtual cocos2d::ccScriptType getScriptType() { return cocos2d::kScriptTypeJavascript; }; /** @brief Remove Object from lua state @param object to remove */ - virtual void removeScriptObjectByObject(Object* pObj); + virtual void removeScriptObjectByObject(cocos2d::Object* pObj); /** @brief Execute script code contained in the given string. @@ -87,13 +85,13 @@ public: */ virtual int executeGlobalFunction(const char* functionName) { return 0; } - virtual int sendEvent(ScriptEvent* message) override; + virtual int sendEvent(cocos2d::ScriptEvent* message) override; virtual bool parseConfig(ConfigType type, const std::string& str) override; virtual bool handleAssert(const char *msg) { return false; } - bool executeFunctionWithObjectData(Node *self, const char *name, JSObject *obj); + bool executeFunctionWithObjectData(cocos2d::Node *self, const char *name, JSObject *obj); JSBool executeFunctionWithOwner(jsval owner, const char *name, uint32_t argc = 0, jsval* vp = NULL, jsval* retVal = NULL); void executeJSFunctionWithThisObj(jsval thisObj, jsval callback, uint32_t argc = 0, jsval* vp = NULL, jsval* retVal = NULL); @@ -142,12 +140,12 @@ public: static void removeAllRoots(JSContext *cx); - int executeCustomTouchEvent(EventTouch::EventCode eventType, - Touch *pTouch, JSObject *obj, jsval &retval); - int executeCustomTouchEvent(EventTouch::EventCode eventType, - Touch *pTouch, JSObject *obj); - int executeCustomTouchesEvent(EventTouch::EventCode eventType, - const std::vector& touches, JSObject *obj); + int executeCustomTouchEvent(cocos2d::EventTouch::EventCode eventType, + cocos2d::Touch *pTouch, JSObject *obj, jsval &retval); + int executeCustomTouchEvent(cocos2d::EventTouch::EventCode eventType, + cocos2d::Touch *pTouch, JSObject *obj); + int executeCustomTouchesEvent(cocos2d::EventTouch::EventCode eventType, + const std::vector& touches, JSObject *obj); /** * @return the global context */ diff --git a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id index 3f4e0f866e..bed1d27c2b 100644 --- a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id +++ b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id @@ -1 +1 @@ -887e2d3869dfa674b390e1373c94937ae965ea6f \ No newline at end of file +0690676c834cdda681e69a387225425f186a0cc6 \ No newline at end of file diff --git a/cocos/scripting/javascript/bindings/cocos2d_specifics.hpp b/cocos/scripting/javascript/bindings/cocos2d_specifics.hpp index 044689a70f..e43b3804dd 100644 --- a/cocos/scripting/javascript/bindings/cocos2d_specifics.hpp +++ b/cocos/scripting/javascript/bindings/cocos2d_specifics.hpp @@ -11,20 +11,20 @@ class JSScheduleWrapper; // It will prove that i'm right. :) typedef struct jsScheduleFunc_proxy { JSObject* jsfuncObj; - Array* targets; + cocos2d::Array* targets; UT_hash_handle hh; } schedFunc_proxy_t; typedef struct jsScheduleTarget_proxy { JSObject* jsTargetObj; - Array* targets; + cocos2d::Array* targets; UT_hash_handle hh; } schedTarget_proxy_t; typedef struct jsCallFuncTarget_proxy { void * ptr; - Array *obj; + cocos2d::Array *obj; UT_hash_handle hh; } callfuncTarget_proxy_t; @@ -93,7 +93,7 @@ jsval anonEvaluate(JSContext *cx, JSObject *thisObj, const char* string); void register_cocos2dx_js_extensions(JSContext* cx, JSObject* obj); -class JSCallbackWrapper: public Object { +class JSCallbackWrapper: public cocos2d::Object { public: JSCallbackWrapper(); virtual ~JSCallbackWrapper(); @@ -118,9 +118,9 @@ public: virtual ~JSScheduleWrapper(); static void setTargetForSchedule(jsval sched, JSScheduleWrapper *target); - static Array * getTargetForSchedule(jsval sched); + static cocos2d::Array * getTargetForSchedule(jsval sched); static void setTargetForJSObject(JSObject* jsTargetObj, JSScheduleWrapper *target); - static Array * getTargetForJSObject(JSObject* jsTargetObj); + static cocos2d::Array * getTargetForJSObject(JSObject* jsTargetObj); // Remove all targets. static void removeAllTargets(); @@ -157,7 +157,7 @@ protected: }; -class JSTouchDelegate: public Object +class JSTouchDelegate: public cocos2d::Object { public: JSTouchDelegate(); @@ -178,16 +178,16 @@ public: // So this function need to be binded. void unregisterTouchDelegate(); - bool onTouchBegan(Touch *touch, Event *event); - void onTouchMoved(Touch *touch, Event *event); - void onTouchEnded(Touch *touch, Event *event); - void onTouchCancelled(Touch *touch, Event *event); + bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *event); + void onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *event); + void onTouchEnded(cocos2d::Touch *touch, cocos2d::Event *event); + void onTouchCancelled(cocos2d::Touch *touch, cocos2d::Event *event); // optional - void onTouchesBegan(const std::vector& touches, Event *event); - void onTouchesMoved(const std::vector& touches, Event *event); - void onTouchesEnded(const std::vector& touches, Event *event); - void onTouchesCancelled(const std::vector& touches, Event *event); + void onTouchesBegan(const std::vector& touches, cocos2d::Event *event); + void onTouchesMoved(const std::vector& touches, cocos2d::Event *event); + void onTouchesEnded(const std::vector& touches, cocos2d::Event *event); + void onTouchesCancelled(const std::vector& touches, cocos2d::Event *event); private: JSObject* _obj; @@ -195,8 +195,8 @@ private: typedef std::pair TouchDelegatePair; static TouchDelegateMap sTouchDelegateMap; bool _needUnroot; - EventListenerTouchOneByOne* _touchListenerOneByOne; - EventListenerTouchAllAtOnce* _touchListenerAllAtOnce; + cocos2d::EventListenerTouchOneByOne* _touchListenerOneByOne; + cocos2d::EventListenerTouchAllAtOnce* _touchListenerAllAtOnce; }; diff --git a/cocos/scripting/javascript/bindings/gui/jsb_cocos2dx_gui_manual.cpp b/cocos/scripting/javascript/bindings/gui/jsb_cocos2dx_gui_manual.cpp index 1e1f3a0aa5..e0832bc2ba 100644 --- a/cocos/scripting/javascript/bindings/gui/jsb_cocos2dx_gui_manual.cpp +++ b/cocos/scripting/javascript/bindings/gui/jsb_cocos2dx_gui_manual.cpp @@ -9,7 +9,8 @@ #include "cocos2d_specifics.hpp" #include "gui/CocosGUI.h" -using namespace gui; +using namespace cocos2d; +using namespace cocos2d::gui; class JSStudioEventListenerWrapper: public JSCallbackWrapper { public: From d345139a084ae7ca5ecbd8e6ae90b3b2d8fedb9f Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 2 Jan 2014 21:53:18 +0800 Subject: [PATCH 124/428] fix compiling errors --- cocos/network/HttpRequest.h | 2 +- cocos/scripting/javascript/bindings/network/XMLHTTPRequest.h | 2 +- cocos/scripting/javascript/bindings/network/jsb_websocket.cpp | 2 +- tools/tojs/cocos2dx.ini | 2 +- tools/tolua/cocos2dx.ini | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos/network/HttpRequest.h b/cocos/network/HttpRequest.h index dd30f74455..4aff1e2d10 100644 --- a/cocos/network/HttpRequest.h +++ b/cocos/network/HttpRequest.h @@ -34,7 +34,7 @@ namespace network { class HttpClient; class HttpResponse; typedef void (cocos2d::Object::*SEL_HttpResponse)(HttpClient* client, HttpResponse* response); -#define httpresponse_selector(_SELECTOR) (network::SEL_HttpResponse)(&_SELECTOR) +#define httpresponse_selector(_SELECTOR) (cocos2d::network::SEL_HttpResponse)(&_SELECTOR) /** @brief defines the object which users must packed for HttpClient::send(HttpRequest*) method. diff --git a/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.h b/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.h index ba190608c8..b04633e842 100644 --- a/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.h +++ b/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.h @@ -102,7 +102,7 @@ private: ResponseType _responseType; unsigned _timeout; bool _isAsync; - network::HttpRequest* _httpRequest; + cocos2d::network::HttpRequest* _httpRequest; bool _isNetwork; bool _withCredentialsValue; std::unordered_map _httpHeader; diff --git a/cocos/scripting/javascript/bindings/network/jsb_websocket.cpp b/cocos/scripting/javascript/bindings/network/jsb_websocket.cpp index ae3b1c64ce..4eb0c29ad1 100644 --- a/cocos/scripting/javascript/bindings/network/jsb_websocket.cpp +++ b/cocos/scripting/javascript/bindings/network/jsb_websocket.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. #include "ScriptingCore.h" #include "cocos2d_specifics.hpp" -using namespace network; +using namespace cocos2d::network; /* [Constructor(in DOMString url, in optional DOMString protocols)] diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index da6a3a0ae1..11487a4d71 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -101,7 +101,7 @@ skip = Node::[^setPosition$ setGrid setGLServerState description getUserObject . Bezier.*::[create actionWithDuration], CardinalSpline.*::[create actionWithDuration setPoints], Scheduler::[pause resume unschedule schedule update isTargetPaused], - TextureCache::[addPVRTCImage], + TextureCache::[addPVRTCImage addImageAsync], Timer::[getSelector createWithScriptHandler], *::[copyWith.* onEnter.* onExit.* ^description$ getObjectType onTouch.* onAcc.* onKey.* onRegisterTouchListener], FileUtils::[(g|s)etSearchResolutionsOrder$ (g|s)etSearchPaths$ getFileData getDataFromFile], diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index fbd9fbd161..898664d49f 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -99,7 +99,7 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS Bezier.*::[create actionWithDuration], CardinalSpline.*::[create actionWithDuration setPoints], Scheduler::[pause resume unschedule schedule update isTargetPaused], - TextureCache::[addPVRTCImage], + TextureCache::[addPVRTCImage addImageAsync], Timer::[getSelector createWithScriptHandler], *::[copyWith.* onEnter.* onExit.* ^description$ getObjectType (g|s)etDelegate onTouch.* onAcc.* onKey.* onRegisterTouchListener], FileUtils::[(g|s)etSearchResolutionsOrder$ (g|s)etSearchPaths$ getFileData getDataFromFile], From e337fb35fc11be42f449534e45bb625ff0097281 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 2 Jan 2014 21:59:25 +0800 Subject: [PATCH 125/428] closed #3291: XMLHttpRequest.status needs to be assigned even when connection fails. --- .../bindings/network/XMLHTTPRequest.cpp | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.cpp b/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.cpp index 8201955869..6581d93205 100644 --- a/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.cpp +++ b/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.cpp @@ -174,15 +174,13 @@ void MinXmlHttpRequest::handle_requestResponse(cocos2d::network::HttpClient *sen CCLOG("%s completed", response->getHttpRequest()->getTag()); } - int statusCode = response->getResponseCode(); - char statusString[64] = {}; - sprintf(statusString, "HTTP Status Code: %d, tag = %s", statusCode, response->getHttpRequest()->getTag()); + long statusCode = response->getResponseCode(); + char statusString[64] = {0}; + sprintf(statusString, "HTTP Status Code: %ld, tag = %s", statusCode, response->getHttpRequest()->getTag()); if (!response->isSucceed()) { - CCLOG("response failed"); - CCLOG("error buffer: %s", response->getErrorBuffer()); - return; + CCLOG("Response failed, error buffer: %s", response->getErrorBuffer()); } // set header @@ -207,7 +205,7 @@ void MinXmlHttpRequest::handle_requestResponse(cocos2d::network::HttpClient *sen _status = 200; _readyState = DONE; - _dataSize = buffer->size(); + _dataSize = static_cast(buffer->size()); CC_SAFE_FREE(_data); _data = (char*) malloc(_dataSize + 1); _data[_dataSize] = '\0'; @@ -546,17 +544,23 @@ JS_BINDED_PROP_SET_IMPL(MinXmlHttpRequest, withCredentials) */ JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, responseText) { - jsval strVal = std_string_to_jsval(cx, _data); - - if (strVal != JSVAL_NULL) + if (_data) { - vp.set(strVal); - //JS_ReportError(cx, "Result: %s", data.str().c_str()); - return JS_TRUE; - } else { - JS_ReportError(cx, "Error trying to create JSString from data"); - return JS_FALSE; + jsval strVal = std_string_to_jsval(cx, _data); + + if (strVal != JSVAL_NULL) + { + vp.set(strVal); + return JS_TRUE; + } } + + CCLOGERROR("ResponseText was empty, probably there is a network error!"); + + // Return an empty string + vp.set(std_string_to_jsval(cx, "")); + + return JS_TRUE; } /** From 22195a44d0d7947e6ed941652e52f40661b0b9f4 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 2 Jan 2014 22:06:18 +0800 Subject: [PATCH 126/428] include spine dependence in testjavascript --- samples/Javascript/TestJavascript/proj.android/jni/Android.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/Javascript/TestJavascript/proj.android/jni/Android.mk b/samples/Javascript/TestJavascript/proj.android/jni/Android.mk index 867b8ccdc3..40d4e4ee1a 100644 --- a/samples/Javascript/TestJavascript/proj.android/jni/Android.mk +++ b/samples/Javascript/TestJavascript/proj.android/jni/Android.mk @@ -19,6 +19,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += jsb_network_static LOCAL_WHOLE_STATIC_LIBRARIES += jsb_builder_static LOCAL_WHOLE_STATIC_LIBRARIES += jsb_gui_static LOCAL_WHOLE_STATIC_LIBRARIES += jsb_studio_static +LOCAL_WHOLE_STATIC_LIBRARIES += spine_static LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 @@ -33,3 +34,4 @@ $(call import-module,scripting/javascript/bindings/network) $(call import-module,scripting/javascript/bindings/cocosbuilder) $(call import-module,scripting/javascript/bindings/gui) $(call import-module,scripting/javascript/bindings/cocostudio) +$(call import-module,editor-support/spine) From c120394cae0f6fa0d204a60d14c4cc0138e14f0b Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 2 Jan 2014 14:20:27 +0000 Subject: [PATCH 127/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index a33de463dc..46a4f8dfc8 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit a33de463dcadbc7464bfaedb6178c7a4eda3e296 +Subproject commit 46a4f8dfc80cf72227576d89305d4fe6b7572318 From 6892d8cf6aab7307ac1f20d66209c1d6c7d4ed21 Mon Sep 17 00:00:00 2001 From: chengstory Date: Fri, 3 Jan 2014 01:14:12 +0800 Subject: [PATCH 128/428] issue #3480 1. add SceneReader Tests. 2. Modify class member name. --- .../cocostudio/CCComAttribute.cpp | 2 +- .../cocostudio/CCSSceneReader.cpp | 83 +- .../cocostudio/CCSSceneReader.h | 14 +- .../SceneController.cpp | 4 +- .../CocoStudioSceneTest/SceneEditorTest.cpp | 836 ++++++++++++++++-- .../CocoStudioSceneTest/SceneEditorTest.h | 197 ++++- .../CocoStudioSceneTest/TriggerCode/acts.cpp | 187 ++-- .../CocoStudioSceneTest/TriggerCode/acts.h | 54 +- .../CocoStudioSceneTest/TriggerCode/cons.cpp | 68 +- .../CocoStudioSceneTest/TriggerCode/cons.h | 20 +- 10 files changed, 1159 insertions(+), 306 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp index 10186cb768..ad03fe34fa 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -29,7 +29,7 @@ namespace cocostudio { ComAttribute::ComAttribute(void) { - _name = "ComAttribute"; + _name = "CCComAttribute"; } ComAttribute::~ComAttribute(void) diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index 5b65a2f7d8..68adc34c8c 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -24,6 +24,7 @@ #include "cocostudio/CocoStudio.h" #include "gui/CocosGUI.h" +#include "SimpleAudioEngine.h" using namespace cocos2d; using namespace gui; @@ -33,9 +34,9 @@ namespace cocostudio { SceneReader* SceneReader::s_sharedReader = nullptr; SceneReader::SceneReader() - : _pListener(NULL) - , _pfnSelector(NULL) - , _pNode(NULL) + : _listener(NULL) + , _fnSelector(NULL) + , _node(NULL) { } @@ -48,24 +49,23 @@ namespace cocostudio { return "1.0.0.0"; } - cocos2d::Node* SceneReader::createNodeWithSceneFile(const char* pszFileName) + cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName) { rapidjson::Document jsonDict; do { - CC_BREAK_IF(!readJson(pszFileName, jsonDict)); - _pNode = createObject(jsonDict, NULL); + CC_BREAK_IF(!readJson(fileName, jsonDict)); + _node = createObject(jsonDict, NULL); TriggerMng::getInstance()->parse(jsonDict); } while (0); - return _pNode; + return _node; } - bool SceneReader::readJson(const char *pszFileName, rapidjson::Document &doc) + bool SceneReader::readJson(const std::string &fileName, rapidjson::Document &doc) { bool bRet = false; do { - CC_BREAK_IF(pszFileName == NULL); - std::string jsonpath = CCFileUtils::getInstance()->fullPathForFilename(pszFileName); + std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(fileName); std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath); doc.Parse<0>(contentStr.c_str()); CC_BREAK_IF(doc.HasParseError()); @@ -74,26 +74,26 @@ namespace cocostudio { return bRet; } - Node* SceneReader::nodeByTag(Node *pParent, int nTag) + Node* SceneReader::nodeByTag(Node *parent, int tag) { - if (pParent == NULL) + if (parent == NULL) { return NULL; } Node *_retNode = NULL; - Vector& Children = pParent->getChildren(); + Vector& Children = parent->getChildren(); Vector::iterator iter = Children.begin(); while (iter != Children.end()) { Node* pNode = *iter; - if(pNode != NULL && pNode->getTag() == nTag) + if(pNode != NULL && pNode->getTag() == tag) { _retNode = pNode; break; } else { - _retNode = nodeByTag(pNode, nTag); + _retNode = nodeByTag(pNode, tag); if (_retNode != NULL) { break; @@ -200,9 +200,9 @@ namespace cocostudio { } gb->addComponent(pRender); - if (_pListener && _pfnSelector) + if (_listener && _fnSelector) { - (_pListener->*_pfnSelector)(pSprite, (void*)(&subDict)); + (_listener->*_fnSelector)(pSprite, (void*)(&subDict)); } } else if(comName != nullptr && strcmp(comName, "CCTMXTiledMap") == 0) @@ -227,9 +227,9 @@ namespace cocostudio { pRender->setName(pComName); } gb->addComponent(pRender); - if (_pListener && _pfnSelector) + if (_listener && _fnSelector) { - (_pListener->*_pfnSelector)(pTmx, (void*)(&subDict)); + (_listener->*_fnSelector)(pTmx, (void*)(&subDict)); } } else if(comName != nullptr && strcmp(comName, "CCParticleSystemQuad") == 0) @@ -257,9 +257,9 @@ namespace cocostudio { pRender->setName(pComName); } gb->addComponent(pRender); - if (_pListener && _pfnSelector) + if (_listener && _fnSelector) { - (_pListener->*_pfnSelector)(pParticle, (void*)(&subDict)); + (_listener->*_fnSelector)(pParticle, (void*)(&subDict)); } } else if(comName != nullptr && strcmp(comName, "CCArmature") == 0) @@ -301,9 +301,9 @@ namespace cocostudio { { pAr->getAnimation()->play(actionName); } - if (_pListener && _pfnSelector) + if (_listener && _fnSelector) { - (_pListener->*_pfnSelector)(pAr, (void*)(&subDict)); + (_listener->*_fnSelector)(pAr, (void*)(&subDict)); } } else if(comName != nullptr && strcmp(comName, "CCComAudio") == 0) @@ -318,10 +318,14 @@ namespace cocostudio { continue; } pAudio->preloadEffect(pPath.c_str()); - gb->addComponent(pAudio); - if (_pListener && _pfnSelector) + if (pComName != NULL) { - (_pListener->*_pfnSelector)(pAudio, (void*)(&subDict)); + pAudio->setName(pComName); + } + gb->addComponent(pAudio); + if (_listener && _fnSelector) + { + (_listener->*_fnSelector)(pAudio, (void*)(&subDict)); } } else if(comName != nullptr && strcmp(comName, "CCComAttribute") == 0) @@ -337,9 +341,9 @@ namespace cocostudio { continue; } gb->addComponent(pAttribute); - if (_pListener && _pfnSelector) + if (_listener && _fnSelector) { - (_pListener->*_pfnSelector)(pAttribute, (void*)(&subDict)); + (_listener->*_fnSelector)(pAttribute, (void*)(&subDict)); } } else if (comName != nullptr && strcmp(comName, "CCBackgroundAudio") == 0) @@ -358,6 +362,10 @@ namespace cocostudio { const bool bLoop = (DICTOOL->getIntValue_json(subDict, "loop") != 0); pAudio->setLoop(bLoop); gb->addComponent(pAudio); + if (pComName != NULL) + { + pAudio->setName(pComName); + } pAudio->playBackgroundMusic(pPath.c_str(), bLoop); } else if(comName != nullptr && strcmp(comName, "GUIComponent") == 0) @@ -369,9 +377,9 @@ namespace cocostudio { pRender->setName(pComName); } gb->addComponent(pRender); - if (_pListener && _pfnSelector) + if (_listener && _fnSelector) { - (_pListener->*_pfnSelector)(widget, (void*)(&subDict)); + (_listener->*_fnSelector)(widget, (void*)(&subDict)); } } } @@ -395,21 +403,21 @@ namespace cocostudio { void SceneReader::setTarget(Object *rec, SEL_CallFuncOD selector) { - _pListener = rec; - _pfnSelector = selector; + _listener = rec; + _fnSelector = selector; } Node* SceneReader::getNodeByTag(int nTag) { - if (_pNode == NULL) + if (_node == NULL) { return NULL; } - if (_pNode->getTag() == nTag) + if (_node->getTag() == nTag) { - return _pNode; + return _node; } - return nodeByTag(_pNode, nTag); + return nodeByTag(_node, nTag); } void SceneReader::setPropertyFromJsonDict(const rapidjson::Value &root, cocos2d::Node *node) @@ -449,6 +457,9 @@ namespace cocostudio { { DictionaryHelper::destroyInstance(); TriggerMng::destroyInstance(); + _fnSelector = nullptr; + _listener = nullptr; + CocosDenshion::SimpleAudioEngine::end(); CC_SAFE_DELETE(s_sharedReader); } diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.h b/cocos/editor-support/cocostudio/CCSSceneReader.h index 46a9c5f1ff..3dbe1644bf 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/CCSSceneReader.h @@ -53,21 +53,21 @@ public: * @js purge * @lua destroySceneReader */ - static void destroyInstance(); + void destroyInstance(); static const char* sceneReaderVersion(); - cocos2d::Node* createNodeWithSceneFile(const char *pszFileName); + cocos2d::Node* createNodeWithSceneFile(const std::string &fileName); void setTarget(cocos2d::Object *rec, SEL_CallFuncOD selector); cocos2d::Node* getNodeByTag(int nTag); private: cocos2d::Node* createObject(const rapidjson::Value& dict, cocos2d::Node* parent); void setPropertyFromJsonDict(const rapidjson::Value& dict, cocos2d::Node *node); - bool readJson(const char *pszFileName, rapidjson::Document &doc); - cocos2d::Node* nodeByTag(cocos2d::Node *pParent, int nTag); + bool readJson(const std::string &fileName, rapidjson::Document& doc); + cocos2d::Node* nodeByTag(cocos2d::Node *parent, int tag); private: static SceneReader* s_sharedReader; - cocos2d::Object* _pListener; - SEL_CallFuncOD _pfnSelector; - cocos2d::Node* _pNode; + cocos2d::Object* _listener; + SEL_CallFuncOD _fnSelector; + cocos2d::Node* _node; }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp index b88e8f77b3..2a729ff1f2 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp @@ -91,9 +91,9 @@ void SceneController::spriteMoveFinished(Node* sender) void SceneController::increaseKillCount() { - int nProjectilesDestroyed = ((ComAttribute*)(_owner->getComponent("ComAttribute")))->getInt("KillCount"); + int nProjectilesDestroyed = ((ComAttribute*)(_owner->getComponent("CCComAttribute")))->getInt("KillCount"); - ComAttribute *p = (ComAttribute*)(_owner->getComponent("ComAttribute")); + ComAttribute *p = (ComAttribute*)(_owner->getComponent("CCComAttribute")); p->setInt("KillCount", ++nProjectilesDestroyed); if (nProjectilesDestroyed >= 5) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index 33d7852a45..083e9829d8 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -5,84 +5,796 @@ #include "cocostudio/CocoStudio.h" #include "gui/CocosGUI.h" #include "TriggerCode/EventDef.h" +#include "../../testResource.h" using namespace cocos2d; using namespace cocostudio; using namespace gui; -SceneEditorTestLayer::~SceneEditorTestLayer() +Layer *Next(); +Layer *Back(); +Layer *Restart(); + +static int s_nIdx = -1; + +Layer *createTests(int index) { - ArmatureDataManager::destroyInstance(); - SceneReader::destroyInstance(); - ActionManagerEx::destroyInstance(); - auto dispatcher = Director::getInstance()->getEventDispatcher(); - dispatcher->removeEventListener(_touchListener); + Layer *layer = nullptr; + switch(index) + { + case TEST_LOADSCENEEDITORFILE: + layer = new loadSceneEdtiorFileTest(); + break; + case TEST_SPIRTECOMPONENT: + layer = new SpriteComponentTest(); + break; + case TEST_ARMATURECOMPONENT: + layer = new ArmatureComponentTest(); + break; + case TEST_UICOMPONENT: + layer = new UIComponentTest(); + break; + case TEST_TMXMAPCOMPONENT: + layer = new TmxMapComponentTest(); + break; + case TEST_PARTICLECOMPONENT: + layer = new ParticleComponentTest(); + break; + case TEST_EFEECTCOMPONENT: + layer = new EffectComponentTest(); + break; + case TEST_BACKGROUNDCOMPONENT: + layer = new BackgroundComponentTest(); + break; + case TEST_ATTRIBUTECOMPONENT: + layer = new AttributeComponentTest(); + break; + case TEST_TRIGGER: + layer = new TriggerTest(); + layer->init(); + break; + default: + break; + } + return layer; } -SceneEditorTestLayer::SceneEditorTestLayer() +Layer *Next() { - _curNode = nullptr; - _touchListener = nullptr; + ++s_nIdx; + s_nIdx = s_nIdx % TEST_SCENEEDITOR_COUNT; + + Layer *layer = createTests(s_nIdx); + layer->autorelease(); + + return layer; } -Scene* SceneEditorTestLayer::scene() +Layer *Back() { - Scene * scene = nullptr; - do - { - // 'scene' is an autorelease object - scene = Scene::create(); - CC_BREAK_IF(! scene); + --s_nIdx; + if( s_nIdx < 0 ) + s_nIdx += TEST_SCENEEDITOR_COUNT; - // 'layer' is an autorelease object - SceneEditorTestLayer *layer = SceneEditorTestLayer::create(); - CC_BREAK_IF(! layer); + Layer *layer = createTests(s_nIdx); + layer->autorelease(); - // add layer as a child to scene - scene->addChild(layer); - } while (0); - - // return the scene - return scene; + return layer; } -// on "init" you need to initialize your instance -bool SceneEditorTestLayer::init() +Layer *Restart() { + Layer *layer = createTests(s_nIdx); + layer->autorelease(); + + return layer; +} + +SceneEditorTestScene::SceneEditorTestScene(bool bPortrait) +{ + TestScene::init(); +} + +void SceneEditorTestScene::runThisTest() +{ + s_nIdx = -1; + addChild(Next()); + CCDirector::getInstance()->replaceScene(this); +} + +void SceneEditorTestScene::MainMenuCallback(Object *pSender) +{ + removeAllChildren(); +} + + +void SceneEditorTestLayer::onEnter() +{ + CCLayer::onEnter(); + + // add title and subtitle + std::string str = title(); + const char *pTitle = str.c_str(); + LabelTTF *label = LabelTTF::create(pTitle, "Arial", 18); + label->setColor(Color3B(255, 255, 255)); + addChild(label, 1, 10000); + label->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 30) ); + + std::string strSubtitle = subtitle(); + if( ! strSubtitle.empty() ) + { + LabelTTF *l = LabelTTF::create(strSubtitle.c_str(), "Arial", 18); + l->setColor(Color3B(0, 0, 0)); + addChild(l, 1, 10001); + l->setPosition(Point(VisibleRect::center().x, VisibleRect::top().y - 60) ); + } + + // add menu + backItem = MenuItemImage::create(s_pathB1, s_pathB2, CC_CALLBACK_1(SceneEditorTestLayer::backCallback, this) ); + restartItem = MenuItemImage::create(s_pathR1, s_pathR2, CC_CALLBACK_1(SceneEditorTestLayer::restartCallback, this) ); + nextItem = MenuItemImage::create(s_pathF1, s_pathF2, CC_CALLBACK_1(SceneEditorTestLayer::nextCallback, this) ); + + + Menu *menu = Menu::create(backItem, restartItem, nextItem, nullptr); + + float fScale = 0.5f; + + menu->setPosition(Point(0, 0)); + backItem->setPosition(Point(VisibleRect::center().x - restartItem->getContentSize().width * 2 * fScale, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); + backItem->setScale(fScale); + + restartItem->setPosition(Point(VisibleRect::center().x, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); + restartItem->setScale(fScale); + + nextItem->setPosition(Point(VisibleRect::center().x + restartItem->getContentSize().width * 2 * fScale, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); + nextItem->setScale(fScale); + + addChild(menu, 100); + + setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR)); +} + +void SceneEditorTestLayer::onExit() +{ + removeAllChildren(); + backItem = restartItem = nextItem = nullptr; + Layer::onExit(); +} + +std::string SceneEditorTestLayer::title() +{ + return "SceneReader Test LoadSceneEditorFile"; +} + +std::string SceneEditorTestLayer::subtitle() +{ + return ""; +} + +void SceneEditorTestLayer::restartCallback(Object *pSender) +{ + Scene *s = new SceneEditorTestScene(); + s->addChild(Restart()); + Director::getInstance()->replaceScene(s); + s->release(); +} + +void SceneEditorTestLayer::nextCallback(Object *pSender) +{ + Scene *s = new SceneEditorTestScene(); + s->addChild(Next()); + Director::getInstance()->replaceScene(s); + s->release(); +} + +void SceneEditorTestLayer::backCallback(Object *pSender) +{ + Scene *s = new SceneEditorTestScene(); + s->addChild(Back()); + Director::getInstance()->replaceScene(s); + s->release(); +} + +void SceneEditorTestLayer::draw() +{ + Layer::draw(); +} + + +loadSceneEdtiorFileTest::loadSceneEdtiorFileTest() +{ + +} + +loadSceneEdtiorFileTest::~loadSceneEdtiorFileTest() +{ + +} + +std::string loadSceneEdtiorFileTest::title() +{ + return "loadSceneEdtiorFile Test"; +} + +void loadSceneEdtiorFileTest::onEnter() +{ + SceneEditorTestLayer::onEnter(); bool bRet = false; do { Node *root = createGameScene(); CC_BREAK_IF(!root); this->addChild(root, 0, 1); - sendEvent(TRIGGEREVENT_INITSCENE); - this->schedule(schedule_selector(SceneEditorTestLayer::gameLogic)); - auto dispatcher = Director::getInstance()->getEventDispatcher(); - auto listener = EventListenerTouchOneByOne::create(); - listener->setSwallowTouches(true); - listener->onTouchBegan = CC_CALLBACK_2(SceneEditorTestLayer::onTouchBegan, this); - listener->onTouchMoved = CC_CALLBACK_2(SceneEditorTestLayer::onTouchMoved, this); - listener->onTouchEnded = CC_CALLBACK_2(SceneEditorTestLayer::onTouchEnded, this); - listener->onTouchCancelled = CC_CALLBACK_2(SceneEditorTestLayer::onTouchCancelled, this); - dispatcher->addEventListenerWithFixedPriority(listener, 1); - _touchListener = listener; + bRet = true; + } while (0); +} + +void loadSceneEdtiorFileTest::onExit() +{ + ArmatureDataManager::getInstance()->destroyInstance(); + SceneReader::getInstance()->destroyInstance(); + ActionManagerEx::getInstance()->destroyInstance(); + GUIReader::shareReader()->purgeGUIReader(); + SceneEditorTestLayer::onExit(); +} + + +cocos2d::Node* loadSceneEdtiorFileTest::createGameScene() +{ + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/loadSceneEdtiorFileTest/FishJoy2.json"); + if (node == nullptr) + { + return nullptr; + } + ActionManagerEx::getInstance()->playActionByName("startMenu_1.json","Animation1"); + return node; +} + +SpriteComponentTest::SpriteComponentTest() +{ + +} + +SpriteComponentTest::~SpriteComponentTest() +{ + +} + +std::string SpriteComponentTest::title() +{ + return "Sprite Component Test"; +} + +void SpriteComponentTest::onEnter() +{ + SceneEditorTestLayer::onEnter(); + bool bRet = false; + do + { + Node *root = createGameScene(); + CC_BREAK_IF(!root); + this->addChild(root, 0, 1); + bRet = true; + } while (0); +} + +void SpriteComponentTest::onExit() +{ + ArmatureDataManager::getInstance()->destroyInstance(); + SceneReader::getInstance()->destroyInstance(); + ActionManagerEx::getInstance()->destroyInstance(); + GUIReader::shareReader()->purgeGUIReader(); + SceneEditorTestLayer::onExit(); +} + +cocos2d::Node* SpriteComponentTest::createGameScene() +{ + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/SpriteComponentTest/SpriteComponentTest.json"); + if (node == nullptr) + { + return nullptr; + } + + ActionInterval* action1 = CCBlink::create(2, 10); + ActionInterval* action2 = CCBlink::create(2, 5); + + Sprite *pSister1 = static_cast(node->getChildByTag(10003)->getComponent("CCSprite")->getNode()); + pSister1->runAction(action1); + + Sprite *pSister2 = static_cast(node->getChildByTag(10004)->getComponent("CCSprite")->getNode()); + pSister2->runAction(action2); + + return node; +} + +ArmatureComponentTest::ArmatureComponentTest() +{ + +} + +ArmatureComponentTest::~ArmatureComponentTest() +{ + +} + +std::string ArmatureComponentTest::title() +{ + return "Armature Component Test"; +} + +void ArmatureComponentTest::onEnter() +{ + SceneEditorTestLayer::onEnter(); + bool bRet = false; + do + { + Node *root = createGameScene(); + CC_BREAK_IF(!root); + this->addChild(root, 0, 1); + bRet = true; + } while (0); +} + +void ArmatureComponentTest::onExit() +{ + ArmatureDataManager::getInstance()->destroyInstance(); + SceneReader::getInstance()->destroyInstance(); + ActionManagerEx::getInstance()->destroyInstance(); + GUIReader::shareReader()->purgeGUIReader(); + SceneEditorTestLayer::onExit(); +} + +cocos2d::Node* ArmatureComponentTest::createGameScene() +{ + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/ArmatureComponentTest/ArmatureComponentTest.json"); + if (node == nullptr) + { + return nullptr; + } + Armature *pBlowFish = static_cast(node->getChildByTag(10007)->getComponent("Armature")->getNode()); + pBlowFish->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); + + Armature *pButterflyfish = static_cast(node->getChildByTag(10008)->getComponent("Armature")->getNode()); + pButterflyfish->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); + + return node; +} + +UIComponentTest::UIComponentTest() +: _node(nullptr) +{ + +} + +UIComponentTest::~UIComponentTest() +{ +} + +std::string UIComponentTest::title() +{ + return "UI Component Test"; +} + +void UIComponentTest::onEnter() +{ + SceneEditorTestLayer::onEnter(); + bool bRet = false; + do + { + Node *root = createGameScene(); + CC_BREAK_IF(!root); + this->addChild(root, 0, 1); + bRet = true; + } while (0); +} + +void UIComponentTest::onExit() +{ + ArmatureDataManager::getInstance()->destroyInstance(); + SceneReader::getInstance()->destroyInstance(); + ActionManagerEx::getInstance()->destroyInstance(); + GUIReader::shareReader()->purgeGUIReader(); + SceneEditorTestLayer::onExit(); +} + +cocos2d::Node* UIComponentTest::createGameScene() +{ + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/UIComponentTest/UIComponentTest.json"); + if (node == nullptr) + { + return nullptr; + } + _node = node; + + cocos2d::gui::TouchGroup* touchGroup = static_cast(_node->getChildByTag(10025)->getComponent("GUIComponent")->getNode()); + UIWidget* widget = static_cast(touchGroup->getWidgetByName("Panel_154")); + UIButton* button = static_cast(widget->getChildByName("Button_156")); + button->addTouchEventListener(this, toucheventselector(UIComponentTest::touchEvent)); + + return node; +} + +void UIComponentTest::touchEvent(CCObject *pSender, TouchEventType type) +{ + switch (type) + { + case TOUCH_EVENT_BEGAN: + { + Armature *pBlowFish = static_cast(_node->getChildByTag(10010)->getComponent("Armature")->getNode()); + pBlowFish->runAction(CCMoveBy::create(10.0f, ccp(-1000.0f, 0))); + + Armature *pButterflyfish = static_cast(_node->getChildByTag(10011)->getComponent("Armature")->getNode()); + pButterflyfish->runAction(CCMoveBy::create(10.0f, ccp(-1000.0f, 0))); + } + break; + default: + break; + } +} + +TmxMapComponentTest::TmxMapComponentTest() +{ + +} + +TmxMapComponentTest::~TmxMapComponentTest() +{ + +} + +std::string TmxMapComponentTest::title() +{ + return "TmxMap Component Test"; +} + +void TmxMapComponentTest::onEnter() +{ + SceneEditorTestLayer::onEnter(); + bool bRet = false; + do + { + Node *root = createGameScene(); + CC_BREAK_IF(!root); + this->addChild(root, 0, 1); + bRet = true; + } while (0); +} + +void TmxMapComponentTest::onExit() +{ + ArmatureDataManager::getInstance()->destroyInstance(); + SceneReader::getInstance()->destroyInstance(); + ActionManagerEx::getInstance()->destroyInstance(); + GUIReader::shareReader()->purgeGUIReader(); + SceneEditorTestLayer::onExit(); +} + +cocos2d::Node* TmxMapComponentTest::createGameScene() +{ + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/TmxMapComponentTest/TmxMapComponentTest.json"); + if (node == nullptr) + { + return nullptr; + } + TMXTiledMap *tmxMap = static_cast(node->getChildByTag(10015)->getComponent("TMXTiledMap")->getNode()); + ActionInterval *actionTo = SkewTo::create(2, 0.f, 2.f); + ActionInterval *rotateTo = RotateTo::create(2, 61.0f); + ActionInterval *actionScaleTo = ScaleTo::create(2, -0.44f, 0.47f); + + ActionInterval *actionScaleToBack = ScaleTo::create(2, 1.0f, 1.0f); + ActionInterval *rotateToBack = RotateTo::create(2, 0); + ActionInterval *actionToBack = SkewTo::create(2, 0, 0); + + tmxMap->runAction(Sequence::create(actionTo, actionToBack, nullptr)); + tmxMap->runAction(Sequence::create(rotateTo, rotateToBack, nullptr)); + tmxMap->runAction(Sequence::create(actionScaleTo, actionScaleToBack, nullptr)); + return node; +} + +ParticleComponentTest::ParticleComponentTest() +{ + +} + +ParticleComponentTest::~ParticleComponentTest() +{ +} + +std::string ParticleComponentTest::title() +{ + return "Particle Component Test"; +} + +void ParticleComponentTest::onEnter() +{ + SceneEditorTestLayer::onEnter(); + bool bRet = false; + do + { + Node *root = createGameScene(); + CC_BREAK_IF(!root); + this->addChild(root, 0, 1); + bRet = true; + } while (0); +} + +void ParticleComponentTest::onExit() +{ + ArmatureDataManager::getInstance()->destroyInstance(); + SceneReader::getInstance()->destroyInstance(); + ActionManagerEx::getInstance()->destroyInstance(); + GUIReader::shareReader()->purgeGUIReader(); + SceneEditorTestLayer::onExit(); +} + +cocos2d::Node* ParticleComponentTest::createGameScene() +{ + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/ParticleComponentTest/ParticleComponentTest.json"); + if (node == nullptr) + { + return nullptr; + } + + ParticleSystemQuad* Particle = static_cast(node->getChildByTag(10020)->getComponent("CCParticleSystemQuad")->getNode()); + ActionInterval* jump = JumpBy::create(5, Point(-500,0), 50, 4); + FiniteTimeAction* action = Sequence::create( jump, jump->reverse(), nullptr); + Particle->runAction(action); + return node; +} + + +EffectComponentTest::EffectComponentTest() +: _node(nullptr) +{ + +} + +EffectComponentTest::~EffectComponentTest() +{ +} + +std::string EffectComponentTest::title() +{ + return "Effect Component Test"; +} + +void EffectComponentTest::onEnter() +{ + SceneEditorTestLayer::onEnter(); + bool bRet = false; + do + { + Node *root = createGameScene(); + CC_BREAK_IF(!root); + this->addChild(root, 0, 1); + bRet = true; + } while (0); +} + +void EffectComponentTest::onExit() +{ + ArmatureDataManager::getInstance()->destroyInstance(); + SceneReader::getInstance()->destroyInstance(); + ActionManagerEx::getInstance()->destroyInstance(); + GUIReader::shareReader()->purgeGUIReader(); + SceneEditorTestLayer::onExit(); +} + +cocos2d::Node* EffectComponentTest::createGameScene() +{ + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/EffectComponentTest/EffectComponentTest.json"); + if (node == nullptr) + { + return nullptr; + } + _node = node; + Armature *pAr = static_cast(_node->getChildByTag(10015)->getComponent("Armature")->getNode()); + pAr->getAnimation()->setMovementEventCallFunc(this, movementEvent_selector(EffectComponentTest::animationEvent)); + return node; +} + +void EffectComponentTest::animationEvent(Armature *armature, MovementEventType movementType, const std::string& movementID) +{ + std::string id = movementID; + + if (movementType == LOOP_COMPLETE) + { + if (id.compare("Fire") == 0) + { + ComAudio *pAudio = static_cast(_node->getChildByTag(10015)->getComponent("CCComAudio")); + pAudio->playEffect(); + } + } +} + +BackgroundComponentTest::BackgroundComponentTest() +{ + +} + +BackgroundComponentTest::~BackgroundComponentTest() +{ +} + +std::string BackgroundComponentTest::title() +{ + return "Background Component Test"; +} + +void BackgroundComponentTest::onEnter() +{ + SceneEditorTestLayer::onEnter(); + bool bRet = false; + do + { + Node *root = createGameScene(); + CC_BREAK_IF(!root); + this->addChild(root, 0, 1); + bRet = true; + } while (0); +} + +void BackgroundComponentTest::onExit() +{ + ArmatureDataManager::getInstance()->destroyInstance(); + SceneReader::getInstance()->destroyInstance(); + ActionManagerEx::getInstance()->destroyInstance(); + GUIReader::shareReader()->purgeGUIReader(); + SceneEditorTestLayer::onExit(); +} + +cocos2d::Node* BackgroundComponentTest::createGameScene() +{ + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/BackgroundComponentTest/BackgroundComponentTest.json"); + if (node == nullptr) + { + return nullptr; + } + ActionManagerEx::getInstance()->playActionByName("startMenu_1.json","Animation1"); + + ComAudio *Audio = static_cast(node->getComponent("CCBackgroundAudio")); + Audio->playBackgroundMusic(); + return node; +} + + +AttributeComponentTest::AttributeComponentTest() +: _node(nullptr) +{ + +} + +AttributeComponentTest::~AttributeComponentTest() +{ +} + +std::string AttributeComponentTest::title() +{ + return "Attribute Component Test"; +} + +void AttributeComponentTest::onEnter() +{ + SceneEditorTestLayer::onEnter(); + bool bRet = false; + do + { + Node *root = createGameScene(); + CC_BREAK_IF(!root); + initData(); + this->addChild(root, 0, 1); + bRet = true; + } while (0); +} + +void AttributeComponentTest::onExit() +{ + ArmatureDataManager::getInstance()->destroyInstance(); + SceneReader::getInstance()->destroyInstance(); + ActionManagerEx::getInstance()->destroyInstance(); + GUIReader::shareReader()->purgeGUIReader(); + SceneEditorTestLayer::onExit(); +} + +bool AttributeComponentTest::initData() +{ + bool bRet = false; + unsigned long size = 0; + unsigned char *pBytes = nullptr; + rapidjson::Document jsonDict; + do { + CC_BREAK_IF(_node == nullptr); + ComAttribute *pAttribute = static_cast(_node->getChildByTag(10015)->getComponent("CCComAttribute")); + CC_BREAK_IF(pAttribute == nullptr); + std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(pAttribute->getJsonName()); + std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath); + doc.Parse<0>(contentStr.c_str()); + CC_BREAK_IF(doc.HasParseError()); + + std::string playerName = DICTOOL->getStringValue_json(jsonDict, "name"); + float maxHP = DICTOOL->getFloatValue_json(jsonDict, "maxHP"); + float maxMP = DICTOOL->getFloatValue_json(jsonDict, "maxMP"); + + pAttribute->setCString("Name", playerName.c_str()); + pAttribute->setFloat("MaxHP", maxHP); + pAttribute->setFloat("MaxMP", maxMP); + + log("Name: %s, HP: %f, MP: %f", pAttribute->getCString("Name"), pAttribute->getFloat("MaxHP"), pAttribute->getFloat("MaxMP")); bRet = true; } while (0); - return bRet; } -void SceneEditorTestLayer::onEnter() +cocos2d::Node* AttributeComponentTest::createGameScene() { - Layer::onEnter(); - sendEvent(TRIGGEREVENT_ENTERSCENE); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/AttributeComponentTest/AttributeComponentTest.json"); + if (node == nullptr) + { + return nullptr; + } + _node = node; + return node; } + + + + +TriggerTest::TriggerTest() +: _node(nullptr) +, _touchListener(nullptr) +{ + +} + +TriggerTest::~TriggerTest() +{ +} + +std::string TriggerTest::title() +{ + return "Trigger Test"; +} + +bool TriggerTest::init() +{ + sendEvent(TRIGGEREVENT_INITSCENE); + return true; +} + +// on "init" you need to initialize your instance +bool SceneEditorTestLayer::onEnter() +{ + SceneEditorTestLayer::onEnter(); + Node *root = createGameScene(); + this->addChild(root, 0, 1); + this->schedule(schedule_selector(SceneEditorTestLayer::gameLogic)); + auto dispatcher = Director::getInstance()->getEventDispatcher(); + auto listener = EventListenerTouchOneByOne::create(); + listener->setSwallowTouches(true); + listener->onTouchBegan = CC_CALLBACK_2(SceneEditorTestLayer::onTouchBegan, this); + listener->onTouchMoved = CC_CALLBACK_2(SceneEditorTestLayer::onTouchMoved, this); + listener->onTouchEnded = CC_CALLBACK_2(SceneEditorTestLayer::onTouchEnded, this); + listener->onTouchCancelled = CC_CALLBACK_2(SceneEditorTestLayer::onTouchCancelled, this); + dispatcher->addEventListenerWithFixedPriority(listener, 1); + _touchListener = listener; + sendEvent(TRIGGEREVENT_ENTERSCENE); +} + + void SceneEditorTestLayer::onExit() { - Layer::onExit(); sendEvent(TRIGGEREVENT_LEAVESCENE); + this->unschedule(schedule_selector(TriggerTest::gameLogic)); + auto dispatcher = Director::getInstance()->getEventDispatcher(); + dispatcher->removeEventListener(_touchListener); + Device::setAccelerometerEnabled(false); + ArmatureDataManager::getInstance()->destroyInstance(); + SceneReader::getInstance()->destroyInstance(); + ActionManagerEx::getInstance()->destroyInstance(); + GUIReader::shareReader()->purgeGUIReader(); + SceneEditorTestLayer::onExit(); } bool SceneEditorTestLayer::onTouchBegan(Touch *touch, Event *unused_event) @@ -111,45 +823,15 @@ void SceneEditorTestLayer::gameLogic(float dt) sendEvent(TRIGGEREVENT_UPDATESCENE); } -static ActionObject* actionObject = nullptr; cocos2d::Node* SceneEditorTestLayer::createGameScene() { - Node *pNode = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/FishJoy2.json"); - if (pNode == nullptr) + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/TriggerTest/TriggerTest.json"); + if (node == nullptr) { return nullptr; } - _curNode = pNode; + _node = node; - MenuItemFont *itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(SceneEditorTestLayer::toExtensionsMainLayer, this)); - itemBack->setColor(Color3B(255, 255, 255)); - itemBack->setPosition(Point(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); - Menu *menuBack = Menu::create(itemBack, nullptr); - menuBack->setPosition(Point(0.0f, 0.0f)); - menuBack->setZOrder(4); - - pNode->addChild(menuBack); - - return pNode; -} - -void SceneEditorTestLayer::toExtensionsMainLayer(cocos2d::Object *sender) -{ - if (actionObject) - { - actionObject->stop(); - } - ComAudio *pBackMusic = (ComAudio*)(_curNode->getComponent("CCBackgroundAudio")); - pBackMusic->stopBackgroundMusic(); - ExtensionsTestScene *pScene = new ExtensionsTestScene(); - pScene->runThisTest(); - pScene->release(); -} - - -void runSceneEditorTestLayer() -{ - Scene *pScene = SceneEditorTestLayer::scene(); - Director::getInstance()->replaceScene(pScene); + return node; } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h index 74a2f62f28..ec1bafd4c1 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h @@ -4,23 +4,183 @@ #include "cocos2d.h" #include "extensions/cocos-ext.h" -void runSceneEditorTestLayer(); +class SceneEditorTestScene : public TestScene +{ +public: + SceneEditorTestScene(bool bPortrait = false); + + virtual void runThisTest(); + + // The CallBack for back to the main menu scene + virtual void MainMenuCallback(cocos2d::Object* pSender); +}; + +enum { + TEST_LOADSCENEEDITORFILE = 0, + TEST_SPIRTECOMPONENT, + TEST_ARMATURECOMPONENT, + TEST_UICOMPONENT, + TEST_TMXMAPCOMPONENT, + TEST_PARTICLECOMPONENT, + TEST_EFEECTCOMPONENT, + TEST_BACKGROUNDCOMPONENT, + TEST_ATTRIBUTECOMPONENT, + TEST_TRIGGER, + TEST_SCENEEDITOR_COUNT +}; class SceneEditorTestLayer : public cocos2d::Layer { public: - SceneEditorTestLayer(); - ~SceneEditorTestLayer(); - - // Here's a difference. Method 'init' in cocos2d-x returns bool, - // instead of returning 'id' in cocos2d-iphone - virtual bool init(); - - // callback of Scene Enter virtual void onEnter(); - - // callback of Scene Exit virtual void onExit(); + + virtual std::string title(); + virtual std::string subtitle(); + + virtual void restartCallback(cocos2d::Object* pSender); + virtual void nextCallback(cocos2d::Object* pSender); + virtual void backCallback(cocos2d::Object* pSender); + + virtual void draw(); + +protected: + MenuItemImage *restartItem; + MenuItemImage *nextItem; + MenuItemImage *backItem; +}; + +class loadSceneEdtiorFileTest : public SceneEditorTestLayer +{ +public: + loadSceneEdtiorFileTest(); + ~loadSceneEdtiorFileTest(); + + virtual std::string title(); + virtual void onEnter(); + virtual void onExit(); + cocos2d::Node* createGameScene(); +}; + + +class SpriteComponentTest : public SceneEditorTestLayer +{ +public: + SpriteComponentTest(); + ~SpriteComponentTest(); + + virtual std::string title(); + virtual void onEnter(); + virtual void onExit(); + cocos2d::Node* createGameScene(); + +}; + +class ArmatureComponentTest : public SceneEditorTestLayer +{ +public: + ArmatureComponentTest(); + ~ArmatureComponentTest(); + + virtual std::string title(); + virtual void onEnter(); + virtual void onExit(); + cocos2d::Node* createGameScene(); + +}; + +class UIComponentTest : public SceneEditorTestLayer +{ +public: + UIComponentTest(); + ~UIComponentTest(); + + virtual std::string title(); + virtual void onEnter(); + virtual void onExit(); + cocos2d::Node* createGameScene(); + void touchEvent(cocos2d::Object *pSender, cocos2d::gui::TouchEventType type); +private: + cocos2d::Node* _node; +}; + +class TmxMapComponentTest : public SceneEditorTestLayer +{ +public: + TmxMapComponentTest(); + ~TmxMapComponentTest(); + + virtual std::string title(); + virtual void onEnter(); + virtual void onExit(); + cocos2d::Node* createGameScene(); + +}; + +class ParticleComponentTest : public SceneEditorTestLayer +{ +public: + ParticleComponentTest(); + ~ParticleComponentTest(); + + virtual std::string title(); + virtual void onEnter(); + virtual void onExit(); + cocos2d::Node* createGameScene(); +}; + +class EffectComponentTest : public SceneEditorTestLayer +{ +public: + EffectComponentTest(); + ~EffectComponentTest(); + + virtual std::string title(); + virtual void onEnter(); + virtual void onExit(); + cocos2d::Node* createGameScene(); + void animationEvent(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const std::string& movementID); +private: + cocos2d::Node* _node; +}; + +class BackgroundComponentTest : public SceneEditorTestLayer +{ +public: + BackgroundComponentTest(); + ~BackgroundComponentTest(); + + virtual std::string title(); + virtual void onEnter(); + virtual void onExit(); + cocos2d::Node* createGameScene(); +}; + +class AttributeComponentTest : public SceneEditorTestLayer +{ +public: + AttributeComponentTest(); + ~AttributeComponentTest(); + + virtual std::string title(); + virtual void onEnter(); + virtual void onExit(); + bool initData(); + cocos2d::Node* createGameScene(); +private: + cocos2d::Node* _node; +}; + +class TriggerTest : public SceneEditorTestLayer +{ +public: + TriggerTest(); + ~TriggerTest(); + + virtual std::string title(); + virtual bool init(); + virtual void onEnter(); + virtual void onExit(); // default implements are used to call script callback if exist virtual bool onTouchBegan(Touch *touch, Event *unused_event); @@ -31,20 +191,11 @@ public: // update of game void gameLogic(float dt); - // there's no 'id' in cpp, so we recommand to return the exactly class pointer - static cocos2d::Scene* scene(); - - // implement the "static node()" method manually - CREATE_FUNC(SceneEditorTestLayer); - - // init scene + // create scene cocos2d::Node* createGameScene(); - - //back to Extensions Main Layer - void toExtensionsMainLayer(cocos2d::Object *sender); - + private: - cocos2d::Node *_curNode; + cocos2d::Node *_node; cocos2d::EventListener* _touchListener; }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp index b8b03c4e12..5b19de8a91 100755 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp @@ -7,7 +7,7 @@ using namespace cocostudio; IMPLEMENT_CLASS_INFO(PlayMusic) PlayMusic::PlayMusic(void) -:_nTag(-1) +:_tag(-1) { } @@ -24,15 +24,15 @@ void PlayMusic::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); ComAudio *audio = (ComAudio*)(pNode->getComponent(_comName.c_str())); CC_BREAK_IF(audio == nullptr); - if (_nType == 0) + if (_type == 0) { audio->playBackgroundMusic(); } - else if (_nType == 1) + else if (_type == 1) { audio->playEffect(); } @@ -49,7 +49,7 @@ void PlayMusic::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "componentName") @@ -59,7 +59,7 @@ void PlayMusic::serialize(const rapidjson::Value &val) } else if (key == "type") { - _nType = DICTOOL->getIntValue_json(subDict, "value"); + _type = DICTOOL->getIntValue_json(subDict, "value"); continue; } } @@ -71,8 +71,8 @@ void PlayMusic::removeAll() IMPLEMENT_CLASS_INFO(TMoveTo) TMoveTo::TMoveTo(void) -:_nTag(-1) -,_fDuration(0.0f) +:_tag(-1) +,_duration(0.0f) { } @@ -89,9 +89,9 @@ void TMoveTo::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); - ActionInterval* actionTo = MoveTo::create(_fDuration, _pos); + ActionInterval* actionTo = MoveTo::create(_duration, _pos); CC_BREAK_IF(actionTo == nullptr); pNode->runAction(actionTo); } while (0); @@ -106,12 +106,12 @@ void TMoveTo::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "Duration") { - _fDuration = DICTOOL->getFloatValue_json(subDict, "value"); + _duration = DICTOOL->getFloatValue_json(subDict, "value"); continue; } else if (key == "x") @@ -129,13 +129,15 @@ void TMoveTo::serialize(const rapidjson::Value &val) void TMoveTo::removeAll() { + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + node->getActionManager()->removeAllActions(); } IMPLEMENT_CLASS_INFO(TMoveBy) TMoveBy::TMoveBy(void) -:_nTag(-1) -,_fDuration(0.0f) -,_bReverse(false) +:_tag(-1) +,_duration(0.0f) +,_reverse(false) { } @@ -152,11 +154,11 @@ void TMoveBy::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); - ActionInterval* actionBy = MoveBy::create(_fDuration, _pos); + ActionInterval* actionBy = MoveBy::create(_duration, _pos); CC_BREAK_IF(actionBy == nullptr); - if (_bReverse == true) + if (_reverse == true) { ActionInterval* actionByBack = actionBy->reverse(); pNode->runAction( CCSequence::create(actionBy, actionByBack, nullptr)); @@ -177,12 +179,12 @@ void TMoveBy::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "Duration") { - _fDuration = DICTOOL->getFloatValue_json(subDict, "value"); + _duration = DICTOOL->getFloatValue_json(subDict, "value"); continue; } else if (key == "x") @@ -197,7 +199,7 @@ void TMoveBy::serialize(const rapidjson::Value &val) } else if (key == "IsReverse") { - _bReverse = (bool)(DICTOOL->getIntValue_json(subDict, "value")); + _reverse = (bool)(DICTOOL->getIntValue_json(subDict, "value")); continue; } } @@ -205,16 +207,17 @@ void TMoveBy::serialize(const rapidjson::Value &val) void TMoveBy::removeAll() { - CCLOG("TMoveBy::removeAll"); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + node->getActionManager()->removeAllActions(); } IMPLEMENT_CLASS_INFO(TRotateTo) TRotateTo::TRotateTo(void) -: _nTag(-1) -, _fDuration(0.0f) -, _fDeltaAngle(0.0f) +: _tag(-1) +, _duration(0.0f) +, _deltaAngle(0.0f) { } @@ -231,9 +234,9 @@ void TRotateTo::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); - ActionInterval* actionTo = RotateTo::create(_fDuration, _fDeltaAngle); + ActionInterval* actionTo = RotateTo::create(_duration, _deltaAngle); CC_BREAK_IF(actionTo == nullptr); pNode->runAction(actionTo); } while (0); @@ -248,17 +251,17 @@ void TRotateTo::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "Duration") { - _fDuration = DICTOOL->getFloatValue_json(subDict, "value"); + _duration = DICTOOL->getFloatValue_json(subDict, "value"); continue; } else if (key == "DeltaAngle") { - _fDeltaAngle = DICTOOL->getFloatValue_json(subDict, "value"); + _deltaAngle = DICTOOL->getFloatValue_json(subDict, "value"); continue; } } @@ -266,17 +269,18 @@ void TRotateTo::serialize(const rapidjson::Value &val) void TRotateTo::removeAll() { - CCLOG("TRotateTo::removeAll"); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + node->getActionManager()->removeAllActions(); } IMPLEMENT_CLASS_INFO(TRotateBy) TRotateBy::TRotateBy(void) -: _nTag(-1) -, _fDuration(0.0f) -, _fDeltaAngle(0.0f) -, _bReverse(false) +: _tag(-1) +, _duration(0.0f) +, _deltaAngle(0.0f) +, _reverse(false) { } @@ -293,11 +297,11 @@ void TRotateBy::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); - ActionInterval* actionBy = RotateBy::create(_fDuration, _fDeltaAngle); + ActionInterval* actionBy = RotateBy::create(_duration, _deltaAngle); CC_BREAK_IF(actionBy == nullptr); - if (_bReverse == true) + if (_reverse == true) { ActionInterval* actionByBack = actionBy->reverse(); pNode->runAction( Sequence::create(actionBy, actionByBack, nullptr)); @@ -318,22 +322,22 @@ void TRotateBy::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "Duration") { - _fDuration = DICTOOL->getFloatValue_json(subDict, "value"); + _duration = DICTOOL->getFloatValue_json(subDict, "value"); continue; } else if (key == "DeltaAngle") { - _fDeltaAngle = DICTOOL->getFloatValue_json(subDict, "value"); + _deltaAngle = DICTOOL->getFloatValue_json(subDict, "value"); continue; } else if (key == "IsReverse") { - _bReverse = (int)(DICTOOL->getIntValue_json(subDict, "value")); + _reverse = (int)(DICTOOL->getIntValue_json(subDict, "value")); continue; } } @@ -341,15 +345,16 @@ void TRotateBy::serialize(const rapidjson::Value &val) void TRotateBy::removeAll() { - CCLOG("TRotateBy::removeAll"); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + node->getActionManager()->removeAllActions(); } IMPLEMENT_CLASS_INFO(TScaleTo) TScaleTo::TScaleTo(void) -: _nTag(-1) -, _fDuration(0.0f) +: _tag(-1) +, _duration(0.0f) { } @@ -366,9 +371,9 @@ void TScaleTo::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); - ActionInterval* actionTo = ScaleTo::create(_fDuration, _scale.x, _scale.y); + ActionInterval* actionTo = ScaleTo::create(_duration, _scale.x, _scale.y); CC_BREAK_IF(actionTo == nullptr); pNode->runAction(actionTo); } while (0); @@ -383,12 +388,12 @@ void TScaleTo::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "Duration") { - _fDuration = DICTOOL->getFloatValue_json(subDict, "value"); + _duration = DICTOOL->getFloatValue_json(subDict, "value"); continue; } else if (key == "ScaleX") @@ -406,16 +411,17 @@ void TScaleTo::serialize(const rapidjson::Value &val) void TScaleTo::removeAll() { - CCLOG("TScaleTo::removeAll"); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + node->getActionManager()->removeAllActions(); } IMPLEMENT_CLASS_INFO(TScaleBy) TScaleBy::TScaleBy(void) -: _nTag(-1) -, _fDuration(0.0f) -, _bReverse(false) +: _tag(-1) +, _duration(0.0f) +, _reverse(false) { } @@ -432,11 +438,11 @@ void TScaleBy::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); - ActionInterval* actionBy = ScaleBy::create(_fDuration, _scale.x, _scale.y); + ActionInterval* actionBy = ScaleBy::create(_duration, _scale.x, _scale.y); CC_BREAK_IF(actionBy == nullptr); - if (_bReverse == true) + if (_reverse == true) { ActionInterval* actionByBack = actionBy->reverse(); pNode->runAction(Sequence::create(actionBy, actionByBack, nullptr)); @@ -457,12 +463,12 @@ void TScaleBy::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "Duration") { - _fDuration = DICTOOL->getFloatValue_json(subDict, "value"); + _duration = DICTOOL->getFloatValue_json(subDict, "value"); continue; } else if (key == "ScaleX") @@ -477,7 +483,7 @@ void TScaleBy::serialize(const rapidjson::Value &val) } else if (key == "IsReverse") { - _bReverse = (bool)(DICTOOL->getIntValue_json(subDict, "value")); + _reverse = (bool)(DICTOOL->getIntValue_json(subDict, "value")); continue; } } @@ -485,15 +491,16 @@ void TScaleBy::serialize(const rapidjson::Value &val) void TScaleBy::removeAll() { - CCLOG("TScaleBy::removeAll"); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + node->getActionManager()->removeAllActions(); } IMPLEMENT_CLASS_INFO(TSkewTo) TSkewTo::TSkewTo(void) -: _nTag(-1) -, _fDuration(0.0f) +: _tag(-1) +, _duration(0.0f) { } @@ -510,9 +517,9 @@ void TSkewTo::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); - ActionInterval* actionTo = SkewTo::create(_fDuration, _skew.x, _skew.y); + ActionInterval* actionTo = SkewTo::create(_duration, _skew.x, _skew.y); CC_BREAK_IF(actionTo == nullptr); pNode->runAction(actionTo); } while (0); @@ -527,12 +534,12 @@ void TSkewTo::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "Duration") { - _fDuration = DICTOOL->getFloatValue_json(subDict, "value"); + _duration = DICTOOL->getFloatValue_json(subDict, "value"); continue; } else if (key == "SkewX") @@ -550,16 +557,17 @@ void TSkewTo::serialize(const rapidjson::Value &val) void TSkewTo::removeAll() { - CCLOG("TSkewTo::removeAll"); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + node->getActionManager()->removeAllActions(); } IMPLEMENT_CLASS_INFO(TSkewBy) TSkewBy::TSkewBy(void) -: _nTag(-1) -, _fDuration(0.0f) -, _bReverse(false) +: _tag(-1) +, _duration(0.0f) +, _reverse(false) { } @@ -576,11 +584,11 @@ void TSkewBy::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); - ActionInterval* actionBy = SkewBy::create(_fDuration, _skew.x, _skew.y); + ActionInterval* actionBy = SkewBy::create(_duration, _skew.x, _skew.y); CC_BREAK_IF(actionBy == nullptr); - if (_bReverse == true) + if (_reverse == true) { ActionInterval* actionByBack = actionBy->reverse(); pNode->runAction(Sequence::create(actionBy, actionByBack, nullptr)); @@ -601,12 +609,12 @@ void TSkewBy::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "Duration") { - _fDuration = DICTOOL->getFloatValue_json(subDict, "value"); + _duration = DICTOOL->getFloatValue_json(subDict, "value"); continue; } else if (key == "SKewX") @@ -621,22 +629,23 @@ void TSkewBy::serialize(const rapidjson::Value &val) } else if (key == "IsReverse") { - _bReverse = (bool)(DICTOOL->getIntValue_json(subDict, "value")); + _reverse = (bool)(DICTOOL->getIntValue_json(subDict, "value")); } } } void TSkewBy::removeAll() { - CCLOG("TSkewBy::removeAll"); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + node->getActionManager()->removeAllActions(); } IMPLEMENT_CLASS_INFO(TriggerState) TriggerState::TriggerState(void) -:_nID(-1) -,_nState(0) +:_id(-1) +,_state(0) { } @@ -651,20 +660,20 @@ bool TriggerState::init() void TriggerState::done() { - TriggerObj *obj = TriggerMng::getInstance()->getTriggerObj(_nID); + TriggerObj *obj = TriggerMng::getInstance()->getTriggerObj(_id); if (obj != nullptr) { - if (_nState == 0) + if (_state == 0) { obj->setEnabled(false); } - else if (_nState == 1) + else if (_state == 1) { obj->setEnabled(true); } - else if (_nState == 2) + else if (_state == 2) { - TriggerMng::getInstance()->removeTriggerObj(_nID); + TriggerMng::getInstance()->removeTriggerObj(_id); } } @@ -680,12 +689,12 @@ void TriggerState::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "ID") { - _nID = DICTOOL->getIntValue_json(subDict, "value"); + _id = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "State") { - _nState = DICTOOL->getIntValue_json(subDict, "value"); + _state = DICTOOL->getIntValue_json(subDict, "value"); continue; } } @@ -698,7 +707,7 @@ void TriggerState::removeAll() IMPLEMENT_CLASS_INFO(ArmaturePlayAction) ArmaturePlayAction::ArmaturePlayAction(void) -: _nTag(-1) +: _tag(-1) { } @@ -715,7 +724,7 @@ void ArmaturePlayAction::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); ComRender *pRender = (ComRender*)(pNode->getComponent(_ComName.c_str())); CC_BREAK_IF(pRender == nullptr); @@ -734,7 +743,7 @@ void ArmaturePlayAction::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "componentName") diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h index fd6f0b6010..f2a55f17b8 100755 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h @@ -17,9 +17,9 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; + int _tag; std::string _comName; - int _nType; + int _type; }; class TMoveTo: public cocostudio::BaseTriggerAction @@ -34,8 +34,8 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; - float _fDuration; + int _tag; + float _duration; cocos2d::Point _pos; }; @@ -52,10 +52,10 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; - float _fDuration; + int _tag; + float _duration; cocos2d::Point _pos; - bool _bReverse; + bool _reverse; }; @@ -71,9 +71,9 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; - float _fDuration; - float _fDeltaAngle; + int _tag; + float _duration; + float _deltaAngle; }; @@ -89,10 +89,10 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; - float _fDuration; - float _fDeltaAngle; - bool _bReverse; + int _tag; + float _duration; + float _deltaAngle; + bool _reverse; }; @@ -108,8 +108,8 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; - float _fDuration; + int _tag; + float _duration; cocos2d::Point _scale; }; @@ -126,10 +126,10 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; - float _fDuration; + int _tag; + float _duration; cocos2d::Point _scale; - bool _bReverse; + bool _reverse; }; @@ -146,8 +146,8 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; - float _fDuration; + int _tag; + float _duration; cocos2d::Point _skew; }; @@ -164,10 +164,10 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; - float _fDuration; + int _tag; + float _duration; cocos2d::Point _skew; - bool _bReverse; + bool _reverse; }; @@ -183,8 +183,8 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nID; - int _nState; + int _id; + int _state; }; class ArmaturePlayAction : public cocostudio::BaseTriggerAction @@ -199,7 +199,7 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; + int _tag; std::string _ComName; std::string _aniname; }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp index eb9a57ea73..00b78174f6 100755 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp @@ -8,29 +8,29 @@ using namespace cocostudio; IMPLEMENT_CLASS_INFO(TimeElapsed) TimeElapsed::TimeElapsed(void) -:_fTotalTime(0.0f) -,_fTmpTime(0.0f) -,_pScheduler(nullptr) -,_bSuc(false) +:_totalTime(0.0f) +,_tmpTime(0.0f) +,_scheduler(nullptr) +,_suc(false) { - _pScheduler = Director::getInstance()->getScheduler(); - _pScheduler->retain(); + _scheduler = Director::getInstance()->getScheduler(); + _scheduler->retain(); } TimeElapsed::~TimeElapsed(void) { - CC_SAFE_RELEASE(_pScheduler); + CC_SAFE_RELEASE(_scheduler); } bool TimeElapsed::init() { - _pScheduler->scheduleSelector(schedule_selector(TimeElapsed::update), this, 0.0f , kRepeatForever, 0.0f, false); + _scheduler->scheduleSelector(schedule_selector(TimeElapsed::update), this, 0.0f , kRepeatForever, 0.0f, false); return true; } bool TimeElapsed::detect() { - return _bSuc; + return _suc; } void TimeElapsed::serialize(const rapidjson::Value &val) @@ -42,31 +42,31 @@ void TimeElapsed::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "TotalTime") { - _fTotalTime = DICTOOL->getFloatValue_json(subDict, "value"); + _totalTime = DICTOOL->getFloatValue_json(subDict, "value"); } } } void TimeElapsed::removeAll() { - _pScheduler->unscheduleUpdateForTarget(this); + _scheduler->unscheduleUpdateForTarget(this); } void TimeElapsed::update(float dt) { - _fTmpTime += dt; - if (_fTmpTime > _fTotalTime) + _tmpTime += dt; + if (_tmpTime > _totalTime) { - _fTmpTime = 0.0f; - _bSuc = true; + _tmpTime = 0.0f; + _suc = true; } } IMPLEMENT_CLASS_INFO(ArmatureActionState) ArmatureActionState::ArmatureActionState(void) -: _nTag(-1) -, _nState(-1) -, _bSuc(false) +: _tag(-1) +, _state(-1) +, _suc(false) { } @@ -78,7 +78,7 @@ bool ArmatureActionState::init() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); ComRender *pRender = (ComRender*)(pNode->getComponent(_comName.c_str())); CC_BREAK_IF(pRender == nullptr); @@ -92,7 +92,7 @@ bool ArmatureActionState::init() bool ArmatureActionState::detect() { - return _bSuc; + return _suc; } void ArmatureActionState::serialize(const rapidjson::Value &val) @@ -104,7 +104,7 @@ void ArmatureActionState::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "componentName") @@ -119,7 +119,7 @@ void ArmatureActionState::serialize(const rapidjson::Value &val) } else if (key == "ActionType") { - _nState = DICTOOL->getIntValue_json(subDict, "value"); + _state = DICTOOL->getIntValue_json(subDict, "value"); continue; } } @@ -129,7 +129,7 @@ void ArmatureActionState::removeAll() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(pNode == nullptr); ComRender *pRender = (ComRender*)(pNode->getComponent(_comName.c_str())); CC_BREAK_IF(pRender == nullptr); @@ -142,15 +142,15 @@ void ArmatureActionState::removeAll() void ArmatureActionState::animationEvent(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const std::string& movementID) { std::string id = movementID; - if (movementType == _nState && id.compare(_aniname) == 0) + if (movementType == _state && id.compare(_aniname) == 0) { - _bSuc = true; + _suc = true; } } IMPLEMENT_CLASS_INFO(NodeInRect) NodeInRect::NodeInRect(void) -:_nTag(-1) +:_tag(-1) { } @@ -166,7 +166,7 @@ bool NodeInRect::init() bool NodeInRect::detect() { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); if (pNode != nullptr && abs(pNode->getPositionX() - _origin.x) <= _size.width && abs(pNode->getPositionY() - _origin.y) <= _size.height) { return true; @@ -183,7 +183,7 @@ void NodeInRect::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "originX") @@ -217,8 +217,8 @@ void NodeInRect::removeAll() IMPLEMENT_CLASS_INFO(NodeVisible) NodeVisible::NodeVisible(void) -: _nTag(-1) -, _bVisible(false) +: _tag(-1) +, _visible(false) { } @@ -233,8 +233,8 @@ bool NodeVisible::init() bool NodeVisible::detect() { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_nTag); - if (pNode != nullptr && pNode->isVisible() == _bVisible) + Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); + if (pNode != nullptr && pNode->isVisible() == _visible) { return true; } @@ -250,12 +250,12 @@ void NodeVisible::serialize(const rapidjson::Value &val) std::string key = DICTOOL->getStringValue_json(subDict, "key"); if (key == "Tag") { - _nTag = DICTOOL->getIntValue_json(subDict, "value"); + _tag = DICTOOL->getIntValue_json(subDict, "value"); continue; } else if (key == "Visible") { - _bVisible = DICTOOL->getIntValue_json(subDict, "value"); + _visible = DICTOOL->getIntValue_json(subDict, "value"); continue; } } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h index 13cb07c086..c889cbadd1 100755 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h @@ -18,10 +18,10 @@ public: virtual void removeAll(); virtual void update(float dt); private: - float _fTotalTime; - float _fTmpTime; - cocos2d::Scheduler *_pScheduler; - bool _bSuc; + float _totalTime; + float _tmpTime; + cocos2d::Scheduler *_scheduler; + bool _suc; }; @@ -38,11 +38,11 @@ public: virtual void removeAll(); void animationEvent(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const std::string& movementID); private: - int _nTag; + int _tag; std::string _comName; std::string _aniname; - int _nState; - bool _bSuc; + int _state; + bool _suc; }; @@ -58,7 +58,7 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; + int _tag; cocos2d::Point _origin; cocos2d::Size _size; }; @@ -75,8 +75,8 @@ public: virtual void serialize(const rapidjson::Value &val); virtual void removeAll(); private: - int _nTag; - bool _bVisible; + int _tag; + bool _visible; }; From 5903a74bd2672d1d549cdc77ae09a11bc1a97015 Mon Sep 17 00:00:00 2001 From: chengstory Date: Fri, 3 Jan 2014 01:42:14 +0800 Subject: [PATCH 129/428] issue #3480 1. add getNode and setNode class function to Component. 2. fixes some build error. --- cocos/2d/CCComponent.cpp | 10 +++ cocos/2d/CCComponent.h | 3 + .../editor-support/cocostudio/CCComRender.cpp | 17 +++-- cocos/editor-support/cocostudio/CCComRender.h | 3 +- .../CocoStudioSceneTest/SceneEditorTest.cpp | 61 +++++++--------- .../CocoStudioSceneTest/SceneEditorTest.h | 2 +- .../CocoStudioSceneTest/TriggerCode/acts.cpp | 72 +++++++++---------- .../Classes/ExtensionsTest/ExtensionsTest.cpp | 5 +- 8 files changed, 94 insertions(+), 79 deletions(-) diff --git a/cocos/2d/CCComponent.cpp b/cocos/2d/CCComponent.cpp index 4f8482367a..f228775a56 100644 --- a/cocos/2d/CCComponent.cpp +++ b/cocos/2d/CCComponent.cpp @@ -102,4 +102,14 @@ void Component::setEnabled(bool b) _enabled = b; } +Node* Component::getNode() +{ + return nullptr; +} + +void Component::setNode(Node *node) +{ + CC_UNUSED_PARAM(node); +} + NS_CC_END diff --git a/cocos/2d/CCComponent.h b/cocos/2d/CCComponent.h index 5631c2585f..800b707e81 100644 --- a/cocos/2d/CCComponent.h +++ b/cocos/2d/CCComponent.h @@ -60,6 +60,9 @@ public: virtual void setEnabled(bool b); static Component* create(void); + virtual Node* getNode(); + virtual void setNode(Node *node); + const std::string& getName() const; void setName(const std::string& name); diff --git a/cocos/editor-support/cocostudio/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp index 76e549761c..824fbd5922 100644 --- a/cocos/editor-support/cocostudio/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -62,18 +62,23 @@ cocos2d::Node* ComRender::getNode() return _render; } -ComRender* ComRender::create(cocos2d::Node *pNode, const char *comName) +void ComRender::setNode(cocos2d::Node *node) { - ComRender * pRet = new ComRender(pNode, comName); - if (pRet != NULL && pRet->init()) + _render = node; +} + +ComRender* ComRender::create(cocos2d::Node *node, const char *comName) +{ + ComRender * ret = new ComRender(node, comName); + if (ret != NULL && ret->init()) { - pRet->autorelease(); + ret->autorelease(); } else { - CC_SAFE_DELETE(pRet); + CC_SAFE_DELETE(ret); } - return pRet; + return ret; } } diff --git a/cocos/editor-support/cocostudio/CCComRender.h b/cocos/editor-support/cocostudio/CCComRender.h index d35973314c..a7bcb9499e 100644 --- a/cocos/editor-support/cocostudio/CCComRender.h +++ b/cocos/editor-support/cocostudio/CCComRender.h @@ -55,8 +55,9 @@ public: */ virtual void onExit(); cocos2d::Node* getNode(); + void setNode(cocos2d::Node *node); - static ComRender* create(cocos2d::Node *pNode, const char *comName); + static ComRender* create(cocos2d::Node *node, const char *comName); private: cocos2d::Node *_render; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index 083e9829d8..f92a8448e5 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -51,7 +51,6 @@ Layer *createTests(int index) break; case TEST_TRIGGER: layer = new TriggerTest(); - layer->init(); break; default: break; @@ -351,10 +350,10 @@ cocos2d::Node* ArmatureComponentTest::createGameScene() { return nullptr; } - Armature *pBlowFish = static_cast(node->getChildByTag(10007)->getComponent("Armature")->getNode()); + Armature *pBlowFish = static_cast(node->getChildByTag(10007)->getComponent("CCArmature")->getNode()); pBlowFish->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); - Armature *pButterflyfish = static_cast(node->getChildByTag(10008)->getComponent("Armature")->getNode()); + Armature *pButterflyfish = static_cast(node->getChildByTag(10008)->getComponent("CCArmature")->getNode()); pButterflyfish->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); return node; @@ -406,25 +405,24 @@ cocos2d::Node* UIComponentTest::createGameScene() } _node = node; - cocos2d::gui::TouchGroup* touchGroup = static_cast(_node->getChildByTag(10025)->getComponent("GUIComponent")->getNode()); - UIWidget* widget = static_cast(touchGroup->getWidgetByName("Panel_154")); - UIButton* button = static_cast(widget->getChildByName("Button_156")); + Widget* widget = static_cast(_node->getChildByTag(10025)->getComponent("GUIComponent")->getNode()); + Button* button = static_cast(widget->getChildByName("Button_156")); button->addTouchEventListener(this, toucheventselector(UIComponentTest::touchEvent)); return node; } -void UIComponentTest::touchEvent(CCObject *pSender, TouchEventType type) +void UIComponentTest::touchEvent(Object *pSender, TouchEventType type) { switch (type) { case TOUCH_EVENT_BEGAN: { Armature *pBlowFish = static_cast(_node->getChildByTag(10010)->getComponent("Armature")->getNode()); - pBlowFish->runAction(CCMoveBy::create(10.0f, ccp(-1000.0f, 0))); + pBlowFish->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); Armature *pButterflyfish = static_cast(_node->getChildByTag(10011)->getComponent("Armature")->getNode()); - pButterflyfish->runAction(CCMoveBy::create(10.0f, ccp(-1000.0f, 0))); + pButterflyfish->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); } break; default: @@ -701,25 +699,25 @@ bool AttributeComponentTest::initData() bool bRet = false; unsigned long size = 0; unsigned char *pBytes = nullptr; - rapidjson::Document jsonDict; + rapidjson::Document doc; do { CC_BREAK_IF(_node == nullptr); - ComAttribute *pAttribute = static_cast(_node->getChildByTag(10015)->getComponent("CCComAttribute")); - CC_BREAK_IF(pAttribute == nullptr); - std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(pAttribute->getJsonName()); + ComAttribute *attribute = static_cast(_node->getChildByTag(10015)->getComponent("CCComAttribute")); + CC_BREAK_IF(attribute == nullptr); + std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(attribute->getJsonName()); std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath); doc.Parse<0>(contentStr.c_str()); CC_BREAK_IF(doc.HasParseError()); - std::string playerName = DICTOOL->getStringValue_json(jsonDict, "name"); - float maxHP = DICTOOL->getFloatValue_json(jsonDict, "maxHP"); - float maxMP = DICTOOL->getFloatValue_json(jsonDict, "maxMP"); + std::string playerName = DICTOOL->getStringValue_json(doc, "name"); + float maxHP = DICTOOL->getFloatValue_json(doc, "maxHP"); + float maxMP = DICTOOL->getFloatValue_json(doc, "maxMP"); - pAttribute->setCString("Name", playerName.c_str()); - pAttribute->setFloat("MaxHP", maxHP); - pAttribute->setFloat("MaxMP", maxMP); + attribute->setString("Name", playerName); + attribute->setFloat("MaxHP", maxHP); + attribute->setFloat("MaxMP", maxMP); - log("Name: %s, HP: %f, MP: %f", pAttribute->getCString("Name"), pAttribute->getFloat("MaxHP"), pAttribute->getFloat("MaxMP")); + log("Name: %s, HP: %f, MP: %f", attribute->getString("Name").c_str(), attribute->getFloat("MaxHP"), attribute->getFloat("MaxMP")); bRet = true; } while (0); @@ -757,19 +755,14 @@ std::string TriggerTest::title() return "Trigger Test"; } -bool TriggerTest::init() -{ - sendEvent(TRIGGEREVENT_INITSCENE); - return true; -} // on "init" you need to initialize your instance -bool SceneEditorTestLayer::onEnter() +void TriggerTest::onEnter() { SceneEditorTestLayer::onEnter(); Node *root = createGameScene(); this->addChild(root, 0, 1); - this->schedule(schedule_selector(SceneEditorTestLayer::gameLogic)); + this->schedule(schedule_selector(TriggerTest::gameLogic)); auto dispatcher = Director::getInstance()->getEventDispatcher(); auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); @@ -783,7 +776,7 @@ bool SceneEditorTestLayer::onEnter() } -void SceneEditorTestLayer::onExit() +void TriggerTest::onExit() { sendEvent(TRIGGEREVENT_LEAVESCENE); this->unschedule(schedule_selector(TriggerTest::gameLogic)); @@ -797,34 +790,34 @@ void SceneEditorTestLayer::onExit() SceneEditorTestLayer::onExit(); } -bool SceneEditorTestLayer::onTouchBegan(Touch *touch, Event *unused_event) +bool TriggerTest::onTouchBegan(Touch *touch, Event *unused_event) { sendEvent(TRIGGEREVENT_TOUCHBEGAN); return true; } -void SceneEditorTestLayer::onTouchMoved(Touch *touch, Event *unused_event) +void TriggerTest::onTouchMoved(Touch *touch, Event *unused_event) { sendEvent(TRIGGEREVENT_TOUCHMOVED); } -void SceneEditorTestLayer::onTouchEnded(Touch *touch, Event *unused_event) +void TriggerTest::onTouchEnded(Touch *touch, Event *unused_event) { sendEvent(TRIGGEREVENT_TOUCHENDED); } -void SceneEditorTestLayer::onTouchCancelled(Touch *touch, Event *unused_event) +void TriggerTest::onTouchCancelled(Touch *touch, Event *unused_event) { sendEvent(TRIGGEREVENT_TOUCHCANCELLED); } -void SceneEditorTestLayer::gameLogic(float dt) +void TriggerTest::gameLogic(float dt) { sendEvent(TRIGGEREVENT_UPDATESCENE); } -cocos2d::Node* SceneEditorTestLayer::createGameScene() +cocos2d::Node* TriggerTest::createGameScene() { Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/TriggerTest/TriggerTest.json"); if (node == nullptr) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h index ec1bafd4c1..0b7076f7af 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h @@ -3,6 +3,7 @@ #include "cocos2d.h" #include "extensions/cocos-ext.h" +#include "cocostudio/CocoStudio.h" class SceneEditorTestScene : public TestScene { @@ -178,7 +179,6 @@ public: ~TriggerTest(); virtual std::string title(); - virtual bool init(); virtual void onEnter(); virtual void onExit(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp index 5b19de8a91..4449d2cd9d 100755 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp @@ -24,9 +24,9 @@ void PlayMusic::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); - CC_BREAK_IF(pNode == nullptr); - ComAudio *audio = (ComAudio*)(pNode->getComponent(_comName.c_str())); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + CC_BREAK_IF(node == nullptr); + ComAudio *audio = (ComAudio*)(node->getComponent(_comName.c_str())); CC_BREAK_IF(audio == nullptr); if (_type == 0) { @@ -89,11 +89,11 @@ void TMoveTo::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); - CC_BREAK_IF(pNode == nullptr); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + CC_BREAK_IF(node == nullptr); ActionInterval* actionTo = MoveTo::create(_duration, _pos); CC_BREAK_IF(actionTo == nullptr); - pNode->runAction(actionTo); + node->runAction(actionTo); } while (0); } @@ -154,18 +154,18 @@ void TMoveBy::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); - CC_BREAK_IF(pNode == nullptr); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + CC_BREAK_IF(node == nullptr); ActionInterval* actionBy = MoveBy::create(_duration, _pos); CC_BREAK_IF(actionBy == nullptr); if (_reverse == true) { ActionInterval* actionByBack = actionBy->reverse(); - pNode->runAction( CCSequence::create(actionBy, actionByBack, nullptr)); + node->runAction( CCSequence::create(actionBy, actionByBack, nullptr)); } else { - pNode->runAction(actionBy); + node->runAction(actionBy); } } while (0); } @@ -234,11 +234,11 @@ void TRotateTo::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); - CC_BREAK_IF(pNode == nullptr); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + CC_BREAK_IF(node == nullptr); ActionInterval* actionTo = RotateTo::create(_duration, _deltaAngle); CC_BREAK_IF(actionTo == nullptr); - pNode->runAction(actionTo); + node->runAction(actionTo); } while (0); } @@ -297,18 +297,18 @@ void TRotateBy::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); - CC_BREAK_IF(pNode == nullptr); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + CC_BREAK_IF(node == nullptr); ActionInterval* actionBy = RotateBy::create(_duration, _deltaAngle); CC_BREAK_IF(actionBy == nullptr); if (_reverse == true) { ActionInterval* actionByBack = actionBy->reverse(); - pNode->runAction( Sequence::create(actionBy, actionByBack, nullptr)); + node->runAction( Sequence::create(actionBy, actionByBack, nullptr)); } else { - pNode->runAction(actionBy); + node->runAction(actionBy); } } while (0); } @@ -371,11 +371,11 @@ void TScaleTo::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); - CC_BREAK_IF(pNode == nullptr); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + CC_BREAK_IF(node == nullptr); ActionInterval* actionTo = ScaleTo::create(_duration, _scale.x, _scale.y); CC_BREAK_IF(actionTo == nullptr); - pNode->runAction(actionTo); + node->runAction(actionTo); } while (0); } @@ -438,18 +438,18 @@ void TScaleBy::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); - CC_BREAK_IF(pNode == nullptr); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + CC_BREAK_IF(node == nullptr); ActionInterval* actionBy = ScaleBy::create(_duration, _scale.x, _scale.y); CC_BREAK_IF(actionBy == nullptr); if (_reverse == true) { ActionInterval* actionByBack = actionBy->reverse(); - pNode->runAction(Sequence::create(actionBy, actionByBack, nullptr)); + node->runAction(Sequence::create(actionBy, actionByBack, nullptr)); } else { - pNode->runAction(actionBy); + node->runAction(actionBy); } } while (0); } @@ -517,11 +517,11 @@ void TSkewTo::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); - CC_BREAK_IF(pNode == nullptr); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + CC_BREAK_IF(node == nullptr); ActionInterval* actionTo = SkewTo::create(_duration, _skew.x, _skew.y); CC_BREAK_IF(actionTo == nullptr); - pNode->runAction(actionTo); + node->runAction(actionTo); } while (0); } @@ -584,18 +584,18 @@ void TSkewBy::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); - CC_BREAK_IF(pNode == nullptr); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + CC_BREAK_IF(node == nullptr); ActionInterval* actionBy = SkewBy::create(_duration, _skew.x, _skew.y); CC_BREAK_IF(actionBy == nullptr); if (_reverse == true) { ActionInterval* actionByBack = actionBy->reverse(); - pNode->runAction(Sequence::create(actionBy, actionByBack, nullptr)); + node->runAction(Sequence::create(actionBy, actionByBack, nullptr)); } else { - pNode->runAction(actionBy); + node->runAction(actionBy); } } while (0); } @@ -644,9 +644,9 @@ void TSkewBy::removeAll() IMPLEMENT_CLASS_INFO(TriggerState) TriggerState::TriggerState(void) -:_id(-1) -,_state(0) { + _id = -1; + _state = 0; } TriggerState::~TriggerState(void) @@ -724,9 +724,9 @@ void ArmaturePlayAction::done() { do { - Node *pNode = SceneReader::getInstance()->getNodeByTag(_tag); - CC_BREAK_IF(pNode == nullptr); - ComRender *pRender = (ComRender*)(pNode->getComponent(_ComName.c_str())); + Node *node = SceneReader::getInstance()->getNodeByTag(_tag); + CC_BREAK_IF(node == nullptr); + ComRender *pRender = (ComRender*)(node->getComponent(_ComName.c_str())); CC_BREAK_IF(pRender == nullptr); Armature *pAr = (Armature *)(pRender->getNode()); CC_BREAK_IF(pAr == nullptr); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp index 3444655173..393f64ff47 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp @@ -81,7 +81,10 @@ static struct { }, { "CocoStudioComponentsTest", [](Object *sender) { runComponentsTestLayerTest(); } }, - { "CocoStudioSceneTest", [](Object *sender) { runSceneEditorTestLayer(); } + { "CocoStudioSceneTest", [](Object *sender) { SceneEditorTestScene *scene = new SceneEditorTestScene(); + scene->runThisTest(); + scene->release(); + } }, { "CocoStudioGUITest", [](Object *sender) { From 77dca5958fdd989998421c7e060b707ec73e0634 Mon Sep 17 00:00:00 2001 From: chengstory Date: Fri, 3 Jan 2014 02:03:05 +0800 Subject: [PATCH 130/428] issue #3480 upload Samples resources. --- .../project.pbxproj.REMOVED.git-id | 2 +- cocos/editor-support/cocostudio/CCComAttribute.cpp | 8 ++++++++ cocos/editor-support/cocostudio/CCComAttribute.h | 4 ++++ cocos/editor-support/cocostudio/CCSSceneReader.cpp | 1 + .../CocoStudioSceneTest/SceneEditorTest.cpp | 6 ++---- .../Images/startMenuBG.png.REMOVED.git-id | 0 .../Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 0 .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 0 .../Images/startMenuBG.png.REMOVED.git-id | 1 + .../Misc/music_logo.mp3.REMOVED.git-id | 0 .../Misc/music_logo.wav.REMOVED.git-id | 1 + .../startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id | 0 .../startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id | 0 .../startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id | 0 .../CowBoy/Cowboy.ExportJson.REMOVED.git-id | 1 + .../EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id | 1 + .../TriggerTest/Images/startMenuBG.png.REMOVED.git-id | 1 + .../Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 0 .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 0 .../UIComponentTest/Images/startMenuBG.png.REMOVED.git-id | 1 + .../Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 1 + .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 1 + .../Images/startMenuBG.png.REMOVED.git-id | 0 .../Misc/music_logo.mp3.REMOVED.git-id | 0 .../Misc/music_logo.wav.REMOVED.git-id | 1 + .../Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 1 + .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 1 + .../startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id | 1 + .../startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id | 1 + .../startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id | 1 + .../Images/startMenuBG.png.REMOVED.git-id | 1 + .../Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 1 + .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 1 + .../Images/startMenuBG.png.REMOVED.git-id | 1 + .../Misc/music_logo.mp3.REMOVED.git-id | 1 + .../Misc/music_logo.wav.REMOVED.git-id | 1 + .../startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id | 0 .../CowBoy/Cowboy.ExportJson.REMOVED.git-id | 1 + .../EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id | 1 + .../TriggerTest/Images/startMenuBG.png.REMOVED.git-id | 1 + .../Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 1 + .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 1 + .../UIComponentTest/Images/startMenuBG.png.REMOVED.git-id | 1 + .../Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 1 + .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 1 + .../Images/startMenuBG.png.REMOVED.git-id | 1 + .../Misc/music_logo.mp3.REMOVED.git-id | 1 + .../Misc/music_logo.wav.REMOVED.git-id | 1 + .../Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 1 + .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 1 + .../startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id | 1 + 51 files changed, 50 insertions(+), 5 deletions(-) rename samples/Cpp/TestCpp/Resources/{scenetest => hd/scenetest/ArmatureComponentTest}/Images/startMenuBG.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{ => ArmatureComponentTest}/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{ => ArmatureComponentTest}/fishes/blowFish/Blowfish0.png.REMOVED.git-id (100%) create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id rename samples/Cpp/TestCpp/Resources/hd/scenetest/{ => BackgroundComponentTest}/Misc/music_logo.mp3.REMOVED.git-id (100%) create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id rename samples/Cpp/TestCpp/Resources/hd/scenetest/{ => BackgroundComponentTest}/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{ => BackgroundComponentTest}/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{ => BackgroundComponentTest}/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id (100%) create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id rename samples/Cpp/TestCpp/Resources/{scenetest => hd/scenetest/TriggerTest}/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/{scenetest => hd/scenetest/TriggerTest}/fishes/blowFish/Blowfish0.png.REMOVED.git-id (100%) create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename samples/Cpp/TestCpp/Resources/hd/scenetest/{ => loadSceneEdtiorFileTest}/Images/startMenuBG.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/{scenetest => hd/scenetest/loadSceneEdtiorFileTest}/Misc/music_logo.mp3.REMOVED.git-id (100%) create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id rename samples/Cpp/TestCpp/Resources/scenetest/{ => BackgroundComponentTest}/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id (100%) create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index bfb69a92ea..2434808646 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -7cc2be4e284d9095dd8fa56a092a98562f132776 \ No newline at end of file +e2ea226caf64a727f7f6e4a45bb6f3b3bf22e478 \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp index ad03fe34fa..35af4c2f9e 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -116,5 +116,13 @@ ComAttribute* ComAttribute::create(void) return pRet; } +void ComAttribute::setJsonFile(const std::string &jsonName) +{ + _jsonName = jsonName; +} +std::string ComAttribute::getJsonFile() +{ + return _jsonName; +} } diff --git a/cocos/editor-support/cocostudio/CCComAttribute.h b/cocos/editor-support/cocostudio/CCComAttribute.h index 008c047208..29bb02b536 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.h +++ b/cocos/editor-support/cocostudio/CCComAttribute.h @@ -57,8 +57,12 @@ public: float getFloat(const std::string& key, float def = 0.0f) const; bool getBool(const std::string& key, bool def = false) const; std::string getString(const std::string& key, const std::string& def = "") const; + + void setJsonFile(const std::string &jsonName); + std::string getJsonFile(); private: cocos2d::ValueMap _dict; + std::string _jsonName; }; } diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index 68adc34c8c..fa3a80b939 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -340,6 +340,7 @@ namespace cocostudio { CCLOG("unknown resourcetype on CCComAttribute!"); continue; } + pAttribute->setJsonFile(pPath); gb->addComponent(pAttribute); if (_listener && _fnSelector) { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index f92a8448e5..01306f5ad1 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -587,7 +587,7 @@ cocos2d::Node* EffectComponentTest::createGameScene() } _node = node; Armature *pAr = static_cast(_node->getChildByTag(10015)->getComponent("Armature")->getNode()); - pAr->getAnimation()->setMovementEventCallFunc(this, movementEvent_selector(EffectComponentTest::animationEvent)); + pAr->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(EffectComponentTest::animationEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); return node; } @@ -697,14 +697,12 @@ void AttributeComponentTest::onExit() bool AttributeComponentTest::initData() { bool bRet = false; - unsigned long size = 0; - unsigned char *pBytes = nullptr; rapidjson::Document doc; do { CC_BREAK_IF(_node == nullptr); ComAttribute *attribute = static_cast(_node->getChildByTag(10015)->getComponent("CCComAttribute")); CC_BREAK_IF(attribute == nullptr); - std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(attribute->getJsonName()); + std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(attribute->getJsonFile()); std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath); doc.Parse<0>(contentStr.c_str()); CC_BREAK_IF(doc.HasParseError()); diff --git a/samples/Cpp/TestCpp/Resources/scenetest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/Images/startMenuBG.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id new file mode 100644 index 0000000000..ab08309b7e --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id @@ -0,0 +1 @@ +5d84575ee663bd1c3d56b7501b6183302afb62e2 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/Misc/music_logo.mp3.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/Misc/music_logo.mp3.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id new file mode 100644 index 0000000000..709b2d86c0 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id @@ -0,0 +1 @@ +48e8461c309cb59d5610805d9774e64c22468263 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id new file mode 100644 index 0000000000..4dd0da7eee --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id @@ -0,0 +1 @@ +434a36b3e7fa9c849986cf6128b7d4402a382eb7 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id new file mode 100644 index 0000000000..1ab13aff50 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id @@ -0,0 +1 @@ +06fb5524ddc56e1aaa5872fae8b646a97345f6fe \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id new file mode 100644 index 0000000000..ab08309b7e --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id @@ -0,0 +1 @@ +5d84575ee663bd1c3d56b7501b6183302afb62e2 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id new file mode 100644 index 0000000000..ab08309b7e --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id @@ -0,0 +1 @@ +5d84575ee663bd1c3d56b7501b6183302afb62e2 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..13d9610346 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +e22c64c159404622ff93915eb9f01be011001dac \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..d35dbb70ac --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +d7d85cd75e382c2dd04ddc34ca1d07e2ffff66d5 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/Images/startMenuBG.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/Misc/music_logo.mp3.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/Misc/music_logo.mp3.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id new file mode 100644 index 0000000000..709b2d86c0 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id @@ -0,0 +1 @@ +48e8461c309cb59d5610805d9774e64c22468263 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..13d9610346 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +e22c64c159404622ff93915eb9f01be011001dac \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..d35dbb70ac --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +d7d85cd75e382c2dd04ddc34ca1d07e2ffff66d5 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id new file mode 100644 index 0000000000..607f8adcb9 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id @@ -0,0 +1 @@ +c6b8f5b59f6d563cef4a4eba19985716ff1e1f6e \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id new file mode 100644 index 0000000000..958d03a9c2 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id @@ -0,0 +1 @@ +db7f2b0850ff959c24ceca59bcae78b1afcb4c80 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id new file mode 100644 index 0000000000..22c8929ad6 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id @@ -0,0 +1 @@ +9a5e05761c2f6db85e7cd8f3dcf1932b6b6eb2d8 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id new file mode 100644 index 0000000000..ab08309b7e --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id @@ -0,0 +1 @@ +5d84575ee663bd1c3d56b7501b6183302afb62e2 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..13d9610346 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +e22c64c159404622ff93915eb9f01be011001dac \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..d35dbb70ac --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +d7d85cd75e382c2dd04ddc34ca1d07e2ffff66d5 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id new file mode 100644 index 0000000000..ab08309b7e --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id @@ -0,0 +1 @@ +5d84575ee663bd1c3d56b7501b6183302afb62e2 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id new file mode 100644 index 0000000000..604b21ac01 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id @@ -0,0 +1 @@ +4b2aa3f3fbf2f96bced91d0da0e8fc2f7f863a61 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id new file mode 100644 index 0000000000..709b2d86c0 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id @@ -0,0 +1 @@ +48e8461c309cb59d5610805d9774e64c22468263 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id new file mode 100644 index 0000000000..4dd0da7eee --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id @@ -0,0 +1 @@ +434a36b3e7fa9c849986cf6128b7d4402a382eb7 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id new file mode 100644 index 0000000000..d2c12af0e0 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id @@ -0,0 +1 @@ +2b61d3b005b4076c5ff22a78a00822c0f0dc0875 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id new file mode 100644 index 0000000000..ab08309b7e --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id @@ -0,0 +1 @@ +5d84575ee663bd1c3d56b7501b6183302afb62e2 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..13d9610346 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +e22c64c159404622ff93915eb9f01be011001dac \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..d35dbb70ac --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +d7d85cd75e382c2dd04ddc34ca1d07e2ffff66d5 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id new file mode 100644 index 0000000000..ab08309b7e --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id @@ -0,0 +1 @@ +5d84575ee663bd1c3d56b7501b6183302afb62e2 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..13d9610346 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +e22c64c159404622ff93915eb9f01be011001dac \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..d35dbb70ac --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +d7d85cd75e382c2dd04ddc34ca1d07e2ffff66d5 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id new file mode 100644 index 0000000000..ab08309b7e --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id @@ -0,0 +1 @@ +5d84575ee663bd1c3d56b7501b6183302afb62e2 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id new file mode 100644 index 0000000000..604b21ac01 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id @@ -0,0 +1 @@ +4b2aa3f3fbf2f96bced91d0da0e8fc2f7f863a61 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id new file mode 100644 index 0000000000..709b2d86c0 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id @@ -0,0 +1 @@ +48e8461c309cb59d5610805d9774e64c22468263 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..13d9610346 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +e22c64c159404622ff93915eb9f01be011001dac \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..d35dbb70ac --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +d7d85cd75e382c2dd04ddc34ca1d07e2ffff66d5 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id new file mode 100644 index 0000000000..e303572866 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id @@ -0,0 +1 @@ +d9c89ed8831db643cc80a0651e5398e26861bbd0 \ No newline at end of file From e08e4ce0f8ec95393b9c3f09fcf61051bae929a4 Mon Sep 17 00:00:00 2001 From: chengstory Date: Fri, 3 Jan 2014 02:21:36 +0800 Subject: [PATCH 131/428] fixed #3480 add search paths. --- .../cocostudio/CCSSceneReader.cpp | 4 ++++ samples/Cpp/TestCpp/Classes/AppDelegate.cpp | 21 ++++++++++++++++++- .../CocoStudioSceneTest/SceneEditorTest.cpp | 6 ++---- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index fa3a80b939..2df5e0b151 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -362,6 +362,10 @@ namespace cocostudio { pAudio->setFile(pPath.c_str()); const bool bLoop = (DICTOOL->getIntValue_json(subDict, "loop") != 0); pAudio->setLoop(bLoop); + if (pComName != NULL) + { + pAudio->setName(pComName); + } gb->addComponent(pAudio); if (pComName != NULL) { diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp index 3968a54656..7b6abad014 100644 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp +++ b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp @@ -45,11 +45,30 @@ bool AppDelegate::applicationDidFinishLaunching() auto resourceSize = Size(960, 640); searchPaths.push_back("hd"); searchPaths.push_back("hd/scenetest"); + searchPaths.push_back("hd/scenetest/ArmatureComponentTest"); + searchPaths.push_back("hd/scenetest/AttributeComponentTest"); + searchPaths.push_back("hd/scenetest/BackgroundComponentTest"); + searchPaths.push_back("hd/scenetest/EffectComponentTest"); + searchPaths.push_back("hd/scenetest/loadSceneEdtiorFileTest"); + searchPaths.push_back("hd/scenetest/ParticleComponentTest"); + searchPaths.push_back("hd/scenetest/SpriteComponentTest"); + searchPaths.push_back("hd/scenetest/TmxMapComponentTest"); + searchPaths.push_back("hd/scenetest/UIComponentTest"); + searchPaths.push_back("hd/scenetest/TriggerTest"); director->setContentScaleFactor(resourceSize.height/designSize.height); } else { - searchPaths.push_back("scenetest"); + searchPaths.push_back("scenetest/ArmatureComponentTest"); + searchPaths.push_back("scenetest/AttributeComponentTest"); + searchPaths.push_back("scenetest/BackgroundComponentTest"); + searchPaths.push_back("scenetest/EffectComponentTest"); + searchPaths.push_back("scenetest/loadSceneEdtiorFileTest"); + searchPaths.push_back("scenetest/ParticleComponentTest"); + searchPaths.push_back("scenetest/SpriteComponentTest"); + searchPaths.push_back("scenetest/TmxMapComponentTest"); + searchPaths.push_back("scenetest/UIComponentTest"); + searchPaths.push_back("scenetest/TriggerTest"); } pFileUtils->setSearchPaths(searchPaths); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index 01306f5ad1..ef842d863d 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -245,7 +245,6 @@ cocos2d::Node* loadSceneEdtiorFileTest::createGameScene() { return nullptr; } - ActionManagerEx::getInstance()->playActionByName("startMenu_1.json","Animation1"); return node; } @@ -474,7 +473,7 @@ cocos2d::Node* TmxMapComponentTest::createGameScene() { return nullptr; } - TMXTiledMap *tmxMap = static_cast(node->getChildByTag(10015)->getComponent("TMXTiledMap")->getNode()); + TMXTiledMap *tmxMap = static_cast(node->getChildByTag(10015)->getComponent("CCTMXTiledMap")->getNode()); ActionInterval *actionTo = SkewTo::create(2, 0.f, 2.f); ActionInterval *rotateTo = RotateTo::create(2, 61.0f); ActionInterval *actionScaleTo = ScaleTo::create(2, -0.44f, 0.47f); @@ -586,7 +585,7 @@ cocos2d::Node* EffectComponentTest::createGameScene() return nullptr; } _node = node; - Armature *pAr = static_cast(_node->getChildByTag(10015)->getComponent("Armature")->getNode()); + Armature *pAr = static_cast(_node->getChildByTag(10015)->getComponent("CCArmature")->getNode()); pAr->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(EffectComponentTest::animationEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); return node; } @@ -648,7 +647,6 @@ cocos2d::Node* BackgroundComponentTest::createGameScene() { return nullptr; } - ActionManagerEx::getInstance()->playActionByName("startMenu_1.json","Animation1"); ComAudio *Audio = static_cast(node->getComponent("CCBackgroundAudio")); Audio->playBackgroundMusic(); From ee2d9e9c741648e87b852fac713492fc1a483667 Mon Sep 17 00:00:00 2001 From: chengstory Date: Fri, 3 Jan 2014 02:49:11 +0800 Subject: [PATCH 132/428] fixed #3480 remove unused ret. --- .../CocoStudioSceneTest/SceneEditorTest.cpp | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index ef842d863d..f253a381c0 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -218,13 +218,11 @@ std::string loadSceneEdtiorFileTest::title() void loadSceneEdtiorFileTest::onEnter() { SceneEditorTestLayer::onEnter(); - bool bRet = false; do { Node *root = createGameScene(); CC_BREAK_IF(!root); this->addChild(root, 0, 1); - bRet = true; } while (0); } @@ -266,13 +264,11 @@ std::string SpriteComponentTest::title() void SpriteComponentTest::onEnter() { SceneEditorTestLayer::onEnter(); - bool bRet = false; do { Node *root = createGameScene(); CC_BREAK_IF(!root); this->addChild(root, 0, 1); - bRet = true; } while (0); } @@ -323,13 +319,11 @@ std::string ArmatureComponentTest::title() void ArmatureComponentTest::onEnter() { SceneEditorTestLayer::onEnter(); - bool bRet = false; do { Node *root = createGameScene(); CC_BREAK_IF(!root); this->addChild(root, 0, 1); - bRet = true; } while (0); } @@ -376,13 +370,11 @@ std::string UIComponentTest::title() void UIComponentTest::onEnter() { SceneEditorTestLayer::onEnter(); - bool bRet = false; do { Node *root = createGameScene(); CC_BREAK_IF(!root); this->addChild(root, 0, 1); - bRet = true; } while (0); } @@ -447,13 +439,11 @@ std::string TmxMapComponentTest::title() void TmxMapComponentTest::onEnter() { SceneEditorTestLayer::onEnter(); - bool bRet = false; do { Node *root = createGameScene(); CC_BREAK_IF(!root); this->addChild(root, 0, 1); - bRet = true; } while (0); } @@ -505,13 +495,11 @@ std::string ParticleComponentTest::title() void ParticleComponentTest::onEnter() { SceneEditorTestLayer::onEnter(); - bool bRet = false; do { Node *root = createGameScene(); CC_BREAK_IF(!root); this->addChild(root, 0, 1); - bRet = true; } while (0); } @@ -558,13 +546,11 @@ std::string EffectComponentTest::title() void EffectComponentTest::onEnter() { SceneEditorTestLayer::onEnter(); - bool bRet = false; do { Node *root = createGameScene(); CC_BREAK_IF(!root); this->addChild(root, 0, 1); - bRet = true; } while (0); } @@ -621,13 +607,11 @@ std::string BackgroundComponentTest::title() void BackgroundComponentTest::onEnter() { SceneEditorTestLayer::onEnter(); - bool bRet = false; do { Node *root = createGameScene(); CC_BREAK_IF(!root); this->addChild(root, 0, 1); - bRet = true; } while (0); } @@ -672,14 +656,12 @@ std::string AttributeComponentTest::title() void AttributeComponentTest::onEnter() { SceneEditorTestLayer::onEnter(); - bool bRet = false; do { Node *root = createGameScene(); CC_BREAK_IF(!root); initData(); this->addChild(root, 0, 1); - bRet = true; } while (0); } @@ -731,10 +713,6 @@ cocos2d::Node* AttributeComponentTest::createGameScene() return node; } - - - - TriggerTest::TriggerTest() : _node(nullptr) , _touchListener(nullptr) From f023ada6f685e734f41a9b9006c1f8ed0ebf5b5b Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 2 Jan 2014 14:25:28 -0800 Subject: [PATCH 133/428] Improves transitions test Unifies functions with trantions name --- .../TransitionsTest/TransitionsTest.cpp | 168 +++++++----------- 1 file changed, 62 insertions(+), 106 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp index aaa8915438..0c81fa9373 100644 --- a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp @@ -142,127 +142,83 @@ public: } }; -#define MAX_LAYER 41 +#define STRINGIFY(x) #x -static std::string transitions[MAX_LAYER] = { - "CCTransitionJumpZoom", +#define TRANS(__className__) { \ + { [](float t, Scene* s){ return __className__::create(t,s);} }, \ + STRINGIFY(__className__), \ + } - "CCTransitionProgressRadialCCW", - "CCTransitionProgressRadialCW", - "CCTransitionProgressHorizontal", - "CCTransitionProgressVertical", - "CCTransitionProgressInOut", - "CCTransitionProgressOutIn", +struct _transitions { + std::function function; + const char * name; +} transitions[] { + TRANS(TransitionJumpZoom), + TRANS(TransitionProgressRadialCCW), + TRANS(TransitionProgressRadialCW), + TRANS(TransitionProgressHorizontal), + TRANS(TransitionProgressVertical), + TRANS(TransitionProgressInOut), + TRANS(TransitionProgressOutIn), - "CCTransitionCrossFade", - "TransitionPageForward", - "TransitionPageBackward", - "CCTransitionFadeTR", - "CCTransitionFadeBL", - "CCTransitionFadeUp", - "CCTransitionFadeDown", - "CCTransitionTurnOffTiles", - "CCTransitionSplitRows", - "CCTransitionSplitCols", + TRANS(TransitionCrossFade), - "CCTransitionFade", - "FadeWhiteTransition", + TRANS(PageTransitionForward), + TRANS(PageTransitionBackward), + TRANS(TransitionFadeTR), + TRANS(TransitionFadeBL), + TRANS(TransitionFadeUp), + TRANS(TransitionFadeDown), - "FlipXLeftOver", - "FlipXRightOver", - "FlipYUpOver", - "FlipYDownOver", - "FlipAngularLeftOver", - "FlipAngularRightOver", + TRANS(TransitionTurnOffTiles), - "ZoomFlipXLeftOver", - "ZoomFlipXRightOver", - "ZoomFlipYUpOver", - "ZoomFlipYDownOver", - "ZoomFlipAngularLeftOver", - "ZoomFlipAngularRightOver", + TRANS(TransitionSplitRows), + TRANS(TransitionSplitCols), - "CCTransitionShrinkGrow", - "CCTransitionRotoZoom", + TRANS(TransitionFade), + TRANS(FadeWhiteTransition), - "CCTransitionMoveInL", - "CCTransitionMoveInR", - "CCTransitionMoveInT", - "CCTransitionMoveInB", - "CCTransitionSlideInL", - "CCTransitionSlideInR", - "CCTransitionSlideInT", - "CCTransitionSlideInB", + TRANS(FlipXLeftOver), + TRANS(FlipXRightOver), + TRANS(FlipYUpOver), + TRANS(FlipYDownOver), + TRANS(FlipAngularLeftOver), + TRANS(FlipAngularRightOver), + TRANS(ZoomFlipXLeftOver), + TRANS(ZoomFlipXRightOver), + TRANS(ZoomFlipYUpOver), + TRANS(ZoomFlipYDownOver), + TRANS(ZoomFlipAngularLeftOver), + TRANS(ZoomFlipAngularRightOver), + TRANS(TransitionShrinkGrow), + TRANS(TransitionRotoZoom), + + TRANS(TransitionMoveInL), + TRANS(TransitionMoveInR), + TRANS(TransitionMoveInT), + TRANS(TransitionMoveInB), + + TRANS(TransitionSlideInL), + TRANS(TransitionSlideInR), + TRANS(TransitionSlideInT), + TRANS(TransitionSlideInB), }; + + +#define MAX_LAYER (sizeof(transitions) / sizeof(transitions[0])) + + static int s_nSceneIdx = 0; -TransitionScene* createTransition(int nIndex, float t, Scene* s) +TransitionScene* createTransition(int index, float t, Scene* s) { // fix bug #486, without setDepthTest(false), FlipX,Y will flickers Director::getInstance()->setDepthTest(false); - switch(nIndex) - { - case 0: return TransitionJumpZoom::create(t, s); - - case 1: return TransitionProgressRadialCCW::create(t, s); - case 2: return TransitionProgressRadialCW::create(t, s); - case 3: return TransitionProgressHorizontal::create(t, s); - case 4: return TransitionProgressVertical::create(t, s); - case 5: return TransitionProgressInOut::create(t, s); - case 6: return TransitionProgressOutIn::create(t, s); - - case 7: return TransitionCrossFade::create(t,s); - - case 8: return PageTransitionForward::create(t, s); - case 9: return PageTransitionBackward::create(t, s); - case 10: return TransitionFadeTR::create(t, s); - case 11: return TransitionFadeBL::create(t, s); - case 12: return TransitionFadeUp::create(t, s); - case 13: return TransitionFadeDown::create(t, s); - - case 14: return TransitionTurnOffTiles::create(t, s); - - case 15: return TransitionSplitRows::create(t, s); - case 16: return TransitionSplitCols::create(t, s); - - case 17: return TransitionFade::create(t, s); - case 18: return FadeWhiteTransition::create(t, s); - - case 19: return FlipXLeftOver::create(t, s); - case 20: return FlipXRightOver::create(t, s); - case 21: return FlipYUpOver::create(t, s); - case 22: return FlipYDownOver::create(t, s); - case 23: return FlipAngularLeftOver::create(t, s); - case 24: return FlipAngularRightOver::create(t, s); - - case 25: return ZoomFlipXLeftOver::create(t, s); - case 26: return ZoomFlipXRightOver::create(t, s); - case 27: return ZoomFlipYUpOver::create(t, s); - case 28: return ZoomFlipYDownOver::create(t, s); - case 29: return ZoomFlipAngularLeftOver::create(t, s); - case 30: return ZoomFlipAngularRightOver::create(t, s); - - case 31: return TransitionShrinkGrow::create(t, s); - case 32: return TransitionRotoZoom::create(t, s); - - case 33: return TransitionMoveInL::create(t, s); - case 34: return TransitionMoveInR::create(t, s); - case 35: return TransitionMoveInT::create(t, s); - case 36: return TransitionMoveInB::create(t, s); - - case 37: return TransitionSlideInL::create(t, s); - case 38: return TransitionSlideInR::create(t, s); - case 39: return TransitionSlideInT::create(t, s); - case 40: return TransitionSlideInB::create(t, s); - - default: break; - } - - return NULL; -} + return transitions[index].function(t,s); +} void TransitionsTestScene::runThisTest() @@ -286,7 +242,7 @@ TestLayer1::TestLayer1(void) bg1->setPosition( Point(size.width/2, size.height/2) ); addChild(bg1, -1); - auto title = LabelTTF::create( (transitions[s_nSceneIdx]).c_str(), "Thonburi", 32 ); + auto title = LabelTTF::create( (transitions[s_nSceneIdx]).name, "Thonburi", 32 ); addChild(title); title->setColor( Color3B(255,32,32) ); title->setPosition( Point(x/2, y-100) ); @@ -415,7 +371,7 @@ TestLayer2::TestLayer2() bg1->setPosition( Point(size.width/2, size.height/2) ); addChild(bg1, -1); - auto title = LabelTTF::create((transitions[s_nSceneIdx]).c_str(), "Thonburi", 32 ); + auto title = LabelTTF::create((transitions[s_nSceneIdx]).name, "Thonburi", 32 ); addChild(title); title->setColor( Color3B(255,32,32) ); title->setPosition( Point(x/2, y-100) ); From d76e8e57bbe436908380920fce0f1b107cedbcc3 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 2 Jan 2014 15:51:26 -0800 Subject: [PATCH 134/428] NodeTest converted to lambda functions Uses Lambda functions to call the subtests Easier to add new tests --- .../Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp | 53 ++++------- .../Cpp/TestCpp/Classes/NodeTest/NodeTest.h | 94 +++++++++++++------ .../TestCpp/Classes/SpriteTest/SpriteTest.h | 32 +++---- 3 files changed, 101 insertions(+), 78 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp index a9af857f5c..77c7c907d7 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp @@ -22,40 +22,33 @@ Layer* restartCocosNodeAction(); static int sceneIdx = -1; -#define MAX_LAYER 14 -Layer* createCocosNodeLayer(int nIndex) +static std::function createFunctions[] = { - switch(nIndex) - { - case 0: return new CameraCenterTest(); - case 1: return new Test2(); - case 2: return new Test4(); - case 3: return new Test5(); - case 4: return new Test6(); - case 5: return new StressTest1(); - case 6: return new StressTest2(); - case 7: return new NodeToWorld(); - case 8: return new SchedulerTest1(); - case 9: return new CameraOrbitTest(); - case 10: return new CameraZoomTest(); - case 11: return new ConvertToNode(); - case 12: return new NodeOpaqueTest(); - case 13: return new NodeNonOpaqueTest(); - } + CL(CameraCenterTest), + CL(Test2), + CL(Test4), + CL(Test5), + CL(Test6), + CL(StressTest1), + CL(StressTest2), + CL(NodeToWorld), + CL(SchedulerTest1), + CL(CameraOrbitTest), + CL(CameraZoomTest), + CL(ConvertToNode), + CL(NodeOpaqueTest), + CL(NodeNonOpaqueTest), +}; - return NULL; -} +#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0])) Layer* nextCocosNodeAction() { sceneIdx++; sceneIdx = sceneIdx % MAX_LAYER; - auto layer = createCocosNodeLayer(sceneIdx); - layer->autorelease(); - - return layer; + return createFunctions[sceneIdx](); } Layer* backCocosNodeAction() @@ -65,18 +58,12 @@ Layer* backCocosNodeAction() if( sceneIdx < 0 ) sceneIdx += total; - auto layer = createCocosNodeLayer(sceneIdx); - layer->autorelease(); - - return layer; + return createFunctions[sceneIdx](); } Layer* restartCocosNodeAction() { - auto layer = createCocosNodeLayer(sceneIdx); - layer->autorelease(); - - return layer; + return createFunctions[sceneIdx](); } diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h index 99f03bafbb..3e6f8fa9ce 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h @@ -8,8 +8,6 @@ class TestCocosNodeDemo : public BaseTest { public: - TestCocosNodeDemo(void); - ~TestCocosNodeDemo(void); virtual std::string title() const override; virtual std::string subtitle() const override; @@ -18,11 +16,16 @@ public: void restartCallback(Object* sender); void nextCallback(Object* sender); void backCallback(Object* sender); + +protected: + TestCocosNodeDemo(); + virtual ~TestCocosNodeDemo(); }; class Test2 : public TestCocosNodeDemo { public: + CREATE_FUNC(Test2); virtual void onEnter(); virtual std::string title() const override; }; @@ -30,120 +33,153 @@ public: class Test4 : public TestCocosNodeDemo { public: - Test4(); + CREATE_FUNC(Test4); void delay2(float dt); void delay4(float dt); virtual std::string title() const override; + +protected: + Test4(); }; class Test5 : public TestCocosNodeDemo { public: - Test5(); - void addAndRemove(float dt); + CREATE_FUNC(Test5); + void addAndRemove(float dt); virtual std::string title() const override; + +protected: + Test5(); }; class Test6 : public TestCocosNodeDemo { public: - Test6(); + CREATE_FUNC(Test6); void addAndRemove(float dt); - virtual std::string title() const override; + +protected: + Test6(); }; class StressTest1 : public TestCocosNodeDemo { +public: + CREATE_FUNC(StressTest1); void shouldNotCrash(float dt); void removeMe(Node* node); -public: - StressTest1(); - virtual std::string title() const override; + +protected: + StressTest1(); }; class StressTest2 : public TestCocosNodeDemo { - void shouldNotLeak(float dt); public: - StressTest2(); - + CREATE_FUNC(StressTest2); + void shouldNotLeak(float dt); virtual std::string title() const override; + +protected: + StressTest2(); }; class SchedulerTest1 : public TestCocosNodeDemo { public: - SchedulerTest1(); + CREATE_FUNC(SchedulerTest1); void doSomething(float dt); - virtual std::string title() const override; + +protected: + SchedulerTest1(); }; class NodeToWorld : public TestCocosNodeDemo { public: - NodeToWorld(); + CREATE_FUNC(NodeToWorld); virtual std::string title() const override; + +protected: + NodeToWorld(); }; class CameraOrbitTest : public TestCocosNodeDemo { public: - CameraOrbitTest(); - - virtual void onEnter(); - virtual void onExit(); + CREATE_FUNC(CameraOrbitTest); + virtual void onEnter() override; + virtual void onExit() override; virtual std::string title() const override; + +protected: + CameraOrbitTest(); }; class CameraZoomTest : public TestCocosNodeDemo { - float _z; public: - CameraZoomTest(); + CREATE_FUNC(CameraZoomTest); void update(float dt); - virtual void onEnter(); - virtual void onExit(); - + virtual void onEnter() override; + virtual void onExit() override; virtual std::string title() const override; + +protected: + CameraZoomTest(); + float _z; }; class CameraCenterTest : public TestCocosNodeDemo { public: - CameraCenterTest(); + CREATE_FUNC(CameraCenterTest); virtual std::string title() const override; virtual std::string subtitle() const override; + +protected: + CameraCenterTest(); }; class ConvertToNode : public TestCocosNodeDemo { public: - ConvertToNode(); + CREATE_FUNC(ConvertToNode); void onTouchesEnded(const std::vector& touches, Event *event); virtual std::string title() const override; virtual std::string subtitle() const override; + +protected: + ConvertToNode(); }; class NodeOpaqueTest : public TestCocosNodeDemo { public: - NodeOpaqueTest(); + CREATE_FUNC(NodeOpaqueTest); virtual std::string title() const override; virtual std::string subtitle() const override; + +protected: + NodeOpaqueTest(); }; class NodeNonOpaqueTest : public TestCocosNodeDemo { public: - NodeNonOpaqueTest(); + CREATE_FUNC(NodeNonOpaqueTest); virtual std::string title() const override; virtual std::string subtitle() const override; + +protected: + NodeNonOpaqueTest(); }; class CocosNodeTestScene : public TestScene diff --git a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h index a413c9f869..05d171675f 100644 --- a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h +++ b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h @@ -37,7 +37,7 @@ protected: public: SpriteTestDemo(void); - ~SpriteTestDemo(void); + virtual ~SpriteTestDemo(void); void restartCallback(Object* sender); void nextCallback(Object* sender); @@ -383,7 +383,7 @@ class SpriteOffsetAnchorSkew : public SpriteTestDemo public: CREATE_FUNC(SpriteOffsetAnchorSkew); SpriteOffsetAnchorSkew(); - ~SpriteOffsetAnchorSkew(); + virtual ~SpriteOffsetAnchorSkew(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -393,7 +393,7 @@ class SpriteOffsetAnchorRotationalSkew : public SpriteTestDemo public: CREATE_FUNC(SpriteOffsetAnchorRotationalSkew); SpriteOffsetAnchorRotationalSkew(); - ~SpriteOffsetAnchorRotationalSkew(); + virtual ~SpriteOffsetAnchorRotationalSkew(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -403,7 +403,7 @@ class SpriteBatchNodeOffsetAnchorSkew : public SpriteTestDemo public: CREATE_FUNC(SpriteBatchNodeOffsetAnchorSkew); SpriteBatchNodeOffsetAnchorSkew(); - ~SpriteBatchNodeOffsetAnchorSkew(); + virtual ~SpriteBatchNodeOffsetAnchorSkew(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -413,7 +413,7 @@ class SpriteOffsetAnchorRotationalSkewScale : public SpriteTestDemo public: CREATE_FUNC(SpriteOffsetAnchorRotationalSkewScale); SpriteOffsetAnchorRotationalSkewScale(); - ~SpriteOffsetAnchorRotationalSkewScale(); + virtual ~SpriteOffsetAnchorRotationalSkewScale(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -423,7 +423,7 @@ class SpriteBatchNodeOffsetAnchorRotationalSkew : public SpriteTestDemo public: CREATE_FUNC(SpriteBatchNodeOffsetAnchorRotationalSkew); SpriteBatchNodeOffsetAnchorRotationalSkew(); - ~SpriteBatchNodeOffsetAnchorRotationalSkew(); + virtual ~SpriteBatchNodeOffsetAnchorRotationalSkew(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -433,7 +433,7 @@ class SpriteOffsetAnchorSkewScale : public SpriteTestDemo public: CREATE_FUNC(SpriteOffsetAnchorSkewScale); SpriteOffsetAnchorSkewScale(); - ~SpriteOffsetAnchorSkewScale(); + virtual ~SpriteOffsetAnchorSkewScale(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -443,7 +443,7 @@ class SpriteBatchNodeOffsetAnchorSkewScale : public SpriteTestDemo public: CREATE_FUNC(SpriteBatchNodeOffsetAnchorSkewScale); SpriteBatchNodeOffsetAnchorSkewScale(); - ~SpriteBatchNodeOffsetAnchorSkewScale(); + virtual ~SpriteBatchNodeOffsetAnchorSkewScale(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -453,7 +453,7 @@ class SpriteBatchNodeOffsetAnchorRotationalSkewScale : public SpriteTestDemo public: CREATE_FUNC(SpriteBatchNodeOffsetAnchorRotationalSkewScale); SpriteBatchNodeOffsetAnchorRotationalSkewScale(); - ~SpriteBatchNodeOffsetAnchorRotationalSkewScale(); + virtual ~SpriteBatchNodeOffsetAnchorRotationalSkewScale(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -463,7 +463,7 @@ class SpriteOffsetAnchorFlip : public SpriteTestDemo public: CREATE_FUNC(SpriteOffsetAnchorFlip); SpriteOffsetAnchorFlip(); - ~SpriteOffsetAnchorFlip(); + virtual ~SpriteOffsetAnchorFlip(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -473,7 +473,7 @@ class SpriteBatchNodeOffsetAnchorFlip : public SpriteTestDemo public: CREATE_FUNC(SpriteBatchNodeOffsetAnchorFlip); SpriteBatchNodeOffsetAnchorFlip(); - ~SpriteBatchNodeOffsetAnchorFlip(); + virtual ~SpriteBatchNodeOffsetAnchorFlip(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -533,7 +533,7 @@ class SpriteChildrenVisibilityIssue665 : public SpriteTestDemo public: CREATE_FUNC(SpriteChildrenVisibilityIssue665); SpriteChildrenVisibilityIssue665(); - ~SpriteChildrenVisibilityIssue665(); + virtual ~SpriteChildrenVisibilityIssue665(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -668,7 +668,7 @@ class SpriteBatchNodeSkewNegativeScaleChildren : public SpriteTestDemo public: CREATE_FUNC(SpriteBatchNodeSkewNegativeScaleChildren); SpriteBatchNodeSkewNegativeScaleChildren(); - ~SpriteBatchNodeSkewNegativeScaleChildren(); + virtual ~SpriteBatchNodeSkewNegativeScaleChildren(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -678,7 +678,7 @@ class SpriteBatchNodeRotationalSkewNegativeScaleChildren : public SpriteTestDemo public: CREATE_FUNC(SpriteBatchNodeRotationalSkewNegativeScaleChildren); SpriteBatchNodeRotationalSkewNegativeScaleChildren(); - ~SpriteBatchNodeRotationalSkewNegativeScaleChildren(); + virtual ~SpriteBatchNodeRotationalSkewNegativeScaleChildren(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -688,7 +688,7 @@ class SpriteSkewNegativeScaleChildren : public SpriteTestDemo public: CREATE_FUNC(SpriteSkewNegativeScaleChildren); SpriteSkewNegativeScaleChildren(); - ~SpriteSkewNegativeScaleChildren(); + virtual ~SpriteSkewNegativeScaleChildren(); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -698,7 +698,7 @@ class SpriteRotationalSkewNegativeScaleChildren : public SpriteTestDemo public: CREATE_FUNC(SpriteRotationalSkewNegativeScaleChildren); SpriteRotationalSkewNegativeScaleChildren(); - ~SpriteRotationalSkewNegativeScaleChildren(); + virtual ~SpriteRotationalSkewNegativeScaleChildren(); virtual std::string title() const override; virtual std::string subtitle() const override; }; From 04760f2508ece8793d447130da413dfea7660d79 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 10:30:55 +0800 Subject: [PATCH 135/428] [Android] Adds jsb-spine module. TestJavascript now depends on jsb-spine module. --- .../scripting/javascript/bindings/Android.mk | 3 +- .../javascript/bindings/spine/Android.mk | 29 +++++++++++++++++++ .../proj.android/jni/Android.mk | 4 +-- 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 cocos/scripting/javascript/bindings/spine/Android.mk diff --git a/cocos/scripting/javascript/bindings/Android.mk b/cocos/scripting/javascript/bindings/Android.mk index 287a9a469b..1e80132687 100644 --- a/cocos/scripting/javascript/bindings/Android.mk +++ b/cocos/scripting/javascript/bindings/Android.mk @@ -14,8 +14,7 @@ LOCAL_SRC_FILES := ScriptingCore.cpp \ jsb_opengl_functions.cpp \ jsb_opengl_manual.cpp \ jsb_opengl_registration.cpp \ - ../../auto-generated/js-bindings/jsb_cocos2dx_auto.cpp \ - ../../auto-generated/js-bindings/jsb_cocos2dx_spine_auto.cpp + ../../auto-generated/js-bindings/jsb_cocos2dx_auto.cpp LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT diff --git a/cocos/scripting/javascript/bindings/spine/Android.mk b/cocos/scripting/javascript/bindings/spine/Android.mk new file mode 100644 index 0000000000..033e557db2 --- /dev/null +++ b/cocos/scripting/javascript/bindings/spine/Android.mk @@ -0,0 +1,29 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := jsb_spine_static + +LOCAL_MODULE_FILENAME := libcocos2dxjsbspine + +LOCAL_SRC_FILES := ../../../auto-generated/js-bindings/jsb_cocos2dx_spine_auto.cpp + + +LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT + +LOCAL_C_INCLUDES := $(LOCAL_PATH) \ + $(LOCAL_PATH)/../../../../editor-support/spine + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static +LOCAL_WHOLE_STATIC_LIBRARIES += spine_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,spidermonkey/prebuilt/android) +$(call import-module,scripting/javascript/bindings) +$(call import-module,editor-support/spine) diff --git a/samples/Javascript/TestJavascript/proj.android/jni/Android.mk b/samples/Javascript/TestJavascript/proj.android/jni/Android.mk index 40d4e4ee1a..da77714008 100644 --- a/samples/Javascript/TestJavascript/proj.android/jni/Android.mk +++ b/samples/Javascript/TestJavascript/proj.android/jni/Android.mk @@ -19,7 +19,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += jsb_network_static LOCAL_WHOLE_STATIC_LIBRARIES += jsb_builder_static LOCAL_WHOLE_STATIC_LIBRARIES += jsb_gui_static LOCAL_WHOLE_STATIC_LIBRARIES += jsb_studio_static -LOCAL_WHOLE_STATIC_LIBRARIES += spine_static +LOCAL_WHOLE_STATIC_LIBRARIES += jsb_spine_static LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 @@ -34,4 +34,4 @@ $(call import-module,scripting/javascript/bindings/network) $(call import-module,scripting/javascript/bindings/cocosbuilder) $(call import-module,scripting/javascript/bindings/gui) $(call import-module,scripting/javascript/bindings/cocostudio) -$(call import-module,editor-support/spine) +$(call import-module,scripting/javascript/bindings/spine) From 07a3efb5852cf29995be3557432f111f61fc6723 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 3 Jan 2014 10:39:19 +0800 Subject: [PATCH 136/428] Update the lua test cases about the GUI --- .../project.pbxproj.REMOVED.git-id | 2 +- .../project.pbxproj.REMOVED.git-id | 2 +- cocos/scripting/lua/bindings/CCLuaEngine.cpp | 1 + cocos/scripting/lua/bindings/CCLuaStack.cpp | 4 + .../lua_cocos2dx_coco_studio_manual.cpp | 607 ----------------- .../lua_cocos2dx_coco_studio_manual.hpp | 10 - .../lua/bindings/lua_cocos2dx_gui_manual.cpp | 631 ++++++++++++++++++ .../lua/bindings/lua_cocos2dx_gui_manual.hpp | 25 + cocos/scripting/lua/script/GuiConstants.lua | 179 +++++ .../scripting/lua/script/StudioConstants.lua | 185 +---- .../CocoStudioGUITest.lua.REMOVED.git-id | 2 +- .../TestLua/Resources/luaScript/mainMenu.lua | 1 + tools/tolua/cocos2dx_gui.ini | 68 ++ tools/tolua/cocos2dx_studio.ini | 20 +- tools/tolua/genbindings.sh | 3 + 15 files changed, 928 insertions(+), 812 deletions(-) create mode 100644 cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp create mode 100644 cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.hpp create mode 100644 cocos/scripting/lua/script/GuiConstants.lua create mode 100644 tools/tolua/cocos2dx_gui.ini diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index d17bbcb756..e146fcc430 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -4b92c964454c54c1b5df9576f11365c53e253724 \ No newline at end of file +f0d0e2815c4a581e7a1d8895efca2c2e8bc71679 \ No newline at end of file diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index bfb69a92ea..a3d5fedee2 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -7cc2be4e284d9095dd8fa56a092a98562f132776 \ No newline at end of file +3e5ec4c41f43234cf4365c10bef1a57a5373aed1 \ No newline at end of file diff --git a/cocos/scripting/lua/bindings/CCLuaEngine.cpp b/cocos/scripting/lua/bindings/CCLuaEngine.cpp index b064774b2a..0dc5528ae7 100644 --- a/cocos/scripting/lua/bindings/CCLuaEngine.cpp +++ b/cocos/scripting/lua/bindings/CCLuaEngine.cpp @@ -32,6 +32,7 @@ #include "lua_cocos2dx_manual.hpp" #include "lua_cocos2dx_extension_manual.h" #include "lua_cocos2dx_coco_studio_manual.hpp" +#include "lua_cocos2dx_gui_manual.hpp" NS_CC_BEGIN diff --git a/cocos/scripting/lua/bindings/CCLuaStack.cpp b/cocos/scripting/lua/bindings/CCLuaStack.cpp index 82e4e28dd3..b9d9a8db6d 100644 --- a/cocos/scripting/lua/bindings/CCLuaStack.cpp +++ b/cocos/scripting/lua/bindings/CCLuaStack.cpp @@ -58,6 +58,8 @@ extern "C" { #include "lua_cocos2dx_coco_studio_manual.hpp" #include "lua_cocos2dx_spine_auto.hpp" #include "lua_cocos2dx_spine_manual.hpp" +#include "lua_cocos2dx_gui_auto.hpp" +#include "lua_cocos2dx_gui_manual.hpp" namespace { int lua_print(lua_State * luastate) @@ -148,11 +150,13 @@ bool LuaStack::init(void) register_cocos2dx_extension_CCBProxy(_state); register_cocos2dx_event_releated(_state); tolua_opengl_open(_state); + register_all_cocos2dx_gui(_state); register_all_cocos2dx_studio(_state); register_all_cocos2dx_manual(_state); register_all_cocos2dx_extension_manual(_state); register_all_cocos2dx_manual_deprecated(_state); register_all_cocos2dx_coco_studio_manual(_state); + register_all_cocos2dx_gui_manual(_state); register_all_cocos2dx_spine(_state); register_all_cocos2dx_spine_manual(_state); register_glnode_manual(_state); diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp index 1f665a016a..c0459ea85a 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp @@ -12,611 +12,11 @@ extern "C" { #include "LuaBasicConversions.h" #include "LuaScriptHandlerMgr.h" #include "CCLuaValue.h" -#include "CocosGUI.h" #include "CocoStudio.h" #include "CCLuaEngine.h" -using namespace gui; using namespace cocostudio; -class LuaCocoStudioEventListener:public Object -{ -public: - LuaCocoStudioEventListener(); - virtual ~LuaCocoStudioEventListener(); - - static LuaCocoStudioEventListener* create(); - - virtual void eventCallbackFunc(Object* sender,int eventType); -}; - -LuaCocoStudioEventListener::LuaCocoStudioEventListener() -{ - -} - -LuaCocoStudioEventListener::~LuaCocoStudioEventListener() -{ - -} - -LuaCocoStudioEventListener* LuaCocoStudioEventListener::create() -{ - LuaCocoStudioEventListener* listener = new LuaCocoStudioEventListener(); - if (nullptr == listener) - return nullptr; - - listener->autorelease(); - - return listener; -} - -void LuaCocoStudioEventListener::eventCallbackFunc(Object* sender,int eventType) -{ - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); - - if (0 != handler) - { - LuaStudioEventListenerData eventData(sender,eventType); - BasicScriptData data(this,(void*)&eventData); - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER, (void*)&data); - } -} - -static int lua_cocos2dx_Widget_addTouchEventListener(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - Widget* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"Widget",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_Widget_addTouchEventListener'\n", NULL); - return 0; - } -#endif - - argc = lua_gettop(L) - 1; - - if (1 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) - { - goto tolua_lerror; - } -#endif - LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create(); - if (nullptr == listener) - { - tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); - return 0; - } - - LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); - - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); - - self->setUserObject(listener); - self->addTouchEventListener(listener, toucheventselector(LuaCocoStudioEventListener::eventCallbackFunc)); - - return 0; - } - - CCLOG("'addTouchEventListener' function of Widget has wrong number of arguments: %d, was expecting %d\n", argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'addTouchEventListener'.",&tolua_err); - return 0; -#endif -} - -static void extendWidget(lua_State* L) -{ - lua_pushstring(L, "Widget"); - lua_rawget(L, LUA_REGISTRYINDEX); - if (lua_istable(L,-1)) - { - tolua_function(L, "addTouchEventListener", lua_cocos2dx_Widget_addTouchEventListener); - } - lua_pop(L, 1); -} - -static int lua_cocos2dx_CheckBox_addEventListenerCheckBox(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - CheckBox* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"CheckBox",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_CheckBox_addEventListenerCheckBox'\n", NULL); - return 0; - } -#endif - argc = lua_gettop(L) - 1; - if (1 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) - { - goto tolua_lerror; - } -#endif - LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create(); - if (nullptr == listener) - { - tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); - return 0; - } - - LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); - - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); - - self->setUserObject(listener); - self->addEventListenerCheckBox(listener, checkboxselectedeventselector(LuaCocoStudioEventListener::eventCallbackFunc)); - - return 0; - } - - CCLOG("'addEventListenerCheckBox' function of CheckBox has wrong number of arguments: %d, was expecting %d\n", argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'addEventListenerCheckBox'.",&tolua_err); - return 0; -#endif -} - - -static void extendCheckBox(lua_State* L) -{ - lua_pushstring(L, "CheckBox"); - lua_rawget(L, LUA_REGISTRYINDEX); - if (lua_istable(L,-1)) - { - tolua_function(L, "addEventListenerCheckBox", lua_cocos2dx_CheckBox_addEventListenerCheckBox); - } - lua_pop(L, 1); -} - -static int lua_cocos2dx_Slider_addEventListenerSlider(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - Slider* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"Slider",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_Slider_addEventListenerSlider'\n", NULL); - return 0; - } -#endif - argc = lua_gettop(L) - 1; - if (1 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err) ) - { - goto tolua_lerror; - } -#endif - LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create(); - if (nullptr == listener) - { - tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); - return 0; - } - - LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); - - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); - - self->setUserObject(listener); - self->addEventListenerSlider(listener, sliderpercentchangedselector(LuaCocoStudioEventListener::eventCallbackFunc)); - - return 0; - } - - CCLOG("'addEventListenerSlider' function of Slider has wrong number of arguments: %d, was expecting %d\n", argc, 1); - - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'addEventListenerSlider'.",&tolua_err); - return 0; -#endif -} - -static void extendSlider(lua_State* L) -{ - lua_pushstring(L, "Slider"); - lua_rawget(L, LUA_REGISTRYINDEX); - if (lua_istable(L,-1)) - { - tolua_function(L, "addEventListenerSlider", lua_cocos2dx_Slider_addEventListenerSlider); - } - lua_pop(L, 1); -} - -static int lua_cocos2dx_TextField_addEventListenerTextField(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - TextField* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"TextField",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_TextField_addEventListenerTextField'\n", NULL); - return 0; - } -#endif - argc = lua_gettop(L) - 1; - if (1 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) - { - goto tolua_lerror; - } -#endif - LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create(); - if (nullptr == listener) - { - tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); - return 0; - } - - LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); - - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); - - self->setUserObject(listener); - self->addEventListenerTextField(listener, textfieldeventselector(LuaCocoStudioEventListener::eventCallbackFunc)); - - return 0; - } - - CCLOG("'addEventListenerTextField' function of TextField has wrong number of arguments: %d, was expecting %d\n", argc, 1); - - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'addEventListenerTextField'.",&tolua_err); - return 0; -#endif -} - -static void extendTextField(lua_State* L) -{ - lua_pushstring(L, "TextField"); - lua_rawget(L, LUA_REGISTRYINDEX); - if (lua_istable(L,-1)) - { - tolua_function(L, "addEventListenerTextField", lua_cocos2dx_TextField_addEventListenerTextField); - } - lua_pop(L, 1); -} - -static int lua_cocos2dx_PageView_addEventListenerPageView(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - PageView* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"PageView",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_PageView_addEventListenerPageView'\n", NULL); - return 0; - } -#endif - argc = lua_gettop(L) - 1; - if (1 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err) ) - { - goto tolua_lerror; - } -#endif - LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create(); - if (nullptr == listener) - { - tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); - return 0; - } - - LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); - - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); - - self->setUserObject(listener); - self->addEventListenerPageView(listener, pagevieweventselector(LuaCocoStudioEventListener::eventCallbackFunc)); - - return 0; - } - - CCLOG("'addEventListenerPageView' function of PageView has wrong number of arguments: %d, was expecting %d\n", argc, 1); - - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'addEventListenerPageView'.",&tolua_err); - return 0; -#endif -} - -static void extendPageView(lua_State* L) -{ - lua_pushstring(L, "PageView"); - lua_rawget(L, LUA_REGISTRYINDEX); - if (lua_istable(L,-1)) - { - tolua_function(L, "addEventListenerPageView", lua_cocos2dx_PageView_addEventListenerPageView); - } - lua_pop(L, 1); -} - -static int lua_cocos2dx_ListView_addEventListenerListView(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - ListView* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"ListView",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_ListView_addEventListenerListView'\n", NULL); - return 0; - } -#endif - argc = lua_gettop(L) - 1; - if (1 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) - { - goto tolua_lerror; - } -#endif - LuaCocoStudioEventListener* listern = LuaCocoStudioEventListener::create(); - if (nullptr == listern) - { - tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); - return 0; - } - - LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); - - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listern, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); - - self->setUserObject(listern); - self->addEventListenerListView(listern, listvieweventselector(LuaCocoStudioEventListener::eventCallbackFunc)); - - return 0; - } - - CCLOG("'addEventListenerListView' function of ListView has wrong number of arguments: %d, was expecting %d\n", argc, 1); - - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'addEventListenerListView'.",&tolua_err); - return 0; -#endif -} - -static void extendListView(lua_State* L) -{ - lua_pushstring(L, "ListView"); - lua_rawget(L, LUA_REGISTRYINDEX); - if (lua_istable(L,-1)) - { - tolua_function(L, "addEventListenerListView", lua_cocos2dx_ListView_addEventListenerListView); - } - lua_pop(L, 1); -} - -static int lua_cocos2dx_LayoutParameter_setMargin(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - LayoutParameter* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"LayoutParameter",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_LayoutParameter_setMargin'\n", NULL); - return 0; - } -#endif - argc = lua_gettop(L) - 1; - - if (1 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!tolua_istable(L, 2, 0, &tolua_err)) - { - goto tolua_lerror; - } -#endif - - Margin margin; - lua_pushstring(L, "left"); - lua_gettable(L,2); - margin.left = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1); - lua_pop(L,1); - - lua_pushstring(L, "top"); - lua_gettable(L,2); - margin.top = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1); - lua_pop(L,1); - - lua_pushstring(L, "right"); - lua_gettable(L,2); - margin.right = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1); - lua_pop(L,1); - - lua_pushstring(L, "bottom"); - lua_gettable(L,2); - margin.bottom = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1); - lua_pop(L,1); - - self->setMargin(margin); - return 0; - } - - CCLOG("'setMargin' function of LayoutParameter has wrong number of arguments: %d, was expecting %d\n", argc, 1); - - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'setMargin'.",&tolua_err); - return 0; -#endif -} - -static int lua_cocos2dx_LayoutParameter_getMargin(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - LayoutParameter* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"LayoutParameter",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_LayoutParameter_getMargin'\n", NULL); - return 0; - } -#endif - argc = lua_gettop(L) - 1; - - if (0 == argc) - { - Margin margin = self->getMargin(); - - lua_newtable(L); - - lua_pushstring(L, "left"); - lua_pushnumber(L, (lua_Number) margin.left); - lua_rawset(L, -3); - - lua_pushstring(L, "top"); - lua_pushnumber(L, (lua_Number) margin.top); - lua_rawset(L, -3); - - lua_pushstring(L, "right"); - lua_pushnumber(L, (lua_Number) margin.right); - lua_rawset(L, -3); - - lua_pushstring(L, "bottom"); - lua_pushnumber(L, (lua_Number) margin.bottom); - lua_rawset(L, -3); - - return 1; - } - - CCLOG("'getMargin' function of LayoutParameter has wrong number of arguments: %d, was expecting %d\n", argc, 0); - - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'getMargin'.",&tolua_err); - return 0; -#endif -} - -static void extendLayoutParameter(lua_State* L) -{ - lua_pushstring(L, "LayoutParameter"); - lua_rawget(L, LUA_REGISTRYINDEX); - if (lua_istable(L,-1)) - { - tolua_function(L, "setMargin", lua_cocos2dx_LayoutParameter_setMargin); - tolua_function(L, "getMargin", lua_cocos2dx_LayoutParameter_getMargin); - } - lua_pop(L, 1); -} - class LuaArmatureWrapper:public Object { public: @@ -905,13 +305,6 @@ int register_all_cocos2dx_coco_studio_manual(lua_State* L) { if (nullptr == L) return 0; - extendWidget(L); - extendCheckBox(L); - extendSlider(L); - extendTextField(L); - extendPageView(L); - extendListView(L); - extendLayoutParameter(L); extendArmatureAnimation(L); extendArmatureDataManager(L); diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.hpp b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.hpp index 75c7a40e17..f85d67cb8e 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.hpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.hpp @@ -13,16 +13,6 @@ extern "C" { TOLUA_API int register_all_cocos2dx_coco_studio_manual(lua_State* L); -struct LuaStudioEventListenerData -{ - cocos2d::Object* objTarget; - int eventType; - - LuaStudioEventListenerData(cocos2d::Object* _objTarget, int _eventType):objTarget(_objTarget),eventType(_eventType) - { - } -}; - struct LuaArmatureWrapperEventData { enum class LuaArmatureWrapperEventType diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp new file mode 100644 index 0000000000..34539331dd --- /dev/null +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp @@ -0,0 +1,631 @@ +#include "lua_cocos2dx_gui_manual.hpp" + +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua_fix.h" +#ifdef __cplusplus +} +#endif + +#include "cocos2d.h" +#include "LuaBasicConversions.h" +#include "LuaScriptHandlerMgr.h" +#include "CCLuaValue.h" +#include "CocosGUI.h" +#include "CCLuaEngine.h" + +using namespace gui; + +class LuaCocoStudioEventListener:public Object +{ +public: + LuaCocoStudioEventListener(); + virtual ~LuaCocoStudioEventListener(); + + static LuaCocoStudioEventListener* create(); + + virtual void eventCallbackFunc(Object* sender,int eventType); +}; + +LuaCocoStudioEventListener::LuaCocoStudioEventListener() +{ + +} + +LuaCocoStudioEventListener::~LuaCocoStudioEventListener() +{ + +} + +LuaCocoStudioEventListener* LuaCocoStudioEventListener::create() +{ + LuaCocoStudioEventListener* listener = new LuaCocoStudioEventListener(); + if (nullptr == listener) + return nullptr; + + listener->autorelease(); + + return listener; +} + +void LuaCocoStudioEventListener::eventCallbackFunc(Object* sender,int eventType) +{ + int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); + + if (0 != handler) + { + LuaStudioEventListenerData eventData(sender,eventType); + BasicScriptData data(this,(void*)&eventData); + LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER, (void*)&data); + } +} + +static int lua_cocos2dx_Widget_addTouchEventListener(lua_State* L) +{ + if (nullptr == L) + return 0; + + int argc = 0; + Widget* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"Widget",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_Widget_addTouchEventListener'\n", NULL); + return 0; + } +#endif + + argc = lua_gettop(L) - 1; + + if (1 == argc) + { +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) + { + goto tolua_lerror; + } +#endif + LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create(); + if (nullptr == listener) + { + tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); + return 0; + } + + LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); + + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); + + self->setUserObject(listener); + self->addTouchEventListener(listener, toucheventselector(LuaCocoStudioEventListener::eventCallbackFunc)); + + return 0; + } + + CCLOG("'addTouchEventListener' function of Widget has wrong number of arguments: %d, was expecting %d\n", argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'addTouchEventListener'.",&tolua_err); + return 0; +#endif +} + +static void extendWidget(lua_State* L) +{ + lua_pushstring(L, "Widget"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "addTouchEventListener", lua_cocos2dx_Widget_addTouchEventListener); + } + lua_pop(L, 1); +} + +static int lua_cocos2dx_CheckBox_addEventListenerCheckBox(lua_State* L) +{ + if (nullptr == L) + return 0; + + int argc = 0; + CheckBox* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"CheckBox",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_CheckBox_addEventListenerCheckBox'\n", NULL); + return 0; + } +#endif + argc = lua_gettop(L) - 1; + if (1 == argc) + { +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) + { + goto tolua_lerror; + } +#endif + LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create(); + if (nullptr == listener) + { + tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); + return 0; + } + + LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); + + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); + + self->setUserObject(listener); + self->addEventListenerCheckBox(listener, checkboxselectedeventselector(LuaCocoStudioEventListener::eventCallbackFunc)); + + return 0; + } + + CCLOG("'addEventListenerCheckBox' function of CheckBox has wrong number of arguments: %d, was expecting %d\n", argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'addEventListenerCheckBox'.",&tolua_err); + return 0; +#endif +} + + +static void extendCheckBox(lua_State* L) +{ + lua_pushstring(L, "CheckBox"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "addEventListenerCheckBox", lua_cocos2dx_CheckBox_addEventListenerCheckBox); + } + lua_pop(L, 1); +} + +static int lua_cocos2dx_Slider_addEventListenerSlider(lua_State* L) +{ + if (nullptr == L) + return 0; + + int argc = 0; + Slider* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"Slider",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_Slider_addEventListenerSlider'\n", NULL); + return 0; + } +#endif + argc = lua_gettop(L) - 1; + if (1 == argc) + { +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err) ) + { + goto tolua_lerror; + } +#endif + LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create(); + if (nullptr == listener) + { + tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); + return 0; + } + + LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); + + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); + + self->setUserObject(listener); + self->addEventListenerSlider(listener, sliderpercentchangedselector(LuaCocoStudioEventListener::eventCallbackFunc)); + + return 0; + } + + CCLOG("'addEventListenerSlider' function of Slider has wrong number of arguments: %d, was expecting %d\n", argc, 1); + + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'addEventListenerSlider'.",&tolua_err); + return 0; +#endif +} + +static void extendSlider(lua_State* L) +{ + lua_pushstring(L, "Slider"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "addEventListenerSlider", lua_cocos2dx_Slider_addEventListenerSlider); + } + lua_pop(L, 1); +} + +static int lua_cocos2dx_TextField_addEventListenerTextField(lua_State* L) +{ + if (nullptr == L) + return 0; + + int argc = 0; + TextField* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"TextField",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_TextField_addEventListenerTextField'\n", NULL); + return 0; + } +#endif + argc = lua_gettop(L) - 1; + if (1 == argc) + { +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) + { + goto tolua_lerror; + } +#endif + LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create(); + if (nullptr == listener) + { + tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); + return 0; + } + + LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); + + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); + + self->setUserObject(listener); + self->addEventListenerTextField(listener, textfieldeventselector(LuaCocoStudioEventListener::eventCallbackFunc)); + + return 0; + } + + CCLOG("'addEventListenerTextField' function of TextField has wrong number of arguments: %d, was expecting %d\n", argc, 1); + + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'addEventListenerTextField'.",&tolua_err); + return 0; +#endif +} + +static void extendTextField(lua_State* L) +{ + lua_pushstring(L, "TextField"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "addEventListenerTextField", lua_cocos2dx_TextField_addEventListenerTextField); + } + lua_pop(L, 1); +} + +static int lua_cocos2dx_PageView_addEventListenerPageView(lua_State* L) +{ + if (nullptr == L) + return 0; + + int argc = 0; + PageView* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"PageView",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_PageView_addEventListenerPageView'\n", NULL); + return 0; + } +#endif + argc = lua_gettop(L) - 1; + if (1 == argc) + { +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err) ) + { + goto tolua_lerror; + } +#endif + LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create(); + if (nullptr == listener) + { + tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); + return 0; + } + + LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); + + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); + + self->setUserObject(listener); + self->addEventListenerPageView(listener, pagevieweventselector(LuaCocoStudioEventListener::eventCallbackFunc)); + + return 0; + } + + CCLOG("'addEventListenerPageView' function of PageView has wrong number of arguments: %d, was expecting %d\n", argc, 1); + + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'addEventListenerPageView'.",&tolua_err); + return 0; +#endif +} + +static void extendPageView(lua_State* L) +{ + lua_pushstring(L, "PageView"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "addEventListenerPageView", lua_cocos2dx_PageView_addEventListenerPageView); + } + lua_pop(L, 1); +} + +static int lua_cocos2dx_ListView_addEventListenerListView(lua_State* L) +{ + if (nullptr == L) + return 0; + + int argc = 0; + ListView* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"ListView",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_ListView_addEventListenerListView'\n", NULL); + return 0; + } +#endif + argc = lua_gettop(L) - 1; + if (1 == argc) + { +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) + { + goto tolua_lerror; + } +#endif + LuaCocoStudioEventListener* listern = LuaCocoStudioEventListener::create(); + if (nullptr == listern) + { + tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); + return 0; + } + + LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); + + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listern, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER); + + self->setUserObject(listern); + self->addEventListenerListView(listern, listvieweventselector(LuaCocoStudioEventListener::eventCallbackFunc)); + + return 0; + } + + CCLOG("'addEventListenerListView' function of ListView has wrong number of arguments: %d, was expecting %d\n", argc, 1); + + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'addEventListenerListView'.",&tolua_err); + return 0; +#endif +} + +static void extendListView(lua_State* L) +{ + lua_pushstring(L, "ListView"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "addEventListenerListView", lua_cocos2dx_ListView_addEventListenerListView); + } + lua_pop(L, 1); +} + +static int lua_cocos2dx_LayoutParameter_setMargin(lua_State* L) +{ + if (nullptr == L) + return 0; + + int argc = 0; + LayoutParameter* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"LayoutParameter",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_LayoutParameter_setMargin'\n", NULL); + return 0; + } +#endif + argc = lua_gettop(L) - 1; + + if (1 == argc) + { +#if COCOS2D_DEBUG >= 1 + if (!tolua_istable(L, 2, 0, &tolua_err)) + { + goto tolua_lerror; + } +#endif + + Margin margin; + lua_pushstring(L, "left"); + lua_gettable(L,2); + margin.left = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1); + lua_pop(L,1); + + lua_pushstring(L, "top"); + lua_gettable(L,2); + margin.top = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1); + lua_pop(L,1); + + lua_pushstring(L, "right"); + lua_gettable(L,2); + margin.right = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1); + lua_pop(L,1); + + lua_pushstring(L, "bottom"); + lua_gettable(L,2); + margin.bottom = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1); + lua_pop(L,1); + + self->setMargin(margin); + return 0; + } + + CCLOG("'setMargin' function of LayoutParameter has wrong number of arguments: %d, was expecting %d\n", argc, 1); + + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'setMargin'.",&tolua_err); + return 0; +#endif +} + +static int lua_cocos2dx_LayoutParameter_getMargin(lua_State* L) +{ + if (nullptr == L) + return 0; + + int argc = 0; + LayoutParameter* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"LayoutParameter",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_LayoutParameter_getMargin'\n", NULL); + return 0; + } +#endif + argc = lua_gettop(L) - 1; + + if (0 == argc) + { + Margin margin = self->getMargin(); + + lua_newtable(L); + + lua_pushstring(L, "left"); + lua_pushnumber(L, (lua_Number) margin.left); + lua_rawset(L, -3); + + lua_pushstring(L, "top"); + lua_pushnumber(L, (lua_Number) margin.top); + lua_rawset(L, -3); + + lua_pushstring(L, "right"); + lua_pushnumber(L, (lua_Number) margin.right); + lua_rawset(L, -3); + + lua_pushstring(L, "bottom"); + lua_pushnumber(L, (lua_Number) margin.bottom); + lua_rawset(L, -3); + + return 1; + } + + CCLOG("'getMargin' function of LayoutParameter has wrong number of arguments: %d, was expecting %d\n", argc, 0); + + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'getMargin'.",&tolua_err); + return 0; +#endif +} + +static void extendLayoutParameter(lua_State* L) +{ + lua_pushstring(L, "LayoutParameter"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "setMargin", lua_cocos2dx_LayoutParameter_setMargin); + tolua_function(L, "getMargin", lua_cocos2dx_LayoutParameter_getMargin); + } + lua_pop(L, 1); +} + +int register_all_cocos2dx_gui_manual(lua_State* L) +{ + if (nullptr == L) + return 0; + extendWidget(L); + extendCheckBox(L); + extendSlider(L); + extendTextField(L); + extendPageView(L); + extendListView(L); + extendLayoutParameter(L); + + return 0; +} \ No newline at end of file diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.hpp b/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.hpp new file mode 100644 index 0000000000..b7a9c42033 --- /dev/null +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.hpp @@ -0,0 +1,25 @@ +#ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_GUI_MANUAL_H +#define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_GUI_MANUAL_H + +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua++.h" +#ifdef __cplusplus +} +#endif + +#include "CCObject.h" + +TOLUA_API int register_all_cocos2dx_gui_manual(lua_State* L); + +struct LuaStudioEventListenerData +{ + cocos2d::Object* objTarget; + int eventType; + + LuaStudioEventListenerData(cocos2d::Object* _objTarget, int _eventType):objTarget(_objTarget),eventType(_eventType) + { + } +}; +#endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_GUI_MANUAL_H diff --git a/cocos/scripting/lua/script/GuiConstants.lua b/cocos/scripting/lua/script/GuiConstants.lua new file mode 100644 index 0000000000..028f8d9778 --- /dev/null +++ b/cocos/scripting/lua/script/GuiConstants.lua @@ -0,0 +1,179 @@ +ccui = ccui or {} + +ccui.BrightStyle = +{ + none = -1, + normal = 0, + highlight = 1, +} + +ccui.WidgetType = +{ + widget = 0, --control + container = 1, --container +} + +ccui.TextureResType = +{ + localType = 0, + plistType = 1, +} + +ccui.TouchEventType = +{ + began = 0, + moved = 1, + ended = 2, + canceled = 3, +} + +ccui.SizeType = +{ + absolute = 0, + percent = 1, +} + +ccui.PositionType = { + absolute = 0, + percent = 1, +} + +ccui.CheckBoxEventType = +{ + selected = 0, + unselected = 1, +} + +ccui.TextFiledEventType = +{ + attach_with_ime = 0, + detach_with_ime = 1, + insert_text = 2, + delete_backward = 3, +} + +ccui.LayoutBackGroundColorType = +{ + none = 0, + solid = 1, + gradient = 2, +} + +ccui.LayoutType = +{ + absolute = 0, + linearVertical = 1, + linearHorizontal = 2, + relative = 3, +} + +ccui.LayoutParameterType = +{ + none = 0, + linear = 1, + relative = 2, +} + +ccui.LinearGravity = +{ + none = 0, + left = 1, + top = 2, + right = 3, + bottom = 4, + centerVertical = 5, + centerHorizontal = 6, +} + +ccui.RelativeAlign = +{ + alignNone = 0, + alignParentTopLeft = 1, + alignParentTopCenterHorizontal = 2, + alignParentTopRight = 3, + alignParentLeftCenterVertical = 4, + centerInParent = 5, + alignParentRightCenterVertical = 6, + alignParentLeftBottom = 7, + alignParentBottomCenterHorizontal = 8, + alignParentRightBottom = 9, + locationAboveLeftAlign = 10, + locationAboveCenter = 11, + locationAboveRightAlign = 12, + locationLeftOfTopAlign = 13, + locationLeftOfCenter = 14, + locationLeftOfBottomAlign = 15, + locationRightOfTopAlign = 16, + locationRightOfCenter = 17, + locationRightOfBottomAlign = 18, + locationBelowLeftAlign = 19, + locationBelowCenter = 20, + locationBelowRightAlign = 21, +} + +ccui.SliderEventType = {percentChanged = 0} + +ccui.LoadingBarType = { left = 0, right = 1} + +ccui.ScrollViewDir = { + none = 0, + vertical = 1, + horizontal = 2, + both = 3, +} + +ccui.ScrollViewMoveDir = { + none = 0, + up = 1, + down = 2, + left = 3, + right = 4, +} + +ccui.ScrollviewEventType = { + scrollToTop = 0, + scrollToBottom = 1, + scrollToLeft = 2, + scrollToRight = 3, + scrolling = 4, + bounceTop = 5, + bounceBottom = 6, + bounceLeft = 7, + bounceRight = 8, +} + +ccui.ListViewDirection = { + none = 0, + vertical = 1, + horizontal = 2, +} + +ccui.ListViewMoveDirection = { + none = 0, + up = 1, + down = 2, + left = 3, + right = 4, +} + +ccui.ListViewEventType = { + onsSelectedItem = 0, +} + +ccui.PageViewEventType = { + turning = 0, +} + +ccui.PVTouchDir = { + touchLeft = 0, + touchRight = 1, +} + +ccui.ListViewGravity = { + left = 0, + right = 1, + centerHorizontal = 2, + top = 3, + bottom = 4 , + centerVertical = 5, +} diff --git a/cocos/scripting/lua/script/StudioConstants.lua b/cocos/scripting/lua/script/StudioConstants.lua index 107b0f8406..5f9bca3036 100644 --- a/cocos/scripting/lua/script/StudioConstants.lua +++ b/cocos/scripting/lua/script/StudioConstants.lua @@ -2,186 +2,7 @@ ccs = ccs or {} ccs.MovementEventType = { - START = 0, - COMPLETE = 1, - LOOP_COMPLETE = 2, -} - -ccs.BrightStyle = -{ - none = -1, - normal = 0, - highlight = 1, -} - -ccs.WidgetType = -{ - widget = 0, --control - container = 1, --container -} - -ccs.TextureResType = -{ - UI_TEX_TYPE_LOCAL = 0, - UI_TEX_TYPE_PLIST = 1, -} - -ccs.TouchEventType = -{ - began = 0, - moved = 1, - ended = 2, - canceled = 3, -} - -ccs.SizeType = -{ - absolute = 0, - percent = 1, -} - -ccs.PositionType = { - absolute = 0, - percent = 1, -} - -ccs.CheckBoxEventType = -{ - selected = 0, - unselected = 1, -} - -ccs.TextFiledEventType = -{ - attach_with_ime = 0, - detach_with_ime = 1, - insert_text = 2, - delete_backward = 3, -} - -ccs.LayoutBackGroundColorType = -{ - none = 0, - solid = 1, - gradient = 2, -} - -ccs.LayoutType = -{ - absolute = 0, - linearVertical = 1, - linearHorizontal = 2, - relative = 3, -} - -ccs.UILayoutParameterType = -{ - none = 0, - linear = 1, - relative = 2, -} - -ccs.UILinearGravity = -{ - none = 0, - left = 1, - top = 2, - right = 3, - bottom = 4, - centerVertical = 5, - centerHorizontal = 6, -} - -ccs.UIRelativeAlign = -{ - alignNone = 0, - alignParentTopLeft = 1, - alignParentTopCenterHorizontal = 2, - alignParentTopRight = 3, - alignParentLeftCenterVertical = 4, - centerInParent = 5, - alignParentRightCenterVertical = 6, - alignParentLeftBottom = 7, - alignParentBottomCenterHorizontal = 8, - alignParentRightBottom = 9, - locationAboveLeftAlign = 10, - locationAboveCenter = 11, - locationAboveRightAlign = 12, - locationLeftOfTopAlign = 13, - locationLeftOfCenter = 14, - locationLeftOfBottomAlign = 15, - locationRightOfTopAlign = 16, - locationRightOfCenter = 17, - locationRightOfBottomAlign = 18, - locationBelowLeftAlign = 19, - locationBelowCenter = 20, - locationBelowRightAlign = 21, -} - -ccs.SliderEventType = {percent_changed = 0} - -ccs.LoadingBarType = { left = 0, right = 1} - -ccs.SCROLLVIEW_DIR = { - none = 0, - vertical = 1, - horizontal = 2, - both = 3, -} - -ccs.SCROLLVIEW_MOVE_DIR = { - none = 0, - up = 1, - down = 2, - left = 3, - right = 4, -} - -ccs.ScrollviewEventType = { - SCROLL_TO_TOP = 0, - SCROLL_TO_BOTTOM = 1, - SCROLL_TO_LEFT = 2, - SCROLL_TO_RIGHT = 3, - SCROLLING = 4, - BOUNCE_TOP = 5, - BOUNCE_BOTTOM = 6, - BOUNCE_LEFT = 7, - BOUNCE_RIGHT = 8, -} - -ccs.ListViewDirection = { - none = 0, - vertical = 1, - horizontal = 2, -} - -ccs.ListViewMoveDirection = { - none = 0, - up = 1, - down = 2, - left = 3, - right = 4, -} - -ccs.ListViewEventType = { - init_child = 0, - update_child = 1, -} - -ccs.PageViewEventType = { - turning = 0, -} - -ccs.PVTouchDir = { - touch_left = 0, - touch_right = 1, -} - -ccs.ListViewGravity = { - left = 0, - right = 1, - center_horizontal = 2, - top = 3, - bottom = 4 , - center_vertical = 5, + start = 0, + complete = 1, + loopComplete = 2, } diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua.REMOVED.git-id b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua.REMOVED.git-id index ca5791ada7..8d7bc14119 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua.REMOVED.git-id +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua.REMOVED.git-id @@ -1 +1 @@ -63707dd119d9dad00da66996544c1892162dab08 \ No newline at end of file +1cb290e913d84d8cd141945c8b4a78ea45481cd5 \ No newline at end of file diff --git a/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua b/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua index 9f33902d66..f1845dc0e4 100644 --- a/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua +++ b/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua @@ -3,6 +3,7 @@ require "Cocos2dConstants" require "Opengl" require "OpenglConstants" require "StudioConstants" +require "GuiConstants" require "luaScript/helper" require "luaScript/testResource" require "luaScript/VisibleRect" diff --git a/tools/tolua/cocos2dx_gui.ini b/tools/tolua/cocos2dx_gui.ini new file mode 100644 index 0000000000..876afe3252 --- /dev/null +++ b/tools/tolua/cocos2dx_gui.ini @@ -0,0 +1,68 @@ +[cocos2dx_gui] +# the prefix to be added to the generated functions. You might or might not use this in your own +# templates +prefix = cocos2dx_gui + +# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`) +# all classes will be embedded in that namespace +target_namespace = ccui + +# the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as "cocos2d::Label" <-> "cocos2d::gui::Label". +cpp_namespace = cocos2d::gui + +android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include +android_flags = -D_SIZE_T_DEFINED_ + +clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include +clang_flags = -nostdinc -x c++ -std=c++11 + +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s + +cocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT + +cxxgenerator_headers = + +# extra arguments for clang +extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s + +# what headers to parse +headers = %(cocosdir)s/cocos/gui/CocosGUI.h + +# what classes to produce code for. You can use regular expressions here. When testing the regular +# expression, it will be enclosed in "^$", like this: "^Menu*$". +classes = Helper Widget Layer Layout RootWidget Button CheckBox ImageView Text TextAtlas TextBMFont LoadingBar Slider Switch TextField ScrollView ListView PageView LayoutParameter LinearLayoutParameter RelativeLayoutParameter + +# what should we skip? in the format ClassName::[function function] +# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also +# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just +# add a single "*" as functions. See bellow for several examples. A special class name is "*", which +# will apply to all class names. This is a convenience wildcard to be able to skip similar named +# functions from all classes. + +skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*HSV onTouch.* onAcc.* onKey.* onRegisterTouchListener (s|g)etBlendFunc ccTouch.*], + Widget::[(s|g)etUserObject], + Layer::[getInputManager], + LayoutParameter::[(s|g)etMargin], + Helper::[init], + ImageView::[doubleClickEvent checkDoubleClick] + +rename_functions = + +rename_classes = + +# for all class names, should we remove something when registering in the target VM? +remove_prefix = + +# classes for which there will be no "parent" lookup +classes_have_no_parents = Helper + +# base classes which will be skipped when their sub-classes found them. +base_classes_to_skip = Object + +# classes that create no constructor +# Set is special and we will use a hand-written constructor +abstract_classes = Helper + +# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. +script_control_cpp = no + diff --git a/tools/tolua/cocos2dx_studio.ini b/tools/tolua/cocos2dx_studio.ini index 379f9768fd..455f5da0ad 100644 --- a/tools/tolua/cocos2dx_studio.ini +++ b/tools/tolua/cocos2dx_studio.ini @@ -8,7 +8,7 @@ prefix = cocos2dx_studio target_namespace = ccs # the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as "cocos2d::Label" <-> "cocos2d::gui::Label". -cpp_namespace = cocos2d::gui cocostudio +cpp_namespace = cocostudio android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include android_flags = -D_SIZE_T_DEFINED_ @@ -26,11 +26,11 @@ cxxgenerator_headers = extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos/gui/CocosGUI.h %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h +headers = %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ Widget Layout RootWidget Button CheckBox ImageView Text TextAtlas LoadingBar ScrollView Slider TextField ListView TextBMFont PageView Helper Layer LayoutParameter GReader LinearLayoutParameter RelativeLayoutParameter SceneReader ActionManagerEx ComAudio ComController ComAttribute ComRender BatchNode +classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ ActionManagerEx ComAudio ComController ComAttribute ComRender BatchNode SceneReader GUIReader ActionObject Tween DisplayManager # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -45,14 +45,14 @@ skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .* Skin::[(s|g)etSkinData], ArmatureAnimation::[updateHandler updateFrameData frameEvent setMovementEventCallFunc setFrameEventCallFunc], Bone::[(s|g)etIgnoreMovementBoneData], - Layer::[getInputManager], - LayoutParameter::[(s|g)etMargin], - Helper::[init], - GReader::[setPropsForImageButtonFromJsonDictionary], - ImageView::[doubleClickEvent], ActionManagerEx::[initWithDictionary], + ActionObject::[initWithDictionary], + DisplayManager::[initDisplayList (s|g)etCurrentDecorativeDisplay getDecorativeDisplayByIndex], + Tween::[(s|g)etMovementBoneData], + GUIReader::[storeFileDesignSize getFileDesignSize], ActionNode::[initWithDictionary], - ActionObject::[initWithDictionary] + ActionObject::[initWithDictionary], + BaseData::[copy subtract] rename_functions = GUIReader::[shareReader=getInstance purgeGUIReader=destroyInstance], ActionManagerEx::[shareManager=getInstance purgeActionManager=destroyInstance], @@ -72,7 +72,7 @@ base_classes_to_skip = Object ProcessBase # classes that create no constructor # Set is special and we will use a hand-written constructor -abstract_classes = ArmatureDataManager +abstract_classes = ArmatureDataManager ComAttribute ComRender ComAudio ActionManagerEx SceneReader GUIReader BatchNode # Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. script_control_cpp = no diff --git a/tools/tolua/genbindings.sh b/tools/tolua/genbindings.sh index 9870d0f364..c758bffaa5 100755 --- a/tools/tolua/genbindings.sh +++ b/tools/tolua/genbindings.sh @@ -85,6 +85,9 @@ LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py echo "Generating bindings for cocos2dx_extension..." LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t lua -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/lua-bindings -n lua_cocos2dx_extension_auto +echo "Generating bindings for cocos2dx_gui..." +LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_gui.ini -s cocos2dx_gui -t lua -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/lua-bindings -n lua_cocos2dx_gui_auto + echo "Generating bindings for cocos2dx_studio..." LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_studio.ini -s cocos2dx_studio -t lua -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/lua-bindings -n lua_cocos2dx_studio_auto From 0e90ef83377e0221161aa97cf15f23f3ded3aa27 Mon Sep 17 00:00:00 2001 From: andyque Date: Fri, 3 Jan 2014 10:37:26 +0800 Subject: [PATCH 137/428] fix move assignment operator doesn't clear previous content bug --- cocos/base/CCMap.h | 1 + cocos/base/CCVector.h | 1 + 2 files changed, 2 insertions(+) diff --git a/cocos/base/CCMap.h b/cocos/base/CCMap.h index 3f42bdc847..f25bc73741 100644 --- a/cocos/base/CCMap.h +++ b/cocos/base/CCMap.h @@ -330,6 +330,7 @@ public: { if (this != &other) { CCLOGINFO("In the move assignment operator of Map!"); + clear(); _data = std::move(other._data); } return *this; diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index ebafd8b199..12d9de6d34 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -121,6 +121,7 @@ public: { if (this != &other) { CCLOGINFO("In the move assignment operator!"); + clear(); _data = std::move(other._data); } return *this; From 93d724f408495bad47e176d1a01c773590715ae3 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 3 Jan 2014 10:41:26 +0800 Subject: [PATCH 138/428] [ci skip] --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 472f6e09ee..73dc65cfdf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -22,6 +22,8 @@ cocos2d-x-3.0beta0 ?? 2013 [FIX] OpenAL context isn't destroyed correctly on mac and ios. [FIX] Useless conversion in ScrollView::onTouchBegan. [FIX] Two memory leak fixes in EventDispatcher::removeEventListener(s). + [NEW] TextureCache::addImageAsync() uses std::function<> as call back + [NEW] Namespace changed: network -> cocos2d::network, gui -> cocos2d::gui [Android] [NEW] build/android-build.sh: add supporting to generate .apk file [FIX] XMLHttpRequest receives wrong binary array. From 67153f816c7cfb7993e66f433197d787fa7e25ca Mon Sep 17 00:00:00 2001 From: andyque Date: Fri, 3 Jan 2014 10:44:43 +0800 Subject: [PATCH 139/428] remove unused code --- cocos/base/CCVector.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index 12d9de6d34..d751479d23 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -265,14 +265,7 @@ public: * which causes an automatic reallocation of the allocated storage space * if -and only if- the new vector size surpasses the current vector capacity. */ - void pushBack(const T& object) - { - CCASSERT(object != nullptr, "The object should not be nullptr"); - _data.push_back( object ); - object->retain(); - } - - void pushBack(T&& object) + void pushBack(T object) { CCASSERT(object != nullptr, "The object should not be nullptr"); _data.push_back( object ); From cdc82d6e8ce9b6be5d326f391e0a19a9c70a4964 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 3 Jan 2014 10:50:06 +0800 Subject: [PATCH 140/428] Add a newline --- cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp index 34539331dd..d6827dfa0a 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp @@ -628,4 +628,4 @@ int register_all_cocos2dx_gui_manual(lua_State* L) extendLayoutParameter(L); return 0; -} \ No newline at end of file +} From b193768f260c86b0366d9d0892b3a5978b19cb00 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 10:57:09 +0800 Subject: [PATCH 141/428] Update AUTHORS [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index e7e4c95105..f4d416c903 100644 --- a/AUTHORS +++ b/AUTHORS @@ -697,6 +697,7 @@ Developers: andyque Fixed a bug that missing to check self assignment of Vector, Map, Value and String. + Fixed a bug that move assignment operator doesn't clear previous content bug. Retired Core Developers: WenSheng Yang From 4549760f2c8b4af7cb791233d0b4ed03bb9adc36 Mon Sep 17 00:00:00 2001 From: heliclei Date: Fri, 3 Jan 2014 10:59:37 +0800 Subject: [PATCH 142/428] fetch pull request and checkout to a local branch --- tools/jenkins-scripts/ghprb.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index e17413e505..936ce61bfc 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -64,6 +64,21 @@ def main(): except: traceback.format_exc() + #reset path to workspace root + os.system("cd " + os.environ['WORKSPACE']); + + #fetch pull request to local repo + git_fetch_pr = "git fetch origin pull/" + str(pr_num) + "/head" + os.system(git_fetch_pr) + + #checkout + git_checkout = "git checkout -b " + "pull" + str(pr_num) + " FETCH_HEAD" + os.system(git_checkout) + + #update submodule + git_update_submodule = "git submodule update --init --force" + os.system(git_update_submodule) + #build #TODO: support android-mac build currently #TODO: add android-windows7 build From 51e3e3fd1bd89b22d566534ffb6752b6fd342ec2 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 3 Jan 2014 11:15:46 +0800 Subject: [PATCH 143/428] Resolve the android and linux compile error --- cocos/scripting/CMakeLists.txt | 2 ++ cocos/scripting/lua/bindings/Android.mk | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cocos/scripting/CMakeLists.txt b/cocos/scripting/CMakeLists.txt index 09a2afed02..11667106a8 100644 --- a/cocos/scripting/CMakeLists.txt +++ b/cocos/scripting/CMakeLists.txt @@ -2,6 +2,7 @@ set(LUABINDING_SRC auto-generated/lua-bindings/lua_cocos2dx_auto.cpp auto-generated/lua-bindings/lua_cocos2dx_extension_auto.cpp auto-generated/lua-bindings/lua_cocos2dx_studio_auto.cpp + auto-generated/lua-bindings/lua_cocos2dx_gui_auto.cpp auto-generated/lua-bindings/lua_cocos2dx_spine_auto.cpp lua/bindings/tolua_fix.c lua/bindings/CCLuaBridge.cpp @@ -16,6 +17,7 @@ set(LUABINDING_SRC lua/bindings/lua_cocos2dx_manual.cpp lua/bindings/lua_cocos2dx_extension_manual.cpp lua/bindings/lua_cocos2dx_coco_studio_manual.cpp + lua/bindings/lua_cocos2dx_gui_manual.cpp lua/bindings/lua_cocos2dx_spine_manual.cpp lua/bindings/lua_cocos2dx_deprecated.cpp lua/bindings/lua_xml_http_request.cpp diff --git a/cocos/scripting/lua/bindings/Android.mk b/cocos/scripting/lua/bindings/Android.mk index 694c1de755..6d19106743 100644 --- a/cocos/scripting/lua/bindings/Android.mk +++ b/cocos/scripting/lua/bindings/Android.mk @@ -19,10 +19,12 @@ LOCAL_SRC_FILES := CCLuaBridge.cpp \ ../../auto-generated/lua-bindings/lua_cocos2dx_auto.cpp \ ../../auto-generated/lua-bindings/lua_cocos2dx_extension_auto.cpp \ ../../auto-generated/lua-bindings/lua_cocos2dx_studio_auto.cpp \ + ../../auto-generated/lua-bindings/lua_cocos2dx_gui_auto.cpp \ ../../auto-generated/lua-bindings/lua_cocos2dx_spine_auto.cpp \ lua_cocos2dx_manual.cpp \ lua_cocos2dx_extension_manual.cpp \ lua_cocos2dx_coco_studio_manual.cpp \ + lua_cocos2dx_gui_manual \ lua_cocos2dx_spine_manual.cpp \ lua_cocos2dx_deprecated.cpp \ lua_xml_http_request.cpp \ From 53f2415fcf8896025b7151778de05ead361e4c5f Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 3 Jan 2014 11:29:56 +0800 Subject: [PATCH 144/428] Resolve the android compile error --- cocos/scripting/lua/bindings/Android.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/lua/bindings/Android.mk b/cocos/scripting/lua/bindings/Android.mk index 6d19106743..018cc5b6fe 100644 --- a/cocos/scripting/lua/bindings/Android.mk +++ b/cocos/scripting/lua/bindings/Android.mk @@ -24,7 +24,7 @@ LOCAL_SRC_FILES := CCLuaBridge.cpp \ lua_cocos2dx_manual.cpp \ lua_cocos2dx_extension_manual.cpp \ lua_cocos2dx_coco_studio_manual.cpp \ - lua_cocos2dx_gui_manual \ + lua_cocos2dx_gui_manual.cpp \ lua_cocos2dx_spine_manual.cpp \ lua_cocos2dx_deprecated.cpp \ lua_xml_http_request.cpp \ From 774542a3411b1a239a4dd448cf59bf33f2e5ad14 Mon Sep 17 00:00:00 2001 From: andyque Date: Fri, 3 Jan 2014 10:15:46 +0800 Subject: [PATCH 145/428] fix compile error of getRandomObject in map and add srand to vector and map --- cocos/base/CCMap.h | 5 ++++- cocos/base/CCVector.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cocos/base/CCMap.h b/cocos/base/CCMap.h index f25bc73741..dab3b729c0 100644 --- a/cocos/base/CCMap.h +++ b/cocos/base/CCMap.h @@ -282,8 +282,11 @@ public: { if (!_data.empty()) { + srand(time(NULL)); ssize_t randIdx = rand() % _data.size(); - return (_data.begin() + randIdx)->second; + iterator randIter = _data.begin(); + std::advance(randIter , randIdx); + return randIter->second; } return nullptr; } diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index d751479d23..e420012001 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -229,6 +229,7 @@ public: { if (!_data.empty()) { + srand(time(NULL)); ssize_t randIdx = rand() % _data.size(); return *(_data.begin() + randIdx); } From 88efbfc9ccfeeac30e56c29aa71522377431ae0a Mon Sep 17 00:00:00 2001 From: andyque Date: Fri, 3 Jan 2014 11:56:58 +0800 Subject: [PATCH 146/428] remove srand function call --- cocos/base/CCMap.h | 1 - cocos/base/CCVector.h | 1 - 2 files changed, 2 deletions(-) diff --git a/cocos/base/CCMap.h b/cocos/base/CCMap.h index dab3b729c0..097e33992c 100644 --- a/cocos/base/CCMap.h +++ b/cocos/base/CCMap.h @@ -282,7 +282,6 @@ public: { if (!_data.empty()) { - srand(time(NULL)); ssize_t randIdx = rand() % _data.size(); iterator randIter = _data.begin(); std::advance(randIter , randIdx); diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index e420012001..d751479d23 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -229,7 +229,6 @@ public: { if (!_data.empty()) { - srand(time(NULL)); ssize_t randIdx = rand() % _data.size(); return *(_data.begin() + randIdx); } From e734f3ccaf5f1c3a96849e6708408b77e1023389 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Fri, 3 Jan 2014 12:14:21 +0800 Subject: [PATCH 147/428] optimize button --- cocos/gui/UIButton.cpp | 86 +++++++++++++------ cocos/gui/UIButton.h | 43 ++++++---- cocos/gui/UITextField.cpp | 2 +- .../CocoStudioGUITest/UIScene.cpp | 17 ++-- 4 files changed, 90 insertions(+), 58 deletions(-) diff --git a/cocos/gui/UIButton.cpp b/cocos/gui/UIButton.cpp index 206203a014..01071ea51a 100644 --- a/cocos/gui/UIButton.cpp +++ b/cocos/gui/UIButton.cpp @@ -22,17 +22,17 @@ THE SOFTWARE. ****************************************************************************/ -#include "gui/UIButton.h" +#include "UIButton.h" #include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" NS_CC_BEGIN namespace gui { -#define NORMALRENDERERZ (0) -#define PRESSEDRENDERERZ (0) -#define DISABLEDRENDERERZ (0) -#define TITLERENDERERZ (1) +#define NORMALRENDERERZ (-2) +#define PRESSEDRENDERERZ (-2) +#define DISABLEDRENDERERZ (-2) +#define TITLERENDERERZ (-1) Button::Button(): _buttonNormalRenderer(nullptr), @@ -54,7 +54,14 @@ _normalTextureSize(_size), _pressedTextureSize(_size), _disabledTextureSize(_size), _pressedActionEnabled(false), -_titleColor(Color3B::WHITE) +_titleColor(Color3B::WHITE), +_normalTextureScaleXInSize(1.0f), +_normalTextureScaleYInSize(1.0f), +_pressedTextureScaleXInSize(1.0f), +_pressedTextureScaleYInSize(1.0f), +_normalTextureLoaded(false), +_pressedTextureLoaded(false), +_disabledTextureLoaded(false) { } @@ -90,6 +97,7 @@ void Button::initRenderer() _buttonClickedRenderer = Sprite::create(); _buttonDisableRenderer = Sprite::create(); _titleRenderer = LabelTTF::create(); + Node::addChild(_buttonNormalRenderer, NORMALRENDERERZ, -1); Node::addChild(_buttonClickedRenderer, PRESSEDRENDERERZ, -1); Node::addChild(_buttonDisableRenderer, DISABLEDRENDERERZ, -1); @@ -104,11 +112,9 @@ void Button::setScale9Enabled(bool able) } _brightStyle = BRIGHT_NONE; _scale9Enabled = able; - Node::removeChild(_buttonNormalRenderer); Node::removeChild(_buttonClickedRenderer); Node::removeChild(_buttonDisableRenderer); - _buttonNormalRenderer = nullptr; _buttonClickedRenderer = nullptr; _buttonDisableRenderer = nullptr; @@ -207,6 +213,7 @@ void Button::loadTextureNormal(const char* normal,TextureResType texType) updateDisplayedOpacity(getOpacity()); updateAnchorPoint(); normalTextureScaleChangedWithSize(); + _normalTextureLoaded = true; } void Button::loadTexturePressed(const char* selected,TextureResType texType) @@ -253,6 +260,7 @@ void Button::loadTexturePressed(const char* selected,TextureResType texType) updateDisplayedOpacity(getOpacity()); updateAnchorPoint(); pressedTextureScaleChangedWithSize(); + _pressedTextureLoaded = true; } void Button::loadTextureDisabled(const char* disabled,TextureResType texType) @@ -299,6 +307,7 @@ void Button::loadTextureDisabled(const char* disabled,TextureResType texType) updateDisplayedOpacity(getOpacity()); updateAnchorPoint(); disabledTextureScaleChangedWithSize(); + _disabledTextureLoaded = true; } void Button::setCapInsets(const Rect &capInsets) @@ -343,36 +352,49 @@ void Button::onPressStateChangedToNormal() _buttonNormalRenderer->setVisible(true); _buttonClickedRenderer->setVisible(false); _buttonDisableRenderer->setVisible(false); - if (_pressedActionEnabled) + if (_pressedTextureLoaded) + { + if (_pressedActionEnabled) + { + _buttonNormalRenderer->stopAllActions(); + _buttonClickedRenderer->stopAllActions(); + Action *zoomAction = ScaleTo::create(0.05f, _normalTextureScaleXInSize, _normalTextureScaleYInSize); + _buttonNormalRenderer->runAction(zoomAction); + _buttonClickedRenderer->setScale(_pressedTextureScaleXInSize, _pressedTextureScaleYInSize); + } + } + else { _buttonNormalRenderer->stopAllActions(); - _buttonClickedRenderer->stopAllActions(); - _buttonDisableRenderer->stopAllActions(); - Action *zoomAction = ScaleTo::create(0.05f, 1.0f); - Action *zoomAction1 = ScaleTo::create(0.05f, 1.0f); - Action *zoomAction2 = ScaleTo::create(0.05f, 1.0f); + Action *zoomAction = ScaleTo::create(0.05f, _normalTextureScaleXInSize, _normalTextureScaleYInSize); _buttonNormalRenderer->runAction(zoomAction); - _buttonClickedRenderer->runAction(zoomAction1); - _buttonDisableRenderer->runAction(zoomAction2); } } void Button::onPressStateChangedToPressed() { - _buttonNormalRenderer->setVisible(false); - _buttonClickedRenderer->setVisible(true); - _buttonDisableRenderer->setVisible(false); - if (_pressedActionEnabled) + if (_pressedTextureLoaded) { + _buttonNormalRenderer->setVisible(false); + _buttonClickedRenderer->setVisible(true); + _buttonDisableRenderer->setVisible(false); + if (_pressedActionEnabled) + { + _buttonNormalRenderer->stopAllActions(); + _buttonClickedRenderer->stopAllActions(); + Action *zoomAction = ScaleTo::create(0.05f, _pressedTextureScaleXInSize + 0.1f, _pressedTextureScaleYInSize + 0.1f); + _buttonClickedRenderer->runAction(zoomAction); + _buttonNormalRenderer->setScale(_pressedTextureScaleXInSize + 0.1f, _pressedTextureScaleYInSize + 0.1f); + } + } + else + { + _buttonNormalRenderer->setVisible(true); + _buttonClickedRenderer->setVisible(true); + _buttonDisableRenderer->setVisible(false); _buttonNormalRenderer->stopAllActions(); - _buttonClickedRenderer->stopAllActions(); - _buttonDisableRenderer->stopAllActions(); - Action *zoomAction = ScaleTo::create(0.05f, 1.1f); - Action *zoomAction1 = ScaleTo::create(0.05f, 1.1f); - Action *zoomAction2 = ScaleTo::create(0.05f, 1.1f); + Action *zoomAction = ScaleTo::create(0.05f, _pressedTextureScaleXInSize + 0.1f, _pressedTextureScaleYInSize + 0.1f); _buttonNormalRenderer->runAction(zoomAction); - _buttonClickedRenderer->runAction(zoomAction1); - _buttonDisableRenderer->runAction(zoomAction2); } } @@ -381,6 +403,8 @@ void Button::onPressStateChangedToDisabled() _buttonNormalRenderer->setVisible(false); _buttonClickedRenderer->setVisible(false); _buttonDisableRenderer->setVisible(true); + _buttonNormalRenderer->setScale(_normalTextureScaleXInSize, _normalTextureScaleYInSize); + _buttonClickedRenderer->setScale(_pressedTextureScaleXInSize, _pressedTextureScaleYInSize); } void Button::setFlipX(bool flipX) @@ -474,6 +498,7 @@ void Button::normalTextureScaleChangedWithSize() if (!_scale9Enabled) { _buttonNormalRenderer->setScale(1.0f); + _normalTextureScaleXInSize = _normalTextureScaleYInSize = 1.0f; _size = _normalTextureSize; } } @@ -482,6 +507,7 @@ void Button::normalTextureScaleChangedWithSize() if (_scale9Enabled) { static_cast(_buttonNormalRenderer)->setPreferredSize(_size); + _normalTextureScaleXInSize = _normalTextureScaleYInSize = 1.0f; } else { @@ -495,6 +521,8 @@ void Button::normalTextureScaleChangedWithSize() float scaleY = _size.height / textureSize.height; _buttonNormalRenderer->setScaleX(scaleX); _buttonNormalRenderer->setScaleY(scaleY); + _normalTextureScaleXInSize = scaleX; + _normalTextureScaleYInSize = scaleY; } } } @@ -506,6 +534,7 @@ void Button::pressedTextureScaleChangedWithSize() if (!_scale9Enabled) { _buttonClickedRenderer->setScale(1.0f); + _pressedTextureScaleXInSize = _pressedTextureScaleYInSize = 1.0f; } } else @@ -513,6 +542,7 @@ void Button::pressedTextureScaleChangedWithSize() if (_scale9Enabled) { static_cast(_buttonClickedRenderer)->setPreferredSize(_size); + _pressedTextureScaleXInSize = _pressedTextureScaleYInSize = 1.0f; } else { @@ -526,6 +556,8 @@ void Button::pressedTextureScaleChangedWithSize() float scaleY = _size.height / _pressedTextureSize.height; _buttonClickedRenderer->setScaleX(scaleX); _buttonClickedRenderer->setScaleY(scaleY); + _pressedTextureScaleXInSize = scaleX; + _pressedTextureScaleYInSize = scaleY; } } } diff --git a/cocos/gui/UIButton.h b/cocos/gui/UIButton.h index a74600df2b..46c5d012fe 100644 --- a/cocos/gui/UIButton.h +++ b/cocos/gui/UIButton.h @@ -122,7 +122,7 @@ public: void setCapInsetsDisabledRenderer(const Rect &capInsets); //override "setAnchorPoint" of widget. - virtual void setAnchorPoint(const Point &pt) override; + virtual void setAnchorPoint(const Point &pt); /** * Sets if button is using scale9 renderer. @@ -132,16 +132,16 @@ public: virtual void setScale9Enabled(bool able); //override "setFlipX" of widget. - virtual void setFlipX(bool flipX) override; + virtual void setFlipX(bool flipX); //override "setFlipY" of widget. - virtual void setFlipY(bool flipY) override; + virtual void setFlipY(bool flipY); //override "isFlipX" of widget. - virtual bool isFlipX() override; + virtual bool isFlipX(); //override "isFlipY" of widget. - virtual bool isFlipY() override; + virtual bool isFlipY(); /** * Changes if button can be clicked zoom effect. @@ -151,13 +151,13 @@ public: void setPressedActionEnabled(bool enabled); //override "ignoreContentAdaptWithSize" method of widget. - virtual void ignoreContentAdaptWithSize(bool ignore) override; + virtual void ignoreContentAdaptWithSize(bool ignore); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const override; + virtual const Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer() override; + virtual Node* getVirtualRenderer(); /** * Sets color to widget @@ -166,12 +166,12 @@ public: * * @param color */ - virtual void setColor(const Color3B &color) override; + virtual void setColor(const Color3B &color); /** * Returns the "class name" of widget. */ - virtual std::string getDescription() const override; + virtual std::string getDescription() const; void setTitleText(const std::string& text); const std::string& getTitleText() const; @@ -183,18 +183,18 @@ public: const char* getTitleFontName() const; protected: - virtual bool init() override; - virtual void initRenderer() override; - virtual void onPressStateChangedToNormal() override; - virtual void onPressStateChangedToPressed() override; - virtual void onPressStateChangedToDisabled() override; - virtual void onSizeChanged() override; + virtual bool init(); + virtual void initRenderer(); + virtual void onPressStateChangedToNormal(); + virtual void onPressStateChangedToPressed(); + virtual void onPressStateChangedToDisabled(); + virtual void onSizeChanged(); void normalTextureScaleChangedWithSize(); void pressedTextureScaleChangedWithSize(); void disabledTextureScaleChangedWithSize(); - virtual Widget* createCloneInstance() override; - virtual void copySpecialProperties(Widget* model) override; + virtual Widget* createCloneInstance(); + virtual void copySpecialProperties(Widget* model); protected: Node* _buttonNormalRenderer; Node* _buttonClickedRenderer; @@ -216,6 +216,13 @@ protected: Size _disabledTextureSize; bool _pressedActionEnabled; Color3B _titleColor; + float _normalTextureScaleXInSize; + float _normalTextureScaleYInSize; + float _pressedTextureScaleXInSize; + float _pressedTextureScaleYInSize; + bool _normalTextureLoaded; + bool _pressedTextureLoaded; + bool _disabledTextureLoaded; }; } diff --git a/cocos/gui/UITextField.cpp b/cocos/gui/UITextField.cpp index fa7c89dbe7..217f1ed481 100644 --- a/cocos/gui/UITextField.cpp +++ b/cocos/gui/UITextField.cpp @@ -335,7 +335,7 @@ void TextField::setText(const std::string& text) if (isPasswordEnabled()) { _textFieldRenderer->setPasswordText(content); - _textFieldRenderer->insertText(content, strlen(content)); + _textFieldRenderer->insertText(content, static_cast(strlen(content))); } else { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp index 527d8526a1..75d90246e7 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp @@ -30,6 +30,11 @@ bool UIScene::init() _widget = dynamic_cast(cocostudio::GUIReader::shareReader()->widgetFromJsonFile("cocosgui/UITest/UITest.json")); _uiLayer->addChild(_widget); + Size screenSize = Director::getInstance()->getWinSize(); + Size rootSize = _widget->getSize(); + _uiLayer->setPosition(Point((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + Layout* root = static_cast(_uiLayer->getChildByTag(81)); _sceneTitle = dynamic_cast(root->getChildByName("UItest")); @@ -46,18 +51,6 @@ bool UIScene::init() Button* right_button = dynamic_cast(root->getChildByName("right_Button")); right_button->addTouchEventListener(this, toucheventselector(UIScene::nextCallback)); - /* - gui::Label* mainMenuLabel = gui::Label::create(); - mainMenuLabel->setText("MainMenu"); - mainMenuLabel->setFontSize(20); - mainMenuLabel->setTouchScaleChangeEnabled(true); - mainMenuLabel->setPosition(Point(430,30)); - mainMenuLabel->setTouchEnabled(true); - mainMenuLabel->addTouchEventListener(this, toucheventselector(UIScene::menuCloseCallback)); - _uiLayer->addWidget(mainMenuLabel); - */ - - return true; } return false; From 7d8d645c70730eb83a95781a4ed54f84f6d6e6e3 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Fri, 3 Jan 2014 12:15:42 +0800 Subject: [PATCH 148/428] Modify "include" --- cocos/gui/UIButton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/gui/UIButton.cpp b/cocos/gui/UIButton.cpp index 01071ea51a..656d10bb25 100644 --- a/cocos/gui/UIButton.cpp +++ b/cocos/gui/UIButton.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "UIButton.h" +#include "gui/UIButton.h" #include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" NS_CC_BEGIN From 3e2ff8d467581d85bce730e9a4bb04017ee3feb3 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 12:50:52 +0800 Subject: [PATCH 149/428] Update AUTHORS [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index f4d416c903..cbeafc6df3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -698,6 +698,7 @@ Developers: andyque Fixed a bug that missing to check self assignment of Vector, Map, Value and String. Fixed a bug that move assignment operator doesn't clear previous content bug. + Fixed the compile error of Map's getRandomObject. Retired Core Developers: WenSheng Yang From 1caae5214053637f473a4d52a57124cad76ba153 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 3 Jan 2014 12:58:57 +0800 Subject: [PATCH 150/428] [ci skip] --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 73dc65cfdf..9075d3ec41 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -cocos2d-x-3.0beta0 ?? 2013 +cocos2d-x-3.0beta ?? 2013 [All] [NEW] Upgrated Box2D to 2.3.0 [NEW] SChedule::performFunctionInCocosThread() From 0661d87cdb80df8914ac4ce0006dfef5dff136ea Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 3 Jan 2014 05:02:28 +0000 Subject: [PATCH 151/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 46a4f8dfc8..0c34519f80 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 46a4f8dfc80cf72227576d89305d4fe6b7572318 +Subproject commit 0c34519f802c69e39bf0c3654b08968115e80ffb From 2b19da00df799676d65b82154b0bff6f5c040f15 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 3 Jan 2014 14:51:36 +0800 Subject: [PATCH 152/428] Update the lua test cases about the armature --- cocos/2d/cocos2d.h | 1 + .../lua_cocos2dx_coco_studio_manual.cpp | 82 ++++--- cocos/scripting/lua/script/Deprecated.lua | 15 -- .../CocoStudioArmatureTest.lua | 202 ++++++++++++------ 4 files changed, 178 insertions(+), 122 deletions(-) diff --git a/cocos/2d/cocos2d.h b/cocos/2d/cocos2d.h index 1dfdcba511..fceec68f6a 100644 --- a/cocos/2d/cocos2d.h +++ b/cocos/2d/cocos2d.h @@ -111,6 +111,7 @@ THE SOFTWARE. #include "CCMotionStreak.h" #include "CCProgressTimer.h" #include "CCRenderTexture.h" +#include "CCNodeGrid.h" // particle_nodes #include "CCParticleBatchNode.h" diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp index c0459ea85a..affd70c634 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp @@ -23,8 +23,6 @@ public: LuaArmatureWrapper(); virtual ~LuaArmatureWrapper(); - virtual void movementEventCallback(Armature* armature, MovementEventType type,const char* movementID); - virtual void frameEventCallback(Bone* bone, const char* frameEventName, int orginFrameIndex, int currentFrameIndex); virtual void addArmatureFileInfoAsyncCallback(float percent); }; @@ -38,41 +36,6 @@ LuaArmatureWrapper::~LuaArmatureWrapper() } -void LuaArmatureWrapper::movementEventCallback(Armature* armature, MovementEventType type,const char* movementID) -{ - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); - - if (0 != handler) - { - std::string strMovementID = movementID; - LuaArmatureMovementEventData movementData(armature,(int)type, strMovementID); - - LuaArmatureWrapperEventData wrapperData(LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::MOVEMENT_EVENT , (void*)&movementData); - - BasicScriptData data(this,(void*)&wrapperData); - - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ARMATURE_EVENT, (void*)&data); - } -} - -void LuaArmatureWrapper::frameEventCallback(Bone* bone, const char* frameEventName, int orginFrameIndex, int currentFrameIndex) -{ - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); - - if (0 != handler) - { - std::string strFrameEventName(frameEventName); - - LuaArmatureFrameEventData frameData(bone,strFrameEventName,orginFrameIndex,currentFrameIndex); - - LuaArmatureWrapperEventData wrapperData(LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::FRAME_EVENT , (void*)&frameData); - - BasicScriptData data(this,(void*)&wrapperData); - - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ARMATURE_EVENT, (void*)&data); - } -} - void LuaArmatureWrapper::addArmatureFileInfoAsyncCallback(float percent) { int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); @@ -124,11 +87,25 @@ static int lua_cocos2dx_ArmatureAnimation_setMovementEventCallFunc(lua_State* L) LuaArmatureWrapper* wrapper = new LuaArmatureWrapper(); wrapper->autorelease(); + Vector vec; + vec.pushBack(wrapper); ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); - - self->setUserObject(wrapper); - self->setMovementEventCallFunc(wrapper, movementEvent_selector(LuaArmatureWrapper::movementEventCallback)); - + + self->setMovementEventCallFunc([=](Armature *armature, MovementEventType movementType, const std::string& movementID){ + int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)vec.at(0), ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); + + if (0 != handler) + { + std::string strMovementID = movementID; + LuaArmatureMovementEventData movementData(armature,(int)movementType, strMovementID); + + LuaArmatureWrapperEventData wrapperData(LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::MOVEMENT_EVENT , (void*)&movementData); + + BasicScriptData data((void*)vec.at(0),(void*)&wrapperData); + + LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ARMATURE_EVENT, (void*)&data); + } + }); return 0; } @@ -180,10 +157,27 @@ static int lua_cocos2dx_ArmatureAnimation_setFrameEventCallFunc(lua_State* L) LuaArmatureWrapper* wrapper = new LuaArmatureWrapper(); wrapper->autorelease(); - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); + Vector vec; + vec.pushBack(wrapper); - self->setUserObject(wrapper); - self->setFrameEventCallFunc(wrapper, frameEvent_selector(LuaArmatureWrapper::frameEventCallback)); + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); + + self->setFrameEventCallFunc([=](Bone *bone, const std::string& frameEventName, int originFrameIndex, int currentFrameIndex){ + int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)vec.at(0), ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); + + if (0 != handler) + { + std::string strFrameEventName(frameEventName); + + LuaArmatureFrameEventData frameData(bone,frameEventName,originFrameIndex,currentFrameIndex); + + LuaArmatureWrapperEventData wrapperData(LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::FRAME_EVENT , (void*)&frameData); + + BasicScriptData data((void*)vec.at(0),(void*)&wrapperData); + + LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ARMATURE_EVENT, (void*)&data); + } + }); return 0; } diff --git a/cocos/scripting/lua/script/Deprecated.lua b/cocos/scripting/lua/script/Deprecated.lua index 01ce6f62a7..391c47238a 100644 --- a/cocos/scripting/lua/script/Deprecated.lua +++ b/cocos/scripting/lua/script/Deprecated.lua @@ -1088,21 +1088,6 @@ end rawset(SceneReader,"purgeSceneReader",SceneReaderDeprecated.purgeSceneReader) --functions of SceneReader will be deprecated end ---functions of ActionManager will be deprecated begin -local ActionManagerDeprecated = { } -function ActionManagerDeprecated.shareManager() - deprecatedTip("ActionManager:shareManager","ccs.ActionManagerEx:getInstance") - return ccs.ActionManagerEx:getInstance() -end -rawset(ActionManager,"shareManager",ActionManagerDeprecated.shareManager) - -function ActionManagerDeprecated.destroyInstance() - deprecatedTip("ActionManager:destroyInstance","ccs.ActionManagerEx:destroyActionManager") - return ccs.ActionManagerEx:destroyActionManager() -end -rawset(ActionManager,"destroyInstance",ActionManagerDeprecated.destroyInstance) ---functions of ActionManager will be deprecated end - --functions of CCEGLView will be deprecated begin local CCEGLViewDeprecated = { } function CCEGLViewDeprecated.sharedOpenGLView() diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua index 7531500dc8..d47b24034e 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua @@ -10,15 +10,14 @@ local ArmatureTestIndex = TEST_COCOSTUDIO_WITH_SKELETON = 3, TEST_DRAGON_BONES_2_0 = 4, TEST_PERFORMANCE = 5, - TEST_PERFORMANCE_BATCHNODE = 6, - TEST_CHANGE_ZORDER = 7, - TEST_ANIMATION_EVENT = 8, - TEST_FRAME_EVENT = 9, - TEST_PARTICLE_DISPLAY = 10, - TEST_USE_DIFFERENT_PICTURE = 11, - TEST_ANCHORPOINT = 12, - TEST_ARMATURE_NESTING = 13, - TEST_ARMATURE_NESTING_2 = 14, + TEST_CHANGE_ZORDER = 6, + TEST_ANIMATION_EVENT = 7, + TEST_FRAME_EVENT = 8, + TEST_PARTICLE_DISPLAY = 9, + TEST_USE_DIFFERENT_PICTURE = 10, + TEST_ANCHORPOINT = 11, + TEST_ARMATURE_NESTING = 12, + TEST_ARMATURE_NESTING_2 = 13, } local armatureSceneIdx = ArmatureTestIndex.TEST_ASYNCHRONOUS_LOADING @@ -80,8 +79,6 @@ function ArmatureTestLayer.title(idx) return "Test Export From DragonBones version 2.0" elseif ArmatureTestIndex.TEST_PERFORMANCE == idx then return "Test Performance" - elseif ArmatureTestIndex.TEST_PERFORMANCE_BATCHNODE == idx then - return "Test Performance of using BatchNode" elseif ArmatureTestIndex.TEST_CHANGE_ZORDER == idx then return "Test Change ZOrder Of Different Armature" elseif ArmatureTestIndex.TEST_ANIMATION_EVENT == idx then @@ -106,8 +103,6 @@ function ArmatureTestLayer.subTitle(idx) return "current percent :" elseif ArmatureTestIndex.TEST_PERFORMANCE == idx then return "Current Armature Count : " - elseif ArmatureTestIndex.TEST_PERFORMANCE_BATCHNODE == idx then - return "Current Armature Count : " elseif ArmatureTestIndex.TEST_PARTICLE_DISPLAY == idx then return "Touch to change animation" elseif ArmatureTestIndex.TEST_USE_DIFFERENT_PICTURE == idx then @@ -125,7 +120,12 @@ function ArmatureTestLayer.create() if nil ~= layer then layer:createMenu() layer:createToExtensionMenu() - layer:onEnter() + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) layer:creatTitleAndSubTitle(armatureSceneIdx) end @@ -174,7 +174,7 @@ function ArmatureTestLayer:createMenu() end function ArmatureTestLayer.toExtensionMenu() - ccs.ArmatureDataManager:destoryInstance() + ccs.ArmatureDataManager:destroyInstance() local scene = CocoStudioTestMain() if scene ~= nil then cc.Director:getInstance():replaceScene(scene) @@ -278,7 +278,12 @@ function TestAsynchronousLoading.create() if nil ~= layer then layer:createMenu() layer:createToExtensionMenu() - layer:onEnter() + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) end return layer @@ -301,7 +306,7 @@ function TestDirectLoading:onEnter() ccs.ArmatureDataManager:getInstance():removeArmatureFileInfo("armature/bear.ExportJson") ccs.ArmatureDataManager:getInstance():addArmatureFileInfo("armature/bear.ExportJson") local armature = ccs.Armature:create("bear") - armature:getAnimation():playByIndex(0) + armature:getAnimation():playWithIndex(0) armature:setPosition(cc.p(VisibleRect:center())) self:addChild(armature) end @@ -311,7 +316,13 @@ function TestDirectLoading.create() if nil ~= layer then layer:createMenu() layer:createToExtensionMenu() - layer:onEnter() + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) + layer:creatTitleAndSubTitle(armatureSceneIdx) end return layer @@ -333,7 +344,7 @@ end function TestCSWithSkeleton:onEnter() local armature = ccs.Armature:create("Cowboy") - armature:getAnimation():playByIndex(0) + armature:getAnimation():playWithIndex(0) armature:setScale(0.2) armature:setAnchorPoint(cc.p(0.5, 0.5)) armature:setPosition(cc.p(winSize.width / 2, winSize.height / 2)) @@ -346,7 +357,12 @@ function TestCSWithSkeleton.create() if nil ~= layer then layer:createMenu() layer:createToExtensionMenu() - layer:onEnter() + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) layer:creatTitleAndSubTitle(armatureSceneIdx) end @@ -368,7 +384,7 @@ end function TestDragonBones20:onEnter() local armature = ccs.Armature:create("Dragon") - armature:getAnimation():playByIndex(1) + armature:getAnimation():playWithIndex(1) armature:getAnimation():setSpeedScale(0.4) armature:setPosition(cc.p(VisibleRect:center().x, VisibleRect:center().y * 0.3)) armature:setScale(0.6) @@ -381,7 +397,12 @@ function TestDragonBones20.create() if nil ~= layer then layer:createMenu() layer:createToExtensionMenu() - layer:onEnter() + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) layer:creatTitleAndSubTitle(armatureSceneIdx) end return layer @@ -423,7 +444,7 @@ function TestPerformance:addArmature(num) for i = 1, num do self._armatureCount = self._armatureCount + 1 local armature = ccs.Armature:create("Knight_f/Knight") - armature:getAnimation():playByIndex(0) + armature:getAnimation():playWithIndex(0) armature:setPosition(50 + self._armatureCount * 2, 150) armature:setScale(0.6) self:addArmatureToParent(armature) @@ -480,7 +501,12 @@ function TestPerformance.create() layer:createMenu() layer:createToExtensionMenu() layer:creatTitleAndSubTitle(armatureSceneIdx) - layer:onEnter() + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) end return layer end @@ -557,7 +583,12 @@ function TestPerformanceBatchNode.create() layer:createMenu() layer:createToExtensionMenu() layer:creatTitleAndSubTitle(armatureSceneIdx) - layer:onEnter() + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) end return layer end @@ -580,21 +611,21 @@ function TestChangeZorder:onEnter() self.currentTag = -1 local armature = ccs.Armature:create("Knight_f/Knight") - armature:getAnimation():playByIndex(0) + armature:getAnimation():playWithIndex(0) armature:setPosition(cc.p(winSize.width / 2, winSize.height / 2 - 100 )) armature:setScale(0.6) self.currentTag = self.currentTag + 1 self:addChild(armature, self.currentTag, self.currentTag) armature = ccs.Armature:create("Cowboy") - armature:getAnimation():playByIndex(0) + armature:getAnimation():playWithIndex(0) armature:setScale(0.24) armature:setPosition(cc.p(winSize.width / 2, winSize.height / 2 - 100)) self.currentTag = self.currentTag + 1 self:addChild(armature, self.currentTag, self.currentTag) armature = ccs.Armature:create("Dragon") - armature:getAnimation():playByIndex(0) + armature:getAnimation():playWithIndex(0) armature:setPosition(cc.p(winSize.width / 2, winSize.height / 2 - 100)) armature:setScale(0.6) self.currentTag = self.currentTag + 1 @@ -615,8 +646,13 @@ function TestChangeZorder.create() if nil ~= layer then layer:createMenu() layer:createToExtensionMenu() - layer:onEnter() layer:creatTitleAndSubTitle(armatureSceneIdx) + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) end return layer end @@ -654,7 +690,7 @@ function TestAnimationEvent:onEnter() local function animationEvent(armatureBack,movementType,movementID) local id = movementID - if movementType == ccs.MovementEventType.LOOP_COMPLETE then + if movementType == ccs.MovementEventType.loopComplete then if id == "Fire" then local actionToRight = cc.MoveTo:create(2, cc.p(VisibleRect:right().x - 50, VisibleRect:right().y)) armatureBack:stopAllActions() @@ -680,8 +716,13 @@ function TestAnimationEvent.create() if nil ~= layer then layer:createMenu() layer:createToExtensionMenu() - layer:onEnter() layer:creatTitleAndSubTitle(armatureSceneIdx) + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) end return layer end @@ -700,27 +741,32 @@ function TestFrameEvent.extend(target) end function TestFrameEvent:onEnter() + + local gridNode = cc.NodeGrid:create() + local armature = ccs.Armature:create("HeroAnimation") armature:getAnimation():play("attack") armature:getAnimation():setSpeedScale(0.5) armature:setPosition(cc.p(VisibleRect:center().x - 50, VisibleRect:center().y -100)) local function onFrameEvent( bone,evt,originFrameIndex,currentFrameIndex) - if (not self:getActionByTag(frameEventActionTag)) or (not self:getActionByTag(frameEventActionTag):isDone()) then - self:stopAllActions() + if (not gridNode:getActionByTag(frameEventActionTag)) or (not gridNode:getActionByTag(frameEventActionTag):isDone()) then + gridNode:stopAllActions() + local action = cc.ShatteredTiles3D:create(0.2, cc.size(16,12), 5, false) action:setTag(frameEventActionTag) - self:runAction(action) + gridNode:runAction(action) end end armature:getAnimation():setFrameEventCallFunc(onFrameEvent) + gridNode:addChild(armature) - self:addChild(armature) + self:addChild(gridNode) local function checkAction(dt) - if self:getNumberOfRunningActions() == 0 and self:getGrid() ~= nil then - self:setGrid(nil) + if gridNode:getNumberOfRunningActions() == 0 and gridNode:getGrid() ~= nil then + gridNode:setGrid(nil) end end @@ -740,7 +786,12 @@ function TestFrameEvent.create() layer:createMenu() layer:createToExtensionMenu() layer:creatTitleAndSubTitle(armatureSceneIdx) - layer:onEnter() + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) end return layer end @@ -765,7 +816,7 @@ function TestParticleDisplay:onEnter() self.animationID = 0 self.armature = ccs.Armature:create("robot") - self.armature:getAnimation():playByIndex(0) + self.armature:getAnimation():playWithIndex(0) self.armature:setPosition(VisibleRect:center()) self.armature:setScale(0.48) self:addChild(self.armature) @@ -775,7 +826,7 @@ function TestParticleDisplay:onEnter() local bone = ccs.Bone:create("p1") bone:addDisplay(p1, 0) - bone:changeDisplayByIndex(0, true) + bone:changeDisplayWithIndex(0, true) bone:setIgnoreMovementBoneData(true) bone:setZOrder(100) bone:setScale(1.2) @@ -783,7 +834,7 @@ function TestParticleDisplay:onEnter() bone = ccs.Bone:create("p2") bone:addDisplay(p2, 0) - bone:changeDisplayByIndex(0, true) + bone:changeDisplayWithIndex(0, true) bone:setIgnoreMovementBoneData(true) bone:setZOrder(100) bone:setScale(1.2) @@ -791,7 +842,7 @@ function TestParticleDisplay:onEnter() local function onTouchBegan(x, y) self.animationID = (self.animationID + 1) % self.armature:getAnimation():getMovementCount() - self.armature:getAnimation():playByIndex(self.animationID) + self.armature:getAnimation():playWithIndex(self.animationID) return false end @@ -810,8 +861,13 @@ function TestParticleDisplay.create() if nil ~= layer then layer:createMenu() layer:createToExtensionMenu() - layer:onEnter() layer:creatTitleAndSubTitle(armatureSceneIdx) + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) end return layer @@ -837,7 +893,7 @@ function TestUseMutiplePicture:onEnter() self.displayIndex = 1 self.armature = ccs.Armature:create("Knight_f/Knight") - self.armature:getAnimation():playByIndex(0) + self.armature:getAnimation():playWithIndex(0) self.armature:setPosition(cc.p(VisibleRect:left().x + 70, VisibleRect:left().y)) self.armature:setScale(1.2) self:addChild(self.armature) @@ -861,7 +917,7 @@ function TestUseMutiplePicture:onEnter() local function onTouchBegan(x, y) self.displayIndex = (self.displayIndex + 1) % (table.getn(weapon) - 1) - self.armature:getBone("weapon"):changeDisplayByIndex(self.displayIndex, true) + self.armature:getBone("weapon"):changeDisplayWithIndex(self.displayIndex, true) return false end @@ -880,8 +936,13 @@ function TestUseMutiplePicture.create() if nil ~= layer then layer:createMenu() layer:createToExtensionMenu() - layer:onEnter() layer:creatTitleAndSubTitle(armatureSceneIdx) + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) end return layer @@ -904,7 +965,7 @@ function TestAnchorPoint:onEnter() local i = 1 for i = 1 , 5 do local armature = ccs.Armature:create("Cowboy") - armature:getAnimation():playByIndex(0) + armature:getAnimation():playWithIndex(0) armature:setPosition(VisibleRect:center()) armature:setScale(0.2) self:addChild(armature, 0, i - 1) @@ -923,8 +984,13 @@ function TestAnchorPoint.create() if nil ~= layer then layer:createMenu() layer:createToExtensionMenu() - layer:onEnter() layer:creatTitleAndSubTitle(armatureSceneIdx) + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) end return layer @@ -950,7 +1016,7 @@ function TestArmatureNesting:onEnter() self.weaponIndex = 0 self.armature = ccs.Armature:create("cyborg") - self.armature:getAnimation():playByIndex(1) + self.armature:getAnimation():playWithIndex(1) self.armature:setPosition(VisibleRect:center()) self.armature:setScale(1.2) self.armature:getAnimation():setSpeedScale(0.4) @@ -958,8 +1024,8 @@ function TestArmatureNesting:onEnter() local function onTouchBegan(x, y) self.weaponIndex = (self.weaponIndex + 1) % 4 - self.armature:getBone("armInside"):getChildArmature():getAnimation():playByIndex(self.weaponIndex) - self.armature:getBone("armOutside"):getChildArmature():getAnimation():playByIndex(self.weaponIndex) + self.armature:getBone("armInside"):getChildArmature():getAnimation():playWithIndex(self.weaponIndex) + self.armature:getBone("armOutside"):getChildArmature():getAnimation():playWithIndex(self.weaponIndex) return false end @@ -978,8 +1044,13 @@ function TestArmatureNesting.create() if nil ~= layer then layer:createMenu() layer:createToExtensionMenu() - layer:onEnter() layer:creatTitleAndSubTitle(armatureSceneIdx) + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) end return layer @@ -1005,7 +1076,7 @@ function Hero:changeMount(armature) --note self:retain() - self:playByIndex(0) + self:playWithIndex(0) self._mount:getBone("hero"):removeDisplay(0) self._mount:stopAllActions() self:setPosition(self._mount:getPosition()) @@ -1015,22 +1086,22 @@ function Hero:changeMount(armature) else self._mount = armature self:retain() - self:removeFromParentAndCleanup(false) + self:removeFromParent(false) local bone = armature:getBone("hero") bone:addDisplay(self, 0) - bone:changeDisplayByIndex(0, true) + bone:changeDisplayWithIndex(0, true) bone:setIgnoreMovementBoneData(true) self:setPosition(cc.p(0,0)) - self:playByIndex(1) + self:playWithIndex(1) self:setScale(1) self:release() end end -function Hero:playByIndex(index) - self:getAnimation():playByIndex(index) +function Hero:playWithIndex(index) + self:getAnimation():playWithIndex(index) if nil ~= self._mount then - self._mount:getAnimation():playByIndex(index) + self._mount:getAnimation():playWithIndex(index) end end @@ -1112,7 +1183,7 @@ function TestArmatureNesting2:onEnter() self._hero = Hero.create("hero") self._hero._layer = self - self._hero:playByIndex(0) + self._hero:playWithIndex(0) self._hero:setPosition(cc.p(VisibleRect:left().x + 20, VisibleRect:left().y)) self:addChild(self._hero) @@ -1126,7 +1197,7 @@ end function TestArmatureNesting2:createMount(name,pt) local armature = ccs.Armature:create(name) - armature:getAnimation():playByIndex(0) + armature:getAnimation():playWithIndex(0) armature:setPosition(pt) self:addChild(armature) return armature @@ -1139,7 +1210,12 @@ function TestArmatureNesting2.create() layer:createMenu() layer:createToExtensionMenu() layer:creatTitleAndSubTitle(armatureSceneIdx) - layer:onEnter() + local function onNodeEvent(event) + if "enter" == event then + layer:onEnter() + end + end + layer:registerScriptHandler(onNodeEvent) end return layer @@ -1153,7 +1229,7 @@ local armatureSceneArr = TestCSWithSkeleton.create, TestDragonBones20.create, TestPerformance.create, - TestPerformanceBatchNode.create, + --TestPerformanceBatchNode.create, TestChangeZorder.create, TestAnimationEvent.create, TestFrameEvent.create, From 9c0e669e098edc75ca6a082cd8a51ab9a2a908ca Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Fri, 3 Jan 2014 15:14:48 +0800 Subject: [PATCH 153/428] Add "override" --- cocos/gui/UIButton.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/cocos/gui/UIButton.h b/cocos/gui/UIButton.h index 46c5d012fe..6e74ee2ac1 100644 --- a/cocos/gui/UIButton.h +++ b/cocos/gui/UIButton.h @@ -122,7 +122,7 @@ public: void setCapInsetsDisabledRenderer(const Rect &capInsets); //override "setAnchorPoint" of widget. - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const Point &pt) override; /** * Sets if button is using scale9 renderer. @@ -132,16 +132,16 @@ public: virtual void setScale9Enabled(bool able); //override "setFlipX" of widget. - virtual void setFlipX(bool flipX); + virtual void setFlipX(bool flipX) override; //override "setFlipY" of widget. - virtual void setFlipY(bool flipY); + virtual void setFlipY(bool flipY) override; //override "isFlipX" of widget. - virtual bool isFlipX(); + virtual bool isFlipX() override; //override "isFlipY" of widget. - virtual bool isFlipY(); + virtual bool isFlipY() override; /** * Changes if button can be clicked zoom effect. @@ -151,13 +151,13 @@ public: void setPressedActionEnabled(bool enabled); //override "ignoreContentAdaptWithSize" method of widget. - virtual void ignoreContentAdaptWithSize(bool ignore); + virtual void ignoreContentAdaptWithSize(bool ignore) override; //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const Size& getContentSize() const override; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual Node* getVirtualRenderer() override; /** * Sets color to widget @@ -166,12 +166,12 @@ public: * * @param color */ - virtual void setColor(const Color3B &color); + virtual void setColor(const Color3B &color) override; /** * Returns the "class name" of widget. */ - virtual std::string getDescription() const; + virtual std::string getDescription() const override; void setTitleText(const std::string& text); const std::string& getTitleText() const; @@ -183,18 +183,18 @@ public: const char* getTitleFontName() const; protected: - virtual bool init(); - virtual void initRenderer(); - virtual void onPressStateChangedToNormal(); - virtual void onPressStateChangedToPressed(); - virtual void onPressStateChangedToDisabled(); - virtual void onSizeChanged(); + virtual bool init() override; + virtual void initRenderer() override; + virtual void onPressStateChangedToNormal() override; + virtual void onPressStateChangedToPressed() override; + virtual void onPressStateChangedToDisabled() override; + virtual void onSizeChanged() override; void normalTextureScaleChangedWithSize(); void pressedTextureScaleChangedWithSize(); void disabledTextureScaleChangedWithSize(); - virtual Widget* createCloneInstance(); - virtual void copySpecialProperties(Widget* model); + virtual Widget* createCloneInstance() override; + virtual void copySpecialProperties(Widget* model) override; protected: Node* _buttonNormalRenderer; Node* _buttonClickedRenderer; From 8e2c51d31e7d44de3ea069deb2d9dfb8410dc43e Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 3 Jan 2014 15:29:50 +0800 Subject: [PATCH 154/428] update vs project for split spine binding. --- build/cocos2d-win32.vc2012.sln | 7 ++ .../bindings/proj.win32/libJSBinding.vcxproj | 2 - .../proj.win32/libJSBinding.vcxproj.filters | 6 - .../spine/libJSBindingForSpine.vcxproj | 117 ++++++++++++++++++ .../libJSBindingForSpine.vcxproj.filters | 28 +++++ .../spine/libJSBindingForSpine.vcxproj.user | 6 + .../proj.win32/TestJavascript.vcxproj | 3 + 7 files changed, 161 insertions(+), 8 deletions(-) create mode 100644 cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj create mode 100644 cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj.filters create mode 100644 cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj.user diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index 28792555a1..3593a117d8 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -65,6 +65,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBindingForLocalStorage EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBindingForGui", "..\cocos\scripting\javascript\bindings\gui\libJSBindingForGui.vcxproj", "{9A844C88-97E8-4E2D-B09A-E138C67D338B}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBindingForSpine", "..\cocos\scripting\javascript\bindings\spine\libJSBindingForSpine.vcxproj", "{E78CDC6B-F37D-48D2-AD91-1DB549497E32}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -195,6 +197,10 @@ Global {9A844C88-97E8-4E2D-B09A-E138C67D338B}.Debug|Win32.Build.0 = Debug|Win32 {9A844C88-97E8-4E2D-B09A-E138C67D338B}.Release|Win32.ActiveCfg = Release|Win32 {9A844C88-97E8-4E2D-B09A-E138C67D338B}.Release|Win32.Build.0 = Release|Win32 + {E78CDC6B-F37D-48D2-AD91-1DB549497E32}.Debug|Win32.ActiveCfg = Debug|Win32 + {E78CDC6B-F37D-48D2-AD91-1DB549497E32}.Debug|Win32.Build.0 = Debug|Win32 + {E78CDC6B-F37D-48D2-AD91-1DB549497E32}.Release|Win32.ActiveCfg = Release|Win32 + {E78CDC6B-F37D-48D2-AD91-1DB549497E32}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -208,6 +214,7 @@ Global {21070E58-EEC6-4E16-8B4F-6D083DF55790} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1} {68F5F371-BD7B-4C30-AE5B-0B08F22E0CDE} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1} {9A844C88-97E8-4E2D-B09A-E138C67D338B} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1} + {E78CDC6B-F37D-48D2-AD91-1DB549497E32} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1} EndGlobalSection GlobalSection(DPCodeReviewSolutionGUID) = preSolution DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} diff --git a/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj b/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj index e959aa34a6..a4cbbd4d50 100644 --- a/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj +++ b/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj @@ -12,7 +12,6 @@ - @@ -24,7 +23,6 @@ - diff --git a/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters b/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters index 13bcceb35b..85bb2eccd3 100644 --- a/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters +++ b/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters @@ -41,9 +41,6 @@ generated - - generated - @@ -82,9 +79,6 @@ generated - - generated - diff --git a/cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj b/cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj new file mode 100644 index 0000000000..13f9b1c4c1 --- /dev/null +++ b/cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj @@ -0,0 +1,117 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + + + + + {E78CDC6B-F37D-48D2-AD91-1DB549497E32} + Win32Proj + libJSBindingForSpine + + + + StaticLibrary + true + Unicode + v100 + v110 + v110_xp + + + StaticLibrary + false + Unicode + v100 + v110 + v110_xp + + + + + + + + + + + + + + + $(SolutionDir)$(Configuration).win32\ + + + $(Configuration).win32\ + + + $(SolutionDir)$(Configuration).win32\ + + + $(Configuration).win32\ + + + + + + Level3 + Disabled + WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories) + 4068;4101;4800;4251;4244;%(DisableSpecificWarnings) + true + false + OldStyle + + + Windows + true + + + + + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories) + 4068;4101;4800;4251;4244;%(DisableSpecificWarnings) + true + + + Windows + true + true + true + + + + + + + + + + \ No newline at end of file diff --git a/cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj.filters b/cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj.filters new file mode 100644 index 0000000000..5f6eb93a21 --- /dev/null +++ b/cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj.filters @@ -0,0 +1,28 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + generated + + + + + generated + + + + + generated + + + \ No newline at end of file diff --git a/cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj.user b/cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj.user new file mode 100644 index 0000000000..3f03091124 --- /dev/null +++ b/cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj.user @@ -0,0 +1,6 @@ + + + + false + + \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj b/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj index bb12af0fb5..e3be6f4245 100644 --- a/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj +++ b/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj @@ -237,6 +237,9 @@ xcopy "$(ProjectDir)..\..\Shared\tests" "$(OutDir)\TestJavascriptRes\" /e /Y {39379840-825a-45a0-b363-c09ffef864bd} + + {e78cdc6b-f37d-48d2-ad91-1db549497e32} + {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} From 767bf81e90917416ce4382c29cc8e4c76ddaeb90 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Fri, 3 Jan 2014 15:46:42 +0800 Subject: [PATCH 155/428] Modify renderers draw order define. --- cocos/gui/UIButton.cpp | 22 +++++++++++----------- cocos/gui/UICheckBox.cpp | 20 ++++++++++---------- cocos/gui/UIImageView.cpp | 6 +++--- cocos/gui/UILayout.cpp | 16 ++++++++-------- cocos/gui/UILoadingBar.cpp | 6 +++--- cocos/gui/UIScrollView.cpp | 2 +- cocos/gui/UISlider.cpp | 16 ++++++++-------- cocos/gui/UIText.cpp | 4 ++-- cocos/gui/UITextAtlas.cpp | 4 ++-- cocos/gui/UITextBMFont.cpp | 4 ++-- cocos/gui/UITextField.cpp | 4 ++-- 11 files changed, 52 insertions(+), 52 deletions(-) diff --git a/cocos/gui/UIButton.cpp b/cocos/gui/UIButton.cpp index 656d10bb25..c0d21dc2b3 100644 --- a/cocos/gui/UIButton.cpp +++ b/cocos/gui/UIButton.cpp @@ -29,10 +29,10 @@ NS_CC_BEGIN namespace gui { -#define NORMALRENDERERZ (-2) -#define PRESSEDRENDERERZ (-2) -#define DISABLEDRENDERERZ (-2) -#define TITLERENDERERZ (-1) +static const int NORMAL_RENDERER_Z = (-2); +static const int PRESSED_RENDERER_Z = (-2); +static const int DISABLED_RENDERER_Z = (-2); +static const int TITLE_RENDERER_Z = (-1); Button::Button(): _buttonNormalRenderer(nullptr), @@ -98,10 +98,10 @@ void Button::initRenderer() _buttonDisableRenderer = Sprite::create(); _titleRenderer = LabelTTF::create(); - Node::addChild(_buttonNormalRenderer, NORMALRENDERERZ, -1); - Node::addChild(_buttonClickedRenderer, PRESSEDRENDERERZ, -1); - Node::addChild(_buttonDisableRenderer, DISABLEDRENDERERZ, -1); - Node::addChild(_titleRenderer, TITLERENDERERZ, -1); + Node::addChild(_buttonNormalRenderer, NORMAL_RENDERER_Z, -1); + Node::addChild(_buttonClickedRenderer, PRESSED_RENDERER_Z, -1); + Node::addChild(_buttonDisableRenderer, DISABLED_RENDERER_Z, -1); + Node::addChild(_titleRenderer, TITLE_RENDERER_Z, -1); } void Button::setScale9Enabled(bool able) @@ -134,9 +134,9 @@ void Button::setScale9Enabled(bool able) loadTextureNormal(_normalFileName.c_str(), _normalTexType); loadTexturePressed(_clickedFileName.c_str(), _pressedTexType); loadTextureDisabled(_disabledFileName.c_str(), _disabledTexType); - Node::addChild(_buttonNormalRenderer, NORMALRENDERERZ, -1); - Node::addChild(_buttonClickedRenderer, PRESSEDRENDERERZ, -1); - Node::addChild(_buttonDisableRenderer, DISABLEDRENDERERZ, -1); + Node::addChild(_buttonNormalRenderer, NORMAL_RENDERER_Z, -1); + Node::addChild(_buttonClickedRenderer, PRESSED_RENDERER_Z, -1); + Node::addChild(_buttonDisableRenderer, DISABLED_RENDERER_Z, -1); if (_scale9Enabled) { bool ignoreBefore = _ignoreSize; diff --git a/cocos/gui/UICheckBox.cpp b/cocos/gui/UICheckBox.cpp index 27d447bc74..b255cfe49c 100644 --- a/cocos/gui/UICheckBox.cpp +++ b/cocos/gui/UICheckBox.cpp @@ -28,11 +28,11 @@ NS_CC_BEGIN namespace gui { -#define BACKGROUNDBOXRENDERERZ (-1) -#define BACKGROUNDSELECTEDBOXRENDERERZ (-1) -#define FRONTCROSSRENDERERZ (-1) -#define BACKGROUNDBOXDISABLEDRENDERERZ (-1) -#define FRONTCROSSDISABLEDRENDERERZ (-1) +static const int BACKGROUNDBOX_RENDERER_Z = (-1); +static const int BACKGROUNDSELECTEDBOX_RENDERER_Z = (-1); +static const int FRONTCROSS_RENDERER_Z = (-1); +static const int BACKGROUNDBOXDISABLED_RENDERER_Z = (-1); +static const int FRONTCROSSDISABLED_RENDERER_Z = (-1); CheckBox::CheckBox(): _backGroundBoxRenderer(nullptr), @@ -92,11 +92,11 @@ void CheckBox::initRenderer() _backGroundBoxDisabledRenderer = Sprite::create(); _frontCrossDisabledRenderer = Sprite::create(); - Node::addChild(_backGroundBoxRenderer, BACKGROUNDBOXRENDERERZ, -1); - Node::addChild(_backGroundSelectedBoxRenderer, BACKGROUNDSELECTEDBOXRENDERERZ, -1); - Node::addChild(_frontCrossRenderer, FRONTCROSSRENDERERZ, -1); - Node::addChild(_backGroundBoxDisabledRenderer, BACKGROUNDBOXDISABLEDRENDERERZ, -1); - Node::addChild(_frontCrossDisabledRenderer, FRONTCROSSDISABLEDRENDERERZ, -1); + Node::addChild(_backGroundBoxRenderer, BACKGROUNDBOX_RENDERER_Z, -1); + Node::addChild(_backGroundSelectedBoxRenderer, BACKGROUNDSELECTEDBOX_RENDERER_Z, -1); + Node::addChild(_frontCrossRenderer, FRONTCROSS_RENDERER_Z, -1); + Node::addChild(_backGroundBoxDisabledRenderer, BACKGROUNDBOXDISABLED_RENDERER_Z, -1); + Node::addChild(_frontCrossDisabledRenderer, FRONTCROSSDISABLED_RENDERER_Z, -1); } void CheckBox::loadTextures(const char *backGround, const char *backGroundSelected, const char *cross,const char* backGroundDisabled,const char* frontCrossDisabled,TextureResType texType) diff --git a/cocos/gui/UIImageView.cpp b/cocos/gui/UIImageView.cpp index c228c5a513..fd2a0640c5 100644 --- a/cocos/gui/UIImageView.cpp +++ b/cocos/gui/UIImageView.cpp @@ -33,7 +33,7 @@ namespace gui { #define STATIC_CAST_CCSPRITE static_cast(_imageRenderer) #define STATIC_CAST_SCALE9SPRITE static_cast(_imageRenderer) -#define IMAGERENDERERZ (-1) +static const int IMAGE_RENDERER_Z = (-1); ImageView::ImageView(): _scale9Enabled(false), @@ -67,7 +67,7 @@ ImageView* ImageView::create() void ImageView::initRenderer() { _imageRenderer = Sprite::create(); - Node::addChild(_imageRenderer, IMAGERENDERERZ, -1); + Node::addChild(_imageRenderer, IMAGE_RENDERER_Z, -1); } void ImageView::loadTexture(const char *fileName, TextureResType texType) @@ -193,7 +193,7 @@ void ImageView::setScale9Enabled(bool able) _imageRenderer = Sprite::create(); } loadTexture(_textureFile.c_str(),_imageTexType); - Node::addChild(_imageRenderer, IMAGERENDERERZ, -1); + Node::addChild(_imageRenderer, IMAGE_RENDERER_Z, -1); if (_scale9Enabled) { bool ignoreBefore = _ignoreSize; diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index 9d511283a8..9c7085432c 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -30,8 +30,8 @@ NS_CC_BEGIN namespace gui { -#define BACKGROUNDIMAGEZ (-1) -#define BCAKGROUNDCOLORRENDERERZ (-2) +static const int BACKGROUNDIMAGE_Z = (-1); +static const int BCAKGROUNDCOLORRENDERER_Z = (-2); static GLint g_sStencilBits = -1; @@ -428,12 +428,12 @@ void Layout::setBackGroundImageScale9Enabled(bool able) if (_backGroundScale9Enabled) { _backGroundImage = extension::Scale9Sprite::create(); - Node::addChild(_backGroundImage, BACKGROUNDIMAGEZ, -1); + Node::addChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1); } else { _backGroundImage = Sprite::create(); - Node::addChild(_backGroundImage, BACKGROUNDIMAGEZ, -1); + Node::addChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1); } setBackGroundImage(_backGroundImageFileName.c_str(),_bgImageTexType); setBackGroundImageCapInsets(_backGroundImageCapInsets); @@ -546,14 +546,14 @@ void Layout::addBackGroundImage() { _backGroundImage = extension::Scale9Sprite::create(); _backGroundImage->setZOrder(-1); - Node::addChild(_backGroundImage, BACKGROUNDIMAGEZ, -1); + Node::addChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1); static_cast(_backGroundImage)->setPreferredSize(_size); } else { _backGroundImage = Sprite::create(); _backGroundImage->setZOrder(-1); - Node::addChild(_backGroundImage, BACKGROUNDIMAGEZ, -1); + Node::addChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1); } _backGroundImage->setPosition(Point(_size.width/2.0f, _size.height/2.0f)); } @@ -617,7 +617,7 @@ void Layout::setBackGroundColorType(LayoutBackGroundColorType type) _colorRender->setContentSize(_size); _colorRender->setOpacity(_cOpacity); _colorRender->setColor(_cColor); - Node::addChild(_colorRender, BACKGROUNDIMAGEZ, -1); + Node::addChild(_colorRender, BCAKGROUNDCOLORRENDERER_Z, -1); break; case LAYOUT_COLOR_GRADIENT: _gradientRender = LayerGradient::create(); @@ -626,7 +626,7 @@ void Layout::setBackGroundColorType(LayoutBackGroundColorType type) _gradientRender->setStartColor(_gStartColor); _gradientRender->setEndColor(_gEndColor); _gradientRender->setVector(_alongVector); - Node::addChild(_gradientRender, BACKGROUNDIMAGEZ, -1); + Node::addChild(_gradientRender, BCAKGROUNDCOLORRENDERER_Z, -1); break; default: break; diff --git a/cocos/gui/UILoadingBar.cpp b/cocos/gui/UILoadingBar.cpp index aec388a8c0..38ca9a3764 100644 --- a/cocos/gui/UILoadingBar.cpp +++ b/cocos/gui/UILoadingBar.cpp @@ -29,7 +29,7 @@ NS_CC_BEGIN namespace gui { -#define BARRENDERERZ (-1) +static const int BAR_RENDERER_Z = (-1); LoadingBar::LoadingBar(): _barType(LoadingBarTypeLeft), @@ -65,7 +65,7 @@ LoadingBar* LoadingBar::create() void LoadingBar::initRenderer() { _barRenderer = Sprite::create(); - Node::addChild(_barRenderer, BARRENDERERZ, -1); + Node::addChild(_barRenderer, BAR_RENDERER_Z, -1); _barRenderer->setAnchorPoint(Point(0.0,0.5)); } @@ -182,7 +182,7 @@ void LoadingBar::setScale9Enabled(bool enabled) _barRenderer = Sprite::create(); } loadTexture(_textureFile.c_str(),_renderBarTexType); - Node::addChild(_barRenderer, BARRENDERERZ, -1); + Node::addChild(_barRenderer, BAR_RENDERER_Z, -1); if (_scale9Enabled) { bool ignoreBefore = _ignoreSize; diff --git a/cocos/gui/UIScrollView.cpp b/cocos/gui/UIScrollView.cpp index 436cb52ea7..7a5614faff 100644 --- a/cocos/gui/UIScrollView.cpp +++ b/cocos/gui/UIScrollView.cpp @@ -28,7 +28,7 @@ NS_CC_BEGIN namespace gui { -#define AUTOSCROLLMAXSPEED 1000.0f +static const float AUTOSCROLLMAXSPEED = 1000.0f; const Point SCROLLDIR_UP = Point(0.0f, 1.0f); const Point SCROLLDIR_DOWN = Point(0.0f, -1.0f); diff --git a/cocos/gui/UISlider.cpp b/cocos/gui/UISlider.cpp index 30fc583524..cad6f3d763 100644 --- a/cocos/gui/UISlider.cpp +++ b/cocos/gui/UISlider.cpp @@ -29,9 +29,9 @@ NS_CC_BEGIN namespace gui { -#define BASEBARRENDERERZ (-2) -#define PROGRESSBARRENDERERZ (-2) -#define SLIDBALLRENDERERZ (-1) +static const int BASEBAR_RENDERER_Z = (-2); +static const int PROGRESSBAR_RENDERER_Z = (-2); +static const int SLIDBALL_RENDERER_Z = (-1); Slider::Slider(): _barRenderer(nullptr), @@ -85,8 +85,8 @@ void Slider::initRenderer() _barRenderer = Sprite::create(); _progressBarRenderer = Sprite::create(); _progressBarRenderer->setAnchorPoint(Point(0.0f, 0.5f)); - Node::addChild(_barRenderer, BASEBARRENDERERZ, -1); - Node::addChild(_progressBarRenderer, PROGRESSBARRENDERERZ, -1); + Node::addChild(_barRenderer, BASEBAR_RENDERER_Z, -1); + Node::addChild(_progressBarRenderer, PROGRESSBAR_RENDERER_Z, -1); _slidBallNormalRenderer = Sprite::create(); _slidBallPressedRenderer = Sprite::create(); _slidBallPressedRenderer->setVisible(false); @@ -96,7 +96,7 @@ void Slider::initRenderer() _slidBallRenderer->addChild(_slidBallNormalRenderer); _slidBallRenderer->addChild(_slidBallPressedRenderer); _slidBallRenderer->addChild(_slidBallDisabledRenderer); - Node::addChild(_slidBallRenderer, SLIDBALLRENDERERZ, -1); + Node::addChild(_slidBallRenderer, SLIDBALL_RENDERER_Z, -1); } void Slider::loadBarTexture(const char* fileName, TextureResType texType) @@ -201,8 +201,8 @@ void Slider::setScale9Enabled(bool able) } loadBarTexture(_textureFile.c_str(), _barTexType); loadProgressBarTexture(_progressBarTextureFile.c_str(), _progressBarTexType); - Node::addChild(_barRenderer, BASEBARRENDERERZ, -1); - Node::addChild(_progressBarRenderer, PROGRESSBARRENDERERZ, -1); + Node::addChild(_barRenderer, BASEBAR_RENDERER_Z, -1); + Node::addChild(_progressBarRenderer, PROGRESSBAR_RENDERER_Z, -1); if (_scale9Enabled) { bool ignoreBefore = _ignoreSize; diff --git a/cocos/gui/UIText.cpp b/cocos/gui/UIText.cpp index a57c2c5b3b..91815575b1 100644 --- a/cocos/gui/UIText.cpp +++ b/cocos/gui/UIText.cpp @@ -28,7 +28,7 @@ NS_CC_BEGIN namespace gui { -#define LABELRENDERERZ (-1) +static const int LABEL_RENDERER_Z = (-1); Text::Text(): _touchScaleChangeEnabled(false), @@ -70,7 +70,7 @@ bool Text::init() void Text::initRenderer() { _labelRenderer = LabelTTF::create(); - Node::addChild(_labelRenderer, LABELRENDERERZ, -1); + Node::addChild(_labelRenderer, LABEL_RENDERER_Z, -1); } void Text::setText(const std::string& text) diff --git a/cocos/gui/UITextAtlas.cpp b/cocos/gui/UITextAtlas.cpp index cd1d2c0609..9e5444ab60 100644 --- a/cocos/gui/UITextAtlas.cpp +++ b/cocos/gui/UITextAtlas.cpp @@ -28,7 +28,7 @@ NS_CC_BEGIN namespace gui { -#define LABELATLASRENDERERZ (-1) +static const int LABELATLAS_RENDERER_Z = (-1); UICCLabelAtlas::UICCLabelAtlas() @@ -107,7 +107,7 @@ TextAtlas* TextAtlas::create() void TextAtlas::initRenderer() { _labelAtlasRenderer = UICCLabelAtlas::create(); - Node::addChild(_labelAtlasRenderer, LABELATLASRENDERERZ, -1); + Node::addChild(_labelAtlasRenderer, LABELATLAS_RENDERER_Z, -1); } void TextAtlas::setProperty(const std::string& stringValue, const std::string& charMapFile, int itemWidth, int itemHeight, const std::string& startCharMap) diff --git a/cocos/gui/UITextBMFont.cpp b/cocos/gui/UITextBMFont.cpp index f062a884b8..846ed82876 100644 --- a/cocos/gui/UITextBMFont.cpp +++ b/cocos/gui/UITextBMFont.cpp @@ -28,7 +28,7 @@ NS_CC_BEGIN namespace gui { -#define LABELBMFONTRENDERERZ (-1) +static const int LABELBMFONT_RENDERER_Z = (-1); TextBMFont::TextBMFont(): _labelBMFontRenderer(nullptr), @@ -58,7 +58,7 @@ TextBMFont* TextBMFont::create() void TextBMFont::initRenderer() { _labelBMFontRenderer = cocos2d::LabelBMFont::create(); - Node::addChild(_labelBMFontRenderer, LABELBMFONTRENDERERZ, -1); + Node::addChild(_labelBMFontRenderer, LABELBMFONT_RENDERER_Z, -1); } void TextBMFont::setFntFile(const char *fileName) diff --git a/cocos/gui/UITextField.cpp b/cocos/gui/UITextField.cpp index 217f1ed481..58cf592df7 100644 --- a/cocos/gui/UITextField.cpp +++ b/cocos/gui/UITextField.cpp @@ -269,7 +269,7 @@ bool UICCTextField::getDeleteBackward() return _deleteBackward; } -#define TEXTFIELDRENDERERZ (-1) +static const int TEXTFIELD_RENDERER_Z = (-1); TextField::TextField(): @@ -314,7 +314,7 @@ bool TextField::init() void TextField::initRenderer() { _textFieldRenderer = UICCTextField::create("input words here", "Thonburi", 20); - Node::addChild(_textFieldRenderer, TEXTFIELDRENDERERZ, -1); + Node::addChild(_textFieldRenderer, TEXTFIELD_RENDERER_Z, -1); } void TextField::setTouchSize(const Size &size) From 2f84abd19c4f740c6bc8338f0ece9e54dd7625b0 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 3 Jan 2014 16:13:13 +0800 Subject: [PATCH 156/428] fix compiling error in TransitionTest on vs. --- .../Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp index 0c81fa9373..728901b809 100644 --- a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp @@ -145,14 +145,13 @@ public: #define STRINGIFY(x) #x #define TRANS(__className__) { \ - { [](float t, Scene* s){ return __className__::create(t,s);} }, \ + [](float t, Scene* s){ return __className__::create(t,s);}, \ STRINGIFY(__className__), \ } - struct _transitions { std::function function; const char * name; -} transitions[] { +} transitions[] = { TRANS(TransitionJumpZoom), TRANS(TransitionProgressRadialCCW), TRANS(TransitionProgressRadialCW), From 37c8b0325307c67bdbd8455deb280958635d3f3e Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 3 Jan 2014 08:37:25 +0000 Subject: [PATCH 157/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 0c34519f80..24265e82aa 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 0c34519f802c69e39bf0c3654b08968115e80ffb +Subproject commit 24265e82aa5e64b6a344a7634e3987e298c0f45d From d52e9805383cfdad88599c2a9ae570c108fb00f6 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 3 Jan 2014 16:53:04 +0800 Subject: [PATCH 158/428] don't release an object return by Object::create() --- .../Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp index df7cce7c38..4b104da5ea 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp @@ -80,7 +80,6 @@ void AllocBasicLayer::showCurrentTest() scene->initWithQuantityOfNodes(nodes); Director::getInstance()->replaceScene(scene); - scene->release(); } } From 7c0d4240ae8c6417eeb6ffa24673b320b7b3da55 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 3 Jan 2014 18:12:58 +0800 Subject: [PATCH 159/428] Don't release an autoreleased object --- .../Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp index 3fde8293b7..d7fa2eba2c 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp @@ -109,7 +109,6 @@ void NodeChildrenMenuLayer::showCurrentTest() scene->initWithQuantityOfNodes(nodes); Director::getInstance()->replaceScene(scene); - scene->release(); } } From 1d04b429470e7e66f5be4764f806e7e6f7e4807e Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 3 Jan 2014 18:15:56 +0800 Subject: [PATCH 160/428] Put "initxx" functions into protected. --- cocos/2d/CCParticleBatchNode.h | 23 +++++++++++-------- cocos/2d/CCParticleSystemQuad.h | 13 ++++++----- .../Classes/ParticleTest/ParticleTest.cpp | 3 +-- .../PerformanceParticleTest.cpp | 9 +------- 4 files changed, 22 insertions(+), 26 deletions(-) diff --git a/cocos/2d/CCParticleBatchNode.h b/cocos/2d/CCParticleBatchNode.h index 4162d3b9dd..41fb9e5d40 100644 --- a/cocos/2d/CCParticleBatchNode.h +++ b/cocos/2d/CCParticleBatchNode.h @@ -73,22 +73,13 @@ public: /** initializes the particle system with the name of a file on disk (for a list of supported formats look at the Texture2D class), a capacity of particles */ static ParticleBatchNode* create(const std::string& fileImage, int capacity = kParticleDefaultCapacity); - /** - * @js ctor - */ - ParticleBatchNode(); + /** * @js NA * @lua NA */ virtual ~ParticleBatchNode(); - /** initializes the particle system with Texture2D, a capacity of particles */ - bool initWithTexture(Texture2D *tex, int capacity); - - /** initializes the particle system with the name of a file on disk (for a list of supported formats look at the Texture2D class), a capacity of particles */ - bool initWithFile(const std::string& fileImage, int capacity); - /** Inserts a child into the ParticleBatchNode */ void insertChild(ParticleSystem* system, int index); @@ -127,6 +118,18 @@ public: * @lua NA */ virtual const BlendFunc& getBlendFunc(void) const override; + +protected: + /** + * @js ctor + */ + ParticleBatchNode(); + + /** initializes the particle system with Texture2D, a capacity of particles */ + bool initWithTexture(Texture2D *tex, int capacity); + + /** initializes the particle system with the name of a file on disk (for a list of supported formats look at the Texture2D class), a capacity of particles */ + bool initWithFile(const std::string& fileImage, int capacity); private: void updateAllAtlasIndexes(); diff --git a/cocos/2d/CCParticleSystemQuad.h b/cocos/2d/CCParticleSystemQuad.h index 93e7a1f948..9901655313 100644 --- a/cocos/2d/CCParticleSystemQuad.h +++ b/cocos/2d/CCParticleSystemQuad.h @@ -84,12 +84,6 @@ public: */ void listenBackToForeground(EventCustom* event); - // Overrides - /** - * @js NA - * @lua NA - */ - virtual bool initWithTotalParticles(int numberOfParticles) override; /** * @js NA * @lua NA @@ -140,6 +134,13 @@ protected: /** initializes the texture with a rectangle measured Points */ void initTexCoordsWithRect(const Rect& rect); + + // Overrides + /** + * @js NA + * @lua NA + */ + virtual bool initWithTotalParticles(int numberOfParticles) override; void setupVBOandVAO(); void setupVBO(); diff --git a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp index d7ecafe32b..18f9c8a4bd 100644 --- a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp @@ -1553,8 +1553,7 @@ void MultipleParticleSystemsBatched::onEnter() removeChild(_background, true); _background = NULL; - auto batchNode = new ParticleBatchNode(); - batchNode->initWithTexture(NULL, 3000); + ParticleBatchNode *batchNode = ParticleBatchNode::createWithTexture(nullptr, 3000); addChild(batchNode, 1, 2); diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp index 1f4adbbf1a..2ec2501ce6 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp @@ -196,24 +196,21 @@ void ParticleMainScene::createParticleSystem() // } // else { - particleSystem = ParticleSystemQuad::create(); + particleSystem = ParticleSystemQuad::createWithTotalParticles(quantityParticles); } switch( subtestNumber) { case 1: Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888); - particleSystem->initWithTotalParticles(quantityParticles); particleSystem->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png")); break; case 2: Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444); - particleSystem->initWithTotalParticles(quantityParticles); particleSystem->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png")); break; case 3: Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::A8); - particleSystem->initWithTotalParticles(quantityParticles); particleSystem->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png")); break; // case 4: @@ -223,21 +220,17 @@ void ParticleMainScene::createParticleSystem() // break; case 4: Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888); - particleSystem->initWithTotalParticles(quantityParticles); particleSystem->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png")); break; case 5: Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444); - particleSystem->initWithTotalParticles(quantityParticles); particleSystem->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png")); break; case 6: Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::A8); - particleSystem->initWithTotalParticles(quantityParticles); particleSystem->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png")); break; // case 8: -// particleSystem->initWithTotalParticles(quantityParticles); // ////---- particleSystem.texture = [[TextureCache sharedTextureCache] addImage:@"fire.pvr"]; // particleSystem->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png")); // break; From b0c23eacf54b5a081ff33a56791c156e81b96b34 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 3 Jan 2014 18:28:43 +0800 Subject: [PATCH 161/428] Don't release autoreased object. --- .../TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp index 2ec2501ce6..d653d67bb3 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp @@ -240,7 +240,6 @@ void ParticleMainScene::createParticleSystem() break; } addChild(particleSystem, 0, kTagParticleSystem); - particleSystem->release(); doTest(); From c22cc77c6690bbb08ed94ae5bd4ff99571039d6b Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Fri, 3 Jan 2014 19:09:13 +0800 Subject: [PATCH 162/428] add cocos files list configure script --- .../config-create/config.gitingore | 103 ++++++++++++ .../config-create/create_config.py | 148 ++++++++++++++++++ tools/project-creator/create_project.pyw | 4 +- .../module/cocos_files.json.REMOVED.git-id | 1 + tools/project-creator/module/core.py | 90 +++++------ tools/project-creator/module/ui.py | 9 +- 6 files changed, 298 insertions(+), 57 deletions(-) create mode 100644 tools/project-creator/config-create/config.gitingore create mode 100644 tools/project-creator/config-create/create_config.py create mode 100644 tools/project-creator/module/cocos_files.json.REMOVED.git-id diff --git a/tools/project-creator/config-create/config.gitingore b/tools/project-creator/config-create/config.gitingore new file mode 100644 index 0000000000..9f30065cea --- /dev/null +++ b/tools/project-creator/config-create/config.gitingore @@ -0,0 +1,103 @@ +#This configure file use .gitingore rules. +#So you can config this file like config .gitingore +# + +# Ignore thumbnails created by windows +Thumbs.db +.git +.gitignore + +# ignore copy files +/lib +/linux-build +/samples +/template + +# Ignore files build by Visual Studio +win32-msvc-vs201*-x86 +*.obj +*.exe +*.pdb +*.aps +*.vcproj.*.user +*.vspscc +*_i.c +*.i +*.icf +*_p.c +*.ncb +*.suo +*.tlb +*.tlh +*.bak +*.cache +*.ilk +*.log +[Bb]in +[Dd]ebug/ +[Dd]ebug.win32/ +*.sbr +*.sdf +obj/ +[Rr]elease/ +[Rr]elease.win32/ +_ReSharper*/ +[Tt]est[Rr]esult* +ipch/ +*.opensdf + +# Ignore files build by ndk and eclipse +libs/ +bin/ +obj/ +gen/ +assets/ +local.properties + +# Ignore python compiled files +*.pyc + +# Ignore files build by airplay and marmalade +build_*_xcode/ +build_*_vc10/ + +# Ignore files build by xcode +*.mode*v* +*.pbxuser +*.xcbkptlist +*.xcscheme +*.xcworkspacedata +*.xcuserstate +*.xccheckout +xcschememanagement.plist +.DS_Store +._.* +xcuserdata/ +DerivedData/ + +# Ignore files built by AppCode +.idea/ + +# Ignore files built by bada +.Simulator-Debug/ +.Target-Debug/ +.Target-Release/ + +# Ignore files built by blackberry +Simulator/ +Device-Debug/ +Device-Release/ + +# Ignore vim swaps +*.swp +*.swo + +# Ignore files created by create_project.py +/projects + +# CTags +tags + +#include +!/tools/cocos2d-console/console/bin/ +!/plugin-x/plugin-x_ios.xcworkspace/ \ No newline at end of file diff --git a/tools/project-creator/config-create/create_config.py b/tools/project-creator/config-create/create_config.py new file mode 100644 index 0000000000..b2c9e46b08 --- /dev/null +++ b/tools/project-creator/config-create/create_config.py @@ -0,0 +1,148 @@ +#!/usr/bin/python +#coding=utf-8 +"""**************************************************************************** +Copyright (c) 2013 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************""" + +import os +import sys +import re + +class CocosFileList: + """ + Function: + List cocos engine's files and save to "../module/cocos_file_list.json". + config "config.gitingore" file can set exclude or include files. + """ + + def __init__(self): + self.excludeConfig=[] + self.inludeConfig=[] + self.rootDir = "" + self.fileList=[] + + def readIngoreFile(self, fileName): + """ + Read configure file which use ".gitingore"'s rules. + """ + pfile = "" + try: + pfile = open(fileName, 'r') + except IOError: + return + + for line in pfile: + line = line.strip() + if not line or line[0] == "#": + continue + + #convert .gitingore regular expression to python's regular expression + line=line.replace('.', '\\.') + line=line.replace('*', '.*') + line="%s$" %line + if line[0] == "!": + self.inludeConfig.append(line[1:]) + else: + self.excludeConfig.append(line) + pfile.close() + + def parseFileList(self, rootDir): + self.rootDir = os.path.abspath(rootDir) + self.__parseFileList(rootDir) + + def __parseFileList(self, folderdir): + """ + """ + for item in os.listdir(folderdir): + path = os.path.join(folderdir, item) + relativePath = path[len(self.rootDir)+1:len(path)] + relativePath = relativePath.replace('\\', '/') + if os.path.isdir(path): + if ( + self.__bInclude("/%s" %relativePath) or + self.__bInclude("/%s/" %relativePath) or + self.__bInclude(item) or + self.__bInclude("%s/" %item) + ): + self.fileList.append("%s/" %relativePath) + continue + if ( + self.__bExclude("/%s" %relativePath) or + self.__bExclude("/%s/" %relativePath) or + self.__bExclude(item) or + self.__bExclude("%s/" %item) + ): + continue + self.__parseFileList(path) + else: + if ( + not self.__bInclude("/%s" %relativePath) and + not self.__bInclude(item) + ): + if ( + self.__bExclude("/%s" %relativePath) or + self.__bExclude(item) + ): + continue + print(relativePath) + self.fileList.append(relativePath) + + def __bExclude(self, item): + bexclude = False + for index in range(len(self.excludeConfig)): + if re.match(self.excludeConfig[index], item): + bexclude = True + break + return bexclude + + def __bInclude(self, item): + binclude = False + for index in range(len(self.inludeConfig)): + if re.match(self.inludeConfig[index], item): + binclude = True + break + return binclude + + def writeFileList(self,fileName): + """ + Save content to file with json format. + """ + f = open(fileName,"w") + content = "[\n\"%s\"\n]" % ("\",\n\"".join(self.fileList)) + f.write(content) + f.close() + return True + +# ------------ main -------------- +if __name__ == '__main__': + + cocos_root =os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) + cocos_file_path =os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "module", "cocos_files.json")) + cocos_file_ingore =os.path.abspath(os.path.join(os.path.dirname(__file__), "config.gitingore")) + print ("begin list files") + cocosObj = CocosFileList() + cocosObj.readIngoreFile(cocos_file_ingore) + cocosObj.parseFileList(cocos_root) + cocosObj.writeFileList(cocos_file_path) + print ("had list files to cocos_file_list.json") + diff --git a/tools/project-creator/create_project.pyw b/tools/project-creator/create_project.pyw index 0ff3bfae7f..4a58425739 100755 --- a/tools/project-creator/create_project.pyw +++ b/tools/project-creator/create_project.pyw @@ -42,10 +42,10 @@ if __name__ == '__main__': #create_project.py -n MyGame -k com.MyCompany.AwesomeGame -l javascript -p c:/mycompany """ if len(sys.argv)==1: - try: + try: from module.ui import createTkCocosDialog createTkCocosDialog() - except ImportError: + except ImportError: commandCreate() else: commandCreate() diff --git a/tools/project-creator/module/cocos_files.json.REMOVED.git-id b/tools/project-creator/module/cocos_files.json.REMOVED.git-id new file mode 100644 index 0000000000..60eb92e773 --- /dev/null +++ b/tools/project-creator/module/cocos_files.json.REMOVED.git-id @@ -0,0 +1 @@ +6b36f5d803952b11046d0b2395c232fe66301b2f \ No newline at end of file diff --git a/tools/project-creator/module/core.py b/tools/project-creator/module/core.py index 72aa704b60..4ed447076d 100644 --- a/tools/project-creator/module/core.py +++ b/tools/project-creator/module/core.py @@ -68,6 +68,7 @@ class CocosProject: "dst_package_name": None, "src_project_path": None, "dst_project_path": None, + "cocos_file_list":None, "script_dir": None } self.platforms_list = [] @@ -134,6 +135,7 @@ class CocosProject: self.context["language"] = language self.context["dst_project_path"] = os.path.join(projectPath,projectName) self.context["script_dir"] = os.path.abspath(os.path.dirname(__file__)) + self.context["cocos_file_list"] = os.path.join(self.context["script_dir"], "cocos_files.json") # fill in src_project_name and src_package_name according to "language" template_dir = os.path.abspath(os.path.join(self.cocos_root, "template")) @@ -163,70 +165,52 @@ class CocosProject: shutil.copytree(self.context["src_project_path"], self.context["dst_project_path"], True) # check cocos engine exist - dirlist = os.listdir(self.cocos_root) - if (not "cocos" in dirlist) or (not "extensions" in dirlist): - print ("The Cocos2d Engine doesn\'t exist." \ - "Check engine path, please") + + if not os.path.exists(self.context["cocos_file_list"]): + print ("cocos_file_list.json doesn\'t exist." \ + "generate it, please") return False + f = open(self.context["cocos_file_list"]) + fileList = json.load(f) + f.close() + self.platforms_list = self.platforms.get(self.context["language"], []) + self.totalStep = len(self.platforms_list) + len(fileList) + self.step = 0 + + #begin copy engine + print("###begin copy engine...") + dstPath = os.path.join(self.context["dst_project_path"],"cocos2d") + for index in range(len(fileList)): + srcfile = os.path.join(self.cocos_root,fileList[index]) + dstfile = os.path.join(dstPath,fileList[index]) + if not os.path.exists(os.path.dirname(dstfile)): + os.makedirs(os.path.dirname(dstfile)) + + print (fileList[index]) + #copy file or folder + if os.path.exists(srcfile): + if os.path.isdir(srcfile): + if os.path.exists(dstfile): + shutil.rmtree(dstfile) + shutil.copytree(srcfile, dstfile) + else: + if os.path.exists(dstfile): + os.remove(dstfile) + shutil.copyfile(srcfile, dstfile) + self.step = self.step + 1 + if self.callbackfun and self.step%int(self.totalStep/100) == 0: + self.callbackfun(self.step,self.totalStep,fileList[index]) + # call process_proj from each platform's script folder - self.platforms_list = self.platforms.get(self.context["language"], []) - self.totalStep = len(self.platforms_list) + len(dirlist) - self.step = 0 for platform in self.platforms_list: self.__processPlatformProjects(platform) - # copy cocos2d engine. - if not self.__copyCocos2dEngine(): - print ("New project Failure") - if os.path.exists(self.context["dst_project_path"]): - shutil.rmtree(self.context["dst_project_path"]) - return False - print ("###New project has been created in this path: ") print (self.context["dst_project_path"].replace("\\", "/")) print ("Have Fun!") return True - def __copyCocos2dEngine(self): - """Copy cocos2d engine to dst_project_path. - Arg: - empty - """ - - ignoreList={ - "samples": None, - "docs": None, - "licenses": None, - "template": None, - ".git":None - } - - # create "cocos2d" folder - dstPath = os.path.join(self.context["dst_project_path"],"cocos2d") - if not os.path.exists(dstPath): - os.makedirs(dstPath) - - # begin copy - print("###begin copy engine...") - # list engine root dir. - dirlist = os.listdir(self.cocos_root) - for line in dirlist: - filepath = os.path.join(self.cocos_root,line) - showMsg = "%s\t\t\t: Done!" % line - self.step += 1 - if ignoreList.has_key(line): - continue - if os.path.isdir(filepath): - shutil.copytree(filepath, os.path.join(dstPath,line), True) - print (showMsg) - else: - shutil.copyfile(filepath, os.path.join(dstPath,line)) - - if self.callbackfun: - self.callbackfun(self.step,self.totalStep,showMsg) - return True - def __processPlatformProjects(self, platform): """ Process each platform project. Arg: diff --git a/tools/project-creator/module/ui.py b/tools/project-creator/module/ui.py index 4042374902..5158832216 100644 --- a/tools/project-creator/module/ui.py +++ b/tools/project-creator/module/ui.py @@ -67,8 +67,13 @@ class ThreadedTask(threading.Thread): #delete exist project. if os.path.exists(os.path.join(self.projectPath, self.projectName)): print ("###begin remove... " + self.projectName) - shutil.rmtree(os.path.join(self.projectPath, self.projectName)) - print ("###remove finish: " + self.projectName) + try: + shutil.rmtree(os.path.join(self.projectPath, self.projectName)) + print ("###remove finish: " + self.projectName) + except: + print ("###remove folder failure %s" %self.projectName) + putMsg = "end@%d@%d@%s" %(100, 100, "create failure") + self.queue.put(putMsg) putMsg = "begin@%d@%d@%s" %(0, 100, "begin create") self.queue.put(putMsg) From 3ccb80085f1b8d76b4c6cdd6a6173d352246d505 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Fri, 3 Jan 2014 19:14:17 +0800 Subject: [PATCH 163/428] Fixed bugs of page view --- cocos/gui/UIPageView.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cocos/gui/UIPageView.cpp b/cocos/gui/UIPageView.cpp index bc83c7a7aa..b41242b32d 100644 --- a/cocos/gui/UIPageView.cpp +++ b/cocos/gui/UIPageView.cpp @@ -392,11 +392,6 @@ void PageView::onTouchMoved(Touch *touch, Event *unusedEvent) widgetParent->checkChildInfo(1,this,_touchMovePos); } moveEvent(); - if (!hitTest(_touchMovePos)) - { - setFocused(false); - onTouchEnded(touch, unusedEvent); - } } void PageView::onTouchEnded(Touch *touch, Event *unusedEvent) @@ -558,6 +553,7 @@ void PageView::interceptTouchEvent(int handleState, Widget *sender, const Point break; case 3: + handleReleaseLogic(touchPoint); break; } } From 46c7338008adfd3fe45ce752330e506a34ad5f2c Mon Sep 17 00:00:00 2001 From: chengstory Date: Fri, 3 Jan 2014 19:30:47 +0800 Subject: [PATCH 164/428] fixed #3480 1. remove unused getnode and setnode interface. 2. add condition test. 3. Modify ComAttribute to support for parse json file. 4. Replace scenereader callback function to C++ 11 implement. --- cocos/2d/CCComponent.cpp | 10 - cocos/2d/CCComponent.h | 3 - .../cocostudio/CCComAttribute.cpp | 62 +- .../cocostudio/CCComAttribute.h | 5 +- .../editor-support/cocostudio/CCComAudio.cpp | 2 +- .../cocostudio/CCComController.cpp | 2 +- .../editor-support/cocostudio/CCComRender.cpp | 10 +- .../cocostudio/CCSSceneReader.cpp | 801 +++++++++--------- .../cocostudio/CCSSceneReader.h | 5 +- .../SceneController.cpp | 2 +- .../CocoStudioSceneTest/SceneEditorTest.cpp | 57 +- 11 files changed, 478 insertions(+), 481 deletions(-) diff --git a/cocos/2d/CCComponent.cpp b/cocos/2d/CCComponent.cpp index f228775a56..4f8482367a 100644 --- a/cocos/2d/CCComponent.cpp +++ b/cocos/2d/CCComponent.cpp @@ -102,14 +102,4 @@ void Component::setEnabled(bool b) _enabled = b; } -Node* Component::getNode() -{ - return nullptr; -} - -void Component::setNode(Node *node) -{ - CC_UNUSED_PARAM(node); -} - NS_CC_END diff --git a/cocos/2d/CCComponent.h b/cocos/2d/CCComponent.h index 800b707e81..5631c2585f 100644 --- a/cocos/2d/CCComponent.h +++ b/cocos/2d/CCComponent.h @@ -60,9 +60,6 @@ public: virtual void setEnabled(bool b); static Component* create(void); - virtual Node* getNode(); - virtual void setNode(Node *node); - const std::string& getName() const; void setName(const std::string& name); diff --git a/cocos/editor-support/cocostudio/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp index 35af4c2f9e..fc4ba9e2d4 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -64,42 +64,65 @@ void ComAttribute::setString(const std::string& key, const std::string& value) int ComAttribute::getInt(const std::string& key, int def) const { - if (_dict.find(key) == _dict.end()) + if (_dict.find(key) != _dict.end()) + { + const cocos2d::Value& v = _dict.at(key); + return v.asInt(); + } + + if (!DICTOOL->checkObjectExist_json(_doc, key.c_str())) { return def; } - const cocos2d::Value& v = _dict.at(key); - return v.asInt(); + + return DICTOOL->getIntValue_json(_doc, key.c_str()); } float ComAttribute::getFloat(const std::string& key, float def) const { - if (_dict.find(key) == _dict.end()) + if (_dict.find(key) != _dict.end()) + { + const cocos2d::Value& v = _dict.at(key); + return v.asFloat(); + } + + if (!DICTOOL->checkObjectExist_json(_doc, key.c_str())) { return def; } - const cocos2d::Value& v = _dict.at(key); - return v.asFloat(); + return DICTOOL->getFloatValue_json(_doc, key.c_str()); } bool ComAttribute::getBool(const std::string& key, bool def) const { - if (_dict.find(key) == _dict.end()) + if (_dict.find(key) != _dict.end()) + { + const cocos2d::Value& v = _dict.at(key); + return v.asBool(); + } + + if (!DICTOOL->checkObjectExist_json(_doc, key.c_str())) { return def; } - const cocos2d::Value& v = _dict.at(key); - return v.asBool(); + + return DICTOOL->getBooleanValue_json(_doc, key.c_str()); } std::string ComAttribute::getString(const std::string& key, const std::string& def) const { - if (_dict.find(key) == _dict.end()) + if (_dict.find(key) != _dict.end()) + { + const cocos2d::Value& v = _dict.at(key); + return v.asString(); + } + + if (!DICTOOL->checkObjectExist_json(_doc, key.c_str())) { return def; } - const cocos2d::Value& v = _dict.at(key); - return v.asString(); + + return DICTOOL->getStringValue_json(_doc, key.c_str()); } ComAttribute* ComAttribute::create(void) @@ -116,13 +139,16 @@ ComAttribute* ComAttribute::create(void) return pRet; } -void ComAttribute::setJsonFile(const std::string &jsonName) +bool ComAttribute::parse(const std::string &jsonFile) { - _jsonName = jsonName; -} -std::string ComAttribute::getJsonFile() -{ - return _jsonName; + bool ret = false; + do { + std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonFile); + _doc.Parse<0>(contentStr.c_str()); + CC_BREAK_IF(_doc.HasParseError()); + ret = true; + } while (0); + return ret; } } diff --git a/cocos/editor-support/cocostudio/CCComAttribute.h b/cocos/editor-support/cocostudio/CCComAttribute.h index 29bb02b536..e62d9cee94 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.h +++ b/cocos/editor-support/cocostudio/CCComAttribute.h @@ -58,11 +58,10 @@ public: bool getBool(const std::string& key, bool def = false) const; std::string getString(const std::string& key, const std::string& def = "") const; - void setJsonFile(const std::string &jsonName); - std::string getJsonFile(); + bool parse(const std::string &jsonFile); private: cocos2d::ValueMap _dict; - std::string _jsonName; + rapidjson::Document _doc; }; } diff --git a/cocos/editor-support/cocostudio/CCComAudio.cpp b/cocos/editor-support/cocostudio/CCComAudio.cpp index c8112bc4c7..84a6bb8ea9 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.cpp +++ b/cocos/editor-support/cocostudio/CCComAudio.cpp @@ -31,7 +31,7 @@ ComAudio::ComAudio(void) : _filePath("") , _loop(false) { - _name = "Audio"; + _name = "CCComAudio"; } ComAudio::~ComAudio(void) diff --git a/cocos/editor-support/cocostudio/CCComController.cpp b/cocos/editor-support/cocostudio/CCComController.cpp index bf57a8724a..41ab0f4401 100644 --- a/cocos/editor-support/cocostudio/CCComController.cpp +++ b/cocos/editor-support/cocostudio/CCComController.cpp @@ -28,7 +28,7 @@ namespace cocostudio { ComController::ComController(void) { - _name = "Constoller"; + _name = "CCComController"; } ComController::~ComController(void) diff --git a/cocos/editor-support/cocostudio/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp index 824fbd5922..dafff1ecf8 100644 --- a/cocos/editor-support/cocostudio/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -29,7 +29,7 @@ namespace cocostudio { ComRender::ComRender(void) : _render(nullptr) { - + _name = "CCComRender"; } @@ -41,12 +41,12 @@ ComRender::ComRender(cocos2d::Node *node, const char *comName) ComRender::~ComRender(void) { - _render = NULL; + _render = nullptr; } void ComRender::onEnter() { - if (_owner != NULL) + if (_owner != nullptr) { _owner->addChild(_render); } @@ -54,7 +54,7 @@ void ComRender::onEnter() void ComRender::onExit() { - _render = NULL; + _render = nullptr; } cocos2d::Node* ComRender::getNode() @@ -70,7 +70,7 @@ void ComRender::setNode(cocos2d::Node *node) ComRender* ComRender::create(cocos2d::Node *node, const char *comName) { ComRender * ret = new ComRender(node, comName); - if (ret != NULL && ret->init()) + if (ret != nullptr && ret->init()) { ret->autorelease(); } diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index 2df5e0b151..ba31a8dfc0 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -31,441 +31,438 @@ using namespace gui; namespace cocostudio { - SceneReader* SceneReader::s_sharedReader = nullptr; +SceneReader* SceneReader::s_sharedReader = nullptr; - SceneReader::SceneReader() - : _listener(NULL) - , _fnSelector(NULL) - , _node(NULL) +SceneReader::SceneReader() +: _fnSelector(nullptr) +, _node(nullptr) +{ +} + +SceneReader::~SceneReader() +{ +} + +const char* SceneReader::sceneReaderVersion() +{ + return "1.0.0.0"; +} + +cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName) +{ + rapidjson::Document jsonDict; + do { + CC_BREAK_IF(!readJson(fileName, jsonDict)); + _node = createObject(jsonDict, nullptr); + TriggerMng::getInstance()->parse(jsonDict); + } while (0); + + return _node; +} + +bool SceneReader::readJson(const std::string &fileName, rapidjson::Document &doc) +{ + bool bRet = false; + do { + std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(fileName); + std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath); + doc.Parse<0>(contentStr.c_str()); + CC_BREAK_IF(doc.HasParseError()); + bRet = true; + } while (0); + return bRet; +} + +Node* SceneReader::nodeByTag(Node *parent, int tag) +{ + if (parent == nullptr) { + return nullptr; } - - SceneReader::~SceneReader() + Node *_retNode = nullptr; + Vector& Children = parent->getChildren(); + Vector::iterator iter = Children.begin(); + while (iter != Children.end()) { - } - - const char* SceneReader::sceneReaderVersion() - { - return "1.0.0.0"; - } - - cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName) - { - rapidjson::Document jsonDict; - do { - CC_BREAK_IF(!readJson(fileName, jsonDict)); - _node = createObject(jsonDict, NULL); - TriggerMng::getInstance()->parse(jsonDict); - } while (0); - - return _node; - } - - bool SceneReader::readJson(const std::string &fileName, rapidjson::Document &doc) - { - bool bRet = false; - do { - std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(fileName); - std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath); - doc.Parse<0>(contentStr.c_str()); - CC_BREAK_IF(doc.HasParseError()); - bRet = true; - } while (0); - return bRet; - } - - Node* SceneReader::nodeByTag(Node *parent, int tag) - { - if (parent == NULL) - { - return NULL; - } - Node *_retNode = NULL; - Vector& Children = parent->getChildren(); - Vector::iterator iter = Children.begin(); - while (iter != Children.end()) - { - Node* pNode = *iter; - if(pNode != NULL && pNode->getTag() == tag) - { - _retNode = pNode; - break; - } - else - { - _retNode = nodeByTag(pNode, tag); - if (_retNode != NULL) - { - break; - } - - } - ++iter; - } - return _retNode; - } - - - Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* parent) - { - const char *className = DICTOOL->getStringValue_json(dict, "classname"); - if(strcmp(className, "CCNode") == 0) + Node* pNode = *iter; + if(pNode != nullptr && pNode->getTag() == tag) { - Node* gb = nullptr; - if(nullptr == parent) + _retNode = pNode; + break; + } + else + { + _retNode = nodeByTag(pNode, tag); + if (_retNode != nullptr) { - gb = Node::create(); + break; + } + + } + ++iter; + } + return _retNode; +} + + +Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* parent) +{ + const char *className = DICTOOL->getStringValue_json(dict, "classname"); + if(strcmp(className, "CCNode") == 0) + { + Node* gb = nullptr; + if(nullptr == parent) + { + gb = Node::create(); + } + else + { + gb = Node::create(); + parent->addChild(gb); + } + + setPropertyFromJsonDict(dict, gb); + + int count = DICTOOL->getArrayCount_json(dict, "components"); + for (int i = 0; i < count; i++) + { + const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(dict, "components", i); + if (!DICTOOL->checkObjectExist_json(subDict)) + { + break; + } + const char *comName = DICTOOL->getStringValue_json(subDict, "classname"); + const char *pComName = DICTOOL->getStringValue_json(subDict, "name"); + + const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(subDict, "fileData"); + std::string pPath; + std::string pPlistFile; + int nResType = 0; + if (DICTOOL->checkObjectExist_json(fileData)) + { + const char *file = DICTOOL->getStringValue_json(fileData, "path"); + nResType = DICTOOL->getIntValue_json(fileData, "resourceType", - 1); + const char *plistFile = DICTOOL->getStringValue_json(fileData, "plistFile"); + if (file != nullptr) + { + pPath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); + } + + if (plistFile != nullptr) + { + pPlistFile.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(plistFile)); + } + + if (file == nullptr && plistFile == nullptr) + { + continue; + } } else { - gb = Node::create(); - parent->addChild(gb); + continue; } - - setPropertyFromJsonDict(dict, gb); - - int count = DICTOOL->getArrayCount_json(dict, "components"); - for (int i = 0; i < count; i++) - { - const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(dict, "components", i); - if (!DICTOOL->checkObjectExist_json(subDict)) - { - break; - } - const char *comName = DICTOOL->getStringValue_json(subDict, "classname"); - const char *pComName = DICTOOL->getStringValue_json(subDict, "name"); - - const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(subDict, "fileData"); - std::string pPath; - std::string pPlistFile; - int nResType = 0; - if (DICTOOL->checkObjectExist_json(fileData)) - { - const char *file = DICTOOL->getStringValue_json(fileData, "path"); - nResType = DICTOOL->getIntValue_json(fileData, "resourceType", - 1); - const char *plistFile = DICTOOL->getStringValue_json(fileData, "plistFile"); - if (file != nullptr) - { - pPath.append(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); - } - if (plistFile != nullptr) - { - pPlistFile.append(cocos2d::FileUtils::getInstance()->fullPathForFilename(plistFile)); - } - - if (file == nullptr && plistFile == nullptr) + if (comName != nullptr && strcmp(comName, "CCSprite") == 0) + { + cocos2d::Sprite *pSprite = nullptr; + + if (nResType == 0) + { + if (pPath.find(".png") == pPath.npos) { continue; } + pSprite = Sprite::create(pPath.c_str()); + } + else if (nResType == 1) + { + std::string pngFile = pPlistFile; + std::string::size_type pos = pngFile.find(".plist"); + if (pos == pPath.npos) + { + continue; + } + pngFile.replace(pos, pngFile.length(), ".png"); + CCSpriteFrameCache::getInstance()->addSpriteFramesWithFile(pPlistFile.c_str(), pngFile.c_str()); + pSprite = Sprite::createWithSpriteFrameName(pPath.c_str()); + } + else + { + continue; + } + + ComRender *pRender = ComRender::create(pSprite, "CCSprite"); + if (pComName != nullptr) + { + pRender->setName(pComName); + } + + gb->addComponent(pRender); + if (_fnSelector != nullptr) + { + _fnSelector(pSprite, (void*)(&subDict)); + } + } + else if(comName != nullptr && strcmp(comName, "CCTMXTiledMap") == 0) + { + cocos2d::TMXTiledMap *pTmx = nullptr; + if (nResType == 0) + { + if (pPath.find(".tmx") == pPath.npos) + { + continue; + } + pTmx = TMXTiledMap::create(pPath.c_str()); } else { continue; } - if (comName != nullptr && strcmp(comName, "CCSprite") == 0) + ComRender *pRender = ComRender::create(pTmx, "CCTMXTiledMap"); + if (pComName != nullptr) { - cocos2d::Sprite *pSprite = nullptr; - - if (nResType == 0) - { - if (pPath.find(".png") == pPath.npos) - { - continue; - } - pSprite = Sprite::create(pPath.c_str()); - } - else if (nResType == 1) - { - std::string pngFile = pPlistFile; - std::string::size_type pos = pngFile.find(".plist"); - if (pos == pPath.npos) - { - continue; - } - pngFile.replace(pos, pngFile.length(), ".png"); - CCSpriteFrameCache::getInstance()->addSpriteFramesWithFile(pPlistFile.c_str(), pngFile.c_str()); - pSprite = Sprite::createWithSpriteFrameName(pPath.c_str()); - } - else - { - continue; - } - - ComRender *pRender = ComRender::create(pSprite, "CCSprite"); - if (pComName != nullptr) - { - pRender->setName(pComName); - } - - gb->addComponent(pRender); - if (_listener && _fnSelector) - { - (_listener->*_fnSelector)(pSprite, (void*)(&subDict)); - } - } - else if(comName != nullptr && strcmp(comName, "CCTMXTiledMap") == 0) - { - cocos2d::TMXTiledMap *pTmx = nullptr; - if (nResType == 0) - { - if (pPath.find(".tmx") == pPath.npos) - { - continue; - } - pTmx = TMXTiledMap::create(pPath.c_str()); - } - else - { - continue; - } - - ComRender *pRender = ComRender::create(pTmx, "CCTMXTiledMap"); - if (pComName != nullptr) - { - pRender->setName(pComName); - } - gb->addComponent(pRender); - if (_listener && _fnSelector) - { - (_listener->*_fnSelector)(pTmx, (void*)(&subDict)); - } - } - else if(comName != nullptr && strcmp(comName, "CCParticleSystemQuad") == 0) - { - std::string::size_type pos = pPath.find(".plist"); - if (pos == pPath.npos) - { - continue; - } - - cocos2d::ParticleSystemQuad *pParticle = nullptr; - if (nResType == 0) - { - pParticle = ParticleSystemQuad::create(pPath.c_str()); - } - else - { - CCLOG("unknown resourcetype on CCParticleSystemQuad!"); - } - - pParticle->setPosition(0, 0); - ComRender *pRender = ComRender::create(pParticle, "CCParticleSystemQuad"); - if (pComName != nullptr) - { - pRender->setName(pComName); - } - gb->addComponent(pRender); - if (_listener && _fnSelector) - { - (_listener->*_fnSelector)(pParticle, (void*)(&subDict)); - } - } - else if(comName != nullptr && strcmp(comName, "CCArmature") == 0) - { - if (nResType != 0) - { - continue; - } - std::string reDir = pPath; - std::string file_path = ""; - size_t pos = reDir.find_last_of('/'); - if (pos != std::string::npos) - { - file_path = reDir.substr(0, pos+1); - } - - rapidjson::Document jsonDict; - if(!readJson(pPath.c_str(), jsonDict)) - { - log("read json file[%s] error!\n", pPath.c_str()); - continue; - } - - const rapidjson::Value &subData = DICTOOL->getDictionaryFromArray_json(jsonDict, "armature_data", 0); - const char *name = DICTOOL->getStringValue_json(subData, "name"); - - ArmatureDataManager::getInstance()->addArmatureFileInfo(pPath.c_str()); - - Armature *pAr = Armature::create(name); - ComRender *pRender = ComRender::create(pAr, "CCArmature"); - if (pComName != nullptr) - { - pRender->setName(pComName); - } - gb->addComponent(pRender); - - const char *actionName = DICTOOL->getStringValue_json(subDict, "selectedactionname"); - if (actionName != nullptr && pAr->getAnimation() != nullptr) - { - pAr->getAnimation()->play(actionName); - } - if (_listener && _fnSelector) - { - (_listener->*_fnSelector)(pAr, (void*)(&subDict)); - } - } - else if(comName != nullptr && strcmp(comName, "CCComAudio") == 0) - { - ComAudio *pAudio = nullptr; - if (nResType == 0) - { - pAudio = ComAudio::create(); - } - else - { - continue; - } - pAudio->preloadEffect(pPath.c_str()); - if (pComName != NULL) - { - pAudio->setName(pComName); - } - gb->addComponent(pAudio); - if (_listener && _fnSelector) - { - (_listener->*_fnSelector)(pAudio, (void*)(&subDict)); - } - } - else if(comName != nullptr && strcmp(comName, "CCComAttribute") == 0) - { - ComAttribute *pAttribute = nullptr; - if (nResType == 0) - { - pAttribute = ComAttribute::create(); - } - else - { - CCLOG("unknown resourcetype on CCComAttribute!"); - continue; - } - pAttribute->setJsonFile(pPath); - gb->addComponent(pAttribute); - if (_listener && _fnSelector) - { - (_listener->*_fnSelector)(pAttribute, (void*)(&subDict)); - } - } - else if (comName != nullptr && strcmp(comName, "CCBackgroundAudio") == 0) - { - ComAudio *pAudio = nullptr; - if (nResType == 0) - { - pAudio = ComAudio::create(); - } - else - { - continue; - } - pAudio->preloadBackgroundMusic(pPath.c_str()); - pAudio->setFile(pPath.c_str()); - const bool bLoop = (DICTOOL->getIntValue_json(subDict, "loop") != 0); - pAudio->setLoop(bLoop); - if (pComName != NULL) - { - pAudio->setName(pComName); - } - gb->addComponent(pAudio); - if (pComName != NULL) - { - pAudio->setName(pComName); - } - pAudio->playBackgroundMusic(pPath.c_str(), bLoop); - } - else if(comName != nullptr && strcmp(comName, "GUIComponent") == 0) - { - Widget* widget= GUIReader::shareReader()->widgetFromJsonFile(pPath.c_str()); - ComRender *pRender = ComRender::create(widget, "GUIComponent"); - if (pComName != nullptr) - { pRender->setName(pComName); - } - gb->addComponent(pRender); - if (_listener && _fnSelector) - { - (_listener->*_fnSelector)(widget, (void*)(&subDict)); - } - } - } - - int length = DICTOOL->getArrayCount_json(dict, "gameobjects"); - for (int i = 0; i < length; ++i) - { - const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(dict, "gameobjects", i); - if (!DICTOOL->checkObjectExist_json(subDict)) - { - break; } - createObject(subDict, gb); + gb->addComponent(pRender); + if (_fnSelector != nullptr) + { + _fnSelector(pTmx, (void*)(&subDict)); + } } - - return gb; + else if(comName != nullptr && strcmp(comName, "CCParticleSystemQuad") == 0) + { + std::string::size_type pos = pPath.find(".plist"); + if (pos == pPath.npos) + { + continue; + } + + cocos2d::ParticleSystemQuad *pParticle = nullptr; + if (nResType == 0) + { + pParticle = ParticleSystemQuad::create(pPath.c_str()); + } + else + { + CCLOG("unknown resourcetype on CCParticleSystemQuad!"); + } + + pParticle->setPosition(0, 0); + ComRender *pRender = ComRender::create(pParticle, "CCParticleSystemQuad"); + if (pComName != nullptr) + { + pRender->setName(pComName); + } + gb->addComponent(pRender); + if(_fnSelector != nullptr) + { + _fnSelector(pParticle, (void*)(&subDict)); + } + } + else if(comName != nullptr && strcmp(comName, "CCArmature") == 0) + { + if (nResType != 0) + { + continue; + } + std::string reDir = pPath; + std::string file_path = ""; + size_t pos = reDir.find_last_of('/'); + if (pos != std::string::npos) + { + file_path = reDir.substr(0, pos+1); + } + + rapidjson::Document jsonDict; + if(!readJson(pPath.c_str(), jsonDict)) + { + log("read json file[%s] error!\n", pPath.c_str()); + continue; + } + + const rapidjson::Value &subData = DICTOOL->getDictionaryFromArray_json(jsonDict, "armature_data", 0); + const char *name = DICTOOL->getStringValue_json(subData, "name"); + + ArmatureDataManager::getInstance()->addArmatureFileInfo(pPath.c_str()); + + Armature *pAr = Armature::create(name); + ComRender *pRender = ComRender::create(pAr, "CCArmature"); + if (pComName != nullptr) + { + pRender->setName(pComName); + } + gb->addComponent(pRender); + + const char *actionName = DICTOOL->getStringValue_json(subDict, "selectedactionname"); + if (actionName != nullptr && pAr->getAnimation() != nullptr) + { + pAr->getAnimation()->play(actionName); + } + if (_fnSelector != nullptr) + { + _fnSelector(pAr, (void*)(&subDict)); + } + } + else if(comName != nullptr && strcmp(comName, "CCComAudio") == 0) + { + ComAudio *pAudio = nullptr; + if (nResType == 0) + { + pAudio = ComAudio::create(); + } + else + { + continue; + } + pAudio->preloadEffect(pPath.c_str()); + if (pComName != nullptr) + { + pAudio->setName(pComName); + } + gb->addComponent(pAudio); + if(_fnSelector != nullptr) + { + _fnSelector(pAudio, (void*)(&subDict)); + } + } + else if(comName != nullptr && strcmp(comName, "CCComAttribute") == 0) + { + ComAttribute *pAttribute = nullptr; + if (nResType == 0) + { + pAttribute = ComAttribute::create(); + } + else + { + CCLOG("unknown resourcetype on CCComAttribute!"); + continue; + } + pAttribute->parse(pPath); + gb->addComponent(pAttribute); + if(_fnSelector != nullptr) + { + _fnSelector(pAttribute, (void*)(&subDict)); + } + } + else if (comName != nullptr && strcmp(comName, "CCBackgroundAudio") == 0) + { + ComAudio *pAudio = nullptr; + if (nResType == 0) + { + pAudio = ComAudio::create(); + } + else + { + continue; + } + pAudio->preloadBackgroundMusic(pPath.c_str()); + pAudio->setFile(pPath.c_str()); + const bool bLoop = (DICTOOL->getIntValue_json(subDict, "loop") != 0); + pAudio->setLoop(bLoop); + if (pComName != nullptr) + { + pAudio->setName(pComName); + } + gb->addComponent(pAudio); + if (pComName != nullptr) + { + pAudio->setName(pComName); + } + pAudio->playBackgroundMusic(pPath.c_str(), bLoop); + } + else if(comName != nullptr && strcmp(comName, "GUIComponent") == 0) + { + Widget* widget= GUIReader::shareReader()->widgetFromJsonFile(pPath.c_str()); + ComRender *pRender = ComRender::create(widget, "GUIComponent"); + if (pComName != nullptr) + { + pRender->setName(pComName); + } + gb->addComponent(pRender); + if(_fnSelector != nullptr) + { + _fnSelector(widget, (void*)(&subDict)); + } + } + } + + int length = DICTOOL->getArrayCount_json(dict, "gameobjects"); + for (int i = 0; i < length; ++i) + { + const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(dict, "gameobjects", i); + if (!DICTOOL->checkObjectExist_json(subDict)) + { + break; + } + createObject(subDict, gb); } + return gb; + } + + return nullptr; +} + +void SceneReader::setTarget(std::function selector) +{ + _fnSelector = selector; +} + +Node* SceneReader::getNodeByTag(int nTag) +{ + if (_node == nullptr) + { return nullptr; } - - void SceneReader::setTarget(Object *rec, SEL_CallFuncOD selector) - { - _listener = rec; - _fnSelector = selector; - } - - Node* SceneReader::getNodeByTag(int nTag) - { - if (_node == NULL) - { - return NULL; - } - if (_node->getTag() == nTag) - { - return _node; - } - return nodeByTag(_node, nTag); - } - - void SceneReader::setPropertyFromJsonDict(const rapidjson::Value &root, cocos2d::Node *node) + if (_node->getTag() == nTag) { - float x = DICTOOL->getFloatValue_json(root, "x"); - float y = DICTOOL->getFloatValue_json(root, "y"); - node->setPosition(Point(x, y)); - - const bool bVisible = (DICTOOL->getIntValue_json(root, "visible", 1) != 0); - node->setVisible(bVisible); - - int nTag = DICTOOL->getIntValue_json(root, "objecttag", -1); - node->setTag(nTag); - - int nZorder = DICTOOL->getIntValue_json(root, "zorder"); - node->setZOrder(nZorder); - - float fScaleX = DICTOOL->getFloatValue_json(root, "scalex", 1.0); - float fScaleY = DICTOOL->getFloatValue_json(root, "scaley", 1.0); - node->setScaleX(fScaleX); - node->setScaleY(fScaleY); - - float fRotationZ = DICTOOL->getFloatValue_json(root, "rotation"); - node->setRotation(fRotationZ); + return _node; } + return nodeByTag(_node, nTag); +} - SceneReader* SceneReader::getInstance() - { - if (s_sharedReader == nullptr) - { - s_sharedReader = new SceneReader(); - } - return s_sharedReader; - } +void SceneReader::setPropertyFromJsonDict(const rapidjson::Value &root, cocos2d::Node *node) +{ + float x = DICTOOL->getFloatValue_json(root, "x"); + float y = DICTOOL->getFloatValue_json(root, "y"); + node->setPosition(Point(x, y)); + + const bool bVisible = (DICTOOL->getIntValue_json(root, "visible", 1) != 0); + node->setVisible(bVisible); + + int nTag = DICTOOL->getIntValue_json(root, "objecttag", -1); + node->setTag(nTag); + + int nZorder = DICTOOL->getIntValue_json(root, "zorder"); + node->setZOrder(nZorder); + + float fScaleX = DICTOOL->getFloatValue_json(root, "scalex", 1.0); + float fScaleY = DICTOOL->getFloatValue_json(root, "scaley", 1.0); + node->setScaleX(fScaleX); + node->setScaleY(fScaleY); + + float fRotationZ = DICTOOL->getFloatValue_json(root, "rotation"); + node->setRotation(fRotationZ); +} - void SceneReader::destroyInstance() +SceneReader* SceneReader::getInstance() +{ + if (s_sharedReader == nullptr) { - DictionaryHelper::destroyInstance(); - TriggerMng::destroyInstance(); - _fnSelector = nullptr; - _listener = nullptr; - CocosDenshion::SimpleAudioEngine::end(); - CC_SAFE_DELETE(s_sharedReader); + s_sharedReader = new SceneReader(); } + return s_sharedReader; +} + +void SceneReader::destroyInstance() +{ + DictionaryHelper::destroyInstance(); + TriggerMng::destroyInstance(); + _fnSelector = nullptr; + CocosDenshion::SimpleAudioEngine::end(); + CC_SAFE_DELETE(s_sharedReader); +} } diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.h b/cocos/editor-support/cocostudio/CCSSceneReader.h index 3dbe1644bf..2713bded36 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/CCSSceneReader.h @@ -56,7 +56,7 @@ public: void destroyInstance(); static const char* sceneReaderVersion(); cocos2d::Node* createNodeWithSceneFile(const std::string &fileName); - void setTarget(cocos2d::Object *rec, SEL_CallFuncOD selector); + void setTarget(std::function selector); cocos2d::Node* getNodeByTag(int nTag); private: cocos2d::Node* createObject(const rapidjson::Value& dict, cocos2d::Node* parent); @@ -65,8 +65,7 @@ private: cocos2d::Node* nodeByTag(cocos2d::Node *parent, int tag); private: static SceneReader* s_sharedReader; - cocos2d::Object* _listener; - SEL_CallFuncOD _fnSelector; + std::function _fnSelector; cocos2d::Node* _node; }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp index 2a729ff1f2..1511b8193f 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp @@ -29,7 +29,7 @@ void SceneController::onEnter() _fAddTargetTime = 1.0f; static_cast(_owner->getComponent("Audio"))->playBackgroundMusic("background-music-aac.wav", true); - static_cast(_owner->getComponent("ComAttribute"))->setInt("KillCount", 0); + static_cast(_owner->getComponent("CCComAttribute"))->setInt("KillCount", 0); } void SceneController::onExit() diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index f253a381c0..3be166b271 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -292,11 +292,11 @@ cocos2d::Node* SpriteComponentTest::createGameScene() ActionInterval* action1 = CCBlink::create(2, 10); ActionInterval* action2 = CCBlink::create(2, 5); - Sprite *pSister1 = static_cast(node->getChildByTag(10003)->getComponent("CCSprite")->getNode()); - pSister1->runAction(action1); + ComRender *pSister1 = static_cast(node->getChildByTag(10003)->getComponent("CCSprite")); + pSister1->getNode()->runAction(action1); - Sprite *pSister2 = static_cast(node->getChildByTag(10004)->getComponent("CCSprite")->getNode()); - pSister2->runAction(action2); + ComRender *pSister2 = static_cast(node->getChildByTag(10004)->getComponent("CCSprite")); + pSister2->getNode()->runAction(action2); return node; } @@ -343,11 +343,11 @@ cocos2d::Node* ArmatureComponentTest::createGameScene() { return nullptr; } - Armature *pBlowFish = static_cast(node->getChildByTag(10007)->getComponent("CCArmature")->getNode()); - pBlowFish->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); + ComRender *pBlowFish = static_cast(node->getChildByTag(10007)->getComponent("CCArmature")); + pBlowFish->getNode()->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); - Armature *pButterflyfish = static_cast(node->getChildByTag(10008)->getComponent("CCArmature")->getNode()); - pButterflyfish->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); + ComRender *pButterflyfish = static_cast(node->getChildByTag(10008)->getComponent("CCArmature")); + pButterflyfish->getNode()->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); return node; } @@ -396,7 +396,8 @@ cocos2d::Node* UIComponentTest::createGameScene() } _node = node; - Widget* widget = static_cast(_node->getChildByTag(10025)->getComponent("GUIComponent")->getNode()); + ComRender *render = static_cast(_node->getChildByTag(10025)->getComponent("GUIComponent")); + Widget* widget = static_cast(render->getNode()); Button* button = static_cast(widget->getChildByName("Button_156")); button->addTouchEventListener(this, toucheventselector(UIComponentTest::touchEvent)); @@ -409,11 +410,11 @@ void UIComponentTest::touchEvent(Object *pSender, TouchEventType type) { case TOUCH_EVENT_BEGAN: { - Armature *pBlowFish = static_cast(_node->getChildByTag(10010)->getComponent("Armature")->getNode()); - pBlowFish->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); + ComRender *pBlowFish = static_cast(_node->getChildByTag(10010)->getComponent("Armature")); + pBlowFish->getNode()->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); - Armature *pButterflyfish = static_cast(_node->getChildByTag(10011)->getComponent("Armature")->getNode()); - pButterflyfish->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); + ComRender *pButterflyfish = static_cast(_node->getChildByTag(10011)->getComponent("Armature")); + pButterflyfish->getNode()->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); } break; default: @@ -463,7 +464,7 @@ cocos2d::Node* TmxMapComponentTest::createGameScene() { return nullptr; } - TMXTiledMap *tmxMap = static_cast(node->getChildByTag(10015)->getComponent("CCTMXTiledMap")->getNode()); + ComRender *tmxMap = static_cast(node->getChildByTag(10015)->getComponent("CCTMXTiledMap")); ActionInterval *actionTo = SkewTo::create(2, 0.f, 2.f); ActionInterval *rotateTo = RotateTo::create(2, 61.0f); ActionInterval *actionScaleTo = ScaleTo::create(2, -0.44f, 0.47f); @@ -472,9 +473,9 @@ cocos2d::Node* TmxMapComponentTest::createGameScene() ActionInterval *rotateToBack = RotateTo::create(2, 0); ActionInterval *actionToBack = SkewTo::create(2, 0, 0); - tmxMap->runAction(Sequence::create(actionTo, actionToBack, nullptr)); - tmxMap->runAction(Sequence::create(rotateTo, rotateToBack, nullptr)); - tmxMap->runAction(Sequence::create(actionScaleTo, actionScaleToBack, nullptr)); + tmxMap->getNode()->runAction(Sequence::create(actionTo, actionToBack, nullptr)); + tmxMap->getNode()->runAction(Sequence::create(rotateTo, rotateToBack, nullptr)); + tmxMap->getNode()->runAction(Sequence::create(actionScaleTo, actionScaleToBack, nullptr)); return node; } @@ -520,10 +521,10 @@ cocos2d::Node* ParticleComponentTest::createGameScene() return nullptr; } - ParticleSystemQuad* Particle = static_cast(node->getChildByTag(10020)->getComponent("CCParticleSystemQuad")->getNode()); + ComRender* Particle = static_cast(node->getChildByTag(10020)->getComponent("CCParticleSystemQuad")); ActionInterval* jump = JumpBy::create(5, Point(-500,0), 50, 4); FiniteTimeAction* action = Sequence::create( jump, jump->reverse(), nullptr); - Particle->runAction(action); + Particle->getNode()->runAction(action); return node; } @@ -571,7 +572,8 @@ cocos2d::Node* EffectComponentTest::createGameScene() return nullptr; } _node = node; - Armature *pAr = static_cast(_node->getChildByTag(10015)->getComponent("CCArmature")->getNode()); + ComRender *render = static_cast(_node->getChildByTag(10015)->getComponent("CCArmature")); + Armature *pAr = static_cast(render->getNode()); pAr->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(EffectComponentTest::animationEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); return node; } @@ -682,20 +684,7 @@ bool AttributeComponentTest::initData() CC_BREAK_IF(_node == nullptr); ComAttribute *attribute = static_cast(_node->getChildByTag(10015)->getComponent("CCComAttribute")); CC_BREAK_IF(attribute == nullptr); - std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(attribute->getJsonFile()); - std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath); - doc.Parse<0>(contentStr.c_str()); - CC_BREAK_IF(doc.HasParseError()); - - std::string playerName = DICTOOL->getStringValue_json(doc, "name"); - float maxHP = DICTOOL->getFloatValue_json(doc, "maxHP"); - float maxMP = DICTOOL->getFloatValue_json(doc, "maxMP"); - - attribute->setString("Name", playerName); - attribute->setFloat("MaxHP", maxHP); - attribute->setFloat("MaxMP", maxMP); - - log("Name: %s, HP: %f, MP: %f", attribute->getString("Name").c_str(), attribute->getFloat("MaxHP"), attribute->getFloat("MaxMP")); + log("Name: %s, HP: %f, MP: %f", attribute->getString("name").c_str(), attribute->getFloat("maxHP"), attribute->getFloat("maxMP")); bRet = true; } while (0); From 126c315673c55f8c7ee04d7880280bc1a5ae6866 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 3 Jan 2014 11:32:54 +0000 Subject: [PATCH 165/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 24265e82aa..7da441dcdb 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 24265e82aa5e64b6a344a7634e3987e298c0f45d +Subproject commit 7da441dcdb1ae69e88d85e7c1101b7c3f656f939 From d75d2159dd6cb6234c50f1fb42aa2fcee967ad3a Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Fri, 3 Jan 2014 19:53:14 +0800 Subject: [PATCH 166/428] fix control switch bug --- .../CCControlExtension/CCControlSwitch.cpp | 72 +++++++------------ 1 file changed, 25 insertions(+), 47 deletions(-) diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp index 13b2329579..f583398f06 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp @@ -43,11 +43,6 @@ public: LabelTTF* onLabel, LabelTTF* offLabel); - /** - * @js NA - * @lua NA - */ - void draw() override; /** * @js NA * @lua NA @@ -93,6 +88,8 @@ public: CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) CC_SYNTHESIZE_RETAIN(LabelTTF*, _onLabel, OnLabel) CC_SYNTHESIZE_RETAIN(LabelTTF*, _offLabel, OffLabel) + + Sprite* _clipperStencil; protected: /** @@ -116,7 +113,6 @@ protected: Sprite *thumbSprite, LabelTTF* onLabel, LabelTTF* offLabel); - private: CC_DISALLOW_COPY_AND_ASSIGN(ControlSwitchSprite); }; @@ -146,6 +142,7 @@ ControlSwitchSprite::ControlSwitchSprite() , _thumbSprite(NULL) , _onLabel(NULL) , _offLabel(NULL) +, _clipperStencil(nullptr) { } @@ -158,6 +155,7 @@ ControlSwitchSprite::~ControlSwitchSprite() CC_SAFE_RELEASE(_onLabel); CC_SAFE_RELEASE(_offLabel); CC_SAFE_RELEASE(_maskTexture); + CC_SAFE_RELEASE(_clipperStencil); } bool ControlSwitchSprite::initWithMaskSprite( @@ -180,8 +178,24 @@ bool ControlSwitchSprite::initWithMaskSprite( setThumbSprite(thumbSprite); setOnLabel(onLabel); setOffLabel(offLabel); - - addChild(_thumbSprite); + //setOnSprite(nullptr); + //setOffSprite(nullptr); + //setOnLabel(nullptr); + //setOffLabel(nullptr); + ClippingNode* clipper = ClippingNode::create(); + _clipperStencil = Sprite::createWithTexture(maskSprite->getTexture()); + _clipperStencil->retain(); + clipper->setAlphaThreshold(0.1f); + + clipper->setStencil(_clipperStencil); + + clipper->addChild(thumbSprite); + clipper->addChild(onSprite); + clipper->addChild(offSprite); + clipper->addChild(onLabel); + clipper->addChild(offLabel); + + addChild(clipper); // Set up the mask with the Mask shader setMaskTexture(maskSprite->getTexture()); @@ -221,45 +235,6 @@ void ControlSwitchSprite::updateTweenAction(float value, const std::string& key) setSliderXPosition(value); } -void ControlSwitchSprite::draw() -{ - CC_NODE_DRAW_SETUP(); - - GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX); - GL::blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - getShaderProgram()->setUniformsForBuiltins(); - - GL::bindTexture2DN(0, getTexture()->getName()); - glUniform1i(_textureLocation, 0); - - GL::bindTexture2DN(1, _maskTexture->getName()); - glUniform1i(_maskLocation, 1); - -#define kQuadSize sizeof(_quad.bl) -#ifdef EMSCRIPTEN - long offset = 0; - setGLBufferData(&_quad, 4 * kQuadSize, 0); -#else - long offset = (long)&_quad; -#endif // EMSCRIPTEN - - // vertex - int diff = offsetof( V3F_C4B_T2F, vertices); - glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff)); - - // texCoods - diff = offsetof( V3F_C4B_T2F, texCoords); - glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff)); - - // color - diff = offsetof( V3F_C4B_T2F, colors); - glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff)); - - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - - GL::bindTexture2DN(0, 0); -} - void ControlSwitchSprite::needsLayout() { _onSprite->setPosition(Point(_onSprite->getContentSize().width / 2 + _sliderXPosition, @@ -269,6 +244,9 @@ void ControlSwitchSprite::needsLayout() _thumbSprite->setPosition(Point(_onSprite->getContentSize().width + _sliderXPosition, _maskTexture->getContentSize().height / 2)); + _clipperStencil->setPosition(Point(_maskTexture->getContentSize().width/2, + _maskTexture->getContentSize().height / 2)); + if (_onLabel) { _onLabel->setPosition(Point(_onSprite->getPosition().x - _thumbSprite->getContentSize().width / 6, From 785e1740e4d32ce501986f324cfd1e6d8d06de07 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Fri, 3 Jan 2014 20:29:16 +0800 Subject: [PATCH 167/428] Add "addNode" methods --- cocos/gui/UIWidget.cpp | 72 ++++++++++++++++++- cocos/gui/UIWidget.h | 17 +++++ .../UIWidgetAddNodeTest.cpp | 2 +- 3 files changed, 89 insertions(+), 2 deletions(-) diff --git a/cocos/gui/UIWidget.cpp b/cocos/gui/UIWidget.cpp index 11a5c1dbf7..dfae39662e 100644 --- a/cocos/gui/UIWidget.cpp +++ b/cocos/gui/UIWidget.cpp @@ -66,7 +66,8 @@ Widget::~Widget() _touchEventListener = nullptr; _touchEventSelector = nullptr; _widgetChildren.clear(); - CC_SAFE_RELEASE(_touchListener); + setTouchEnabled(false); + _nodes.clear(); } Widget* Widget::create() @@ -251,6 +252,75 @@ Widget* Widget::getChildByName(const char *name) } return nullptr; } + +void Widget::addNode(Node* node) +{ + addNode(node, node->getZOrder(), node->getTag()); +} + +void Widget::addNode(Node * node, int zOrder) +{ + addNode(node, zOrder, node->getTag()); +} + +void Widget::addNode(Node* node, int zOrder, int tag) +{ + CCAssert(dynamic_cast(node) == NULL, "Widget only supports Nodes as renderer"); + Node::addChild(node, zOrder, tag); + _nodes.pushBack(node); +} + +Node* Widget::getNodeByTag(int tag) +{ + CCAssert( tag != Node::INVALID_TAG, "Invalid tag"); + + for (auto& node : _nodes) + { + if(node && node->getTag() == tag) + return node; + } + return nullptr; +} + +Vector& Widget::getNodes() +{ + return _nodes; +} + +void Widget::removeNode(Node* node) +{ + Node::removeChild(node); + _nodes.eraseObject(node); +} + +void Widget::removeNodeByTag(int tag) +{ + CCAssert( tag != Node::INVALID_TAG, "Invalid tag"); + + Node *node = this->getNodeByTag(tag); + + if (node == NULL) + { + CCLOG("cocos2d: removeNodeByTag(tag = %d): child not found!", tag); + } + else + { + this->removeNode(node); + } +} + +void Widget::removeAllNodes() +{ + for (auto& node : _nodes) + { + if (node) + { + Node::removeChild(node); + } + } + _nodes.clear(); +} + void Widget::initRenderer() { diff --git a/cocos/gui/UIWidget.h b/cocos/gui/UIWidget.h index f48210038e..62b3f19279 100644 --- a/cocos/gui/UIWidget.h +++ b/cocos/gui/UIWidget.h @@ -315,6 +315,22 @@ public: */ virtual Widget* getChildByName(const char* name); + virtual void addNode(Node* node); + + virtual void addNode(Node * node, int zOrder); + + virtual void addNode(Node* node, int zOrder, int tag); + + virtual Node * getNodeByTag(int tag); + + virtual Vector& getNodes(); + + virtual void removeNode(Node* node); + + virtual void removeNodeByTag(int tag); + + virtual void removeAllNodes(); + virtual void visit() override; /** @@ -684,6 +700,7 @@ protected: EventListenerTouchOneByOne* _touchListener; Map _layoutParameterDictionary; Vector _widgetChildren; + Vector _nodes; }; } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp index d0570b57d9..66dd77838e 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp @@ -36,7 +36,7 @@ bool UIWidgetAddNodeTest::init() Sprite* sprite = Sprite::create("cocosgui/ccicon.png"); sprite->setPosition(Point(0, sprite->getBoundingBox().size.height / 4)); -// widget->addRenderer(sprite, 0); + widget->addNode(sprite, 0); return true; } From a6b70bef834a4d1fae89e126198d0c9d2c1bf50e Mon Sep 17 00:00:00 2001 From: chengstory Date: Fri, 3 Jan 2014 20:33:07 +0800 Subject: [PATCH 168/428] fixed #3480 loadSceneEdtiorFileTest -> LoadSceneEdtiorFileTest --- .../CocoStudioSceneTest/SceneEditorTest.cpp | 16 ++++++++-------- .../CocoStudioSceneTest/SceneEditorTest.h | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index 3be166b271..d0d057fe32 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -23,7 +23,7 @@ Layer *createTests(int index) switch(index) { case TEST_LOADSCENEEDITORFILE: - layer = new loadSceneEdtiorFileTest(); + layer = new LoadSceneEdtiorFileTest(); break; case TEST_SPIRTECOMPONENT: layer = new SpriteComponentTest(); @@ -200,22 +200,22 @@ void SceneEditorTestLayer::draw() } -loadSceneEdtiorFileTest::loadSceneEdtiorFileTest() +LoadSceneEdtiorFileTest::LoadSceneEdtiorFileTest() { } -loadSceneEdtiorFileTest::~loadSceneEdtiorFileTest() +LoadSceneEdtiorFileTest::~LoadSceneEdtiorFileTest() { } -std::string loadSceneEdtiorFileTest::title() +std::string LoadSceneEdtiorFileTest::title() { return "loadSceneEdtiorFile Test"; } -void loadSceneEdtiorFileTest::onEnter() +void LoadSceneEdtiorFileTest::onEnter() { SceneEditorTestLayer::onEnter(); do @@ -226,7 +226,7 @@ void loadSceneEdtiorFileTest::onEnter() } while (0); } -void loadSceneEdtiorFileTest::onExit() +void LoadSceneEdtiorFileTest::onExit() { ArmatureDataManager::getInstance()->destroyInstance(); SceneReader::getInstance()->destroyInstance(); @@ -236,9 +236,9 @@ void loadSceneEdtiorFileTest::onExit() } -cocos2d::Node* loadSceneEdtiorFileTest::createGameScene() +cocos2d::Node* LoadSceneEdtiorFileTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/loadSceneEdtiorFileTest/FishJoy2.json"); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/LoadSceneEdtiorFileTest/FishJoy2.json"); if (node == nullptr) { return nullptr; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h index 0b7076f7af..68f08bac2f 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h @@ -51,11 +51,11 @@ protected: MenuItemImage *backItem; }; -class loadSceneEdtiorFileTest : public SceneEditorTestLayer +class LoadSceneEdtiorFileTest : public SceneEditorTestLayer { public: - loadSceneEdtiorFileTest(); - ~loadSceneEdtiorFileTest(); + LoadSceneEdtiorFileTest(); + ~LoadSceneEdtiorFileTest(); virtual std::string title(); virtual void onEnter(); From 8c5678a59e9ef5b60a5d90d32ebcb20aedcbc2f6 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Fri, 3 Jan 2014 20:35:14 +0800 Subject: [PATCH 169/428] Modify wrong codes. --- cocos/gui/UIWidget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/gui/UIWidget.cpp b/cocos/gui/UIWidget.cpp index dfae39662e..6b68087843 100644 --- a/cocos/gui/UIWidget.cpp +++ b/cocos/gui/UIWidget.cpp @@ -128,7 +128,7 @@ void Widget::addChild(Node * child, int zOrder) void Widget::addChild(Node* child, int zOrder, int tag) { - CCASSERT(dynamic_cast(child) != NULL, "Widget only supports Widgets as children"); + CCASSERT(dynamic_cast(child) != nullptr, "Widget only supports Widgets as children"); Node::addChild(child, zOrder, tag); _widgetChildren.pushBack(child); } @@ -198,7 +198,7 @@ void Widget::removeChildByTag(int tag, bool cleanup) Node *child = getChildByTag(tag); - if (child == NULL) + if (child == nullptr) { CCLOG("cocos2d: removeChildByTag(tag = %d): child not found!", tag); } @@ -265,7 +265,7 @@ void Widget::addNode(Node * node, int zOrder) void Widget::addNode(Node* node, int zOrder, int tag) { - CCAssert(dynamic_cast(node) == NULL, "Widget only supports Nodes as renderer"); + CCAssert(dynamic_cast(node) == nullptr, "Widget only supports Nodes as renderer"); Node::addChild(node, zOrder, tag); _nodes.pushBack(node); } @@ -299,7 +299,7 @@ void Widget::removeNodeByTag(int tag) Node *node = this->getNodeByTag(tag); - if (node == NULL) + if (node == nullptr) { CCLOG("cocos2d: removeNodeByTag(tag = %d): child not found!", tag); } From b4d392dc38794e0960b38d49eee09eb30f25ab14 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 3 Jan 2014 21:33:48 +0800 Subject: [PATCH 170/428] update js binding for studio change. --- .../cocos2d_specifics.cpp.REMOVED.git-id | 2 +- .../javascript/script/jsb_cocos2d.js | 84 ++++++++++++++++++- tools/tojs/cocos2dx.ini | 3 +- tools/tojs/cocos2dx_studio.ini | 8 +- 4 files changed, 91 insertions(+), 6 deletions(-) diff --git a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id index bed1d27c2b..0461b27c7d 100644 --- a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id +++ b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id @@ -1 +1 @@ -0690676c834cdda681e69a387225425f186a0cc6 \ No newline at end of file +9f5dda004e2659caf1fc9f9032e7b386754c7200 \ No newline at end of file diff --git a/cocos/scripting/javascript/script/jsb_cocos2d.js b/cocos/scripting/javascript/script/jsb_cocos2d.js index a79f189c8d..d119c670f6 100644 --- a/cocos/scripting/javascript/script/jsb_cocos2d.js +++ b/cocos/scripting/javascript/script/jsb_cocos2d.js @@ -142,8 +142,34 @@ cc.log = cc._cocosplayerLog || cc.log || log; // cc.c3b = function( r, g, b ) { - return {r:r, g:g, b:b }; + switch (arguments.length) { + case 0: + return {r:0, g:0, b:0 }; + case 1: + if (r && r instanceof cc.c3b) { + return {r:r.r, g:r.g, b:r.b }; + } else { + return {r:0, g:0, b:0 }; + } + case 3: + return {r:r, g:g, b:b }; + default: + throw "unknown argument type"; + break; + } }; + +cc.integerToColor3B = function (intValue) { + intValue = intValue || 0; + + var offset = 0xff; + var retColor = {r:0, g:0, b:0 }; + retColor.r = intValue & (offset); + retColor.g = (intValue >> 8) & offset; + retColor.b = (intValue >> 16) & offset; + return retColor; +}; + cc._c3b = function( r, g, b ) { cc._reuse_color3b.r = r; @@ -152,6 +178,46 @@ cc._c3b = function( r, g, b ) return cc._reuse_color3b; }; +cc.c3BEqual = function(color1, color2){ + return color1.r === color2.r && color1.g === color2.g && color1.b === color2.b; +}; + +cc.white = function () { + return cc.c3b(255, 255, 255); +}; + +cc.yellow = function () { + return cc.c3b(255, 255, 0); +}; + +cc.blue = function () { + return cc.c3b(0, 0, 255); +}; + +cc.green = function () { + return cc.c3b(0, 255, 0); +}; + +cc.red = function () { + return cc.c3b(255, 0, 0); +}; + +cc.magenta = function () { + return cc.c3b(255, 0, 255); +}; + +cc.black = function () { + return cc.c3b(0, 0, 0); +}; + +cc.orange = function () { + return cc.c3b(255, 127, 0); +}; + +cc.gray = function () { + return cc.c3b(166, 166, 166); +}; + // // Color 4B // @@ -193,6 +259,22 @@ cc.c4f = function( r, g, b, a ) return {r:r, g:g, b:b, a:a }; }; +cc.c4FFromccc3B = function (c) { + return cc.c4f(c.r / 255.0, c.g / 255.0, c.b / 255.0, 1.0); +}; + +cc.c4FFromccc4B = function (c) { + return cc.c4f(c.r / 255.0, c.g / 255.0, c.b / 255.0, c.a / 255.0); +}; + +cc.c4BFromccc4F = function (c) { + return cc.c4f(0 | (c.r * 255), 0 | (c.g * 255), 0 | (c.b * 255), 0 | (c.a * 255)); +}; + +cc.c4FEqual = function (a, b) { + return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a; +}; + // // Point // diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index 11487a4d71..99f57b9e8e 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -37,8 +37,9 @@ classes_need_extend = Node Layer.* Sprite MenuItemFont Scene DrawNode # will apply to all class names. This is a convenience wildcard to be able to skip similar named # functions from all classes. -skip = Node::[^setPosition$ setGrid setGLServerState description getUserObject .*UserData getGLServerState .*schedule setContentSize setAnchorPoint], +skip = Node::[^setPosition$ setGLServerState description getUserObject .*UserData getGLServerState .*schedule setContentSize setAnchorPoint], Sprite::[getQuad getBlendFunc ^setPosition$ setBlendFunc], + NodeGrid::[setGrid], SpriteBatchNode::[getBlendFunc setBlendFunc getDescendants], MotionStreak::[getBlendFunc setBlendFunc draw update], AtlasNode::[getBlendFunc setBlendFunc], diff --git a/tools/tojs/cocos2dx_studio.ini b/tools/tojs/cocos2dx_studio.ini index c071886085..e69b174823 100644 --- a/tools/tojs/cocos2dx_studio.ini +++ b/tools/tojs/cocos2dx_studio.ini @@ -27,7 +27,7 @@ headers = %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager InputDelegate ComController ComAudio ComAttribute ComRender ActionManagerEx SceneReader GUIReader BatchNode ActionObject BaseData Tween ColliderFilter DisplayManager +classes = Armature ArmatureAnimation Skin Bone ColliderDetector ColliderBody ArmatureDataManager InputDelegate ComController ComAudio ComAttribute ComRender ActionManagerEx SceneReader GUIReader BatchNode ActionObject BaseData Tween ColliderFilter DisplayManager # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -52,7 +52,9 @@ skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*H Tween::[(s|g)etMovementBoneData], DisplayManager::[initDisplayList (s|g)etCurrentDecorativeDisplay getDecorativeDisplayByIndex], ActionNode::[initWithDictionary], - ActionObject::[initWithDictionary] + ActionObject::[initWithDictionary], + ColliderDetector::[addContourData.* removeContourData], + ColliderBody::[getContourData] rename_functions = ActionManagerEx::[shareManager=getInstance purgeActionManager=purge], SceneReader::[purgeSceneReader=purge], @@ -71,7 +73,7 @@ base_classes_to_skip = Object ProcessBase # classes that create no constructor # Set is special and we will use a hand-written constructor -abstract_classes = ArmatureDataManager ComAttribute InputDelegate ComRender ComAudio InputDelegate ActionManagerEx SceneReader GUIReader BatchNode ColliderFilter +abstract_classes = ColliderDetector ColliderBody ArmatureDataManager ComAttribute InputDelegate ComRender ComAudio InputDelegate ActionManagerEx SceneReader GUIReader BatchNode ColliderFilter # Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. script_control_cpp = no From b6e676caa4005dbc4173c9e2b21daa83104f28b6 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 3 Jan 2014 23:03:48 +0800 Subject: [PATCH 171/428] fix warn and compiling error in jsb_cocos2dx_studio_manual.cpp. --- .../cocostudio/jsb_cocos2dx_studio_manual.cpp | 62 +++++++++++++++---- tools/tojs/cocos2dx_studio.ini | 2 +- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.cpp b/cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.cpp index 183da6c04b..a46b40d754 100644 --- a/cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.cpp +++ b/cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.cpp @@ -16,8 +16,8 @@ public: virtual void setJSCallbackThis(jsval thisObj); - void movementCallbackFunc(cocostudio::Armature * pArmature, cocostudio::MovementEventType pMovementEventType, const char *pMovementId); - void frameCallbackFunc(cocostudio::Bone *pBone, const char *frameEventName, int originFrameIndex, int currentFrameIndex); + void movementCallbackFunc(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const std::string& movementID); + void frameCallbackFunc(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex); void addArmatureFileInfoAsyncCallbackFunc(float percent); private: @@ -54,18 +54,18 @@ void JSArmatureWrapper::setJSCallbackThis(jsval _jsThisObj) } } -void JSArmatureWrapper::movementCallbackFunc(cocostudio::Armature *pArmature, cocostudio::MovementEventType pMovementEventType, const char *pMovementId) +void JSArmatureWrapper::movementCallbackFunc(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const std::string& movementID) { JSContext *cx = ScriptingCore::getInstance()->getGlobalContext(); JSObject *thisObj = JSVAL_IS_VOID(_jsThisObj) ? NULL : JSVAL_TO_OBJECT(_jsThisObj); - js_proxy_t *proxy = js_get_or_create_proxy(cx, pArmature); + js_proxy_t *proxy = js_get_or_create_proxy(cx, armature); jsval retval; if (_jsCallback != JSVAL_VOID) { - int movementEventType = (int)pMovementEventType; + int movementEventType = (int)movementType; jsval movementVal = INT_TO_JSVAL(movementEventType); - jsval idVal = c_string_to_jsval(cx, pMovementId); + jsval idVal = std_string_to_jsval(cx, movementID); jsval valArr[3]; valArr[0] = OBJECT_TO_JSVAL(proxy->obj); @@ -100,17 +100,17 @@ void JSArmatureWrapper::addArmatureFileInfoAsyncCallbackFunc(float percent) } -void JSArmatureWrapper::frameCallbackFunc(cocostudio::Bone *pBone, const char *frameEventName, int originFrameIndex, int currentFrameIndex) +void JSArmatureWrapper::frameCallbackFunc(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex) { JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET JSContext *cx = ScriptingCore::getInstance()->getGlobalContext(); JSObject *thisObj = JSVAL_IS_VOID(_jsThisObj) ? NULL : JSVAL_TO_OBJECT(_jsThisObj); - js_proxy_t *proxy = js_get_or_create_proxy(cx, pBone); + js_proxy_t *proxy = js_get_or_create_proxy(cx, bone); jsval retval; if (_jsCallback != JSVAL_VOID) { - jsval nameVal = c_string_to_jsval(cx, frameEventName); + jsval nameVal = std_string_to_jsval(cx, evt); jsval originIndexVal = INT_TO_JSVAL(originFrameIndex); jsval currentIndexVal = INT_TO_JSVAL(currentFrameIndex); @@ -144,8 +144,8 @@ static JSBool js_cocos2dx_ArmatureAnimation_setMovementEventCallFunc(JSContext * tmpObj->setJSCallbackFunc(argv[0]); tmpObj->setJSCallbackThis(argv[1]); - cobj->setMovementEventCallFunc(tmpObj, movementEvent_selector(JSArmatureWrapper::movementCallbackFunc)); - + cobj->setMovementEventCallFunc(CC_CALLBACK_0(JSArmatureWrapper::movementCallbackFunc, tmpObj, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + return JS_TRUE; } JS_ReportError(cx, "Invalid number of arguments"); @@ -169,7 +169,7 @@ static JSBool js_cocos2dx_ArmatureAnimation_setFrameEventCallFunc(JSContext *cx, tmpObj->setJSCallbackFunc(argv[0]); tmpObj->setJSCallbackThis(argv[1]); - cobj->setFrameEventCallFunc(tmpObj, frameEvent_selector(JSArmatureWrapper::frameCallbackFunc)); + cobj->setFrameEventCallFunc(CC_CALLBACK_0(JSArmatureWrapper::frameCallbackFunc, tmpObj, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); return JS_TRUE; } @@ -227,11 +227,49 @@ static JSBool jsb_Animation_addArmatureFileInfoAsyncCallFunc(JSContext *cx, uint return JS_FALSE; } +JSBool js_cocos2dx_studio_ColliderBody_getCalculatedVertexList(JSContext *cx, uint32_t argc, jsval *vp) +{ + JSObject *obj = JS_THIS_OBJECT(cx, vp); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocostudio::ColliderBody* cobj = (cocostudio::ColliderBody *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object"); + if (argc == 0) { + const std::vector& ret = cobj->getCalculatedVertexList(); + JSObject *jsretArr = JS_NewArrayObject(cx, 0, nullptr); + jsval jsret; + //CCObject* obj; + int i = 0; + for(std::vector::const_iterator it = ret.begin(); it != ret.end(); it++) + { + const cocos2d::Point& point = *it; + JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL); + if (!tmp) break; + JSBool ok = JS_DefineProperty(cx, tmp, "x", DOUBLE_TO_JSVAL(point.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) && + JS_DefineProperty(cx, tmp, "y", DOUBLE_TO_JSVAL(point.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT); + + if(!ok || !JS_SetElement(cx, jsretArr, i, &OBJECT_TO_JSVAL(tmp))) + { + break; + } + ++i; + } + jsret = OBJECT_TO_JSVAL(jsretArr); + JS_SET_RVAL(cx, vp, jsret); + return JS_TRUE; + } + + JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 0); + return JS_FALSE; +} + extern JSObject* jsb_cocostudio_ArmatureAnimation_prototype; extern JSObject* jsb_cocostudio_ArmatureDataManager_prototype; +extern JSObject* jsb_cocostudio_ColliderBody_prototype; void register_all_cocos2dx_studio_manual(JSContext* cx, JSObject* global) { + JS_DefineFunction(cx, jsb_cocostudio_ColliderBody_prototype, "getCalculatedVertexList", js_cocos2dx_studio_ColliderBody_getCalculatedVertexList, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT); + JS_DefineFunction(cx, jsb_cocostudio_ArmatureAnimation_prototype, "setMovementEventCallFunc", js_cocos2dx_ArmatureAnimation_setMovementEventCallFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT); JS_DefineFunction(cx, jsb_cocostudio_ArmatureAnimation_prototype, "setFrameEventCallFunc", js_cocos2dx_ArmatureAnimation_setFrameEventCallFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT); diff --git a/tools/tojs/cocos2dx_studio.ini b/tools/tojs/cocos2dx_studio.ini index e69b174823..5bcc9dfce3 100644 --- a/tools/tojs/cocos2dx_studio.ini +++ b/tools/tojs/cocos2dx_studio.ini @@ -54,7 +54,7 @@ skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*H ActionNode::[initWithDictionary], ActionObject::[initWithDictionary], ColliderDetector::[addContourData.* removeContourData], - ColliderBody::[getContourData] + ColliderBody::[getContourData getCalculatedVertexList] rename_functions = ActionManagerEx::[shareManager=getInstance purgeActionManager=purge], SceneReader::[purgeSceneReader=purge], From e017609fc45d34ae205c8b42c5c5c7fe41c54ff5 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 3 Jan 2014 23:59:05 +0800 Subject: [PATCH 172/428] fix compiling error in jsb_cocos2dx_studio_manual.cpp on android. --- .../bindings/cocostudio/jsb_cocos2dx_studio_manual.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.cpp b/cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.cpp index a46b40d754..b50022aba9 100644 --- a/cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.cpp +++ b/cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.cpp @@ -246,8 +246,8 @@ JSBool js_cocos2dx_studio_ColliderBody_getCalculatedVertexList(JSContext *cx, ui if (!tmp) break; JSBool ok = JS_DefineProperty(cx, tmp, "x", DOUBLE_TO_JSVAL(point.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) && JS_DefineProperty(cx, tmp, "y", DOUBLE_TO_JSVAL(point.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT); - - if(!ok || !JS_SetElement(cx, jsretArr, i, &OBJECT_TO_JSVAL(tmp))) + jsval jsTmp = OBJECT_TO_JSVAL(tmp); + if(!ok || !JS_SetElement(cx, jsretArr, i, &jsTmp)) { break; } From 43ce4fa546155d5b701f191460d6e0ed7aacf518 Mon Sep 17 00:00:00 2001 From: Dawid Drozd Date: Fri, 3 Jan 2014 21:22:05 +0100 Subject: [PATCH 173/428] Fixed mistake in documentation addImage doesn't support gif format --- cocos/2d/CCTextureCache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCTextureCache.h b/cocos/2d/CCTextureCache.h index 5b5c9ac95e..75e79cc878 100644 --- a/cocos/2d/CCTextureCache.h +++ b/cocos/2d/CCTextureCache.h @@ -105,7 +105,7 @@ public: * If the filename was not previously loaded, it will create a new Texture2D * object and it will return it. It will use the filename as a key. * Otherwise it will return a reference of a previously loaded image. - * Supported image extensions: .png, .bmp, .tiff, .jpeg, .pvr, .gif + * Supported image extensions: .png, .bmp, .tiff, .jpeg, .pvr */ Texture2D* addImage(const std::string &filepath); From b7314cd6551eb6443766a48f12253a794665335b Mon Sep 17 00:00:00 2001 From: Dawid Drozd Date: Fri, 3 Jan 2014 21:27:08 +0100 Subject: [PATCH 174/428] Fix for missing field in particle file. --- cocos/2d/CCParticleSystem.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index f7855ad799..6d2ceb649f 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -356,12 +356,9 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string& textureName = dirname + textureName; } } - else + else if ( dirname.size()>0 && textureName.empty() == false) { - if (dirname.size()>0) - { - textureName = dirname + textureName; - } + textureName = dirname + textureName; } Texture2D *tex = nullptr; From a7b33e3ec3a85962d1dab87b2f926e9dff113d20 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 3 Jan 2014 14:21:33 -0800 Subject: [PATCH 175/428] Fixes NodeToWorld Multiplication was in the incorrect order --- cocos/2d/CCNode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 3698d90cff..9d9f3a0527 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -1256,7 +1256,7 @@ kmMat4 Node::getNodeToWorldTransform() const kmMat4 t = this->getNodeToParentTransform(); for (Node *p = _parent; p != nullptr; p = p->getParent()) - kmMat4Multiply(&t, &t, &p->getNodeToParentTransform()); + kmMat4Multiply(&t, &p->getNodeToParentTransform(), &t); return t; } From 46153d8c34a3b846e2754c0781e7a99c040fda16 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 09:17:37 +0800 Subject: [PATCH 176/428] More warning fixes. --- cocos/2d/CCActionCatmullRom.cpp | 2 +- cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp | 4 ++-- cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp | 2 +- cocos/editor-support/cocostudio/CCInputDelegate.h | 8 ++++---- cocos/gui/UILayout.cpp | 2 +- cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cocos/2d/CCActionCatmullRom.cpp b/cocos/2d/CCActionCatmullRom.cpp index 0437eb90bf..db7e8e011a 100644 --- a/cocos/2d/CCActionCatmullRom.cpp +++ b/cocos/2d/CCActionCatmullRom.cpp @@ -134,7 +134,7 @@ void PointArray::insertControlPoint(Point &controlPoint, ssize_t index) Point PointArray::getControlPointAtIndex(ssize_t index) { - index = static_cast(MIN(_controlPoints->size()-1, MAX(index, 0))); + index = MIN(_controlPoints->size()-1, MAX(index, 0)); return *(_controlPoints->at(index)); } diff --git a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp index fa8905546b..b96a8c2ba5 100644 --- a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp +++ b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp @@ -501,7 +501,7 @@ void CCBAnimationManager::setAnimatedProperty(const std::string& propName, Node } else if (propName == "displayFrame") { - static_cast(pNode)->setDisplayFrame(static_cast(obj)); + static_cast(pNode)->setSpriteFrame(static_cast(obj)); } else if (propName == "color") { @@ -1002,7 +1002,7 @@ CCBSetSpriteFrame* CCBSetSpriteFrame::reverse() const void CCBSetSpriteFrame::update(float time) { - ((Sprite*)_target)->setDisplayFrame(_spriteFrame); + static_cast(_target)->setSpriteFrame(_spriteFrame); } diff --git a/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp b/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp index 34a2e7f549..0194ffd6b2 100644 --- a/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp @@ -13,7 +13,7 @@ namespace cocosbuilder { void SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_DISPLAYFRAME) == 0) { if(pSpriteFrame != NULL) { - ((Sprite *)pNode)->setDisplayFrame(pSpriteFrame); + ((Sprite *)pNode)->setSpriteFrame(pSpriteFrame); } else { CCLOG("ERROR: SpriteFrame NULL"); } diff --git a/cocos/editor-support/cocostudio/CCInputDelegate.h b/cocos/editor-support/cocostudio/CCInputDelegate.h index c41490a03f..215fa0b21c 100644 --- a/cocos/editor-support/cocostudio/CCInputDelegate.h +++ b/cocos/editor-support/cocostudio/CCInputDelegate.h @@ -80,19 +80,19 @@ public: /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(cocos2d::__Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(cocos2d::__Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(cocos2d::__Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} /** * @js NA */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(cocos2d::__Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} /** * @js NA */ diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index 9c7085432c..91e5314d95 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -312,7 +312,7 @@ const Rect& Layout::getClippingRect() { _handleScissor = true; Point worldPos = convertToWorldSpace(Point::ZERO); - AffineTransform t = nodeToWorldTransform(); + AffineTransform t = getNodeToWorldAffineTransform(); float scissorWidth = _size.width*t.a; float scissorHeight = _size.height*t.d; Rect parentClippingRect; diff --git a/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h b/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h index b6de1dea20..4f1ab9cba1 100644 --- a/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h +++ b/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h @@ -49,7 +49,7 @@ public: void addJoint(PhysicsJointInfo& joint); void removeJoint(PhysicsJointInfo& joint); void setGravity(const Vect& gravity); - inline bool isLocked() { return static_cast(_space->locked_private); } + inline bool isLocked() { return 0 == _space->locked_private ? false : true; } inline void step(float delta) { cpSpaceStep(_space, delta); } private: From 54ee3392fc1e58c796e40ad0ea4aa1c7a1f7dd57 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sat, 4 Jan 2014 01:40:17 +0000 Subject: [PATCH 177/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 7da441dcdb..7b3cd31f03 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 7da441dcdb1ae69e88d85e7c1101b7c3f656f939 +Subproject commit 7b3cd31f0336ecad555315f507d58517aef2ce8f From 5a0284c183634d7ebb7538788f9a54243446a5c8 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 3 Jan 2014 17:54:07 -0800 Subject: [PATCH 178/428] Node vertex Z fix Node correctly sets the Z vertex in getNodeToParentTransform(), and not in transform(). This is the correct thing to do, and also fixes possible collisions with the additionalTransform (eg: Camera) --- cocos/2d/CCNode.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 9d9f3a0527..d992a6e821 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -854,11 +854,8 @@ void Node::transform() kmMat4 transfrom4x4 = this->getNodeToParentTransform(); - // Update Z vertex manually - transfrom4x4.mat[14] = _vertexZ; - - kmGLMultMatrix( &transfrom4x4 ); + // saves the MV matrix kmGLGetMatrix(KM_GL_MODELVIEW, &_modelViewTransform); } @@ -1188,15 +1185,18 @@ const kmMat4& Node::getNodeToParentTransform() const } } + // vertex Z + _transform.mat[14] = _vertexZ; + if (_additionalTransformDirty) { kmMat4Multiply(&_transform, &_transform, &_additionalTransform); _additionalTransformDirty = false; } - + _transformDirty = false; } - + return _transform; } From 0082cf3e4d1736c45de2fa79ed30f3a13e410e3d Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 10:28:09 +0800 Subject: [PATCH 179/428] closed #3579: TestLua->BugsTest->bug914 crashes if clicking 'reset' button all the time. --- cocos/2d/CCEventDispatcher.cpp | 98 ++++++++++++++-------------------- cocos/2d/CCEventDispatcher.h | 11 +++- 2 files changed, 51 insertions(+), 58 deletions(-) diff --git a/cocos/2d/CCEventDispatcher.cpp b/cocos/2d/CCEventDispatcher.cpp index 96a4bda8dc..517697e2a9 100644 --- a/cocos/2d/CCEventDispatcher.cpp +++ b/cocos/2d/CCEventDispatcher.cpp @@ -279,11 +279,10 @@ void EventDispatcher::associateNodeAndEventListener(Node* node, EventListener* l else { listeners = new std::vector(); + _nodeListenersMap.insert(std::make_pair(node, listeners)); } listeners->push_back(listener); - - _nodeListenersMap.insert(std::make_pair(node, listeners)); } void EventDispatcher::dissociateNodeAndEventListener(Node* node, EventListener* listener) @@ -311,29 +310,7 @@ void EventDispatcher::addEventListener(EventListener* listener) { if (_inDispatch == 0) { - EventListenerVector* listenerList = nullptr; - - auto iter = _listeners.find(listener->getListenerID()); - if (iter == _listeners.end()) - { - listenerList = new EventListenerVector(); - _listeners.insert(std::make_pair(listener->getListenerID(), listenerList)); - } - else - { - listenerList = iter->second; - } - - listenerList->push_back(listener); - - if (listener->getFixedPriority() == 0) - { - setDirty(listener->getListenerID(), DirtyFlag::SCENE_GRAPH_PRIORITY); - } - else - { - setDirty(listener->getListenerID(), DirtyFlag::FIXED_PRITORY); - } + forceAddEventListener(listener); } else { @@ -343,6 +320,44 @@ void EventDispatcher::addEventListener(EventListener* listener) listener->retain(); } +void EventDispatcher::forceAddEventListener(EventListener* listener) +{ + EventListenerVector* listeners = nullptr; + EventListener::ListenerID listenerID = listener->getListenerID(); + auto itr = _listeners.find(listenerID); + if (itr == _listeners.end()) + { + + listeners = new EventListenerVector(); + _listeners.insert(std::make_pair(listenerID, listeners)); + } + else + { + listeners = itr->second; + } + + listeners->push_back(listener); + + if (listener->getFixedPriority() == 0) + { + setDirty(listenerID, DirtyFlag::SCENE_GRAPH_PRIORITY); + + auto node = listener->getSceneGraphPriority(); + CCASSERT(node != nullptr, "Invalid scene graph priority!"); + + associateNodeAndEventListener(node, listener); + + if (node->isRunning()) + { + resumeTarget(node); + } + } + else + { + setDirty(listenerID, DirtyFlag::FIXED_PRITORY); + } +} + void EventDispatcher::addEventListenerWithSceneGraphPriority(EventListener* listener, Node* node) { CCASSERT(listener && node, "Invalid parameters."); @@ -356,13 +371,6 @@ void EventDispatcher::addEventListenerWithSceneGraphPriority(EventListener* list listener->setRegistered(true); addEventListener(listener); - - associateNodeAndEventListener(node, listener); - - if (node->isRunning()) - { - resumeTarget(node); - } } void EventDispatcher::addEventListenerWithFixedPriority(EventListener* listener, int fixedPriority) @@ -873,33 +881,9 @@ void EventDispatcher::updateListeners(Event* event) if (!_toAddedListeners.empty()) { - EventListenerVector* listeners = nullptr; - for (auto& listener : _toAddedListeners) { - EventListener::ListenerID listenerID = listener->getListenerID(); - auto itr = _listeners.find(listenerID); - if (itr == _listeners.end()) - { - - listeners = new EventListenerVector(); - _listeners.insert(std::make_pair(listenerID, listeners)); - } - else - { - listeners = itr->second; - } - - listeners->push_back(listener); - - if (listener->getFixedPriority() == 0) - { - setDirty(listenerID, DirtyFlag::SCENE_GRAPH_PRIORITY); - } - else - { - setDirty(listenerID, DirtyFlag::FIXED_PRITORY); - } + forceAddEventListener(listener); } _toAddedListeners.clear(); } diff --git a/cocos/2d/CCEventDispatcher.h b/cocos/2d/CCEventDispatcher.h index 41c98495bd..1bd015b27b 100644 --- a/cocos/2d/CCEventDispatcher.h +++ b/cocos/2d/CCEventDispatcher.h @@ -155,9 +155,18 @@ protected: ssize_t _gt0Index; }; - /** Adds event listener with item */ + /** Adds an event listener with item + * @note if it is dispatching event, the added operation will be delayed to the end of current dispatch + * @see forceAddEventListener + */ void addEventListener(EventListener* listener); + /** Force adding an event listener + * @note force add an event listener which will ignore whether it's in dispatching. + * @see addEventListener + */ + void forceAddEventListener(EventListener* listener); + /** Gets event the listener list for the event listener type. */ EventListenerVector* getListeners(const EventListener::ListenerID& listenerID); From baeacaddfcb9cfb2e889f78056cdf48d7d7fd12b Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 10:30:11 +0800 Subject: [PATCH 180/428] closed #3579: Bug fix in setTouchEnabledForLayer for luabindings. Also fixed lua module error. --- .../lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id | 2 +- .../CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id index d38d577d06..3ef3e93cf1 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id @@ -1 +1 @@ -31ce7e2d174b3b02eb3a30cbc999f1302c70b685 \ No newline at end of file +f0ef8eb2f398001c933c2608c1eb219db7deaebf \ No newline at end of file diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua index 3b1618809a..b7080e57cf 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua @@ -1,4 +1,4 @@ -require "Cocos2dStudio" +require "CocoStudio" local TMoveBy = class("TMoveBy") TMoveBy._tag = -1 From 61af95897613c2df025cb09280dbf3209d8954ab Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 10:32:04 +0800 Subject: [PATCH 181/428] closed #3579: Bug fix in setTouchEnabledForLayer for jsbindings. --- .../javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id index bed1d27c2b..c86de1f5eb 100644 --- a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id +++ b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id @@ -1 +1 @@ -0690676c834cdda681e69a387225425f186a0cc6 \ No newline at end of file +de376c1beb341119b6420706e65bc845ce77360e \ No newline at end of file From b14999a7a7154a34b844e21e93f85aa946fadce8 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Sat, 4 Jan 2014 10:56:14 +0800 Subject: [PATCH 182/428] fix label not appear on the screen --- cocos/2d/CCLabel.cpp | 9 ++++++++- cocos/2d/CCLabel.h | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index c2a512d482..d0e203bbf4 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -500,7 +500,7 @@ void Label::setFontSize(int fontSize) Node::setScale(1.0f*_fontSize/DISTANCEFIELD_ATLAS_FONTSIZE); } -void Label::draw() +void Label::onDraw() { CC_PROFILER_START("CCSpriteBatchNode - draw"); @@ -527,6 +527,13 @@ void Label::draw() CC_PROFILER_STOP("CCSpriteBatchNode - draw"); } +void Label::draw() +{ + _customCommand.init(0, _vertexZ); + _customCommand.func = CC_CALLBACK_0(Label::onDraw, this); + Director::getInstance()->getRenderer()->addCommand(&_customCommand); +} + ///// PROTOCOL STUFF Sprite * Label::getLetter(int ID) diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index 29f0cecb91..aa33f8b72c 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -29,6 +29,7 @@ #include "CCSpriteBatchNode.h" #include "CCLabelTextFormatProtocol.h" #include "ccTypes.h" +#include "renderer/CCCustomCommand.h" NS_CC_BEGIN @@ -119,6 +120,7 @@ public: virtual std::string getDescription() const override; virtual void draw(void) override; + virtual void onDraw(); private: /** @@ -172,7 +174,8 @@ private: Color3B _effectColor; GLuint _uniformEffectColor; - + + CustomCommand _customCommand; }; From 0ed307a5836a27f4a086c481b1f5a7564c33450e Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sat, 4 Jan 2014 02:58:59 +0000 Subject: [PATCH 183/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 7b3cd31f03..3ca9a19144 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 7b3cd31f0336ecad555315f507d58517aef2ce8f +Subproject commit 3ca9a191442d2604e7aea7a9df5787a67e54eb73 From f76a1f05270ff7dedfd075802d61d685906187b3 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 20:14:03 +0800 Subject: [PATCH 184/428] issue #3577: Adds UnitTest.cpp/.h. --- .../Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp | 518 ++++++++++++++++++ .../Cpp/TestCpp/Classes/UnitTest/UnitTest.h | 49 ++ 2 files changed, 567 insertions(+) create mode 100644 samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp create mode 100644 samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.h diff --git a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp new file mode 100644 index 0000000000..7854ae9bc6 --- /dev/null +++ b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp @@ -0,0 +1,518 @@ +#include "UnitTest.h" + +// For ' < o > ' multiply test scene. + +static std::function createFunctions[] = { + CL(TemplateVectorTest), + CL(TemplateMapTest) +}; + +static int sceneIdx = -1; +static const int MAX_LAYER = (sizeof(createFunctions) / sizeof(createFunctions[0])); + +static Layer* nextAction() +{ + sceneIdx++; + sceneIdx = sceneIdx % MAX_LAYER; + + auto layer = (createFunctions[sceneIdx])(); + return layer; +} + +static Layer* backAction() +{ + sceneIdx--; + int total = MAX_LAYER; + if( sceneIdx < 0 ) + sceneIdx += total; + + auto layer = (createFunctions[sceneIdx])(); + return layer; +} + +static Layer* restartAction() +{ + auto layer = (createFunctions[sceneIdx])(); + return layer; +} + +void UnitTestScene::runThisTest() +{ + sceneIdx = -1; + addChild(nextAction()); + Director::getInstance()->replaceScene(this); +} + +void UnitTestDemo::onEnter() +{ + BaseTest::onEnter(); +} + +void UnitTestDemo::onExit() +{ + BaseTest::onExit(); +} + +std::string UnitTestDemo::title() const +{ + return "UnitTest"; +} + +std::string UnitTestDemo::subtitle() const +{ + return ""; +} + +void UnitTestDemo::restartCallback(Object* sender) +{ + auto s = new UnitTestScene(); + s->addChild( restartAction() ); + Director::getInstance()->replaceScene(s); + s->release(); +} + +void UnitTestDemo::nextCallback(Object* sender) +{ + auto s = new UnitTestScene(); + s->addChild( nextAction() ); + Director::getInstance()->replaceScene(s); + s->release(); +} + +void UnitTestDemo::backCallback(Object* sender) +{ + auto s = new UnitTestScene(); + s->addChild( backAction() ); + Director::getInstance()->replaceScene(s); + s->release(); +} + +//--------------------------------------------------------------- + +void TemplateVectorTest::onEnter() +{ + UnitTestDemo::onEnter(); + + Vector vec; + CCASSERT(vec.empty(), ""); + CCASSERT(vec.capacity() == 0, ""); + CCASSERT(vec.size() == 0, ""); + CCASSERT(vec.max_size() > 0, ""); + + auto node1 = Node::create(); + node1->setTag(1); + vec.pushBack(node1); + CCASSERT(node1->retainCount() == 2, ""); + + auto node2 = Node::create(); + node2->setTag(2); + vec.pushBack(node2); + CCASSERT(vec.getIndex(node1) == 0, ""); + CCASSERT(vec.getIndex(node2) == 1, ""); + + auto node3 = Node::create(); + node3->setTag(3); + vec.insert(1, node3); + CCASSERT(vec.at(0)->getTag() == 1, ""); + CCASSERT(vec.at(1)->getTag() == 3, ""); + CCASSERT(vec.at(2)->getTag() == 2, ""); + + // Test copy constructor + Vector vec2(vec); + CCASSERT(vec2.size() == vec.size(), ""); + ssize_t size = vec.size(); + for (ssize_t i = 0; i < size; ++i) + { + CCASSERT(vec2.at(i) == vec.at(i), ""); + CCASSERT(vec.at(i)->retainCount() == 3, ""); + CCASSERT(vec2.at(i)->retainCount() == 3, ""); + } + + // Test copy assignment operator + Vector vec3; + vec3 = vec2; + CCASSERT(vec3.size() == vec2.size(), ""); + size = vec3.size(); + for (ssize_t i = 0; i < size; ++i) + { + CCASSERT(vec3.at(i) == vec2.at(i), ""); + CCASSERT(vec3.at(i)->retainCount() == 4, ""); + CCASSERT(vec2.at(i)->retainCount() == 4, ""); + CCASSERT(vec.at(i)->retainCount() == 4, ""); + } + + // Test move constructor + + auto createVector = [](){ + Vector ret; + + for (int i = 0; i < 20; i++) + { + ret.pushBack(Node::create()); + } + + int j = 1000; + for (auto& child : ret) + { + child->setTag(j++); + } + + return ret; + }; + + Vector vec4(createVector()); + for (const auto& child : vec4) + { + CCASSERT(child->retainCount() == 2, ""); + } + + // Test init Vector with capacity + Vector vec5(10); + CCASSERT(vec5.capacity() == 10, ""); + vec5.reserve(20); + CCASSERT(vec5.capacity() == 20, ""); + + CCASSERT(vec5.size() == 0, ""); + CCASSERT(vec5.empty(), ""); + + auto toRemovedNode = Node::create(); + vec5.pushBack(toRemovedNode); + CCASSERT(toRemovedNode->retainCount() == 2, ""); + + // Test move assignment operator + vec5 = createVector(); + CCASSERT(toRemovedNode->retainCount() == 1, ""); + CCASSERT(vec5.size() == 20, "size should be 20"); + + for (const auto& child : vec5) + { + CCASSERT(child->retainCount() == 2, ""); + } + + // Test Vector::find + CCASSERT(vec.find(node3) == (vec.begin() + 1), ""); + CCASSERT(std::find(std::begin(vec), std::end(vec), node2) == (vec.begin() + 2), ""); + + CCASSERT(vec.front()->getTag() == 1, ""); + CCASSERT(vec.back()->getTag() == 2, ""); + + CCASSERT(vec.getRandomObject(), ""); + CCASSERT(!vec.contains(Node::create()), ""); + CCASSERT(vec.contains(node1), ""); + CCASSERT(vec.contains(node2), ""); + CCASSERT(vec.contains(node3), ""); + CCASSERT(vec.equals(vec2), ""); + CCASSERT(vec.equals(vec3), ""); + + // Insert + vec5.insert(2, node1); + CCASSERT(vec5.at(2)->getTag() == 1, ""); + CCASSERT(vec5.size() == 21, ""); + vec5.back()->setTag(100); + vec5.popBack(); + CCASSERT(vec5.size() == 20, ""); + CCASSERT(vec5.back()->getTag() != 100, ""); + + // Erase and clear + Vector vec6 = createVector(); + Vector vec7 = vec6; // Copy for check + + CCASSERT(vec6.size() == 20, ""); + vec6.erase(vec6.begin() + 1); // + CCASSERT(vec6.size() == 19, ""); + CCASSERT((*(vec6.begin() + 1))->getTag() == 1002, ""); + vec6.erase(vec6.begin() + 2, vec6.begin() + 10); + CCASSERT(vec6.size() == 11, ""); + CCASSERT(vec6.at(0)->getTag() == 1000, ""); + CCASSERT(vec6.at(1)->getTag() == 1002, ""); + CCASSERT(vec6.at(2)->getTag() == 1011, ""); + CCASSERT(vec6.at(3)->getTag() == 1012, ""); + vec6.erase(3); + CCASSERT(vec6.at(3)->getTag() == 1013, ""); + vec6.eraseObject(vec6.at(2)); + CCASSERT(vec6.at(2)->getTag() == 1013, ""); + vec6.clear(); + + // Check the retain count in vec7 + CCASSERT(vec7.size() == 20, ""); + for (const auto& child : vec7) + { + CCASSERT(child->retainCount() == 2, ""); + } + + // Sort + Vector vecForSort = createVector(); + std::sort(vecForSort.begin(), vecForSort.end(), [](Node* a, Node* b){ + return a->getTag() >= b->getTag(); + }); + + for (int i = 0; i < 20; ++i) + { + CCASSERT(vecForSort.at(i)->getTag() - 1000 == (19 - i), ""); + } + + // Reverse + vecForSort.reverse(); + for (int i = 0; i < 20; ++i) + { + CCASSERT(vecForSort.at(i)->getTag() - 1000 == i, ""); + } + + // Swap + Vector vecForSwap = createVector(); + vecForSwap.swap(2, 4); + CCASSERT(vecForSwap.at(2)->getTag() == 1004, ""); + CCASSERT(vecForSwap.at(4)->getTag() == 1002, ""); + vecForSwap.swap(vecForSwap.at(2), vecForSwap.at(4)); + CCASSERT(vecForSwap.at(2)->getTag() == 1002, ""); + CCASSERT(vecForSwap.at(4)->getTag() == 1004, ""); + + // shrinkToFit + Vector vecForShrink = createVector(); + vecForShrink.reserve(100); + CCASSERT(vecForShrink.capacity() == 100, ""); + vecForShrink.pushBack(Node::create()); + vecForShrink.shrinkToFit(); + CCASSERT(vecForShrink.capacity() == 21, ""); + + // get random object + // Set the seed by time + srand(time(nullptr)); + Vector vecForRandom = createVector(); + log("<--- begin ---->"); + for (int i = 0; i < vecForRandom.size(); ++i) + { + log("Vector: random object tag = %d", vecForRandom.getRandomObject()->getTag()); + } + log("<---- end ---->"); + + // Self assignment + Vector vecSelfAssign = createVector(); + vecSelfAssign = vecSelfAssign; + CCASSERT(vecSelfAssign.size() == 20, ""); + + for (const auto& child : vecSelfAssign) + { + CCASSERT(child->retainCount() == 2, ""); + } + + vecSelfAssign = std::move(vecSelfAssign); + CCASSERT(vecSelfAssign.size() == 20, ""); + + for (const auto& child : vecSelfAssign) + { + CCASSERT(child->retainCount() == 2, ""); + } + + // const at + Vector vecConstAt = createVector(); + constFunc(vecConstAt); +} + +void TemplateVectorTest::constFunc(const Vector& vec) const +{ + log("vec[8] = %d", vec.at(8)->getTag()); +} + +std::string TemplateVectorTest::subtitle() const +{ + return "Vector, should not crash"; +} + + +//--------------------------------------------------------------- + +void TemplateMapTest::onEnter() +{ + UnitTestDemo::onEnter(); + + auto createMap = [](){ + Map ret; + for (int i = 0; i < 20; ++i) + { + auto node = Node::create(); + node->setTag(1000 + i); + ret.insert(StringUtils::toString(i), node); + } + + return ret; + }; + + // Default constructor + Map map1; + CCASSERT(map1.empty(), ""); + CCASSERT(map1.size() == 0, ""); + CCASSERT(map1.bucketCount() == 0, ""); + CCASSERT(map1.keys().empty(), ""); + CCASSERT(map1.keys(Node::create()).empty(), ""); + + // Move constructor + Map map2 = createMap(); + for (const auto& e : map2) + { + CCASSERT(e.second->retainCount() == 2, ""); + } + + // Copy constructor + Map map3(map2); + for (const auto& e : map3) + { + CCASSERT(e.second->retainCount() == 3, ""); + } + + // Move assignment operator + Map map4; + auto unusedNode = Node::create(); + map4.insert("unused",unusedNode); + map4 = createMap(); + CCASSERT(unusedNode->retainCount() == 1, ""); + for (const auto& e : map4) + { + CCASSERT(e.second->retainCount() == 2, ""); + } + + // Copy assignment operator + Map map5; + map5 = map4; + for (const auto& e : map5) + { + CCASSERT(e.second->retainCount() == 3, ""); + } + + // Check size + CCASSERT(map4.size() == map5.size(), ""); + + for (const auto& e : map4) + { + CCASSERT(e.second == map5.find(e.first)->second, ""); + } + + // bucket_count, bucket_size(n), bucket + log("--------------"); + log("bucket_count = %d", static_cast(map4.bucketCount())); + log("size = %d", static_cast(map4.size())); + for (int i = 0; i < map4.bucketCount(); ++i) + { + log("bucket_size(%d) = %d", i, static_cast(map4.bucketSize(i))); + } + for (const auto& e : map4) + { + log("bucket(\"%s\"), bucket index = %d", e.first.c_str(), static_cast(map4.bucket(e.first))); + } + + log("----- all keys---------"); + + // keys and at + auto keys = map4.keys(); + for (const auto& key : keys) + { + log("key = %s", key.c_str()); + } + + auto node10Key = map4.at("10"); + map4.insert("100", node10Key); + map4.insert("101", node10Key); + map4.insert("102", node10Key); + + log("------ keys for object --------"); + auto keysForObject = map4.keys(node10Key); + for (const auto& key : keysForObject) + { + log("key = %s", key.c_str()); + } + log("--------------"); + + // at in const function + constFunc(map4); + + // find + auto nodeToFind = map4.find("10"); + CCASSERT(nodeToFind->second->getTag() == 1010, ""); + + // insert + Map map6; + auto node1 = Node::create(); + node1->setTag(101); + auto node2 = Node::create(); + node2->setTag(102); + auto node3 = Node::create(); + node3->setTag(103); + map6.insert("insert01", node1); + map6.insert("insert02", node2); + map6.insert("insert03", node3); + + CCASSERT(node1->retainCount() == 2, ""); + CCASSERT(node2->retainCount() == 2, ""); + CCASSERT(node3->retainCount() == 2, ""); + CCASSERT(map6.at("insert01") == node1, ""); + CCASSERT(map6.at("insert02") == node2, ""); + CCASSERT(map6.at("insert03") == node3, ""); + + // erase + Map mapForErase = createMap(); + mapForErase.erase(mapForErase.find("9")); + CCASSERT(mapForErase.find("9") == mapForErase.end(), ""); + CCASSERT(mapForErase.size() == 19, ""); + + mapForErase.erase("7"); + CCASSERT(mapForErase.find("7") == mapForErase.end(), ""); + CCASSERT(mapForErase.size() == 18, ""); + + std::vector itemsToRemove; + itemsToRemove.push_back("2"); + itemsToRemove.push_back("3"); + itemsToRemove.push_back("4"); + mapForErase.erase(itemsToRemove); + CCASSERT(mapForErase.size() == 15, ""); + + // clear + Map mapForClear = createMap(); + auto mapForClearCopy = mapForClear; + mapForClear.clear(); + + for (const auto& e : mapForClearCopy) + { + CCASSERT(e.second->retainCount() == 2, ""); + } + + // get random object + // Set the seed by time + srand(time(nullptr)); + Map mapForRandom = createMap(); + log("<--- begin ---->"); + for (int i = 0; i < mapForRandom.size(); ++i) + { + log("Map: random object tag = %d", mapForRandom.getRandomObject()->getTag()); + } + log("<---- end ---->"); + + // Self assignment + Map mapForSelfAssign = createMap(); + mapForSelfAssign = mapForSelfAssign; + CCASSERT(mapForSelfAssign.size() == 20, ""); + + for (const auto& e : mapForSelfAssign) + { + CCASSERT(e.second->retainCount() == 2, ""); + } + + mapForSelfAssign = std::move(mapForSelfAssign); + CCASSERT(mapForSelfAssign.size() == 20, ""); + + for (const auto& e : mapForSelfAssign) + { + CCASSERT(e.second->retainCount() == 2, ""); + } +} + +void TemplateMapTest::constFunc(const Map& map) const +{ + log("[%s]=(tag)%d", "0", map.at("0")->getTag()); + log("[%s]=(tag)%d", "1", map.find("1")->second->getTag()); +} + +std::string TemplateMapTest::subtitle() const +{ + return "Map, should not crash"; +} + diff --git a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.h b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.h new file mode 100644 index 0000000000..6c66f0ea44 --- /dev/null +++ b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.h @@ -0,0 +1,49 @@ +#ifndef __UNIT_TEST__ +#define __UNIT_TEST__ + +#include "../testBasic.h" +#include "../BaseTest.h" + +class UnitTestScene : public TestScene +{ +public: + virtual void runThisTest() override; +}; + +class UnitTestDemo : public BaseTest +{ +public: + virtual void onEnter() override; + virtual void onExit() override; + + virtual std::string title() const override; + virtual std::string subtitle() const override; + + virtual void restartCallback(Object* sender) override; + virtual void nextCallback(Object* sender) override; + virtual void backCallback(Object* sender) override; +}; + +//------------------------------------- + +class TemplateVectorTest : public UnitTestDemo +{ +public: + CREATE_FUNC(TemplateVectorTest); + TemplateVectorTest(){} + virtual void onEnter() override; + virtual std::string subtitle() const override; + void constFunc(const Vector& vec) const; +}; + +class TemplateMapTest : public UnitTestDemo +{ +public: + CREATE_FUNC(TemplateMapTest); + TemplateMapTest(){} + virtual void onEnter() override; + virtual std::string subtitle() const override; + void constFunc(const Map& map) const; +}; + +#endif /* __UNIT_TEST__ */ From ebf6d07720448ab96f238a37384b1c2376a1bd0d Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 20:15:19 +0800 Subject: [PATCH 185/428] =?UTF-8?q?issue=20#3577:=20iterator=20=E2=80=94>?= =?UTF-8?q?=20const=5Fiterator=20since=20Map::getRandomObject=20is=20a=20c?= =?UTF-8?q?onst=20function.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/base/CCMap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/base/CCMap.h b/cocos/base/CCMap.h index 097e33992c..4b6e22ad4e 100644 --- a/cocos/base/CCMap.h +++ b/cocos/base/CCMap.h @@ -283,7 +283,7 @@ public: if (!_data.empty()) { ssize_t randIdx = rand() % _data.size(); - iterator randIter = _data.begin(); + const_iterator randIter = _data.begin(); std::advance(randIter , randIdx); return randIter->second; } From 0915d4b00e5274511aa5f139633dc434797e4fb1 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 20:20:40 +0800 Subject: [PATCH 186/428] issue #3577: Removes unused spaces. --- .../Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp | 110 +++++++++--------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp index 7854ae9bc6..415052d135 100644 --- a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp +++ b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp @@ -92,7 +92,7 @@ void UnitTestDemo::backCallback(Object* sender) void TemplateVectorTest::onEnter() { UnitTestDemo::onEnter(); - + Vector vec; CCASSERT(vec.empty(), ""); CCASSERT(vec.capacity() == 0, ""); @@ -116,7 +116,7 @@ void TemplateVectorTest::onEnter() CCASSERT(vec.at(0)->getTag() == 1, ""); CCASSERT(vec.at(1)->getTag() == 3, ""); CCASSERT(vec.at(2)->getTag() == 2, ""); - + // Test copy constructor Vector vec2(vec); CCASSERT(vec2.size() == vec.size(), ""); @@ -127,7 +127,7 @@ void TemplateVectorTest::onEnter() CCASSERT(vec.at(i)->retainCount() == 3, ""); CCASSERT(vec2.at(i)->retainCount() == 3, ""); } - + // Test copy assignment operator Vector vec3; vec3 = vec2; @@ -140,26 +140,26 @@ void TemplateVectorTest::onEnter() CCASSERT(vec2.at(i)->retainCount() == 4, ""); CCASSERT(vec.at(i)->retainCount() == 4, ""); } - + // Test move constructor - + auto createVector = [](){ Vector ret; - + for (int i = 0; i < 20; i++) { ret.pushBack(Node::create()); } - + int j = 1000; for (auto& child : ret) { child->setTag(j++); } - + return ret; }; - + Vector vec4(createVector()); for (const auto& child : vec4) { @@ -171,10 +171,10 @@ void TemplateVectorTest::onEnter() CCASSERT(vec5.capacity() == 10, ""); vec5.reserve(20); CCASSERT(vec5.capacity() == 20, ""); - + CCASSERT(vec5.size() == 0, ""); CCASSERT(vec5.empty(), ""); - + auto toRemovedNode = Node::create(); vec5.pushBack(toRemovedNode); CCASSERT(toRemovedNode->retainCount() == 2, ""); @@ -183,19 +183,19 @@ void TemplateVectorTest::onEnter() vec5 = createVector(); CCASSERT(toRemovedNode->retainCount() == 1, ""); CCASSERT(vec5.size() == 20, "size should be 20"); - + for (const auto& child : vec5) { CCASSERT(child->retainCount() == 2, ""); } - + // Test Vector::find CCASSERT(vec.find(node3) == (vec.begin() + 1), ""); CCASSERT(std::find(std::begin(vec), std::end(vec), node2) == (vec.begin() + 2), ""); - + CCASSERT(vec.front()->getTag() == 1, ""); CCASSERT(vec.back()->getTag() == 2, ""); - + CCASSERT(vec.getRandomObject(), ""); CCASSERT(!vec.contains(Node::create()), ""); CCASSERT(vec.contains(node1), ""); @@ -203,7 +203,7 @@ void TemplateVectorTest::onEnter() CCASSERT(vec.contains(node3), ""); CCASSERT(vec.equals(vec2), ""); CCASSERT(vec.equals(vec3), ""); - + // Insert vec5.insert(2, node1); CCASSERT(vec5.at(2)->getTag() == 1, ""); @@ -216,7 +216,7 @@ void TemplateVectorTest::onEnter() // Erase and clear Vector vec6 = createVector(); Vector vec7 = vec6; // Copy for check - + CCASSERT(vec6.size() == 20, ""); vec6.erase(vec6.begin() + 1); // CCASSERT(vec6.size() == 19, ""); @@ -232,32 +232,32 @@ void TemplateVectorTest::onEnter() vec6.eraseObject(vec6.at(2)); CCASSERT(vec6.at(2)->getTag() == 1013, ""); vec6.clear(); - + // Check the retain count in vec7 CCASSERT(vec7.size() == 20, ""); for (const auto& child : vec7) { CCASSERT(child->retainCount() == 2, ""); } - + // Sort Vector vecForSort = createVector(); std::sort(vecForSort.begin(), vecForSort.end(), [](Node* a, Node* b){ return a->getTag() >= b->getTag(); }); - + for (int i = 0; i < 20; ++i) { CCASSERT(vecForSort.at(i)->getTag() - 1000 == (19 - i), ""); } - + // Reverse vecForSort.reverse(); for (int i = 0; i < 20; ++i) { CCASSERT(vecForSort.at(i)->getTag() - 1000 == i, ""); } - + // Swap Vector vecForSwap = createVector(); vecForSwap.swap(2, 4); @@ -266,7 +266,7 @@ void TemplateVectorTest::onEnter() vecForSwap.swap(vecForSwap.at(2), vecForSwap.at(4)); CCASSERT(vecForSwap.at(2)->getTag() == 1002, ""); CCASSERT(vecForSwap.at(4)->getTag() == 1004, ""); - + // shrinkToFit Vector vecForShrink = createVector(); vecForShrink.reserve(100); @@ -274,7 +274,7 @@ void TemplateVectorTest::onEnter() vecForShrink.pushBack(Node::create()); vecForShrink.shrinkToFit(); CCASSERT(vecForShrink.capacity() == 21, ""); - + // get random object // Set the seed by time srand(time(nullptr)); @@ -285,25 +285,25 @@ void TemplateVectorTest::onEnter() log("Vector: random object tag = %d", vecForRandom.getRandomObject()->getTag()); } log("<---- end ---->"); - + // Self assignment Vector vecSelfAssign = createVector(); vecSelfAssign = vecSelfAssign; CCASSERT(vecSelfAssign.size() == 20, ""); - + for (const auto& child : vecSelfAssign) { CCASSERT(child->retainCount() == 2, ""); } - + vecSelfAssign = std::move(vecSelfAssign); CCASSERT(vecSelfAssign.size() == 20, ""); - + for (const auto& child : vecSelfAssign) { CCASSERT(child->retainCount() == 2, ""); } - + // const at Vector vecConstAt = createVector(); constFunc(vecConstAt); @@ -325,7 +325,7 @@ std::string TemplateVectorTest::subtitle() const void TemplateMapTest::onEnter() { UnitTestDemo::onEnter(); - + auto createMap = [](){ Map ret; for (int i = 0; i < 20; ++i) @@ -334,10 +334,10 @@ void TemplateMapTest::onEnter() node->setTag(1000 + i); ret.insert(StringUtils::toString(i), node); } - + return ret; }; - + // Default constructor Map map1; CCASSERT(map1.empty(), ""); @@ -345,7 +345,7 @@ void TemplateMapTest::onEnter() CCASSERT(map1.bucketCount() == 0, ""); CCASSERT(map1.keys().empty(), ""); CCASSERT(map1.keys(Node::create()).empty(), ""); - + // Move constructor Map map2 = createMap(); for (const auto& e : map2) @@ -359,7 +359,7 @@ void TemplateMapTest::onEnter() { CCASSERT(e.second->retainCount() == 3, ""); } - + // Move assignment operator Map map4; auto unusedNode = Node::create(); @@ -370,7 +370,7 @@ void TemplateMapTest::onEnter() { CCASSERT(e.second->retainCount() == 2, ""); } - + // Copy assignment operator Map map5; map5 = map4; @@ -378,15 +378,15 @@ void TemplateMapTest::onEnter() { CCASSERT(e.second->retainCount() == 3, ""); } - + // Check size CCASSERT(map4.size() == map5.size(), ""); - + for (const auto& e : map4) { CCASSERT(e.second == map5.find(e.first)->second, ""); } - + // bucket_count, bucket_size(n), bucket log("--------------"); log("bucket_count = %d", static_cast(map4.bucketCount())); @@ -399,21 +399,21 @@ void TemplateMapTest::onEnter() { log("bucket(\"%s\"), bucket index = %d", e.first.c_str(), static_cast(map4.bucket(e.first))); } - + log("----- all keys---------"); - + // keys and at auto keys = map4.keys(); for (const auto& key : keys) { log("key = %s", key.c_str()); } - + auto node10Key = map4.at("10"); map4.insert("100", node10Key); map4.insert("101", node10Key); map4.insert("102", node10Key); - + log("------ keys for object --------"); auto keysForObject = map4.keys(node10Key); for (const auto& key : keysForObject) @@ -421,14 +421,14 @@ void TemplateMapTest::onEnter() log("key = %s", key.c_str()); } log("--------------"); - + // at in const function constFunc(map4); - + // find auto nodeToFind = map4.find("10"); CCASSERT(nodeToFind->second->getTag() == 1010, ""); - + // insert Map map6; auto node1 = Node::create(); @@ -440,14 +440,14 @@ void TemplateMapTest::onEnter() map6.insert("insert01", node1); map6.insert("insert02", node2); map6.insert("insert03", node3); - + CCASSERT(node1->retainCount() == 2, ""); CCASSERT(node2->retainCount() == 2, ""); CCASSERT(node3->retainCount() == 2, ""); CCASSERT(map6.at("insert01") == node1, ""); CCASSERT(map6.at("insert02") == node2, ""); CCASSERT(map6.at("insert03") == node3, ""); - + // erase Map mapForErase = createMap(); mapForErase.erase(mapForErase.find("9")); @@ -457,24 +457,24 @@ void TemplateMapTest::onEnter() mapForErase.erase("7"); CCASSERT(mapForErase.find("7") == mapForErase.end(), ""); CCASSERT(mapForErase.size() == 18, ""); - + std::vector itemsToRemove; itemsToRemove.push_back("2"); itemsToRemove.push_back("3"); itemsToRemove.push_back("4"); mapForErase.erase(itemsToRemove); CCASSERT(mapForErase.size() == 15, ""); - + // clear Map mapForClear = createMap(); auto mapForClearCopy = mapForClear; mapForClear.clear(); - + for (const auto& e : mapForClearCopy) { CCASSERT(e.second->retainCount() == 2, ""); } - + // get random object // Set the seed by time srand(time(nullptr)); @@ -485,20 +485,20 @@ void TemplateMapTest::onEnter() log("Map: random object tag = %d", mapForRandom.getRandomObject()->getTag()); } log("<---- end ---->"); - + // Self assignment Map mapForSelfAssign = createMap(); mapForSelfAssign = mapForSelfAssign; CCASSERT(mapForSelfAssign.size() == 20, ""); - + for (const auto& e : mapForSelfAssign) { CCASSERT(e.second->retainCount() == 2, ""); } - + mapForSelfAssign = std::move(mapForSelfAssign); CCASSERT(mapForSelfAssign.size() == 20, ""); - + for (const auto& e : mapForSelfAssign) { CCASSERT(e.second->retainCount() == 2, ""); From 4980214d0ff01da984f16976044e4dc895b4b3e9 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 20:21:04 +0800 Subject: [PATCH 187/428] issue #3677: Updates Makefile. --- samples/Cpp/TestCpp/Android.mk | 1 + samples/Cpp/TestCpp/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/Cpp/TestCpp/Android.mk b/samples/Cpp/TestCpp/Android.mk index 095984ffca..32917fb7c3 100644 --- a/samples/Cpp/TestCpp/Android.mk +++ b/samples/Cpp/TestCpp/Android.mk @@ -139,6 +139,7 @@ Classes/TouchesTest/Ball.cpp \ Classes/TouchesTest/Paddle.cpp \ Classes/TouchesTest/TouchesTest.cpp \ Classes/TransitionsTest/TransitionsTest.cpp \ +Classes/UnitTest/UnitTest.cpp \ Classes/UserDefaultTest/UserDefaultTest.cpp \ Classes/ZwoptexTest/ZwoptexTest.cpp diff --git a/samples/Cpp/TestCpp/CMakeLists.txt b/samples/Cpp/TestCpp/CMakeLists.txt index 91db89f44b..e676cd9856 100644 --- a/samples/Cpp/TestCpp/CMakeLists.txt +++ b/samples/Cpp/TestCpp/CMakeLists.txt @@ -127,6 +127,7 @@ set(SAMPLE_SRC Classes/DataVisitorTest/DataVisitorTest.cpp Classes/ConfigurationTest/ConfigurationTest.cpp Classes/ConsoleTest/ConsoleTest.cpp + Classes/UnitTest/UnitTest.cpp Classes/controller.cpp Classes/testBasic.cpp Classes/AppDelegate.cpp @@ -165,4 +166,3 @@ pre_build(${APP_NAME} COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources ) - From 15029e0173203514f5055620ae6b4747427fb6dd Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 20:21:36 +0800 Subject: [PATCH 188/428] issue #3577: Includes `UnitTest.h` in tests.h. --- samples/Cpp/TestCpp/Classes/tests.h | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/Cpp/TestCpp/Classes/tests.h b/samples/Cpp/TestCpp/Classes/tests.h index d104a894d4..d030ae34f3 100644 --- a/samples/Cpp/TestCpp/Classes/tests.h +++ b/samples/Cpp/TestCpp/Classes/tests.h @@ -1,6 +1,7 @@ #ifndef _TESTS_H_ #define _TESTS_H_ +#include "UnitTest/UnitTest.h" #include "NewRendererTest/NewRendererTest.h" #include "ConsoleTest/ConsoleTest.h" #include "NewEventDispatcherTest/NewEventDispatcherTest.h" From a48f561ac5662e132850db44d21039aa799ac0ef Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 20:22:11 +0800 Subject: [PATCH 189/428] issue #3577: Adds UnitTest to controller.cpp. --- samples/Cpp/TestCpp/Classes/controller.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/Cpp/TestCpp/Classes/controller.cpp b/samples/Cpp/TestCpp/Classes/controller.cpp index 9051e1cd46..750ba02a9f 100644 --- a/samples/Cpp/TestCpp/Classes/controller.cpp +++ b/samples/Cpp/TestCpp/Classes/controller.cpp @@ -19,6 +19,7 @@ struct { // TESTS MUST BE ORDERED ALPHABETICALLY // violators will be prosecuted // + { "AUnitTest", []() { return new UnitTestScene(); }}, { "ANewRenderTest", []() { return new NewRendererTestScene(); } }, { "Accelerometer", []() { return new AccelerometerTestScene(); } }, { "ActionManagerTest", [](){return new ActionManagerTestScene(); } }, From 5072e63f899c546dfd7d1ea1b395e927a876a4cf Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 20:22:29 +0800 Subject: [PATCH 190/428] issue #3577: Updates project file for mac and ios. --- build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index a3d5fedee2..8f414a5f87 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -3e5ec4c41f43234cf4365c10bef1a57a5373aed1 \ No newline at end of file +8c0594ae9199e8dedb5323a263157afc2da83f73 \ No newline at end of file From 9342ae105a710aca4ca695007ba2e3d18dd3d023 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 20:28:30 +0800 Subject: [PATCH 191/428] =?UTF-8?q?issue=20#3577:=20const=5Fiterator=20?= =?UTF-8?q?=E2=80=94>=20iterator=20for=20Vector::erase(first,=20last).=20M?= =?UTF-8?q?akes=20android=20build=20happy.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/base/CCVector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index d751479d23..073dc7651c 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -340,7 +340,7 @@ public: * @return An iterator pointing to the new location of the element that followed the last element erased by the function call. * This is the container end if the operation erased the last element in the sequence. */ - iterator erase(const_iterator first, const_iterator last) + iterator erase(iterator first, iterator last) { for (auto iter = first; iter != last; ++iter) { From cf8fa8e5fa3b28a8a2057e69cfaadbe610db5823 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 3 Jan 2014 21:06:33 +0800 Subject: [PATCH 192/428] issue #3577: Adds ValueTest. --- .../Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp | 89 ++++++++++++++++++- .../Cpp/TestCpp/Classes/UnitTest/UnitTest.h | 11 ++- 2 files changed, 97 insertions(+), 3 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp index 415052d135..bcc42c35fe 100644 --- a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp +++ b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp @@ -4,7 +4,8 @@ static std::function createFunctions[] = { CL(TemplateVectorTest), - CL(TemplateMapTest) + CL(TemplateMapTest), + CL(ValueTest) }; static int sceneIdx = -1; @@ -516,3 +517,89 @@ std::string TemplateMapTest::subtitle() const return "Map, should not crash"; } +//---------------------------------- + +void ValueTest::onEnter() +{ + UnitTestDemo::onEnter(); + + Value v1; + CCASSERT(v1.getType() == Value::Type::NONE, ""); + CCASSERT(v1.isNull(), ""); + + Value v2(100); + CCASSERT(v2.getType() == Value::Type::INTEGER, ""); + CCASSERT(!v2.isNull(), ""); + + Value v3(101.4f); + CCASSERT(v3.getType() == Value::Type::FLOAT, ""); + CCASSERT(!v3.isNull(), ""); + + Value v4(106.1); + CCASSERT(v4.getType() == Value::Type::DOUBLE, ""); + CCASSERT(!v4.isNull(), ""); + + unsigned char byte = 50; + Value v5(byte); + CCASSERT(v5.getType() == Value::Type::BYTE, ""); + CCASSERT(!v5.isNull(), ""); + + Value v6(true); + CCASSERT(v6.getType() == Value::Type::BOOLEAN, ""); + CCASSERT(!v6.isNull(), ""); + + Value v7("string"); + CCASSERT(v7.getType() == Value::Type::STRING, ""); + CCASSERT(!v7.isNull(), ""); + + Value v8(std::string("string2")); + CCASSERT(v8.getType() == Value::Type::STRING, ""); + CCASSERT(!v8.isNull(), ""); + + auto createValueVector = [&](){ + ValueVector ret; + ret.push_back(v1); + ret.push_back(v2); + ret.push_back(v3); + return ret; + }; + + + Value v9(createValueVector()); + CCASSERT(v9.getType() == Value::Type::VECTOR, ""); + CCASSERT(!v9.isNull(), ""); + + auto createValueMap = [&](){ + ValueMap ret; + ret["aaa"] = v1; + ret["bbb"] = v2; + ret["ccc"] = v3; + return ret; + }; + + Value v10(createValueMap()); + CCASSERT(v10.getType() == Value::Type::MAP, ""); + CCASSERT(!v10.isNull(), ""); + + auto createValueMapIntKey = [&](){ + ValueMapIntKey ret; + ret[111] = v1; + ret[222] = v2; + ret[333] = v3; + return ret; + }; + + Value v11(createValueMapIntKey()); + CCASSERT(v11.getType() == Value::Type::INT_KEY_MAP, ""); + CCASSERT(!v11.isNull(), ""); +} + +std::string ValueTest::subtitle() const +{ + return "Value Test, should not crash"; +} + +void ValueTest::constFunc(const Value& value) const +{ + +} diff --git a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.h b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.h index 6c66f0ea44..f969b11249 100644 --- a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.h +++ b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.h @@ -30,7 +30,6 @@ class TemplateVectorTest : public UnitTestDemo { public: CREATE_FUNC(TemplateVectorTest); - TemplateVectorTest(){} virtual void onEnter() override; virtual std::string subtitle() const override; void constFunc(const Vector& vec) const; @@ -40,10 +39,18 @@ class TemplateMapTest : public UnitTestDemo { public: CREATE_FUNC(TemplateMapTest); - TemplateMapTest(){} virtual void onEnter() override; virtual std::string subtitle() const override; void constFunc(const Map& map) const; }; +class ValueTest : public UnitTestDemo +{ +public: + CREATE_FUNC(ValueTest); + virtual void onEnter() override; + virtual std::string subtitle() const override; + void constFunc(const Value& value) const; +}; + #endif /* __UNIT_TEST__ */ From 29e2bb89b16e9d0edb35db10a5502f83a16df0ab Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 11:44:29 +0800 Subject: [PATCH 193/428] =?UTF-8?q?issue=20#3577:=20Captures=20=E2=80=98th?= =?UTF-8?q?is=E2=80=99=20to=20make=20old=20gcc=20on=20linux=20happy.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp index bcc42c35fe..5de0e623dc 100644 --- a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp +++ b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp @@ -144,7 +144,7 @@ void TemplateVectorTest::onEnter() // Test move constructor - auto createVector = [](){ + auto createVector = [this](){ Vector ret; for (int i = 0; i < 20; i++) @@ -327,7 +327,7 @@ void TemplateMapTest::onEnter() { UnitTestDemo::onEnter(); - auto createMap = [](){ + auto createMap = [this](){ Map ret; for (int i = 0; i < 20; ++i) { From 233e0ab4578330ea30a2e9a23d3a272f5103a61b Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 11:50:35 +0800 Subject: [PATCH 194/428] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 9075d3ec41..fe29ff6df1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -24,6 +24,7 @@ cocos2d-x-3.0beta ?? 2013 [FIX] Two memory leak fixes in EventDispatcher::removeEventListener(s). [NEW] TextureCache::addImageAsync() uses std::function<> as call back [NEW] Namespace changed: network -> cocos2d::network, gui -> cocos2d::gui + [NEW] Added more CocoStudioSceneTest samples. [Android] [NEW] build/android-build.sh: add supporting to generate .apk file [FIX] XMLHttpRequest receives wrong binary array. From d29cdb5b52838ea832a7e69d80c48841f47de426 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sat, 4 Jan 2014 03:58:44 +0000 Subject: [PATCH 195/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 3ca9a19144..d8e56833a8 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 3ca9a191442d2604e7aea7a9df5787a67e54eb73 +Subproject commit d8e56833a8366c29b0ef08a47ed317c1317ae0cf From 83028deca6ade7d41d6d17bca007c6e5c1eaf184 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 12:02:11 +0800 Subject: [PATCH 196/428] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index fe29ff6df1..422541293f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -25,6 +25,7 @@ cocos2d-x-3.0beta ?? 2013 [NEW] TextureCache::addImageAsync() uses std::function<> as call back [NEW] Namespace changed: network -> cocos2d::network, gui -> cocos2d::gui [NEW] Added more CocoStudioSceneTest samples. + [NEW] Added UnitTest for Vector, Map, Value. [Android] [NEW] build/android-build.sh: add supporting to generate .apk file [FIX] XMLHttpRequest receives wrong binary array. From 322cf0d233b1a83059b9f2aa304514679c01dbf1 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 12:11:10 +0800 Subject: [PATCH 197/428] Fixing CocoStudio bindings error. --- .../cocostudio/CCSSceneReader.cpp | 2 +- .../cocostudio/CCSSceneReader.h | 20 +++++-------------- tools/tojs/cocos2dx_studio.ini | 3 ++- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index ba31a8dfc0..b7c598ca20 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -405,7 +405,7 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par return nullptr; } -void SceneReader::setTarget(std::function selector) +void SceneReader::setTarget(const std::function& selector) { _fnSelector = selector; } diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.h b/cocos/editor-support/cocostudio/CCSSceneReader.h index 2713bded36..0c04be3309 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/CCSSceneReader.h @@ -31,22 +31,8 @@ namespace cocostudio { -typedef void (cocos2d::Object::*SEL_CallFuncOD)(cocos2d::Object*, void*); -#define callfuncOD_selector(_SELECTOR) (SEL_CallFuncOD)(&_SELECTOR) - class SceneReader { -public: - /** - * @js ctor - */ - SceneReader(void); - /** - * @js NA - * @lua NA - */ - virtual ~SceneReader(void); - public: static SceneReader* getInstance(); /** @@ -56,9 +42,13 @@ public: void destroyInstance(); static const char* sceneReaderVersion(); cocos2d::Node* createNodeWithSceneFile(const std::string &fileName); - void setTarget(std::function selector); + void setTarget(const std::function& selector); cocos2d::Node* getNodeByTag(int nTag); + private: + SceneReader(void); + virtual ~SceneReader(void); + cocos2d::Node* createObject(const rapidjson::Value& dict, cocos2d::Node* parent); void setPropertyFromJsonDict(const rapidjson::Value& dict, cocos2d::Node *node); bool readJson(const std::string &fileName, rapidjson::Document& doc); diff --git a/tools/tojs/cocos2dx_studio.ini b/tools/tojs/cocos2dx_studio.ini index 5bcc9dfce3..2f806a3257 100644 --- a/tools/tojs/cocos2dx_studio.ini +++ b/tools/tojs/cocos2dx_studio.ini @@ -54,7 +54,8 @@ skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*H ActionNode::[initWithDictionary], ActionObject::[initWithDictionary], ColliderDetector::[addContourData.* removeContourData], - ColliderBody::[getContourData getCalculatedVertexList] + ColliderBody::[getContourData getCalculatedVertexList], + SceneReader::[setTarget] rename_functions = ActionManagerEx::[shareManager=getInstance purgeActionManager=purge], SceneReader::[purgeSceneReader=purge], From e42f721c6bbdafce4bedb1058a4ea72f2091779c Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sat, 4 Jan 2014 04:22:17 +0000 Subject: [PATCH 198/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index d8e56833a8..77ab94001c 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit d8e56833a8366c29b0ef08a47ed317c1317ae0cf +Subproject commit 77ab94001cdd7e026e2a719993833be0da5951f4 From 35246b0810231e676c88e8fb5e662d8d21730aed Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Sat, 4 Jan 2014 12:25:12 +0800 Subject: [PATCH 199/428] fix compiling error and miss file on vs. --- cocos/2d/cocos2d.vcxproj | 2 +- .../proj.win32/libCocosBuilder.vcxproj | 1 + .../cocostudio/proj.win32/libCocosStudio.vcxproj | 1 + cocos/gui/proj.win32/libGUI.vcxproj | 1 + cocos/scripting/lua/bindings/liblua.vcxproj | 7 ++++++- .../scripting/lua/bindings/liblua.vcxproj.filters | 15 +++++++++++++++ extensions/proj.win32/libExtensions.vcxproj | 2 +- .../Lua/TestLua/proj.win32/TestLua.win32.vcxproj | 5 ++++- 8 files changed, 30 insertions(+), 4 deletions(-) diff --git a/cocos/2d/cocos2d.vcxproj b/cocos/2d/cocos2d.vcxproj index 02b11faac0..90be6eac6d 100644 --- a/cocos/2d/cocos2d.vcxproj +++ b/cocos/2d/cocos2d.vcxproj @@ -81,7 +81,7 @@ Level3 - EditAndContinue + OldStyle 4267;4251;4244;%(DisableSpecificWarnings) true
diff --git a/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj b/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj index 98571622cf..f9bebc27e3 100644 --- a/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj +++ b/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj @@ -63,6 +63,7 @@ true 4267;4251;4244;%(DisableSpecificWarnings) false + OldStyle
true diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj index 2947e0396d..eca9c14aef 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj +++ b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj @@ -151,6 +151,7 @@ true 4267;4251;4244;%(DisableSpecificWarnings) false + OldStyle
true diff --git a/cocos/gui/proj.win32/libGUI.vcxproj b/cocos/gui/proj.win32/libGUI.vcxproj index 3cec8f360e..8d40d2cca4 100644 --- a/cocos/gui/proj.win32/libGUI.vcxproj +++ b/cocos/gui/proj.win32/libGUI.vcxproj @@ -104,6 +104,7 @@ true 4267;4251;4244;%(DisableSpecificWarnings) false + OldStyle
true diff --git a/cocos/scripting/lua/bindings/liblua.vcxproj b/cocos/scripting/lua/bindings/liblua.vcxproj index 5006e34a8e..9fc1c1c521 100644 --- a/cocos/scripting/lua/bindings/liblua.vcxproj +++ b/cocos/scripting/lua/bindings/liblua.vcxproj @@ -76,7 +76,7 @@ Level3 - EditAndContinue + OldStyle 4800;4267;4251;4244;%(DisableSpecificWarnings) true
@@ -131,6 +131,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$ + @@ -146,6 +147,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$ + @@ -161,6 +163,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$ + @@ -176,6 +179,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$ + @@ -185,6 +189,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$ + diff --git a/cocos/scripting/lua/bindings/liblua.vcxproj.filters b/cocos/scripting/lua/bindings/liblua.vcxproj.filters index 5f7bbe6fb6..f90bdee1d7 100644 --- a/cocos/scripting/lua/bindings/liblua.vcxproj.filters +++ b/cocos/scripting/lua/bindings/liblua.vcxproj.filters @@ -99,6 +99,12 @@ cocos2dx_support + + cocos2dx_support\generated + + + cocos2dx_support + @@ -185,6 +191,12 @@ cocos2dx_support + + cocos2dx_support\generated + + + cocos2dx_support + @@ -196,5 +208,8 @@ cocos2dx_support\generated + + cocos2dx_support\generated + \ No newline at end of file diff --git a/extensions/proj.win32/libExtensions.vcxproj b/extensions/proj.win32/libExtensions.vcxproj index 1e00952529..809221d8da 100644 --- a/extensions/proj.win32/libExtensions.vcxproj +++ b/extensions/proj.win32/libExtensions.vcxproj @@ -72,7 +72,7 @@ Level3 - EditAndContinue + OldStyle 4267;4251;4244;%(DisableSpecificWarnings) true diff --git a/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj b/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj index b95a8da2f8..7d04e0f16c 100644 --- a/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj +++ b/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj @@ -72,7 +72,7 @@ Level3 MultiThreadedDebugDLL false - EditAndContinue + OldStyle EnableFastChecks Disabled WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) @@ -184,6 +184,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ {b57cf53f-2e49-4031-9822-047cc0e6bde2} + + {b7c2a162-dec9-4418-972e-240ab3cbfcae} + {7e06e92c-537a-442b-9e4a-4761c84f8a1a} From d10992951b961626feb5e0129cb931786d025db8 Mon Sep 17 00:00:00 2001 From: "Daniel T. Borelli" Date: Sat, 4 Jan 2014 02:22:09 -0300 Subject: [PATCH 200/428] fix bad name variable --- cocos/2d/CCDirector.cpp | 8 ++++---- cocos/2d/CCDirector.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index 097d89b433..95c6788426 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -132,7 +132,7 @@ bool Director::init(void) _paused = false; // purge ? - _purgeDirecotorInNextLoop = false; + _purgeDirectorInNextLoop = false; _winSizeInPoints = Size::ZERO; @@ -718,7 +718,7 @@ void Director::popToSceneStackLevel(int level) void Director::end() { - _purgeDirecotorInNextLoop = true; + _purgeDirectorInNextLoop = true; } void Director::purgeDirector() @@ -1077,9 +1077,9 @@ void DisplayLinkDirector::startAnimation() void DisplayLinkDirector::mainLoop() { - if (_purgeDirecotorInNextLoop) + if (_purgeDirectorInNextLoop) { - _purgeDirecotorInNextLoop = false; + _purgeDirectorInNextLoop = false; purgeDirector(); } else if (! _invalid) diff --git a/cocos/2d/CCDirector.h b/cocos/2d/CCDirector.h index b2204e7146..b8d73b02a1 100644 --- a/cocos/2d/CCDirector.h +++ b/cocos/2d/CCDirector.h @@ -392,7 +392,7 @@ public: protected: void purgeDirector(); - bool _purgeDirecotorInNextLoop; // this flag will be set to true in end() + bool _purgeDirectorInNextLoop; // this flag will be set to true in end() void setNextScene(); From e860d659a4db9cf3ec093c340c82a93a6d783161 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 13:45:55 +0800 Subject: [PATCH 201/428] Update AUTHORS [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index cbeafc6df3..37572f6171 100644 --- a/AUTHORS +++ b/AUTHORS @@ -700,6 +700,9 @@ Developers: Fixed a bug that move assignment operator doesn't clear previous content bug. Fixed the compile error of Map's getRandomObject. + daltomi + Fixed a typo in Director class. + Retired Core Developers: WenSheng Yang Author of windows port, CCTextField, From accdf5635f62cc748a24475074751b93f3631c9f Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Sat, 4 Jan 2014 13:54:17 +0800 Subject: [PATCH 202/428] modify print message --- tools/project-creator/module/core.py | 8 ++++---- tools/project-creator/module/ui.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/project-creator/module/core.py b/tools/project-creator/module/core.py index 4ed447076d..fbbe0d43bd 100644 --- a/tools/project-creator/module/core.py +++ b/tools/project-creator/module/core.py @@ -179,7 +179,8 @@ class CocosProject: self.step = 0 #begin copy engine - print("###begin copy engine...") + print("###begin copy engine") + print("waitting copy cocos2d ...") dstPath = os.path.join(self.context["dst_project_path"],"cocos2d") for index in range(len(fileList)): srcfile = os.path.join(self.cocos_root,fileList[index]) @@ -187,7 +188,6 @@ class CocosProject: if not os.path.exists(os.path.dirname(dstfile)): os.makedirs(os.path.dirname(dstfile)) - print (fileList[index]) #copy file or folder if os.path.exists(srcfile): if os.path.isdir(srcfile): @@ -199,9 +199,9 @@ class CocosProject: os.remove(dstfile) shutil.copyfile(srcfile, dstfile) self.step = self.step + 1 - if self.callbackfun and self.step%int(self.totalStep/100) == 0: + if self.callbackfun and self.step%int(self.totalStep/50) == 0: self.callbackfun(self.step,self.totalStep,fileList[index]) - + print("cocos2d\t\t: Done!") # call process_proj from each platform's script folder for platform in self.platforms_list: self.__processPlatformProjects(platform) diff --git a/tools/project-creator/module/ui.py b/tools/project-creator/module/ui.py index 5158832216..7ad74f302d 100644 --- a/tools/project-creator/module/ui.py +++ b/tools/project-creator/module/ui.py @@ -66,7 +66,7 @@ class ThreadedTask(threading.Thread): """ #delete exist project. if os.path.exists(os.path.join(self.projectPath, self.projectName)): - print ("###begin remove... " + self.projectName) + print ("###begin remove: " + self.projectName) try: shutil.rmtree(os.path.join(self.projectPath, self.projectName)) print ("###remove finish: " + self.projectName) From 9bb558ad46b9ebc7df250e179f58b2e90ab09c6e Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 13:54:25 +0800 Subject: [PATCH 203/428] Removes wrong resource in TestJavascript project. --- build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index beb1596808..3666a8842c 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -3090e9edf6cd3b64bc352ca4be641ddf9ab514a1 \ No newline at end of file +8aea01d0022bf6e9bf224758ae661cad380f1e9d \ No newline at end of file From 5ffc3d9726c90e849d8bb283f240a42fb9a2a86c Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Sat, 4 Jan 2014 14:04:39 +0800 Subject: [PATCH 204/428] modify create_project.py suffix --- tools/project-creator/{create_project.pyw => create_project.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/project-creator/{create_project.pyw => create_project.py} (100%) mode change 100755 => 100644 diff --git a/tools/project-creator/create_project.pyw b/tools/project-creator/create_project.py old mode 100755 new mode 100644 similarity index 100% rename from tools/project-creator/create_project.pyw rename to tools/project-creator/create_project.py From 046384ca1fac994256caedf59b21ea3ab03620a0 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 14:22:57 +0800 Subject: [PATCH 205/428] Uses blue folder for iOS & Mac resources to prevent adding new resources. --- build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index 3666a8842c..1b078e4bd7 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -8aea01d0022bf6e9bf224758ae661cad380f1e9d \ No newline at end of file +7c4f96e1ab504f9e029e9127350bd92edc5c6de5 \ No newline at end of file From ef5ab1b9bea289723a991cc5d2ac6e24047ab996 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 14:23:40 +0800 Subject: [PATCH 206/428] sharedXXX -> getInstance, purgeXXX -> destroyInstance. --- .../cocostudio/CCSGUIReader.cpp | 16 ++-- .../editor-support/cocostudio/CCSGUIReader.h | 30 +++---- .../cocostudio/CCSSceneReader.cpp | 3 +- .../cocostudio/CCSSceneReader.h | 2 +- .../CocoStudioGUITest/UIScene.cpp | 2 +- .../CocoStudioSceneTest/SceneEditorTest.cpp | 80 +++++++++---------- 6 files changed, 62 insertions(+), 71 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index 16d00f8fc9..3b3bd6e618 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -44,7 +44,7 @@ GUIReader::~GUIReader() { } -GUIReader* GUIReader::shareReader() +GUIReader* GUIReader::getInstance() { if (!sharedReader) { @@ -53,7 +53,7 @@ GUIReader* GUIReader::shareReader() return sharedReader; } -void GUIReader::purgeGUIReader() +void GUIReader::destroyInstance() { CC_SAFE_DELETE(sharedReader); } @@ -171,13 +171,13 @@ Widget* WidgetPropertiesReader0250::createWidget(const rapidjson::Value& data, c float fileDesignWidth = DICTOOL->getFloatValue_json(data, "designWidth"); float fileDesignHeight = DICTOOL->getFloatValue_json(data, "designHeight"); if (fileDesignWidth <= 0 || fileDesignHeight <= 0) { - printf("Read design size error!\n"); + CCLOGERROR("Read design size error!\n"); Size winSize = Director::getInstance()->getWinSize(); - GUIReader::shareReader()->storeFileDesignSize(fileName, winSize); + GUIReader::getInstance()->storeFileDesignSize(fileName, winSize); } else { - GUIReader::shareReader()->storeFileDesignSize(fileName, Size(fileDesignWidth, fileDesignHeight)); + GUIReader::getInstance()->storeFileDesignSize(fileName, Size(fileDesignWidth, fileDesignHeight)); } const rapidjson::Value& widgetTree = DICTOOL->getSubDictionary_json(data, "widgetTree"); Widget* widget = widgetFromJsonDictionary(widgetTree); @@ -870,13 +870,13 @@ Widget* WidgetPropertiesReader0300::createWidget(const rapidjson::Value& data, c float fileDesignWidth = DICTOOL->getFloatValue_json(data, "designWidth"); float fileDesignHeight = DICTOOL->getFloatValue_json(data, "designHeight"); if (fileDesignWidth <= 0 || fileDesignHeight <= 0) { - printf("Read design size error!\n"); + CCLOGERROR("Read design size error!\n"); Size winSize = Director::getInstance()->getWinSize(); - GUIReader::shareReader()->storeFileDesignSize(fileName, winSize); + GUIReader::getInstance()->storeFileDesignSize(fileName, winSize); } else { - GUIReader::shareReader()->storeFileDesignSize(fileName, Size(fileDesignWidth, fileDesignHeight)); + GUIReader::getInstance()->storeFileDesignSize(fileName, Size(fileDesignWidth, fileDesignHeight)); } const rapidjson::Value& widgetTree = DICTOOL->getSubDictionary_json(data, "widgetTree"); Widget* widget = widgetFromJsonDictionary(widgetTree); diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.h b/cocos/editor-support/cocostudio/CCSGUIReader.h index d9c9526a53..c4584f76f2 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.h +++ b/cocos/editor-support/cocostudio/CCSGUIReader.h @@ -31,27 +31,15 @@ namespace cocostudio { #define kCCSVersion 1.0 -class GUIReader : public cocos2d::Object + +class GUIReader { public: - /** - * @js ctor - */ - GUIReader(); - /** - * @js NA - * @lua NA - */ - ~GUIReader(); - /** - * @js getInstance - * @lua getInstance - */ - static GUIReader* shareReader(); - /** - * @js purge - */ - static void purgeGUIReader(); + CC_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; + CC_DEPRECATED_ATTRIBUTE static void purgeGUIReader() { GUIReader::destroyInstance(); }; + + static GUIReader* getInstance(); + static void destroyInstance(); cocos2d::gui::Widget* widgetFromJsonFile(const char* fileName); int getVersionInteger(const char* str); @@ -63,7 +51,11 @@ public: * @js NA */ const cocos2d::Size getFileDesignSize(const char* fileName) const; + protected: + GUIReader(); + ~GUIReader(); + std::string m_strFilePath; cocos2d::ValueMap _fileDesignSizes; diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index b7c598ca20..0a046c8334 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -374,7 +374,7 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par } else if(comName != nullptr && strcmp(comName, "GUIComponent") == 0) { - Widget* widget= GUIReader::shareReader()->widgetFromJsonFile(pPath.c_str()); + Widget* widget= GUIReader::getInstance()->widgetFromJsonFile(pPath.c_str()); ComRender *pRender = ComRender::create(widget, "GUIComponent"); if (pComName != nullptr) { @@ -460,7 +460,6 @@ void SceneReader::destroyInstance() { DictionaryHelper::destroyInstance(); TriggerMng::destroyInstance(); - _fnSelector = nullptr; CocosDenshion::SimpleAudioEngine::end(); CC_SAFE_DELETE(s_sharedReader); } diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.h b/cocos/editor-support/cocostudio/CCSSceneReader.h index 0c04be3309..459062710f 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/CCSSceneReader.h @@ -39,7 +39,7 @@ public: * @js purge * @lua destroySceneReader */ - void destroyInstance(); + static void destroyInstance(); static const char* sceneReaderVersion(); cocos2d::Node* createNodeWithSceneFile(const std::string &fileName); void setTarget(const std::function& selector); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp index 75d90246e7..7eafc723da 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp @@ -27,7 +27,7 @@ bool UIScene::init() _uiLayer = Layer::create(); addChild(_uiLayer); - _widget = dynamic_cast(cocostudio::GUIReader::shareReader()->widgetFromJsonFile("cocosgui/UITest/UITest.json")); + _widget = dynamic_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosgui/UITest/UITest.json")); _uiLayer->addChild(_widget); Size screenSize = Director::getInstance()->getWinSize(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index d0d057fe32..e765f2677f 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -228,10 +228,10 @@ void LoadSceneEdtiorFileTest::onEnter() void LoadSceneEdtiorFileTest::onExit() { - ArmatureDataManager::getInstance()->destroyInstance(); - SceneReader::getInstance()->destroyInstance(); - ActionManagerEx::getInstance()->destroyInstance(); - GUIReader::shareReader()->purgeGUIReader(); + ArmatureDataManager::destroyInstance(); + SceneReader::destroyInstance(); + ActionManagerEx::destroyInstance(); + GUIReader::destroyInstance(); SceneEditorTestLayer::onExit(); } @@ -274,10 +274,10 @@ void SpriteComponentTest::onEnter() void SpriteComponentTest::onExit() { - ArmatureDataManager::getInstance()->destroyInstance(); - SceneReader::getInstance()->destroyInstance(); - ActionManagerEx::getInstance()->destroyInstance(); - GUIReader::shareReader()->purgeGUIReader(); + ArmatureDataManager::destroyInstance(); + SceneReader::destroyInstance(); + ActionManagerEx::destroyInstance(); + GUIReader::destroyInstance(); SceneEditorTestLayer::onExit(); } @@ -329,10 +329,10 @@ void ArmatureComponentTest::onEnter() void ArmatureComponentTest::onExit() { - ArmatureDataManager::getInstance()->destroyInstance(); - SceneReader::getInstance()->destroyInstance(); - ActionManagerEx::getInstance()->destroyInstance(); - GUIReader::shareReader()->purgeGUIReader(); + ArmatureDataManager::destroyInstance(); + SceneReader::destroyInstance(); + ActionManagerEx::destroyInstance(); + GUIReader::destroyInstance(); SceneEditorTestLayer::onExit(); } @@ -380,10 +380,10 @@ void UIComponentTest::onEnter() void UIComponentTest::onExit() { - ArmatureDataManager::getInstance()->destroyInstance(); - SceneReader::getInstance()->destroyInstance(); - ActionManagerEx::getInstance()->destroyInstance(); - GUIReader::shareReader()->purgeGUIReader(); + ArmatureDataManager::destroyInstance(); + SceneReader::destroyInstance(); + ActionManagerEx::destroyInstance(); + GUIReader::destroyInstance(); SceneEditorTestLayer::onExit(); } @@ -450,10 +450,10 @@ void TmxMapComponentTest::onEnter() void TmxMapComponentTest::onExit() { - ArmatureDataManager::getInstance()->destroyInstance(); - SceneReader::getInstance()->destroyInstance(); - ActionManagerEx::getInstance()->destroyInstance(); - GUIReader::shareReader()->purgeGUIReader(); + ArmatureDataManager::destroyInstance(); + SceneReader::destroyInstance(); + ActionManagerEx::destroyInstance(); + GUIReader::destroyInstance(); SceneEditorTestLayer::onExit(); } @@ -506,10 +506,10 @@ void ParticleComponentTest::onEnter() void ParticleComponentTest::onExit() { - ArmatureDataManager::getInstance()->destroyInstance(); - SceneReader::getInstance()->destroyInstance(); - ActionManagerEx::getInstance()->destroyInstance(); - GUIReader::shareReader()->purgeGUIReader(); + ArmatureDataManager::destroyInstance(); + SceneReader::destroyInstance(); + ActionManagerEx::destroyInstance(); + GUIReader::destroyInstance(); SceneEditorTestLayer::onExit(); } @@ -557,10 +557,10 @@ void EffectComponentTest::onEnter() void EffectComponentTest::onExit() { - ArmatureDataManager::getInstance()->destroyInstance(); - SceneReader::getInstance()->destroyInstance(); - ActionManagerEx::getInstance()->destroyInstance(); - GUIReader::shareReader()->purgeGUIReader(); + ArmatureDataManager::destroyInstance(); + SceneReader::destroyInstance(); + ActionManagerEx::destroyInstance(); + GUIReader::destroyInstance(); SceneEditorTestLayer::onExit(); } @@ -619,10 +619,10 @@ void BackgroundComponentTest::onEnter() void BackgroundComponentTest::onExit() { - ArmatureDataManager::getInstance()->destroyInstance(); - SceneReader::getInstance()->destroyInstance(); - ActionManagerEx::getInstance()->destroyInstance(); - GUIReader::shareReader()->purgeGUIReader(); + ArmatureDataManager::destroyInstance(); + SceneReader::destroyInstance(); + ActionManagerEx::destroyInstance(); + GUIReader::destroyInstance(); SceneEditorTestLayer::onExit(); } @@ -669,10 +669,10 @@ void AttributeComponentTest::onEnter() void AttributeComponentTest::onExit() { - ArmatureDataManager::getInstance()->destroyInstance(); - SceneReader::getInstance()->destroyInstance(); - ActionManagerEx::getInstance()->destroyInstance(); - GUIReader::shareReader()->purgeGUIReader(); + ArmatureDataManager::destroyInstance(); + SceneReader::destroyInstance(); + ActionManagerEx::destroyInstance(); + GUIReader::destroyInstance(); SceneEditorTestLayer::onExit(); } @@ -746,10 +746,10 @@ void TriggerTest::onExit() auto dispatcher = Director::getInstance()->getEventDispatcher(); dispatcher->removeEventListener(_touchListener); Device::setAccelerometerEnabled(false); - ArmatureDataManager::getInstance()->destroyInstance(); - SceneReader::getInstance()->destroyInstance(); - ActionManagerEx::getInstance()->destroyInstance(); - GUIReader::shareReader()->purgeGUIReader(); + ArmatureDataManager::destroyInstance(); + SceneReader::destroyInstance(); + ActionManagerEx::destroyInstance(); + GUIReader::destroyInstance(); SceneEditorTestLayer::onExit(); } From 5c77f7d035d581c07787f0a62f312af9dbcc3cd1 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 14:24:25 +0800 Subject: [PATCH 207/428] Refactors search path setting for TestJavascript. --- .../TestJavascript/Classes/AppDelegate.cpp | 38 +++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp index 0da7de9714..5d985b57ea 100644 --- a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp +++ b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp @@ -48,10 +48,42 @@ bool AppDelegate::applicationDidFinishLaunching() // set FPS. the default value is 1.0/60 if you don't call this pDirector->setAnimationInterval(1.0 / 60); - FileUtils::getInstance()->addSearchPath("res"); - FileUtils::getInstance()->addSearchPath("script"); - FileUtils::getInstance()->addSearchPath("res/scenetest"); + auto fileUtils = FileUtils::getInstance(); + std::vector searchPaths; + searchPaths.push_back("script"); + const char* paths[] = { + "res", + "res/scenetest", + "res/scenetest/ArmatureComponentTest", + "res/scenetest/AttributeComponentTest", + "res/scenetest/BackgroundComponentTest", + "res/scenetest/EffectComponentTest", + "res/scenetest/loadSceneEdtiorFileTest", + "res/scenetest/ParticleComponentTest", + "res/scenetest/SpriteComponentTest", + "res/scenetest/TmxMapComponentTest", + "res/scenetest/UIComponentTest", + "res/scenetest/TriggerTest", + }; + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + std::string testFolder = "tests/"; + searchPaths.push_back(testFolder); + + for (const auto& path : paths) + { + searchPaths.push_back(testFolder + path); + } +#else + for (const auto& path : paths) + { + searchPaths.push_back(path); + } +#endif + + fileUtils->setSearchPaths(searchPaths); + ScriptingCore* sc = ScriptingCore::getInstance(); sc->addRegisterCallback(register_all_cocos2dx); sc->addRegisterCallback(register_all_cocos2dx_extension); From e972c97dcfcbd6459611143db0776dea36b62fab Mon Sep 17 00:00:00 2001 From: WuHuan Date: Sat, 4 Jan 2014 14:40:22 +0800 Subject: [PATCH 208/428] support mingw --- cocos/2d/CCActionCamera.cpp | 6 +++--- cocos/2d/platform/win32/CCStdC.h | 11 ++++++++++- cocos/base/CCConsole.cpp | 20 +++++++++++++++++++- cocos/base/CCConsole.h | 2 +- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/cocos/2d/CCActionCamera.cpp b/cocos/2d/CCActionCamera.cpp index 0d8ef23606..7333de1458 100644 --- a/cocos/2d/CCActionCamera.cpp +++ b/cocos/2d/CCActionCamera.cpp @@ -181,11 +181,11 @@ void OrbitCamera::startWithTarget(Node *target) float r, zenith, azimuth; this->sphericalRadius(&r, &zenith, &azimuth); - if( isnan(_radius) ) + if( std::isnan(_radius) ) _radius = r; - if( isnan(_angleZ) ) + if( std::isnan(_angleZ) ) _angleZ = (float)CC_RADIANS_TO_DEGREES(zenith); - if( isnan(_angleX) ) + if( std::isnan(_angleX) ) _angleX = (float)CC_RADIANS_TO_DEGREES(azimuth); _radZ = (float)CC_DEGREES_TO_RADIANS(_angleZ); diff --git a/cocos/2d/platform/win32/CCStdC.h b/cocos/2d/platform/win32/CCStdC.h index 027c8bf3cb..035ff90367 100644 --- a/cocos/2d/platform/win32/CCStdC.h +++ b/cocos/2d/platform/win32/CCStdC.h @@ -108,7 +108,16 @@ NS_CC_END #else -#include +#include +inline int vsnprintf_s(char *buffer, size_t sizeOfBuffer, size_t count, + const char *format, va_list argptr) { + return vsnprintf(buffer, sizeOfBuffer, format, argptr); +} +inline errno_t strcpy_s(char *strDestination, size_t numberOfElements, + const char *strSource) { + strcpy(strDestination, strSource); + return 0; +} #endif // __MINGW32__ diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index e2440a49f7..10a251196b 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -31,7 +31,7 @@ #include #include -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__MINGW32__) #include #include @@ -91,6 +91,24 @@ static void printSceneGraphBoot(int fd) mydprintf(fd, "Total Nodes: %d\n", total); } +#if defined(__MINGW32__) +static const char* inet_ntop(int af, const void* src, char* dst, int cnt) +{ + struct sockaddr_in srcaddr; + + memset(&srcaddr, 0, sizeof(struct sockaddr_in)); + memcpy(&(srcaddr.sin_addr), src, sizeof(srcaddr.sin_addr)); + + srcaddr.sin_family = af; + if (WSAAddressToString((struct sockaddr*) &srcaddr, sizeof(struct sockaddr_in), 0, dst, (LPDWORD) &cnt) != 0) + { + DWORD rv = WSAGetLastError(); + printf("WSAAddressToString() : %d\n",rv); + return NULL; + } + return dst; +} +#endif // // Console code diff --git a/cocos/base/CCConsole.h b/cocos/base/CCConsole.h index d401991525..43faa3d111 100644 --- a/cocos/base/CCConsole.h +++ b/cocos/base/CCConsole.h @@ -26,7 +26,7 @@ #ifndef __CCCONSOLE_H__ #define __CCCONSOLE_H__ -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__MINGW32__) #include //typedef SSIZE_T ssize_t; // ssize_t was redefined as int in libwebsockets.h. From b2dc16c06592a7fe95d3055b731709d344f5a671 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 14:59:24 +0800 Subject: [PATCH 209/428] closed #3580: FileUtilsTest->TextWritePlist crashes --- cocos/base/CCDictionary.cpp | 102 +++++++++++++++++++++++++++++++++--- 1 file changed, 95 insertions(+), 7 deletions(-) diff --git a/cocos/base/CCDictionary.cpp b/cocos/base/CCDictionary.cpp index b958ce0be7..ea1d76ba28 100644 --- a/cocos/base/CCDictionary.cpp +++ b/cocos/base/CCDictionary.cpp @@ -26,6 +26,12 @@ #include "CCString.h" #include "CCInteger.h" #include "platform/CCFileUtils.h" +#include "CCString.h" +#include "CCBool.h" +#include "CCInteger.h" +#include "CCFloat.h" +#include "CCDouble.h" +#include "CCArray.h" using namespace std; @@ -461,15 +467,97 @@ __Dictionary* __Dictionary::createWithContentsOfFile(const char *pFileName) return ret; } +static ValueMap ccdictionary_to_valuemap(__Dictionary* dict); + +static ValueVector ccarray_to_valuevector(__Array* arr) +{ + ValueVector ret; + + Object* obj; + CCARRAY_FOREACH(arr, obj) + { + Value arrElement; + + __String* strVal = nullptr; + __Dictionary* dictVal = nullptr; + __Array* arrVal = nullptr; + __Double* doubleVal = nullptr; + __Bool* boolVal = nullptr; + __Float* floatVal = nullptr; + __Integer* intVal = nullptr; + + if ((strVal = dynamic_cast<__String *>(obj))) { + arrElement = Value(strVal->getCString()); + } else if ((dictVal = dynamic_cast<__Dictionary*>(obj))) { + arrElement = ccdictionary_to_valuemap(dictVal); + } else if ((arrVal = dynamic_cast<__Array*>(obj))) { + arrElement = ccarray_to_valuevector(arrVal); + } else if ((doubleVal = dynamic_cast<__Double*>(obj))) { + arrElement = Value(doubleVal->getValue()); + } else if ((floatVal = dynamic_cast<__Float*>(obj))) { + arrElement = Value(floatVal->getValue()); + } else if ((intVal = dynamic_cast<__Integer*>(obj))) { + arrElement = Value(intVal->getValue()); + } else if ((boolVal = dynamic_cast<__Bool*>(obj))) { + arrElement = boolVal->getValue() ? Value(true) : Value(false); + } else { + CCASSERT(false, "the type isn't suppored."); + } + + ret.push_back(arrElement); + } + return ret; +} + +static ValueMap ccdictionary_to_valuemap(__Dictionary* dict) +{ + ValueMap ret; + DictElement* pElement = nullptr; + CCDICT_FOREACH(dict, pElement) + { + Object* obj = pElement->getObject(); + + __String* strVal = nullptr; + __Dictionary* dictVal = nullptr; + __Array* arrVal = nullptr; + __Double* doubleVal = nullptr; + __Bool* boolVal = nullptr; + __Float* floatVal = nullptr; + __Integer* intVal = nullptr; + + Value dictElement; + + if ((strVal = dynamic_cast<__String *>(obj))) { + dictElement = Value(strVal->getCString()); + } else if ((dictVal = dynamic_cast<__Dictionary*>(obj))) { + dictElement = ccdictionary_to_valuemap(dictVal); + } else if ((arrVal = dynamic_cast<__Array*>(obj))) { + dictElement = ccarray_to_valuevector(arrVal); + } else if ((doubleVal = dynamic_cast<__Double*>(obj))) { + dictElement = Value(doubleVal->getValue()); + } else if ((floatVal = dynamic_cast<__Float*>(obj))) { + dictElement = Value(floatVal->getValue()); + } else if ((intVal = dynamic_cast<__Integer*>(obj))) { + dictElement = Value(intVal->getValue()); + } else if ((boolVal = dynamic_cast<__Bool*>(obj))) { + dictElement = boolVal->getValue() ? Value(true) : Value(false); + } else { + CCASSERT(false, "the type isn't suppored."); + } + + const char* key = pElement->getStrKey(); + if (key && strlen(key) > 0) + { + ret[key] = dictElement; + } + } + return ret; +} + + bool __Dictionary::writeToFile(const char *fullPath) { - ValueMap dict; - DictElement* element = nullptr; - CCDICT_FOREACH(this, element) - { - dict[element->getStrKey()] = Value(static_cast<__String*>(element->getObject())->getCString()); - } - + ValueMap dict = ccdictionary_to_valuemap(this); return FileUtils::getInstance()->writeToFile(dict, fullPath); } From 98265e796102a0b33584616e82f49b84529c479e Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 15:17:36 +0800 Subject: [PATCH 210/428] Reverts GUIReader definition. it should be inherited from Object to make bindings happy. --- cocos/editor-support/cocostudio/CCSGUIReader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.h b/cocos/editor-support/cocostudio/CCSGUIReader.h index c4584f76f2..f93a6c3d5c 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.h +++ b/cocos/editor-support/cocostudio/CCSGUIReader.h @@ -32,7 +32,7 @@ namespace cocostudio { #define kCCSVersion 1.0 -class GUIReader +class GUIReader : public cocos2d::Object { public: CC_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; From 556a6436bd9c0d48c562bece1bdc148256db83f9 Mon Sep 17 00:00:00 2001 From: cw Date: Sat, 4 Jan 2014 15:27:39 +0800 Subject: [PATCH 211/428] =?UTF-8?q?modify=20644=20=E2=80=94>755?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/project-creator/create_project.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/project-creator/create_project.py diff --git a/tools/project-creator/create_project.py b/tools/project-creator/create_project.py old mode 100644 new mode 100755 From ad11468b7b78986065f6543b213434cda5db8239 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sat, 4 Jan 2014 07:40:50 +0000 Subject: [PATCH 212/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 77ab94001c..d33e92408e 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 77ab94001cdd7e026e2a719993833be0da5951f4 +Subproject commit d33e92408e05d9d3ef631ebce30d19bdf79a68d4 From 0550ec33adbac71a8c69bb81c6d4c99420469119 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Sat, 4 Jan 2014 15:46:04 +0800 Subject: [PATCH 213/428] =?UTF-8?q?Fix:Resolve=20the=20bugs=20that=20some?= =?UTF-8?q?=20lua=20test=20cases=20can=E2=80=99t=20run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripting/lua/script/Cocos2dConstants.lua | 6 ++ .../EffectsAdvancedTest.lua | 43 ++++++---- .../luaScript/EffectsTest/EffectsTest.lua | 78 +++++++++---------- .../Resources/luaScript/NodeTest/NodeTest.lua | 15 ++-- .../PerformanceTest/PerformanceTest.lua | 3 +- .../luaScript/TileMapTest/TileMapTest.lua | 16 ++-- 6 files changed, 89 insertions(+), 72 deletions(-) diff --git a/cocos/scripting/lua/script/Cocos2dConstants.lua b/cocos/scripting/lua/script/Cocos2dConstants.lua index 7534f6c24e..82c81598cb 100644 --- a/cocos/scripting/lua/script/Cocos2dConstants.lua +++ b/cocos/scripting/lua/script/Cocos2dConstants.lua @@ -351,4 +351,10 @@ cc.EVENT_KEYBOARD = 3 cc.EVENT_MOUSE = 4 cc.EVENT_ACCELERATION = 5 cc.EVENT_CUSTOM = 6 + +cc.GLYPHCOLLECTION_DYNAMIC = 0 +cc.GLYPHCOLLECTION_NEHE = 1 +cc.GLYPHCOLLECTION_ASCII = 2 +cc.GLYPHCOLLECTION_CUSTOM = 3 + \ No newline at end of file diff --git a/samples/Lua/TestLua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua b/samples/Lua/TestLua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua index b6ea8eb8a2..705ef3fac0 100644 --- a/samples/Lua/TestLua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua @@ -8,23 +8,33 @@ local originCreateLayer = createTestLayer local function createTestLayer(title, subtitle) local ret = originCreateLayer(title, subtitle) - local bg = cc.Sprite:create("Images/background3.png") - ret:addChild(bg, 0, kTagBackground) - bg:setPosition( VisibleRect:center() ) + local bgNode = cc.NodeGrid:create() + bgNode:setAnchorPoint(cc.p(0.5,0.5)) + ret:addChild(bgNode,0,kTagBackground) + local bg = cc.Sprite:create("Images/background3.png") + bg:setPosition( VisibleRect:center()) + bgNode:addChild(bg) + + local target1 = cc.NodeGrid:create() + target1:setAnchorPoint(cc.p(0.5,0.5)) local grossini = cc.Sprite:create("Images/grossinis_sister2.png") - bg:addChild(grossini, 1, kTagSprite1) - grossini:setPosition( cc.p(VisibleRect:left().x+VisibleRect:getVisibleRect().width/3.0, VisibleRect:bottom().y+ 200) ) + target1:addChild(grossini) + bgNode:addChild(target1,1,kTagSprite1) + target1:setPosition(cc.p(VisibleRect:left().x+VisibleRect:getVisibleRect().width/3.0, VisibleRect:bottom().y+ 200) ) local sc = cc.ScaleBy:create(2, 5) local sc_back = sc:reverse() - grossini:runAction( cc.RepeatForever:create(cc.Sequence:create(sc, sc_back))) + target1:runAction( cc.RepeatForever:create(cc.Sequence:create(sc, sc_back))) + local target2 = cc.NodeGrid:create() + target2:setAnchorPoint(cc.p(0.5,0.5)) local tamara = cc.Sprite:create("Images/grossinis_sister1.png") - bg:addChild(tamara, 1, kTagSprite2) - tamara:setPosition( cc.p(VisibleRect:left().x+2*VisibleRect:getVisibleRect().width/3.0,VisibleRect:bottom().y+200) ) + target2:addChild(tamara) + bgNode:addChild(target2,1,kTagSprite2) + target2:setPosition( cc.p(VisibleRect:left().x+2*VisibleRect:getVisibleRect().width/3.0,VisibleRect:bottom().y+200) ) local sc2 = cc.ScaleBy:create(2, 5) local sc2_back = sc2:reverse() - tamara:runAction( cc.RepeatForever:create(cc.Sequence:create(sc2, sc2_back))) + target2:runAction( cc.RepeatForever:create(cc.Sequence:create(sc2, sc2_back))) return ret end @@ -51,9 +61,9 @@ local function Effect1() local reuse = cc.ReuseGrid:create(1) local delay = cc.DelayTime:create(8) - local orbit = cc.OrbitCamera:create(5, 1, 2, 0, 180, 0, -90) - local orbit_back = orbit:reverse() - target:runAction( cc.RepeatForever:create( cc.Sequence:create(orbit, orbit_back))) + -- local orbit = cc.OrbitCamera:create(5, 1, 2, 0, 180, 0, -90) + -- local orbit_back = orbit:reverse() + -- target:runAction( cc.RepeatForever:create( cc.Sequence:create(orbit, orbit_back))) target:runAction( cc.Sequence:create(lens, delay, reuse, waves)) return ret end @@ -165,7 +175,8 @@ local function Effect4() -- ret:addChild(pTarget) -- director:getActionManager():addAction(seq, pTarget, false) - ret:runAction( lens ) + local bg = ret:getChildByTag(kTagBackground) + bg:runAction( lens ) return ret end @@ -216,6 +227,7 @@ local function Issue631() layer:addChild(sprite, 10) -- foreground + local layer2BaseGrid = cc.NodeGrid:create() local layer2 = cc.LayerColor:create(cc.c4b( 0, 255,0,255 ) ) local fog = cc.Sprite:create("Images/Fog.png") @@ -225,9 +237,10 @@ local function Issue631() fog:setBlendFunc(gl.SRC_ALPHA , gl.ONE_MINUS_SRC_ALPHA ) layer2:addChild(fog, 1) - ret:addChild(layer2, 1) + ret:addChild(layer2BaseGrid, 1) + layer2BaseGrid:addChild(layer2) - layer2:runAction( cc.RepeatForever:create(effect) ) + layer2BaseGrid:runAction( cc.RepeatForever:create(effect) ) return ret end diff --git a/samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsTest.lua b/samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsTest.lua index 34e4b7cd05..b5fbe8e1d0 100644 --- a/samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsTest.lua @@ -11,17 +11,16 @@ local MAX_LAYER = 22 local testLayer = nil local titleLabel = nil local entry = nil +local gridNodeTarget = nil local function checkAnim(dt) - local s2 = testLayer:getChildByTag(kTagBackground) - if s2 == nil then + + if nil == gridNodeTarget then return end - if s2:getNumberOfRunningActions() == 0 then - if s2:getGrid() ~= nil then - s2:setGrid(nil) - end + if gridNodeTarget:getNumberOfRunningActions() == 0 and nil ~=gridNodeTarget:getGrid() then + gridNodeTarget:setGrid(nil) end end @@ -85,14 +84,14 @@ end -- Shaky3DDemo -------------------------------------- local function Shaky3DDemo(t) - return cc.Shaky3D:create(t, cc.size(15,10), 5, false); + return cc.Shaky3D:create(t, cc.size(15,10), 5, false) end -------------------------------------- -- Waves3DDemo -------------------------------------- local function Waves3DDemo(t) - return cc.Waves3D:create(t, cc.size(15,10), 5, 40); + return cc.Waves3D:create(t, cc.size(15,10), 5, 40) end -------------------------------------- @@ -121,56 +120,56 @@ end -- Lens3DDemo -------------------------------------- local function Lens3DDemo(t) - return cc.Lens3D:create(t, cc.size(15,10), cc.p(size.width/2,size.height/2), 240); + return cc.Lens3D:create(t, cc.size(15,10), cc.p(size.width/2,size.height/2), 240) end -------------------------------------- -- Ripple3DDemo -------------------------------------- local function Ripple3DDemo(t) - return cc.Ripple3D:create(t, cc.size(32,24), cc.p(size.width/2,size.height/2), 240, 4, 160); + return cc.Ripple3D:create(t, cc.size(32,24), cc.p(size.width/2,size.height/2), 240, 4, 160) end -------------------------------------- -- LiquidDemo -------------------------------------- local function LiquidDemo(t) - return cc.Liquid:create(t, cc.size(16,12), 4, 20); + return cc.Liquid:create(t, cc.size(16,12), 4, 20) end -------------------------------------- -- WavesDemo -------------------------------------- local function WavesDemo(t) - return cc.Waves:create(t, cc.size(16,12), 4, 20, true, true); + return cc.Waves:create(t, cc.size(16,12), 4, 20, true, true) end -------------------------------------- -- TwirlDemo -------------------------------------- local function TwirlDemo(t) - return cc.Twirl:create(t, cc.size(12,8), cc.p(size.width/2, size.height/2), 1, 2.5); + return cc.Twirl:create(t, cc.size(12,8), cc.p(size.width/2, size.height/2), 1, 2.5) end -------------------------------------- -- ShakyTiles3DDemo -------------------------------------- local function ShakyTiles3DDemo(t) - return cc.ShakyTiles3D:create(t, cc.size(16,12), 5, false); + return cc.ShakyTiles3D:create(t, cc.size(16,12), 5, false) end -------------------------------------- -- ShatteredTiles3DDemo -------------------------------------- local function ShatteredTiles3DDemo(t) - return cc.ShatteredTiles3D:create(t, cc.size(16,12), 5, false); + return cc.ShatteredTiles3D:create(t, cc.size(16,12), 5, false) end -------------------------------------- -- ShuffleTilesDemo -------------------------------------- local function ShuffleTilesDemo(t) - local shuffle = cc.ShuffleTiles:create(t, cc.size(16,12), 25); + local shuffle = cc.ShuffleTiles:create(t, cc.size(16,12), 25) local shuffle_back = shuffle:reverse() local delay = cc.DelayTime:create(2) @@ -181,7 +180,7 @@ end -- FadeOutTRTilesDemo -------------------------------------- local function FadeOutTRTilesDemo(t) - local fadeout = cc.FadeOutTRTiles:create(t, cc.size(16,12)); + local fadeout = cc.FadeOutTRTiles:create(t, cc.size(16,12)) local back = fadeout:reverse() local delay = cc.DelayTime:create(0.5) @@ -192,7 +191,7 @@ end -- FadeOutBLTilesDemo -------------------------------------- local function FadeOutBLTilesDemo(t) - local fadeout = cc.FadeOutBLTiles:create(t, cc.size(16,12)); + local fadeout = cc.FadeOutBLTiles:create(t, cc.size(16,12)) local back = fadeout:reverse() local delay = cc.DelayTime:create(0.5) @@ -203,7 +202,7 @@ end -- FadeOutUpTilesDemo -------------------------------------- local function FadeOutUpTilesDemo(t) - local fadeout = cc.FadeOutUpTiles:create(t, cc.size(16,12)); + local fadeout = cc.FadeOutUpTiles:create(t, cc.size(16,12)) local back = fadeout:reverse() local delay = cc.DelayTime:create(0.5) @@ -214,7 +213,7 @@ end -- FadeOutDownTilesDemo -------------------------------------- local function FadeOutDownTilesDemo(t) - local fadeout = cc.FadeOutDownTiles:create(t, cc.size(16,12)); + local fadeout = cc.FadeOutDownTiles:create(t, cc.size(16,12)) local back = fadeout:reverse() local delay = cc.DelayTime:create(0.5) @@ -225,7 +224,7 @@ end -- TurnOffTilesDemo -------------------------------------- local function TurnOffTilesDemo(t) - local fadeout = cc.TurnOffTiles:create(t, cc.size(48,32), 25); + local fadeout = cc.TurnOffTiles:create(t, cc.size(48,32), 25) local back = fadeout:reverse() local delay = cc.DelayTime:create(0.5) @@ -236,28 +235,28 @@ end -- WavesTiles3DDemo -------------------------------------- local function WavesTiles3DDemo(t) - return cc.WavesTiles3D:create(t, cc.size(15,10), 4, 120); + return cc.WavesTiles3D:create(t, cc.size(15,10), 4, 120) end -------------------------------------- -- JumpTiles3DDemo -------------------------------------- local function JumpTiles3DDemo(t) - return cc.JumpTiles3D:create(t, cc.size(15,10), 2, 30); + return cc.JumpTiles3D:create(t, cc.size(15,10), 2, 30) end -------------------------------------- -- SplitRowsDemo -------------------------------------- local function SplitRowsDemo(t) - return cc.SplitRows:create(t, 9); + return cc.SplitRows:create(t, 9) end -------------------------------------- -- SplitColsDemo -------------------------------------- local function SplitColsDemo(t) - return cc.SplitCols:create(t, 9); + return cc.SplitCols:create(t, 9) end -------------------------------------- @@ -265,7 +264,7 @@ end -------------------------------------- local function PageTurn3DDemo(t) cc.Director:getInstance():setDepthTest(true) - return cc.PageTurn3D:create(t, cc.size(15,10)); + return cc.PageTurn3D:create(t, cc.size(15,10)) end -------------------------------------- @@ -327,30 +326,31 @@ end function CreateEffectsTestLayer() testLayer = cc.LayerColor:create(cc.c4b(32,128,32,255)) - local x, y = size.width, size.height - local node = cc.Node:create() + gridNodeTarget = cc.NodeGrid:create() local effect = createEffect(ActionIdx, 3) - node:runAction(effect) - testLayer:addChild(node, 0, kTagBackground) - + gridNodeTarget:runAction(effect) + testLayer:addChild(gridNodeTarget, 0, kTagBackground) + local bg = cc.Sprite:create(s_back3) - node:addChild(bg, 0) - bg:setPosition(cc.p(size.width / 2, size.height / 2)) + gridNodeTarget:addChild(bg, 0) + bg:setPosition(VisibleRect:center()) local grossini = cc.Sprite:create(s_pPathSister2) - node:addChild(grossini, 1) - grossini:setPosition( cc.p(x / 3, y / 2) ) + gridNodeTarget:addChild(grossini, 1) + grossini:setPosition( cc.p(VisibleRect:left().x+VisibleRect:getVisibleRect().width/3,VisibleRect:center().y) ) local sc = cc.ScaleBy:create(2, 5) local sc_back = sc:reverse() - grossini:runAction(cc.RepeatForever:create(cc.Sequence:create(sc, sc_back))) + grossini:runAction( cc.RepeatForever:create(cc.Sequence:create(sc, sc_back) ) ) local tamara = cc.Sprite:create(s_pPathSister1) - node:addChild(tamara, 1) - tamara:setPosition(cc.p(2 * x / 3, y / 2)) + gridNodeTarget:addChild(tamara, 1) + tamara:setPosition( cc.p(VisibleRect:left().x+2*VisibleRect:getVisibleRect().width/3,VisibleRect:center().y) ) local sc2 = cc.ScaleBy:create(2, 5) local sc2_back = sc2:reverse() - tamara:runAction(cc.RepeatForever:create(cc.Sequence:create(sc2, sc2_back))) + tamara:runAction( cc.RepeatForever:create(cc.Sequence:create(sc2, sc2_back)) ) + + local x, y = size.width, size.height titleLabel = cc.LabelTTF:create(EffectsList[ActionIdx], "Marker Felt", 32) titleLabel:setPosition(x / 2, y - 80) diff --git a/samples/Lua/TestLua/Resources/luaScript/NodeTest/NodeTest.lua b/samples/Lua/TestLua/Resources/luaScript/NodeTest/NodeTest.lua index 54e27c2682..47e4d0103e 100644 --- a/samples/Lua/TestLua/Resources/luaScript/NodeTest/NodeTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/NodeTest/NodeTest.lua @@ -446,7 +446,6 @@ local function CameraOrbitTest() sprite:setScale(0.5) p:addChild(sprite, 0) sprite:setPosition(cc.p(s.width / 4 * 1, s.height / 2)) - local cam = sprite:getCamera() local orbit = cc.OrbitCamera:create(2, 1, 0, 0, 360, 0, 0) sprite:runAction(cc.RepeatForever:create(orbit)) @@ -488,12 +487,12 @@ local function CameraZoomTest_update(dt) z = z + dt * 100 local sprite = CameraZoomTest_layer:getChildByTag(20) - local cam = sprite:getCamera() - cam:setEye(0, 0, z) + -- local cam = sprite:getCamera() + -- cam:setEye(0, 0, z) sprite = CameraZoomTest_layer:getChildByTag(40) - cam = sprite:getCamera() - cam:setEye(0, 0, -z) + -- cam = sprite:getCamera() + -- cam:setEye(0, 0, -z) end local function CameraZoomTest_onEnterOrExit(tag) @@ -515,9 +514,9 @@ local function CameraZoomTest() local sprite = cc.Sprite:create(s_pPathGrossini) CameraZoomTest_layer:addChild(sprite, 0) sprite:setPosition(cc.p(s.width / 4 * 1, s.height / 2)) - local cam = sprite:getCamera() - cam:setEye(0, 0, 415 / 2) - cam:setCenter(0, 0, 0) + -- local cam = sprite:getCamera() + -- cam:setEye(0, 0, 415 / 2) + -- cam:setCenter(0, 0, 0) -- CENTER sprite = cc.Sprite:create(s_pPathGrossini) diff --git a/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceTest.lua b/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceTest.lua index 6673fc8d67..0267dd0eb0 100644 --- a/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceTest.lua @@ -733,7 +733,7 @@ local function runParticleTest() --remove the "fire.png" from the TextureCache cache. local pTexture = cc.TextureCache:getInstance():addImage("Images/fire.png") cc.TextureCache:getInstance():removeTexture(pTexture) - local pParticleSystem = cc.ParticleSystemQuad:new() + local pParticleSystem = cc.ParticleSystemQuad:createWithTotalParticles(nQuantityParticles) if 1 == nSubtestNumber then cc.Texture2D:setDefaultAlphaPixelFormat(cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888) elseif 2 == nSubtestNumber then @@ -752,7 +752,6 @@ local function runParticleTest() end if nil ~= pParticleSystem then - pParticleSystem:initWithTotalParticles(nQuantityParticles) pParticleSystem:setTexture(cc.TextureCache:getInstance():addImage("Images/fire.png")) end diff --git a/samples/Lua/TestLua/Resources/luaScript/TileMapTest/TileMapTest.lua b/samples/Lua/TestLua/Resources/luaScript/TileMapTest/TileMapTest.lua index c53801e734..c2326ca230 100644 --- a/samples/Lua/TestLua/Resources/luaScript/TileMapTest/TileMapTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/TileMapTest/TileMapTest.lua @@ -174,14 +174,14 @@ local function TMXOrthoTest() child:getTexture():setAntiAliasTexParameters() end - local x = 0 - local y = 0 - local z = 0 - x, y, z = map:getCamera():getEye() - cclog("before eye x="..x..",y="..y..",z="..z) - map:getCamera():setEye(x-200, y, z+300) - x, y, z = map:getCamera():getEye() - cclog("after eye x="..x..",y="..y..",z="..z) + -- local x = 0 + -- local y = 0 + -- local z = 0 + -- x, y, z = map:getCamera():getEye() + -- cclog("before eye x="..x..",y="..y..",z="..z) + -- map:getCamera():setEye(x-200, y, z+300) + -- x, y, z = map:getCamera():getEye() + -- cclog("after eye x="..x..",y="..y..",z="..z) local function onNodeEvent(event) From 6e1c508960ecec366d3d454131fa8cc46c55d9f9 Mon Sep 17 00:00:00 2001 From: heliclei Date: Sat, 4 Jan 2014 16:25:31 +0800 Subject: [PATCH 214/428] use print_exc() instead of format_exc() --- tools/jenkins-scripts/ghprb.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index 936ce61bfc..b0d3669997 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -22,7 +22,7 @@ def set_description(desc): try: urllib2.urlopen(req) except: - traceback.format_exc() + traceback.print_exc() def main(): #get payload from os env payload_str = os.environ['payload'] @@ -56,13 +56,13 @@ def main(): #set commit status to pending target_url = os.environ['BUILD_URL'] data = {"state":"pending", "target_url":target_url} - acccess_token = os.environ['GITHUB_ACCESS_TOKEN'] - Headers = {"Authorization":"token " + acccess_token} + access_token = os.environ['GITHUB_ACCESS_TOKEN'] + Headers = {"Authorization":"token " + access_token} try: requests.post(statuses_url, data=json.dumps(data), headers=Headers) except: - traceback.format_exc() + traceback.print_exc() #reset path to workspace root os.system("cd " + os.environ['WORKSPACE']); @@ -93,6 +93,7 @@ def main(): #get build result print "build finished and return " + str(ret) + exit_code = 1 if ret == 0: exit_code = 0 data['state'] = "success" @@ -105,7 +106,7 @@ def main(): try: requests.post(statuses_url, data=json.dumps(data), headers=Headers) except: - traceback.format_exc() + traceback.print_exc() #clean workspace os.system("cd " + os.environ['WORKSPACE']); @@ -119,5 +120,5 @@ if __name__ == '__main__': try: main() except: - traceback.format_exc() + traceback.print_exc() exit(1) From 17be52740aa999842c2de84a1ebad9e33ef64186 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 16:57:46 +0800 Subject: [PATCH 215/428] Removes duplicated file in Android.mk --- cocos/editor-support/cocostudio/Android.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/cocos/editor-support/cocostudio/Android.mk b/cocos/editor-support/cocostudio/Android.mk index 7e7d525ab2..7f8d1c4de2 100644 --- a/cocos/editor-support/cocostudio/Android.mk +++ b/cocos/editor-support/cocostudio/Android.mk @@ -8,7 +8,6 @@ LOCAL_MODULE_FILENAME := libcocostudio LOCAL_SRC_FILES := CCActionFrame.cpp \ CCActionEaseEx.cpp \ CCActionFrameEasing.cpp \ -CCActionEaseEx.cpp \ CCActionManagerEx.cpp \ CCActionNode.cpp \ CCActionObject.cpp \ From 052f24ccebe3e25146a5c6ec79661ce08313da99 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 17:33:21 +0800 Subject: [PATCH 216/428] [ci skip] Updates TestLua project for iOS and Mac. --- build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index cb769f7f12..0f53b948c7 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -5f9a4c5622863bb36794083f1446a6d392a3f1fd \ No newline at end of file +2efefc01ff97bda1498d1d4a850ea1881f751f7c \ No newline at end of file From 68275388027e930bb5c058ccc83aca096c7a3567 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 18:12:09 +0800 Subject: [PATCH 217/428] Adds override keyword for override functions. --- cocos/2d/CCLabelBMFont.h | 2 +- cocos/gui/UITextField.h | 8 ++++---- extensions/GUI/CCEditBox/CCEditBox.h | 22 +++++++++++----------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cocos/2d/CCLabelBMFont.h b/cocos/2d/CCLabelBMFont.h index 9b3f226806..58fb570f2b 100644 --- a/cocos/2d/CCLabelBMFont.h +++ b/cocos/2d/CCLabelBMFont.h @@ -234,7 +234,7 @@ public: virtual const std::string& getString() const override; virtual void setCString(const char *label); - virtual void setAnchorPoint(const Point& var); + virtual void setAnchorPoint(const Point& var) override; virtual void updateLabel(); virtual void setAlignment(TextHAlignment alignment); virtual void setWidth(float width); diff --git a/cocos/gui/UITextField.h b/cocos/gui/UITextField.h index 8a00135062..382f80e97a 100644 --- a/cocos/gui/UITextField.h +++ b/cocos/gui/UITextField.h @@ -47,10 +47,10 @@ public: static UICCTextField* create(const char *placeholder, const char *fontName, float fontSize); // CCTextFieldDelegate - virtual bool onTextFieldAttachWithIME(TextFieldTTF *pSender); - virtual bool onTextFieldDetachWithIME(TextFieldTTF * pSender); - virtual bool onTextFieldInsertText(TextFieldTTF * pSender, const char * text, int nLen); - virtual bool onTextFieldDeleteBackward(TextFieldTTF * pSender, const char * delText, int nLen); + virtual bool onTextFieldAttachWithIME(TextFieldTTF *pSender) override; + virtual bool onTextFieldDetachWithIME(TextFieldTTF * pSender) override; + virtual bool onTextFieldInsertText(TextFieldTTF * pSender, const char * text, int nLen) override; + virtual bool onTextFieldDeleteBackward(TextFieldTTF * pSender, const char * delText, int nLen) override; void insertText(const char* text, int len); void deleteBackward(); diff --git a/extensions/GUI/CCEditBox/CCEditBox.h b/extensions/GUI/CCEditBox/CCEditBox.h index 23f375fc53..a1aac55d6e 100644 --- a/extensions/GUI/CCEditBox/CCEditBox.h +++ b/extensions/GUI/CCEditBox/CCEditBox.h @@ -366,45 +366,45 @@ public: void setReturnType(EditBox::KeyboardReturnType returnType); /* override functions */ - virtual void setPosition(const Point& pos); - virtual void setVisible(bool visible); - virtual void setContentSize(const Size& size); - virtual void setAnchorPoint(const Point& anchorPoint); + virtual void setPosition(const Point& pos) override; + virtual void setVisible(bool visible) override; + virtual void setContentSize(const Size& size) override; + virtual void setAnchorPoint(const Point& anchorPoint) override; /** * @js NA * @lua NA */ - virtual void visit(void); + virtual void visit(void) override; /** * @js NA * @lua NA */ - virtual void onEnter(void); + virtual void onEnter(void) override; /** * @js NA * @lua NA */ - virtual void onExit(void); + virtual void onExit(void) override; /** * @js NA * @lua NA */ - virtual void keyboardWillShow(IMEKeyboardNotificationInfo& info); + virtual void keyboardWillShow(IMEKeyboardNotificationInfo& info) override; /** * @js NA * @lua NA */ - virtual void keyboardDidShow(IMEKeyboardNotificationInfo& info); + virtual void keyboardDidShow(IMEKeyboardNotificationInfo& info) override; /** * @js NA * @lua NA */ - virtual void keyboardWillHide(IMEKeyboardNotificationInfo& info); + virtual void keyboardWillHide(IMEKeyboardNotificationInfo& info) override; /** * @js NA * @lua NA */ - virtual void keyboardDidHide(IMEKeyboardNotificationInfo& info); + virtual void keyboardDidHide(IMEKeyboardNotificationInfo& info) override; /* callback funtions * @js NA From c793f2e0fc5722828150323b6fafa75d6c099bcc Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sat, 4 Jan 2014 10:19:07 +0000 Subject: [PATCH 218/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index d33e92408e..0e8db00fab 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit d33e92408e05d9d3ef631ebce30d19bdf79a68d4 +Subproject commit 0e8db00fab4570fbd6b3c120319bdf4d02089e4f From 08dad985928b946cdcf39efadc0b7f1c1cb7fe3b Mon Sep 17 00:00:00 2001 From: "Daniel T. Borelli" Date: Sat, 4 Jan 2014 07:22:50 -0300 Subject: [PATCH 219/428] map:erase() is safe for item.second == FontAtlas* --- cocos/2d/CCFontAtlasCache.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/cocos/2d/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp index b72b76540c..69eebc083a 100644 --- a/cocos/2d/CCFontAtlasCache.cpp +++ b/cocos/2d/CCFontAtlasCache.cpp @@ -103,20 +103,18 @@ std::string FontAtlasCache::generateFontName(const std::string& fontFileName, in bool FontAtlasCache::releaseFontAtlas(FontAtlas *atlas) { - if (atlas) + if (nullptr != atlas) { for( auto &item: _atlasMap ) { if ( item.second == atlas ) { - bool removeFromList = false; - if(item.second->isSingleReference()) - removeFromList = true; + if( atlas->isSingleReference() ) + { + _atlasMap.erase(item.first); + } - item.second->release(); - - if (removeFromList) - _atlasMap.erase(item.first); + atlas->release(); return true; } @@ -126,4 +124,4 @@ bool FontAtlasCache::releaseFontAtlas(FontAtlas *atlas) return false; } -NS_CC_END \ No newline at end of file +NS_CC_END From 465aba951c3b709f6d3f160a2d27ef0f57c84c31 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Sat, 4 Jan 2014 18:36:33 +0800 Subject: [PATCH 220/428] Fix:Remove the ScollView and TableView of extension gui lua binding --- cocos/scripting/lua/bindings/CCLuaEngine.cpp | 95 +-- .../lua_cocos2dx_coco_studio_manual.cpp | 98 +++ .../lua_cocos2dx_extension_manual.cpp | 763 ------------------ .../bindings/lua_cocos2dx_extension_manual.h | 11 - cocos/scripting/lua/script/Deprecated.lua | 14 - .../scripting/lua/script/DeprecatedClass.lua | 24 - .../luaScript/ExtensionTest/ExtensionTest.lua | 197 +---- tools/tolua/cocos2dx_extension.ini | 4 +- 8 files changed, 104 insertions(+), 1102 deletions(-) diff --git a/cocos/scripting/lua/bindings/CCLuaEngine.cpp b/cocos/scripting/lua/bindings/CCLuaEngine.cpp index 0dc5528ae7..752fb3561a 100644 --- a/cocos/scripting/lua/bindings/CCLuaEngine.cpp +++ b/cocos/scripting/lua/bindings/CCLuaEngine.cpp @@ -858,101 +858,14 @@ int LuaEngine::handleEvent(ScriptHandlerMgr::HandlerType type, void* data, int n int LuaEngine::handleTableViewEvent(ScriptHandlerMgr::HandlerType type,void* data) { - if (nullptr == data) - return 0; - - BasicScriptData* eventData = static_cast(data); - if (nullptr == eventData->nativeObject || nullptr == eventData->value) - return 0; - - LuaTableViewEventData* tableViewData = static_cast(eventData->value); - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)eventData->nativeObject, type); - - if (0 == handler) - return 0; - - Object* obj = static_cast(eventData->nativeObject); - if (nullptr == obj) - return 0; - - int ret = 0; - switch (type) - { - case ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL: - case ScriptHandlerMgr::HandlerType::SCROLLVIEW_ZOOM: - { - toluafix_pushusertype_ccobject(_stack->getLuaState(), obj->_ID, &(obj->_luaID), (void*)(obj),"TableView"); - ret = _stack->executeFunctionByHandler(handler, 1); - } - break; - case ScriptHandlerMgr::HandlerType::TABLECELL_TOUCHED: - case ScriptHandlerMgr::HandlerType::TABLECELL_HIGHLIGHT: - case ScriptHandlerMgr::HandlerType::TABLECELL_UNHIGHLIGHT: - case ScriptHandlerMgr::HandlerType::TABLECELL_WILL_RECYCLE: - { - Object* cellObject = static_cast(tableViewData->value); - if (nullptr == cellObject) { - break; - } - toluafix_pushusertype_ccobject(_stack->getLuaState(), obj->_ID, &(obj->_luaID), (void*)(obj),"TableView"); - toluafix_pushusertype_ccobject(_stack->getLuaState(), cellObject->_ID, &(cellObject->_luaID), (void*)(cellObject),"TableViewCell"); - ret = _stack->executeFunctionByHandler(handler, 2); - } - break; - default: - break; - } - - return ret; + CCASSERT(0, "TableView is not bound yet"); + return 0; } int LuaEngine::handleTableViewEvent(ScriptHandlerMgr::HandlerType handlerType,void* data, int numResults, const std::function& func) { - if (nullptr == data || numResults <= 0) - return 0; - - BasicScriptData* eventData = static_cast(data); - if (nullptr == eventData->nativeObject || nullptr == eventData->value) - return 0; - - LuaTableViewEventData* tableViewData = static_cast(eventData->value); - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)eventData->nativeObject, handlerType); - - if (0 == handler) - return 0; - - Object* obj = static_cast(eventData->nativeObject); - if (nullptr == obj) - return 0; - - int ret = 0; - switch (handlerType) - { - case ScriptHandlerMgr::HandlerType::TABLECELL_SIZE_FOR_INDEX: - { - toluafix_pushusertype_ccobject(_stack->getLuaState(), obj->_ID, &(obj->_luaID), (void*)(obj),"TableView"); - _stack->pushLong(*((ssize_t*)tableViewData->value)); - ret = _stack->executeFunction(handler, 2, 2, func); - } - break; - case ScriptHandlerMgr::HandlerType::TABLECELL_AT_INDEX: - { - toluafix_pushusertype_ccobject(_stack->getLuaState(), obj->_ID, &(obj->_luaID), (void*)(obj),"TableView"); - _stack->pushLong(*((ssize_t*)tableViewData->value)); - ret = _stack->executeFunction(handler, 2, 1, func); - } - break; - case ScriptHandlerMgr::HandlerType::TABLEVIEW_NUMS_OF_CELLS: - { - toluafix_pushusertype_ccobject(_stack->getLuaState(), obj->_ID, &(obj->_luaID), (void*)(obj),"TableView"); - ret = _stack->executeFunction(handler, 1, 1, func); - } - break; - default: - break; - } - - return ret; + CCASSERT(0, "TableView is not bound yet"); + return 0; } int LuaEngine::handleAssetsManagerEvent(ScriptHandlerMgr::HandlerType type,void* data) diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp index affd70c634..a72df5ca6b 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp @@ -295,12 +295,110 @@ static void extendArmatureDataManager(lua_State* L) lua_pop(L, 1); } +static int lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData(lua_State* L) +{ + if (nullptr == L) + return 0; + + int argc = 0; + cocostudio::Bone* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"Bone",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData'\n", NULL); + return 0; + } +#endif + + argc = lua_gettop(L) - 1; + + if (1 == argc) + { +#if COCOS2D_DEBUG >= 1 + if (!tolua_isboolean(L, 2, 0, &tolua_err)) + goto tolua_lerror; +#endif + bool ignore = (bool)tolua_toboolean(L, 2, 0); + self->setIgnoreMovementBoneData(ignore); + return 0; + } + + CCLOG("'setIgnoreMovementBoneData' function of Bone has wrong number of arguments: %d, was expecting %d\n", argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'setIgnoreMovementBoneData'.",&tolua_err); + return 0; +#endif +} + +static int lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData(lua_State* L) +{ + if (nullptr == L) + return 0; + + int argc = 0; + cocostudio::Bone* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"Bone",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData'\n", NULL); + return 0; + } +#endif + + argc = lua_gettop(L) - 1; + + if (0 == argc) + { + tolua_pushboolean(L, self->getIgnoreMovementBoneData()); + return 1; + } + + CCLOG("'getIgnoreMovementBoneData' function of Bone has wrong number of arguments: %d, was expecting %d\n", argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'getIgnoreMovementBoneData'.",&tolua_err); + return 0; +#endif +} + +static void extendBone(lua_State* L) +{ + lua_pushstring(L, "Bone"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "setIgnoreMovementBoneData", lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData); + tolua_function(L, "getIgnoreMovementBoneData", lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData); + } + lua_pop(L, 1); +} + int register_all_cocos2dx_coco_studio_manual(lua_State* L) { if (nullptr == L) return 0; extendArmatureAnimation(L); extendArmatureDataManager(L); + extendBone(L); return 0; } \ No newline at end of file diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp index 68ca441fd6..160037fbca 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp @@ -19,202 +19,6 @@ USING_NS_CC; USING_NS_CC_EXT; using namespace cocostudio; -class LuaScrollViewDelegate:public Object, public ScrollViewDelegate -{ -public: - virtual ~LuaScrollViewDelegate() - {} - - virtual void scrollViewDidScroll(ScrollView* view) - { - if (nullptr != view) - { - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)view, ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL); - if (0 != handler) - { - CommonScriptData data(handler,""); - ScriptEvent event(kCommonEvent,(void*)&data); - LuaEngine::getInstance()->sendEvent(&event); - } - - } - } - - virtual void scrollViewDidZoom(ScrollView* view) - { - if (nullptr != view) - { - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)view, ScriptHandlerMgr::HandlerType::SCROLLVIEW_ZOOM); - if (0 != handler) - { - CommonScriptData data(handler,""); - ScriptEvent event(kCommonEvent,(void*)&data); - LuaEngine::getInstance()->sendEvent(&event); - } - } - } -}; - -static int tolua_cocos2dx_ScrollView_setDelegate(lua_State* tolua_S) -{ - if (nullptr == tolua_S) - return 0; - - int argc = 0; - ScrollView* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"ScrollView",0,&tolua_err)) goto tolua_lerror; -#endif - - self = (ScrollView*) tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) - { - tolua_error(tolua_S,"invalid 'self' in function 'tolua_cocos2dx_ScrollView_setDelegate'\n", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (0 == argc) - { - LuaScrollViewDelegate* delegate = new LuaScrollViewDelegate(); - if (nullptr == delegate) - return 0; - - self->setUserObject(delegate); - self->setDelegate(delegate); - - delegate->release(); - - return 0; - } - - CCLOG("'setDelegate' function of ScrollView wrong number of arguments: %d, was expecting %d\n", argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'setDelegate'.",&tolua_err); - return 0; -#endif -} - -static int tolua_cocos2d_ScrollView_registerScriptHandler(lua_State* tolua_S) -{ - if (NULL == tolua_S) - return 0; - - int argc = 0; - ScrollView* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"ScrollView",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(tolua_S,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(tolua_S,"invalid 'self' in function 'tolua_cocos2d_ScrollView_registerScriptHandler'\n", NULL); - return 0; - } -#endif - argc = lua_gettop(tolua_S) - 1; - if (2 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(tolua_S,2,"LUA_FUNCTION",0,&tolua_err) || - !tolua_isnumber(tolua_S, 3, 0, &tolua_err) ) - { - goto tolua_lerror; - } -#endif - LUA_FUNCTION handler = ( toluafix_ref_function(tolua_S,2,0)); - ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType) ((int)tolua_tonumber(tolua_S,3,0) + (int)ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL); - - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, handlerType); - return 0; - } - - CCLOG("'registerScriptHandler' function of ScrollView has wrong number of arguments: %d, was expecting %d\n", argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'registerScriptHandler'.",&tolua_err); - return 0; -#endif -} - -static int tolua_cocos2d_ScrollView_unregisterScriptHandler(lua_State* tolua_S) -{ - if (NULL == tolua_S) - return 0; - - int argc = 0; - ScrollView* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"ScrollView",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(tolua_S,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(tolua_S,"invalid 'self' in function 'tolua_cocos2d_ScrollView_unregisterScriptHandler'\n", NULL); - return 0; - } -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (1 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err)) - goto tolua_lerror; -#endif - ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType) ((int)tolua_tonumber(tolua_S,2,0) + (int)ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL); - ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, handlerType); - return 0; - } - - CCLOG("'unregisterScriptHandler' function of ScrollView has wrong number of arguments: %d, was expecting %d\n", argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'unregisterScriptHandler'.",&tolua_err); - return 0; -#endif -} - -static void extendScrollView(lua_State* tolua_S) -{ - lua_pushstring(tolua_S, "ScrollView"); - lua_rawget(tolua_S, LUA_REGISTRYINDEX); - if (lua_istable(tolua_S,-1)) - { - lua_pushstring(tolua_S,"setDelegate"); - lua_pushcfunction(tolua_S,tolua_cocos2dx_ScrollView_setDelegate ); - lua_rawset(tolua_S,-3); - lua_pushstring(tolua_S,"registerScriptHandler"); - lua_pushcfunction(tolua_S,tolua_cocos2d_ScrollView_registerScriptHandler ); - lua_rawset(tolua_S,-3); - lua_pushstring(tolua_S,"unregisterScriptHandler"); - lua_pushcfunction(tolua_S,tolua_cocos2d_ScrollView_unregisterScriptHandler ); - lua_rawset(tolua_S,-3); - } - lua_pop(tolua_S, 1); -} - static int tolua_cocos2d_Control_registerControlEventHandler(lua_State* tolua_S) { if (NULL == tolua_S) @@ -859,570 +663,6 @@ static void extendCCBAnimationManager(lua_State* tolua_S) lua_pop(tolua_S, 1); } -#define KEY_TABLEVIEW_DATA_SOURCE "TableViewDataSource" -#define KEY_TABLEVIEW_DELEGATE "TableViewDelegate" - -class LUA_TableViewDelegate:public Object, public TableViewDelegate -{ -public: - LUA_TableViewDelegate(){} - - virtual ~LUA_TableViewDelegate(){} - - - virtual void scrollViewDidScroll(ScrollView* view) - { - if (nullptr != view) - { - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)view, ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL); - if (0 != handler) - { - LuaTableViewEventData eventData; - BasicScriptData data(view,&eventData); - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL, (void*)&data); - } - } - } - - virtual void scrollViewDidZoom(ScrollView* view) - { - if (nullptr != view) - { - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)view, ScriptHandlerMgr::HandlerType::SCROLLVIEW_ZOOM); - if (0 != handler) - { - LuaTableViewEventData eventData; - BasicScriptData data(view,&eventData); - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::SCROLLVIEW_ZOOM, (void*)&data); - } - } - } - - virtual void tableCellTouched(TableView* table, TableViewCell* cell) - { - if (nullptr != table && nullptr != cell) - { - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_TOUCHED); - if (0 != handler) - { - LuaTableViewEventData eventData(cell); - BasicScriptData data(table,&eventData); - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_TOUCHED,(void*)&data); - } - } - } - - virtual void tableCellHighlight(TableView* table, TableViewCell* cell) - { - if (nullptr != table && nullptr != cell) - { - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_HIGHLIGHT); - if (0 != handler) - { - LuaTableViewEventData eventData(cell); - BasicScriptData data(table,&eventData); - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_HIGHLIGHT,(void*)&data); - } - } - } - - virtual void tableCellUnhighlight(TableView* table, TableViewCell* cell) - { - if (nullptr != table && nullptr != cell) - { - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_UNHIGHLIGHT); - if (0 != handler) - { - LuaTableViewEventData eventData(cell); - BasicScriptData data(table,&eventData); - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_UNHIGHLIGHT,(void*)&data); - } - } - } - - virtual void tableCellWillRecycle(TableView* table, TableViewCell* cell) - { - if (nullptr != table && nullptr != cell) - { - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_WILL_RECYCLE); - if (0 != handler) - { - LuaTableViewEventData eventData(cell); - BasicScriptData data(table,&eventData); - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_WILL_RECYCLE,(void*)&data); - } - } - } -}; - -static int lua_cocos2dx_TableView_setDelegate(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - TableView* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"TableView",0,&tolua_err)) goto tolua_lerror; -#endif - - self = (TableView*) tolua_tousertype(L,1,0); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) - { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_TableView_setDelegate'\n", nullptr); - return 0; - } -#endif - - argc = lua_gettop(L) - 1; - - if (0 == argc) - { - LUA_TableViewDelegate* delegate = new LUA_TableViewDelegate(); - if (nullptr == delegate) - return 0; - - Dictionary* userDict = static_cast(self->getUserObject()); - if (nullptr == userDict) - { - userDict = new Dictionary(); - if (NULL == userDict) - return 0; - - self->setUserObject(userDict); - userDict->release(); - } - - userDict->setObject(delegate, KEY_TABLEVIEW_DELEGATE); - self->setDelegate(delegate); - delegate->release(); - - return 0; - } - - CCLOG("'setDelegate' function of TableView wrong number of arguments: %d, was expecting %d\n", argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'setDelegate'.",&tolua_err); - return 0; -#endif -} - -class LUA_TableViewDataSource:public Object,public TableViewDataSource -{ -public: - LUA_TableViewDataSource(){} - virtual ~LUA_TableViewDataSource(){} - - virtual Size tableCellSizeForIndex(TableView *table, ssize_t idx) - { - if (nullptr != table ) - { - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_SIZE_FOR_INDEX); - if (0 != handler) - { - LuaTableViewEventData eventData(&idx); - BasicScriptData data(table,&eventData); - float width = 0.0; - float height = 0.0; - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_SIZE_FOR_INDEX, (void*)&data,2,[&](lua_State* L,int numReturn){ - CCASSERT(numReturn == 2, "tableCellSizeForIndex return count error"); - ValueVector vec; - width = (float)tolua_tonumber(L, -1, 0); - lua_pop(L, 1); - height = (float)tolua_tonumber(L, -1, 0); - lua_pop(L, 1); - }); - - return Size(width, height); - } - } - - return Size::ZERO; - } - - virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx) - { - if (nullptr != table ) - { - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_AT_INDEX); - if (0 != handler) - { - LuaTableViewEventData eventData(&idx); - BasicScriptData data(table,&eventData); - TableViewCell* viewCell = nullptr; - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_AT_INDEX, (void*)&data, 1, [&](lua_State* L, int numReturn){ - CCASSERT(numReturn == 1, "tableCellAtIndex return count error"); - viewCell = static_cast(tolua_tousertype(L, -1, nullptr)); - lua_pop(L, 1); - }); - - return viewCell; - } - } - - return NULL; - } - - virtual ssize_t numberOfCellsInTableView(TableView *table) - { - if (nullptr != table ) - { - int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLEVIEW_NUMS_OF_CELLS); - if (0 != handler) - { - LuaTableViewEventData eventData; - BasicScriptData data(table,&eventData); - ssize_t counts = 0; - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLEVIEW_NUMS_OF_CELLS, (void*)&data,1, [&](lua_State* L, int numReturn){ - CCASSERT(numReturn == 1, "numberOfCellsInTableView return count error"); - counts = (ssize_t)tolua_tonumber(L, -1, 0); - lua_pop(L, 1); - }); - return counts; - } - } - return 0; - } -}; - -static int lua_cocos2dx_TableView_setDataSource(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - TableView* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"TableView",0,&tolua_err)) goto tolua_lerror; -#endif - - self = (TableView*) tolua_tousertype(L,1,0); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) - { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_TableView_setDataSource'\n", nullptr); - return 0; - } -#endif - - argc = lua_gettop(L) - 1; - - if (0 == argc) - { - LUA_TableViewDataSource* dataSource = new LUA_TableViewDataSource(); - if (nullptr == dataSource) - return 0; - - Dictionary* userDict = static_cast(self->getUserObject()); - if (nullptr == userDict) - { - userDict = new Dictionary(); - if (NULL == userDict) - return 0; - - self->setUserObject(userDict); - userDict->release(); - } - - userDict->setObject(dataSource, KEY_TABLEVIEW_DATA_SOURCE); - - self->setDataSource(dataSource); - - dataSource->release(); - - return 0; - } - - CCLOG("'setDataSource' function of TableView wrong number of arguments: %d, was expecting %d\n", argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'setDataSource'.",&tolua_err); - return 0; -#endif -} - -static int lua_cocos2dx_TableView_create(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"TableView",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(L) - 1; - - if (2 == argc || 1 == argc) - { - LUA_TableViewDataSource* dataSource = new LUA_TableViewDataSource(); - Size size; - ok &= luaval_to_size(L, 2, &size); - - TableView* ret = nullptr; - - if (1 == argc) - { - ret = TableView::create(dataSource, size); - } - else - { -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(L,3,"Node",0,&tolua_err)) goto tolua_lerror; -#endif - Node* node = static_cast(tolua_tousertype(L, 3, nullptr)); - ret = TableView::create(dataSource, size, node); - } - - if (nullptr == ret) - return 0; - - ret->reloadData(); - - Dictionary* userDict = new Dictionary(); - userDict->setObject(dataSource, KEY_TABLEVIEW_DATA_SOURCE); - ret->setUserObject(userDict); - userDict->release(); - - dataSource->release(); - - - int nID = (int)ret->_ID; - int* pLuaID = &ret->_luaID; - toluafix_pushusertype_ccobject(L, nID, pLuaID, (void*)ret,"TableView"); - - return 1; - } - CCLOG("'create' function of TableView wrong number of arguments: %d, was expecting %d\n", argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'create'.",&tolua_err); - return 0; -#endif -} - -static int lua_cocos2d_TableView_registerScriptHandler(lua_State* L) -{ - if (NULL == L) - return 0; - - int argc = 0; - TableView* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"TableView",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'tolua_cocos2d_TableView_registerScriptHandler'\n", NULL); - return 0; - } -#endif - argc = lua_gettop(L) - 1; - if (2 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err) || - !tolua_isnumber(L, 3, 0, &tolua_err) ) - { - goto tolua_lerror; - } -#endif - LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); - ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType) ((int)tolua_tonumber(L,3,0) + (int)ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL); - - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, handlerType); - return 0; - } - - CCLOG("'registerScriptHandler' function of TableView has wrong number of arguments: %d, was expecting %d\n", argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'registerScriptHandler'.",&tolua_err); - return 0; -#endif -} - -static int lua_cocos2d_TableView_unregisterScriptHandler(lua_State* L) -{ - if (NULL == L) - return 0; - - int argc = 0; - TableView* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"TableView",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2d_TableView_unregisterScriptHandler'\n", NULL); - return 0; - } -#endif - - argc = lua_gettop(L) - 1; - - if (1 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!tolua_isnumber(L, 2, 0, &tolua_err)) - goto tolua_lerror; -#endif - ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType) ((int)tolua_tonumber(L,2,0) + (int)ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL); - ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, handlerType); - return 0; - } - - CCLOG("'unregisterScriptHandler' function of TableView has wrong number of arguments: %d, was expecting %d\n", argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'unregisterScriptHandler'.",&tolua_err); - return 0; -#endif -} - -static void extendTableView(lua_State* L) -{ - lua_pushstring(L, "TableView"); - lua_rawget(L, LUA_REGISTRYINDEX); - if (lua_istable(L,-1)) - { - tolua_function(L, "setDelegate", lua_cocos2dx_TableView_setDelegate); - tolua_function(L, "setDataSource", lua_cocos2dx_TableView_setDataSource); - tolua_function(L, "create", lua_cocos2dx_TableView_create); - tolua_function(L, "registerScriptHandler", lua_cocos2d_TableView_registerScriptHandler); - tolua_function(L, "unregisterScriptHandler", lua_cocos2d_TableView_unregisterScriptHandler); - } - lua_pop(L, 1); -} - -static int lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - cocostudio::Bone* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"Bone",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData'\n", NULL); - return 0; - } -#endif - - argc = lua_gettop(L) - 1; - - if (1 == argc) - { -#if COCOS2D_DEBUG >= 1 - if (!tolua_isboolean(L, 2, 0, &tolua_err)) - goto tolua_lerror; -#endif - bool ignore = (bool)tolua_toboolean(L, 2, 0); - self->setIgnoreMovementBoneData(ignore); - return 0; - } - - CCLOG("'setIgnoreMovementBoneData' function of Bone has wrong number of arguments: %d, was expecting %d\n", argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'setIgnoreMovementBoneData'.",&tolua_err); - return 0; -#endif -} - -static int lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData(lua_State* L) -{ - if (nullptr == L) - return 0; - - int argc = 0; - cocostudio::Bone* self = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"Bone",0,&tolua_err)) goto tolua_lerror; -#endif - - self = static_cast(tolua_tousertype(L,1,0)); - -#if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData'\n", NULL); - return 0; - } -#endif - - argc = lua_gettop(L) - 1; - - if (0 == argc) - { - tolua_pushboolean(L, self->getIgnoreMovementBoneData()); - return 1; - } - - CCLOG("'getIgnoreMovementBoneData' function of Bone has wrong number of arguments: %d, was expecting %d\n", argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'getIgnoreMovementBoneData'.",&tolua_err); - return 0; -#endif -} - -static void extendBone(lua_State* L) -{ - lua_pushstring(L, "Bone"); - lua_rawget(L, LUA_REGISTRYINDEX); - if (lua_istable(L,-1)) - { - tolua_function(L, "setIgnoreMovementBoneData", lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData); - tolua_function(L, "getIgnoreMovementBoneData", lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData); - } - lua_pop(L, 1); -} - class LuaAssetsManagerDelegateProtocol:public Object, public AssetsManagerDelegateProtocol { public: @@ -1539,13 +779,10 @@ static void extendAssetsManager(lua_State* L) int register_all_cocos2dx_extension_manual(lua_State* tolua_S) { - extendScrollView(tolua_S); extendControl(tolua_S); extendEditBox(tolua_S); extendCCBReader(tolua_S); extendCCBAnimationManager(tolua_S); - extendTableView(tolua_S); - extendBone(tolua_S); extendAssetsManager(tolua_S); return 0; } diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h index 39ebdaa7a2..d369ee3659 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h @@ -14,17 +14,6 @@ extern "C" { TOLUA_API int register_all_cocos2dx_extension_manual(lua_State* tolua_S); TOLUA_API int register_cocos2dx_extension_CCBProxy(lua_State* tolua_S); -struct LuaTableViewEventData -{ - void* value; - - // Constructor - LuaTableViewEventData(void* _value = nullptr) - :value(_value) - { - } -}; - struct LuaAssetsManagerEventData { int value; diff --git a/cocos/scripting/lua/script/Deprecated.lua b/cocos/scripting/lua/script/Deprecated.lua index 391c47238a..e48ba122e9 100644 --- a/cocos/scripting/lua/script/Deprecated.lua +++ b/cocos/scripting/lua/script/Deprecated.lua @@ -1097,17 +1097,3 @@ end rawset(CCEGLView,"sharedOpenGLView",CCEGLViewDeprecated.sharedOpenGLView) --functions of CCEGLView will be deprecated end ---Enums of CCTableView will be deprecated begin -rawset(CCTableView, "kTableViewScroll",cc.SCROLLVIEW_SCRIPT_SCROLL) -rawset(CCTableView,"kTableViewZoom",cc.SCROLLVIEW_SCRIPT_ZOOM) -rawset(CCTableView,"kTableCellTouched",cc.TABLECELL_TOUCHED) -rawset(CCTableView,"kTableCellSizeForIndex",cc.TABLECELL_SIZE_FOR_INDEX) -rawset(CCTableView,"kTableCellSizeAtIndex",cc.TABLECELL_SIZE_AT_INDEX) -rawset(CCTableView,"kNumberOfCellsInTableView",cc.NUMBER_OF_CELLS_IN_TABLEVIEW) ---Enums of CCTableView will be deprecated end - ---Enums of CCScrollView will be deprecated begin -rawset(CCScrollView, "kScrollViewScroll",cc.SCROLLVIEW_SCRIPT_SCROLL) -rawset(CCScrollView,"kScrollViewZoom",cc.SCROLLVIEW_SCRIPT_ZOOM) ---Enums of CCScrollView will be deprecated end - diff --git a/cocos/scripting/lua/script/DeprecatedClass.lua b/cocos/scripting/lua/script/DeprecatedClass.lua index c06266c319..c899d0a0dc 100644 --- a/cocos/scripting/lua/script/DeprecatedClass.lua +++ b/cocos/scripting/lua/script/DeprecatedClass.lua @@ -175,14 +175,6 @@ end _G["CCEaseElasticOut"] = DeprecatedClass.CCEaseElasticOut() --CCEaseElasticOut class will be Deprecated,end ---CCTableViewCell class will be Deprecated,begin -function DeprecatedClass.CCTableViewCell() - deprecatedTip("CCTableViewCell","cc.TableViewCell") - return cc.TableViewCell -end -_G["CCTableViewCell"] = DeprecatedClass.CCTableViewCell() ---CCTableViewCell class will be Deprecated,end - --CCEaseBackOut class will be Deprecated,begin function DeprecatedClass.CCEaseBackOut() deprecatedTip("CCEaseBackOut","cc.EaseBackOut") @@ -727,14 +719,6 @@ end _G["CCPlace"] = DeprecatedClass.CCPlace() --CCPlace class will be Deprecated,end ---CCScrollView class will be Deprecated,begin -function DeprecatedClass.CCScrollView() - deprecatedTip("CCScrollView","cc.ScrollView") - return cc.ScrollView -end -_G["CCScrollView"] = DeprecatedClass.CCScrollView() ---CCScrollView class will be Deprecated,end - --CCGLProgram class will be Deprecated,begin function DeprecatedClass.CCGLProgram() deprecatedTip("CCGLProgram","cc.GLProgram") @@ -815,14 +799,6 @@ end _G["CCParticleFlower"] = DeprecatedClass.CCParticleFlower() --CCParticleFlower class will be Deprecated,end ---CCTableView class will be Deprecated,begin -function DeprecatedClass.CCTableView() - deprecatedTip("CCTableView","cc.TableView") - return cc.TableView -end -_G["CCTableView"] = DeprecatedClass.CCTableView() ---CCTableView class will be Deprecated,end - --CCParticleSmoke class will be Deprecated,begin function DeprecatedClass.CCParticleSmoke() deprecatedTip("CCParticleSmoke","cc.ParticleSmoke") diff --git a/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/ExtensionTest.lua b/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/ExtensionTest.lua index 261dd70730..b831962568 100644 --- a/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/ExtensionTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/ExtensionTest.lua @@ -11,9 +11,7 @@ local ExtensionTestEnum = TEST_COCOSBUILDER = 2, TEST_WEBSOCKET = 3, TEST_EDITBOX = 4, - TEST_TABLEVIEW = 5, - TEST_SCROLLVIEW = 6, - TEST_MAX_COUNT = 7, + TEST_MAX_COUNT = 5, } local testsName = @@ -23,8 +21,6 @@ local testsName = "CocosBuilderTest", "WebSocketTest", "EditBoxTest", - "TableViewTest", - "ScrollViewTest", } @@ -992,195 +988,6 @@ local function runEditBoxTest() return newScene end - -local TableViewTestLayer = class("TableViewTestLayer") -TableViewTestLayer.__index = TableViewTestLayer - -function TableViewTestLayer.extend(target) - local t = tolua.getpeer(target) - if not t then - t = {} - tolua.setpeer(target, t) - end - setmetatable(t, TableViewTestLayer) - return target -end - -function TableViewTestLayer.scrollViewDidScroll(view) - print("scrollViewDidScroll") -end - -function TableViewTestLayer.scrollViewDidZoom(view) - print("scrollViewDidZoom") -end - -function TableViewTestLayer.tableCellTouched(table,cell) - print("cell touched at index: " .. cell:getIdx()) -end - -function TableViewTestLayer.cellSizeForTable(table,idx) - return 60,60 -end - -function TableViewTestLayer.tableCellAtIndex(table, idx) - local strValue = string.format("%d",idx) - local cell = table:dequeueCell() - local label = nil - if nil == cell then - cell = cc.TableViewCell:new() - local sprite = cc.Sprite:create("Images/Icon.png") - sprite:setAnchorPoint(cc.p(0,0)) - sprite:setPosition(cc.p(0, 0)) - cell:addChild(sprite) - - label = cc.LabelTTF:create(strValue, "Helvetica", 20.0) - label:setPosition(cc.p(0,0)) - label:setAnchorPoint(cc.p(0,0)) - label:setTag(123) - cell:addChild(label) - else - label = tolua.cast(cell:getChildByTag(123),"LabelTTF") - if nil ~= label then - label:setString(strValue) - end - end - - return cell -end - -function TableViewTestLayer.numberOfCellsInTableView(table) - return 25 -end - -function TableViewTestLayer:init() - - local winSize = cc.Director:getInstance():getWinSize() - - local tableView = cc.TableView:create(cc.size(600,60)) - tableView:setDirection(cc.SCROLLVIEW_DIRECTION_HORIZONTAL) - tableView:setPosition(cc.p(20, winSize.height / 2 - 150)) - tableView:setDelegate() - self:addChild(tableView) - --registerScriptHandler functions must be before the reloadData funtion - tableView:registerScriptHandler(TableViewTestLayer.numberOfCellsInTableView,cc.NUMBER_OF_CELLS_IN_TABLEVIEW) - tableView:registerScriptHandler(TableViewTestLayer.scrollViewDidScroll,cc.SCROLLVIEW_SCRIPT_SCROLL) - tableView:registerScriptHandler(TableViewTestLayer.scrollViewDidZoom,cc.SCROLLVIEW_SCRIPT_ZOOM) - tableView:registerScriptHandler(TableViewTestLayer.tableCellTouched,cc.TABLECELL_TOUCHED) - tableView:registerScriptHandler(TableViewTestLayer.cellSizeForTable,cc.TABLECELL_SIZE_FOR_INDEX) - tableView:registerScriptHandler(TableViewTestLayer.tableCellAtIndex,cc.TABLECELL_SIZE_AT_INDEX) - tableView:reloadData() - - tableView = cc.TableView:create(cc.size(60, 350)) - tableView:setDirection(cc.SCROLLVIEW_DIRECTION_VERTICAL) - tableView:setPosition(cc.p(winSize.width - 150, winSize.height / 2 - 150)) - tableView:setDelegate() - tableView:setVerticalFillOrder(cc.TABLEVIEW_FILL_TOPDOWN) - self:addChild(tableView) - tableView:registerScriptHandler(TableViewTestLayer.scrollViewDidScroll,cc.SCROLLVIEW_SCRIPT_SCROLL) - tableView:registerScriptHandler(TableViewTestLayer.scrollViewDidZoom,cc.SCROLLVIEW_SCRIPT_ZOOM) - tableView:registerScriptHandler(TableViewTestLayer.tableCellTouched,cc.TABLECELL_TOUCHED) - tableView:registerScriptHandler(TableViewTestLayer.cellSizeForTable,cc.TABLECELL_SIZE_FOR_INDEX) - tableView:registerScriptHandler(TableViewTestLayer.tableCellAtIndex,cc.TABLECELL_SIZE_AT_INDEX) - tableView:registerScriptHandler(TableViewTestLayer.numberOfCellsInTableView,cc.NUMBER_OF_CELLS_IN_TABLEVIEW) - tableView:reloadData() - - -- Back Menu - local pToMainMenu = cc.Menu:create() - CreateExtensionsBasicLayerMenu(pToMainMenu) - pToMainMenu:setPosition(cc.p(0, 0)) - self:addChild(pToMainMenu,10) - - return true -end - -function TableViewTestLayer.create() - local layer = TableViewTestLayer.extend(cc.Layer:create()) - if nil ~= layer then - layer:init() - end - - return layer -end - -local function runTableViewTest() - local newScene = cc.Scene:create() - local newLayer = TableViewTestLayer.create() - newScene:addChild(newLayer) - return newScene -end - -local function runScrollViewTest() - local newScene = cc.Scene:create() - local newLayer = cc.Layer:create() - - -- Back Menu - local pToMainMenu = cc.Menu:create() - CreateExtensionsBasicLayerMenu(pToMainMenu) - pToMainMenu:setPosition(cc.p(0, 0)) - newLayer:addChild(pToMainMenu,10) - - local layerColor = cc.LayerColor:create(cc.c4b(128,64,0,255)) - newLayer:addChild(layerColor) - - local scrollView1 = cc.ScrollView:create() - local screenSize = cc.Director:getInstance():getWinSize() - local function scrollView1DidScroll() - print("scrollView1DidScroll") - end - local function scrollView1DidZoom() - print("scrollView1DidZoom") - end - if nil ~= scrollView1 then - scrollView1:setViewSize(cc.size(screenSize.width / 2,screenSize.height)) - scrollView1:setPosition(cc.p(0,0)) - scrollView1:setScale(1.0) - scrollView1:ignoreAnchorPointForPosition(true) - local flowersprite1 = cc.Sprite:create("ccb/flower.jpg") - if nil ~= flowersprite1 then - scrollView1:setContainer(flowersprite1) - scrollView1:updateInset() - end - scrollView1:setDirection(cc.SCROLLVIEW_DIRECTION_BOTH ) - scrollView1:setClippingToBounds(true) - scrollView1:setBounceable(true) - scrollView1:setDelegate() - scrollView1:registerScriptHandler(scrollView1DidScroll,cc.SCROLLVIEW_SCRIPT_SCROLL) - scrollView1:registerScriptHandler(scrollView1DidZoom,cc.SCROLLVIEW_SCRIPT_ZOOM) - end - newLayer:addChild(scrollView1) - - local scrollView2 = cc.ScrollView:create() - local function scrollView2DidScroll() - print("scrollView2DidScroll") - end - local function scrollView2DidZoom() - print("scrollView2DidZoom") - end - if nil ~= scrollView2 then - scrollView2:setViewSize(cc.size(screenSize.width / 2,screenSize.height)) - scrollView2:setPosition(cc.p(screenSize.width / 2,0)) - scrollView2:setScale(1.0) - scrollView2:ignoreAnchorPointForPosition(true) - local flowersprite2 = cc.Sprite:create("ccb/flower.jpg") - if nil ~= flowersprite2 then - scrollView2:setContainer(flowersprite2) - scrollView2:updateInset() - end - scrollView2:setDirection(cc.SCROLLVIEW_DIRECTION_BOTH ) - scrollView2:setClippingToBounds(true) - scrollView2:setBounceable(true) - scrollView2:setDelegate() - scrollView2:registerScriptHandler(scrollView2DidScroll,cc.SCROLLVIEW_SCRIPT_SCROLL) - scrollView2:registerScriptHandler(scrollView2DidZoom,cc.SCROLLVIEW_SCRIPT_ZOOM) - end - newLayer:addChild(scrollView2) - - newScene:addChild(newLayer) - return newScene -end - - - local CreateExtensionsTestTable = { runNotificationCenterTest, @@ -1188,8 +995,6 @@ local CreateExtensionsTestTable = runCocosBuilder, runWebSocketTest, runEditBoxTest, - runTableViewTest, - runScrollViewTest, } diff --git a/tools/tolua/cocos2dx_extension.ini b/tools/tolua/cocos2dx_extension.ini index 2ac5b8f3c6..d75f375305 100644 --- a/tools/tolua/cocos2dx_extension.ini +++ b/tools/tolua/cocos2dx_extension.ini @@ -27,7 +27,7 @@ headers = %(cocosdir)s/extensions/cocos-ext.h %(cocosdir)s/cocos/editor-support/ # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = AssetsManager.* CCBReader.* CCBAnimationManager.* Scale9Sprite Control.* ControlButton.* ScrollView$ TableView$ TableViewCell$ EditBox$ +classes = AssetsManager.* CCBReader.* CCBAnimationManager.* Scale9Sprite Control.* ControlButton.* EditBox$ # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -38,12 +38,10 @@ classes = AssetsManager.* CCBReader.* CCBAnimationManager.* Scale9Sprite Control skip = CCBReader::[^CCBReader$ addOwnerCallbackName isJSControlled readByte getCCBMemberVariableAssigner readFloat getCCBSelectorResolver toLowerCase lastPathComponent deletePathExtension endsWith concat getResolutionScale getAnimatedProperties readBool readInt addOwnerCallbackNode addDocumentCallbackName readCachedString readNodeGraphFromData addDocumentCallbackNode getLoadedSpriteSheet initWithData readFileWithCleanUp getOwner$ readNodeGraphFromFile createSceneWithNodeGraphFromFile getAnimationManagers$ setAnimationManagers], CCBAnimationManager::[setAnimationCompletedCallback setCallFunc addNode], - ScrollView::[(g|s)etDelegate$], .*Delegate::[*], .*Loader.*::[*], *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType (g|s)etDelegate .*HSV], EditBox::[(g|s)etDelegate ^keyboard.* touchDownAction getScriptEditBoxHandler registerScriptEditBoxHandler unregisterScriptEditBoxHandler], - TableView::[create (g|s)etDataSource$ (g|s)etDelegate], AssetsManager::[(g|s)etDelegate], AssetsManagerDelegateProtocol::[*], Control::[removeHandleOfControlEvent addHandleOfControlEvent], From 0b2926cb70b81408731d4d2dfa4dce7eafef8653 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sat, 4 Jan 2014 11:09:00 +0000 Subject: [PATCH 221/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 0e8db00fab..2cff3ce062 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 0e8db00fab4570fbd6b3c120319bdf4d02089e4f +Subproject commit 2cff3ce0622c8b82f83bfdcbd5c729ee5fda0bec From 42356e8597432a0bef4f0ec159caa0fa3c45a099 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 21:53:03 +0800 Subject: [PATCH 222/428] =?UTF-8?q?Exchanges=20order=20of=20Sprite::setSpr?= =?UTF-8?q?iteFrame(string),=20Sprite::setSpriteFrame(frame)=20.=20It?= =?UTF-8?q?=E2=80=99s=20needed=20for=20bindings-generator=20to=20generate?= =?UTF-8?q?=20correct=20binding=20glue=20codes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/2d/CCSprite.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index 3b99769c07..e9e3f06cff 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -230,8 +230,8 @@ public: /** * Sets a new SpriteFrame to the Sprite. */ - virtual void setSpriteFrame(SpriteFrame* newFrame); virtual void setSpriteFrame(const std::string &spriteFrameName); + virtual void setSpriteFrame(SpriteFrame* newFrame); /** @deprecated Use `setSpriteFrame()` instead. */ CC_DEPRECATED_ATTRIBUTE virtual void setDisplayFrame(SpriteFrame *newFrame) { setSpriteFrame(newFrame); } From 3c04d586b045d760629d3819e76198eb672e5214 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 21:54:05 +0800 Subject: [PATCH 223/428] Wrong warning fixes correct in ccUTF8.cpp. --- cocos/2d/ccUTF8.cpp | 50 ++++++++++++++++++++++----------------------- cocos/2d/ccUTF8.h | 6 +++--- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/cocos/2d/ccUTF8.cpp b/cocos/2d/ccUTF8.cpp index 4d31700b85..1cde665dfd 100644 --- a/cocos/2d/ccUTF8.cpp +++ b/cocos/2d/ccUTF8.cpp @@ -318,10 +318,10 @@ std::vector cc_utf16_vec_from_utf16_str(const unsigned short* st * Return value: number of bytes written **/ int -cc_unichar_to_utf8 (unsigned short c, +cc_unichar_to_utf8 (unsigned int c, char *outbuf) { - unsigned int len = 0; + int len = 0; int first; int i; @@ -335,23 +335,21 @@ cc_unichar_to_utf8 (unsigned short c, first = 0xc0; len = 2; } - // XXX FIXME - // These conditions are alwasy true. -// else if (c < 0x10000) -// { -// first = 0xe0; -// len = 3; -// } -// else if (c < 0x200000) -// { -// first = 0xf0; -// len = 4; -// } -// else if (c < 0x4000000) -// { -// first = 0xf8; -// len = 5; -// } + else if (c < 0x10000) + { + first = 0xe0; + len = 3; + } + else if (c < 0x200000) + { + first = 0xf0; + len = 4; + } + else if (c < 0x4000000) + { + first = 0xf8; + len = 5; + } else { first = 0xfc; @@ -400,9 +398,9 @@ cc_unichar_to_utf8 (unsigned short c, **/ char * cc_utf16_to_utf8 (const unsigned short *str, - long len, - long *items_read, - long *items_written) + ssize_t len, + ssize_t *items_read, + ssize_t *items_written) { /* This function and g_utf16_to_ucs4 are almost exactly identical - The lines that differ * are marked. @@ -411,7 +409,7 @@ cc_utf16_to_utf8 (const unsigned short *str, char *out; char *result = nullptr; int n_bytes; - unsigned short high_surrogate; + unsigned int high_surrogate; if (str == 0) return nullptr; @@ -421,7 +419,7 @@ cc_utf16_to_utf8 (const unsigned short *str, while ((len < 0 || in - str < len) && *in) { unsigned short c = *in; - unsigned short wc; + unsigned int wc; if (c >= 0xdc00 && c < 0xe000) /* low surrogate */ { @@ -454,7 +452,7 @@ cc_utf16_to_utf8 (const unsigned short *str, } /********** DIFFERENT for UTF8/UCS4 **********/ - n_bytes += UTF8_LENGTH (static_cast(wc)); + n_bytes += UTF8_LENGTH (wc); next1: in++; @@ -477,7 +475,7 @@ cc_utf16_to_utf8 (const unsigned short *str, while (out < result + n_bytes) { unsigned short c = *in; - unsigned short wc; + unsigned int wc; if (c >= 0xdc00 && c < 0xe000) /* low surrogate */ { diff --git a/cocos/2d/ccUTF8.h b/cocos/2d/ccUTF8.h index bb5b159fe7..76e6d74dc9 100644 --- a/cocos/2d/ccUTF8.h +++ b/cocos/2d/ccUTF8.h @@ -80,9 +80,9 @@ CC_DLL unsigned short* cc_utf8_to_utf16(const char* str_old, int length = -1, in **/ CC_DLL char * cc_utf16_to_utf8 (const unsigned short *str, - long len, - long *items_read, - long *items_written); + ssize_t len, + ssize_t *items_read, + ssize_t *items_written); NS_CC_END From f44775b5814421e9fbc1c51a4d34ff04efa6eff0 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sat, 4 Jan 2014 14:05:19 +0000 Subject: [PATCH 224/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 2cff3ce062..bfbc9df593 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 2cff3ce0622c8b82f83bfdcbd5c729ee5fda0bec +Subproject commit bfbc9df5933bc2cdaba496561da584ce02a06ed3 From f94221a93bd9c877e284de36ece9679696bb7e74 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 4 Jan 2014 22:21:14 +0800 Subject: [PATCH 225/428] compilation error fix. ssize_t -> int --- cocos/2d/ccUTF8.cpp | 6 +++--- cocos/2d/ccUTF8.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos/2d/ccUTF8.cpp b/cocos/2d/ccUTF8.cpp index 1cde665dfd..3436d981d7 100644 --- a/cocos/2d/ccUTF8.cpp +++ b/cocos/2d/ccUTF8.cpp @@ -398,9 +398,9 @@ cc_unichar_to_utf8 (unsigned int c, **/ char * cc_utf16_to_utf8 (const unsigned short *str, - ssize_t len, - ssize_t *items_read, - ssize_t *items_written) + int len, + int *items_read, + int *items_written) { /* This function and g_utf16_to_ucs4 are almost exactly identical - The lines that differ * are marked. diff --git a/cocos/2d/ccUTF8.h b/cocos/2d/ccUTF8.h index 76e6d74dc9..5065785732 100644 --- a/cocos/2d/ccUTF8.h +++ b/cocos/2d/ccUTF8.h @@ -80,9 +80,9 @@ CC_DLL unsigned short* cc_utf8_to_utf16(const char* str_old, int length = -1, in **/ CC_DLL char * cc_utf16_to_utf8 (const unsigned short *str, - ssize_t len, - ssize_t *items_read, - ssize_t *items_written); + int len, + int *items_read, + int *items_written); NS_CC_END From 7efacc4890a8db895abb84e3040539dc7cc40f81 Mon Sep 17 00:00:00 2001 From: chengstory Date: Sun, 5 Jan 2014 01:13:16 +0800 Subject: [PATCH 226/428] issue #3582 void serialize(void *r) -> bool serialize(void *r) --- cocos/2d/CCComponent.cpp | 3 ++- cocos/2d/CCComponent.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCComponent.cpp b/cocos/2d/CCComponent.cpp index 4f8482367a..0d3deb1f47 100644 --- a/cocos/2d/CCComponent.cpp +++ b/cocos/2d/CCComponent.cpp @@ -54,8 +54,9 @@ void Component::update(float delta) { } -void Component::serialize(void *ar) +bool Component::serialize(void *ar) { + return true; } Component* Component::create(void) diff --git a/cocos/2d/CCComponent.h b/cocos/2d/CCComponent.h index 5631c2585f..617cbe8750 100644 --- a/cocos/2d/CCComponent.h +++ b/cocos/2d/CCComponent.h @@ -55,7 +55,7 @@ public: */ virtual void onExit(); virtual void update(float delta); - virtual void serialize(void* r); + virtual bool serialize(void* r); virtual bool isEnabled() const; virtual void setEnabled(bool b); static Component* create(void); From bac600ab9f328e616b14135a5cfba4b77fe5ee15 Mon Sep 17 00:00:00 2001 From: chengstory Date: Sun, 5 Jan 2014 02:22:32 +0800 Subject: [PATCH 227/428] fixed #3582 1. create Component By component Factory. --- .../project.pbxproj.REMOVED.git-id | 2 +- .../cocostudio/CCComAttribute.cpp | 38 +++ .../cocostudio/CCComAttribute.h | 6 +- .../editor-support/cocostudio/CCComAudio.cpp | 64 ++++- cocos/editor-support/cocostudio/CCComAudio.h | 5 +- cocos/editor-support/cocostudio/CCComBase.h | 50 ++++ .../cocostudio/CCComController.cpp | 1 + .../cocostudio/CCComController.h | 4 +- .../editor-support/cocostudio/CCComRender.cpp | 136 ++++++++- cocos/editor-support/cocostudio/CCComRender.h | 16 +- .../cocostudio/CCSSceneReader.cpp | 271 ++---------------- .../cocostudio/ObjectFactory.cpp | 40 ++- .../editor-support/cocostudio/ObjectFactory.h | 4 +- cocos/editor-support/cocostudio/TriggerBase.h | 2 +- .../CocoStudioSceneTest/SceneEditorTest.cpp | 4 +- 15 files changed, 365 insertions(+), 278 deletions(-) create mode 100644 cocos/editor-support/cocostudio/CCComBase.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index e146fcc430..6f628e0c6f 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -f0d0e2815c4a581e7a1d8895efca2c2e8bc71679 \ No newline at end of file +ce0e937f5399e1b52ffc6084295bc18ceb220195 \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp index fc4ba9e2d4..83606be7f9 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -23,10 +23,12 @@ THE SOFTWARE. ****************************************************************************/ #include "cocostudio/CCComAttribute.h" + using namespace cocos2d; namespace cocostudio { +IMPLEMENT_CLASS_COMPONENT_INFO(ComAttribute) ComAttribute::ComAttribute(void) { _name = "CCComAttribute"; @@ -139,6 +141,42 @@ ComAttribute* ComAttribute::create(void) return pRet; } +bool ComAttribute::serialize(void* r) +{ + bool bRet = false; + do + { + CC_BREAK_IF(r == nullptr); + rapidjson::Value *v = (rapidjson::Value *)r; + const char *className = DICTOOL->getStringValue_json(*v, "classname"); + CC_BREAK_IF(className == nullptr); + const char *comName = DICTOOL->getStringValue_json(*v, "name"); + if (comName != nullptr) + { + setName(comName); + } + else + { + setName(className); + } + const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); + CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + const char *file = DICTOOL->getStringValue_json(fileData, "path"); + CC_BREAK_IF(file == nullptr); + std::string filePath; + if (file != nullptr) + { + filePath.assign(cocos2d::CCFileUtils::getInstance()->fullPathForFilename(file)); + } + int resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); + CC_BREAK_IF(resType != 0); + parse(filePath.c_str()); + bRet = true; + } while (0); + + return bRet; +} + bool ComAttribute::parse(const std::string &jsonFile) { bool ret = false; diff --git a/cocos/editor-support/cocostudio/CCComAttribute.h b/cocos/editor-support/cocostudio/CCComAttribute.h index e62d9cee94..da895cbd16 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.h +++ b/cocos/editor-support/cocostudio/CCComAttribute.h @@ -25,14 +25,13 @@ THE SOFTWARE. #ifndef __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ #define __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ -#include "cocos2d.h" -#include -#include "cocostudio/DictionaryHelper.h" +#include "CCComBase.h" namespace cocostudio { class ComAttribute : public cocos2d::Component { + DECLARE_CLASS_COMPONENT_INFO protected: /** * @js ctor @@ -47,6 +46,7 @@ protected: public: virtual bool init(); static ComAttribute* create(void); + virtual bool serialize(void* r); void setInt(const std::string& key, int value); void setFloat(const std::string& key, float value); diff --git a/cocos/editor-support/cocostudio/CCComAudio.cpp b/cocos/editor-support/cocostudio/CCComAudio.cpp index 84a6bb8ea9..c513b8d861 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.cpp +++ b/cocos/editor-support/cocostudio/CCComAudio.cpp @@ -27,6 +27,7 @@ THE SOFTWARE. namespace cocostudio { +IMPLEMENT_CLASS_COMPONENT_INFO(ComAudio) ComAudio::ComAudio(void) : _filePath("") , _loop(false) @@ -64,6 +65,57 @@ void ComAudio::setEnabled(bool b) _enabled = b; } + +bool ComAudio::serialize(void* r) +{ + bool bRet = false; + do + { + CC_BREAK_IF(r == nullptr); + rapidjson::Value *v = (rapidjson::Value *)r; + const char *className = DICTOOL->getStringValue_json(*v, "classname"); + CC_BREAK_IF(className == nullptr); + const char *comName = DICTOOL->getStringValue_json(*v, "name"); + if (comName != nullptr) + { + setName(comName); + } + else + { + setName(className); + } + const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); + CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + const char *file = DICTOOL->getStringValue_json(fileData, "path"); + CC_BREAK_IF(file == nullptr); + std::string filePath; + if (file != nullptr) + { + filePath.assign(cocos2d::CCFileUtils::getInstance()->fullPathForFilename(file)); + } + int resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); + CC_BREAK_IF(resType != 0); + if (strcmp(className, "CCBackgroundAudio") == 0) + { + preloadBackgroundMusic(filePath.c_str()); + bool loop = DICTOOL->getIntValue_json(*v, "loop") != 0? true:false; + setLoop(loop); + playBackgroundMusic(filePath.c_str(), loop); + } + else if(strcmp(className, "CCComAudio") == 0) + { + preloadEffect(filePath.c_str()); + } + else + { + CC_BREAK_IF(true); + } + bRet = true; + } while (0); + + return bRet; +} + ComAudio* ComAudio::create(void) { ComAudio * pRet = new ComAudio(); @@ -90,9 +142,9 @@ void ComAudio::preloadBackgroundMusic(const char* pszFilePath) setLoop(false); } -void ComAudio::playBackgroundMusic(const char* pszFilePath, bool bLoop) +void ComAudio::playBackgroundMusic(const char* pszFilePath, bool loop) { - CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic(pszFilePath, bLoop); + CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic(pszFilePath, loop); } @@ -161,9 +213,9 @@ void ComAudio::setEffectsVolume(float volume) CocosDenshion::SimpleAudioEngine::getInstance()->setEffectsVolume(volume); } -unsigned int ComAudio::playEffect(const char* pszFilePath, bool bLoop) +unsigned int ComAudio::playEffect(const char* pszFilePath, bool loop) { - return CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(pszFilePath, bLoop); + return CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(pszFilePath, loop); } unsigned int ComAudio::playEffect(const char* pszFilePath) @@ -223,9 +275,9 @@ void ComAudio::setFile(const char* pszFilePath) _filePath.assign(pszFilePath); } -void ComAudio::setLoop(bool bLoop) +void ComAudio::setLoop(bool loop) { - _loop = bLoop; + _loop = loop; } const char* ComAudio::getFile() diff --git a/cocos/editor-support/cocostudio/CCComAudio.h b/cocos/editor-support/cocostudio/CCComAudio.h index 94abd103aa..6378f3d87f 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.h +++ b/cocos/editor-support/cocostudio/CCComAudio.h @@ -25,12 +25,14 @@ THE SOFTWARE. #ifndef __CC_EXTENTIONS_CCCOMAUDIO_H__ #define __CC_EXTENTIONS_CCCOMAUDIO_H__ -#include "cocos2d.h" +#include "CCComBase.h" namespace cocostudio { class ComAudio : public cocos2d::Component { + + DECLARE_CLASS_COMPONENT_INFO protected: /** * @js ctor @@ -56,6 +58,7 @@ public: virtual void onExit(); virtual bool isEnabled() const; virtual void setEnabled(bool b); + virtual bool serialize(void* r); static ComAudio* create(void); diff --git a/cocos/editor-support/cocostudio/CCComBase.h b/cocos/editor-support/cocostudio/CCComBase.h new file mode 100644 index 0000000000..82c4bd11a8 --- /dev/null +++ b/cocos/editor-support/cocostudio/CCComBase.h @@ -0,0 +1,50 @@ +/**************************************************************************** +Copyright (c) 2013 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#ifndef __CC_EXTENTIONS_CCCOMBASE_H__ +#define __CC_EXTENTIONS_CCCOMBASE_H__ + +#include "cocos2d.h" +#include "ObjectFactory.h" +#include "DictionaryHelper.h" +#include + + +#define DECLARE_CLASS_COMPONENT_INFO \ + public: \ + static cocostudio::ObjectFactory::TInfo Type; \ + static cocos2d::Object* createInstance(void); \ + +#define IMPLEMENT_CLASS_COMPONENT_INFO(className) \ + cocos2d::Object* className::createInstance(void) \ + { \ + return className::create(); \ + } \ + cocostudio::ObjectFactory::TInfo className::Type(#className, &className::createInstance); \ + +#define CREATE_CLASS_COMPONENT_INFO(className) \ + cocostudio::ObjectFactory::TInfo(#className, &className::createInstance) + + +#endif diff --git a/cocos/editor-support/cocostudio/CCComController.cpp b/cocos/editor-support/cocostudio/CCComController.cpp index 41ab0f4401..1d22237c05 100644 --- a/cocos/editor-support/cocostudio/CCComController.cpp +++ b/cocos/editor-support/cocostudio/CCComController.cpp @@ -26,6 +26,7 @@ THE SOFTWARE. namespace cocostudio { +IMPLEMENT_CLASS_COMPONENT_INFO(ComController) ComController::ComController(void) { _name = "CCComController"; diff --git a/cocos/editor-support/cocostudio/CCComController.h b/cocos/editor-support/cocostudio/CCComController.h index d1778b84e6..5ae0189b19 100644 --- a/cocos/editor-support/cocostudio/CCComController.h +++ b/cocos/editor-support/cocostudio/CCComController.h @@ -25,13 +25,15 @@ THE SOFTWARE. #ifndef __CC_EXTENTIONS_CCCOMCONTROLLER_H__ #define __CC_EXTENTIONS_CCCOMCONTROLLER_H__ -#include "cocos2d.h" +#include "CCComBase.h" #include "cocostudio/CCInputDelegate.h" namespace cocostudio { class ComController : public cocos2d::Component, public InputDelegate { + + DECLARE_CLASS_COMPONENT_INFO public: /** * @js ctor diff --git a/cocos/editor-support/cocostudio/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp index dafff1ecf8..50da86b4c6 100644 --- a/cocos/editor-support/cocostudio/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -23,9 +23,13 @@ THE SOFTWARE. ****************************************************************************/ #include "cocostudio/CCComRender.h" +#include "cocostudio/CocoStudio.h" + +using namespace cocos2d; namespace cocostudio { +IMPLEMENT_CLASS_COMPONENT_INFO(ComRender) ComRender::ComRender(void) : _render(nullptr) { @@ -67,9 +71,125 @@ void ComRender::setNode(cocos2d::Node *node) _render = node; } -ComRender* ComRender::create(cocos2d::Node *node, const char *comName) + +bool ComRender::serialize(void* r) { - ComRender * ret = new ComRender(node, comName); + bool bRet = false; + do + { + CC_BREAK_IF(r == nullptr); + rapidjson::Value *v = (rapidjson::Value *)r; + const char *className = DICTOOL->getStringValue_json(*v, "classname"); + CC_BREAK_IF(className == nullptr); + const char *comName = DICTOOL->getStringValue_json(*v, "name"); + if (comName != nullptr) + { + setName(comName); + } + else + { + setName(className); + } + const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); + CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + const char *file = DICTOOL->getStringValue_json(fileData, "path"); + const char *plist = DICTOOL->getStringValue_json(fileData, "plistFile"); + CC_BREAK_IF(file == nullptr && plist == nullptr); + std::string filePath; + std::string plistPath; + if (file != nullptr) + { + filePath.assign(cocos2d::CCFileUtils::getInstance()->fullPathForFilename(file)); + } + if (plist != nullptr) + { + plistPath.assign(cocos2d::CCFileUtils::getInstance()->fullPathForFilename(plist)); + } + int resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); + if (resType == 0) + { + if (strcmp(className, "CCSprite") == 0 && filePath.find(".png") != filePath.npos) + { + _render = Sprite::create(filePath.c_str()); + } + else if(strcmp(className, "CCTMXTiledMap") == 0 && filePath.find(".tmx") != filePath.npos) + { + _render = TMXTiledMap::create(filePath.c_str()); + } + else if(strcmp(className, "CCParticleSystemQuad") == 0 && filePath.find(".plist") != filePath.npos) + { + _render = ParticleSystemQuad::create(filePath.c_str()); + _render->setPosition(Point(0.0f, 0.0f)); + } + else if(strcmp(className, "CCArmature") == 0) + { + std::string reDir = filePath; + std::string file_path = ""; + size_t pos = reDir.find_last_of('/'); + if (pos != std::string::npos) + { + file_path = reDir.substr(0, pos+1); + } + rapidjson::Document doc; + if(!readJson(filePath.c_str(), doc)) + { + log("read json file[%s] error!\n", filePath.c_str()); + continue; + } + const rapidjson::Value &subData = DICTOOL->getDictionaryFromArray_json(doc, "armature_data", 0); + const char *name = DICTOOL->getStringValue_json(subData, "name"); + ArmatureDataManager::getInstance()->addArmatureFileInfo(filePath.c_str()); + Armature *pAr = Armature::create(name); + _render = pAr; + const char *actionName = DICTOOL->getStringValue_json(*v, "selectedactionname"); + if (actionName != nullptr && pAr->getAnimation() != nullptr) + { + pAr->getAnimation()->play(actionName); + } + } + else if(strcmp(className, "GUIComponent") == 0) + { + cocos2d::gui::Widget* widget = GUIReader::getInstance()->widgetFromJsonFile(filePath.c_str()); + _render = widget; + } + else + { + CC_BREAK_IF(true); + } + } + else if (resType == 1) + { + if (strcmp(className, "CCSprite") == 0) + { + std::string strPngFile = plistPath; + std::string::size_type pos = strPngFile.find(".plist"); + if (pos == strPngFile.npos) + { + continue; + } + strPngFile.replace(pos, strPngFile.length(), ".png"); + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(plistPath.c_str(), strPngFile.c_str()); + _render = Sprite::createWithSpriteFrameName(filePath.c_str()); + } + else + { + CC_BREAK_IF(true); + } + } + else + { + CC_BREAK_IF(true); + } + bRet = true; + } while (0); + + return bRet; +} + + +ComRender* ComRender::create(void) +{ + ComRender * ret = new ComRender(); if (ret != nullptr && ret->init()) { ret->autorelease(); @@ -81,4 +201,16 @@ ComRender* ComRender::create(cocos2d::Node *node, const char *comName) return ret; } +bool ComRender::readJson(const std::string &fileName, rapidjson::Document &doc) +{ + bool ret = false; + do { + std::string contentStr = FileUtils::getInstance()->getStringFromFile(fileName); + doc.Parse<0>(contentStr.c_str()); + CC_BREAK_IF(doc.HasParseError()); + ret = true; + } while (0); + return ret; +} + } diff --git a/cocos/editor-support/cocostudio/CCComRender.h b/cocos/editor-support/cocostudio/CCComRender.h index a7bcb9499e..187dc9332d 100644 --- a/cocos/editor-support/cocostudio/CCComRender.h +++ b/cocos/editor-support/cocostudio/CCComRender.h @@ -22,15 +22,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_EXTENTIONS_CCCOMNODE_H__ -#define __CC_EXTENTIONS_CCCOMNODE_H__ +#ifndef __CC_EXTENTIONS_CCCOMRENDER_H__ +#define __CC_EXTENTIONS_CCCOMRENDER_H__ -#include "cocos2d.h" +#include "CCComBase.h" namespace cocostudio { class ComRender : public cocos2d::Component { + DECLARE_CLASS_COMPONENT_INFO protected: /** * @js ctor @@ -54,10 +55,13 @@ public: * @lua NA */ virtual void onExit(); - cocos2d::Node* getNode(); - void setNode(cocos2d::Node *node); + virtual bool serialize(void* r); + virtual cocos2d::Node* getNode(); + virtual void setNode(cocos2d::Node *node); - static ComRender* create(cocos2d::Node *node, const char *comName); + static ComRender* create(void); +private: + bool readJson(const std::string &fileName, rapidjson::Document &doc); private: cocos2d::Node *_render; diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index 0a046c8334..36d0adc97d 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -25,6 +25,7 @@ #include "cocostudio/CocoStudio.h" #include "gui/CocosGUI.h" #include "SimpleAudioEngine.h" +#include "ObjectFactory.h" using namespace cocos2d; using namespace gui; @@ -37,6 +38,10 @@ SceneReader::SceneReader() : _fnSelector(nullptr) , _node(nullptr) { + ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComAttribute)); + ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComRender)); + ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComAudio)); + ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComController)); } SceneReader::~SceneReader() @@ -132,259 +137,21 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par break; } const char *comName = DICTOOL->getStringValue_json(subDict, "classname"); - const char *pComName = DICTOOL->getStringValue_json(subDict, "name"); - - const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(subDict, "fileData"); - std::string pPath; - std::string pPlistFile; - int nResType = 0; - if (DICTOOL->checkObjectExist_json(fileData)) + Component *com = ObjectFactory::getInstance()->createComponent(comName); + if (com != NULL) + { + if (com->serialize((void*)(&subDict))) + { + gb->addComponent(com); + } + else + { + CC_SAFE_RELEASE(com); + } + } + if(_fnSelector != nullptr) { - const char *file = DICTOOL->getStringValue_json(fileData, "path"); - nResType = DICTOOL->getIntValue_json(fileData, "resourceType", - 1); - const char *plistFile = DICTOOL->getStringValue_json(fileData, "plistFile"); - if (file != nullptr) - { - pPath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); - } - - if (plistFile != nullptr) - { - pPlistFile.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(plistFile)); - } - - if (file == nullptr && plistFile == nullptr) - { - continue; - } - } - else - { - continue; - } - - if (comName != nullptr && strcmp(comName, "CCSprite") == 0) - { - cocos2d::Sprite *pSprite = nullptr; - - if (nResType == 0) - { - if (pPath.find(".png") == pPath.npos) - { - continue; - } - pSprite = Sprite::create(pPath.c_str()); - } - else if (nResType == 1) - { - std::string pngFile = pPlistFile; - std::string::size_type pos = pngFile.find(".plist"); - if (pos == pPath.npos) - { - continue; - } - pngFile.replace(pos, pngFile.length(), ".png"); - CCSpriteFrameCache::getInstance()->addSpriteFramesWithFile(pPlistFile.c_str(), pngFile.c_str()); - pSprite = Sprite::createWithSpriteFrameName(pPath.c_str()); - } - else - { - continue; - } - - ComRender *pRender = ComRender::create(pSprite, "CCSprite"); - if (pComName != nullptr) - { - pRender->setName(pComName); - } - - gb->addComponent(pRender); - if (_fnSelector != nullptr) - { - _fnSelector(pSprite, (void*)(&subDict)); - } - } - else if(comName != nullptr && strcmp(comName, "CCTMXTiledMap") == 0) - { - cocos2d::TMXTiledMap *pTmx = nullptr; - if (nResType == 0) - { - if (pPath.find(".tmx") == pPath.npos) - { - continue; - } - pTmx = TMXTiledMap::create(pPath.c_str()); - } - else - { - continue; - } - - ComRender *pRender = ComRender::create(pTmx, "CCTMXTiledMap"); - if (pComName != nullptr) - { - pRender->setName(pComName); - } - gb->addComponent(pRender); - if (_fnSelector != nullptr) - { - _fnSelector(pTmx, (void*)(&subDict)); - } - } - else if(comName != nullptr && strcmp(comName, "CCParticleSystemQuad") == 0) - { - std::string::size_type pos = pPath.find(".plist"); - if (pos == pPath.npos) - { - continue; - } - - cocos2d::ParticleSystemQuad *pParticle = nullptr; - if (nResType == 0) - { - pParticle = ParticleSystemQuad::create(pPath.c_str()); - } - else - { - CCLOG("unknown resourcetype on CCParticleSystemQuad!"); - } - - pParticle->setPosition(0, 0); - ComRender *pRender = ComRender::create(pParticle, "CCParticleSystemQuad"); - if (pComName != nullptr) - { - pRender->setName(pComName); - } - gb->addComponent(pRender); - if(_fnSelector != nullptr) - { - _fnSelector(pParticle, (void*)(&subDict)); - } - } - else if(comName != nullptr && strcmp(comName, "CCArmature") == 0) - { - if (nResType != 0) - { - continue; - } - std::string reDir = pPath; - std::string file_path = ""; - size_t pos = reDir.find_last_of('/'); - if (pos != std::string::npos) - { - file_path = reDir.substr(0, pos+1); - } - - rapidjson::Document jsonDict; - if(!readJson(pPath.c_str(), jsonDict)) - { - log("read json file[%s] error!\n", pPath.c_str()); - continue; - } - - const rapidjson::Value &subData = DICTOOL->getDictionaryFromArray_json(jsonDict, "armature_data", 0); - const char *name = DICTOOL->getStringValue_json(subData, "name"); - - ArmatureDataManager::getInstance()->addArmatureFileInfo(pPath.c_str()); - - Armature *pAr = Armature::create(name); - ComRender *pRender = ComRender::create(pAr, "CCArmature"); - if (pComName != nullptr) - { - pRender->setName(pComName); - } - gb->addComponent(pRender); - - const char *actionName = DICTOOL->getStringValue_json(subDict, "selectedactionname"); - if (actionName != nullptr && pAr->getAnimation() != nullptr) - { - pAr->getAnimation()->play(actionName); - } - if (_fnSelector != nullptr) - { - _fnSelector(pAr, (void*)(&subDict)); - } - } - else if(comName != nullptr && strcmp(comName, "CCComAudio") == 0) - { - ComAudio *pAudio = nullptr; - if (nResType == 0) - { - pAudio = ComAudio::create(); - } - else - { - continue; - } - pAudio->preloadEffect(pPath.c_str()); - if (pComName != nullptr) - { - pAudio->setName(pComName); - } - gb->addComponent(pAudio); - if(_fnSelector != nullptr) - { - _fnSelector(pAudio, (void*)(&subDict)); - } - } - else if(comName != nullptr && strcmp(comName, "CCComAttribute") == 0) - { - ComAttribute *pAttribute = nullptr; - if (nResType == 0) - { - pAttribute = ComAttribute::create(); - } - else - { - CCLOG("unknown resourcetype on CCComAttribute!"); - continue; - } - pAttribute->parse(pPath); - gb->addComponent(pAttribute); - if(_fnSelector != nullptr) - { - _fnSelector(pAttribute, (void*)(&subDict)); - } - } - else if (comName != nullptr && strcmp(comName, "CCBackgroundAudio") == 0) - { - ComAudio *pAudio = nullptr; - if (nResType == 0) - { - pAudio = ComAudio::create(); - } - else - { - continue; - } - pAudio->preloadBackgroundMusic(pPath.c_str()); - pAudio->setFile(pPath.c_str()); - const bool bLoop = (DICTOOL->getIntValue_json(subDict, "loop") != 0); - pAudio->setLoop(bLoop); - if (pComName != nullptr) - { - pAudio->setName(pComName); - } - gb->addComponent(pAudio); - if (pComName != nullptr) - { - pAudio->setName(pComName); - } - pAudio->playBackgroundMusic(pPath.c_str(), bLoop); - } - else if(comName != nullptr && strcmp(comName, "GUIComponent") == 0) - { - Widget* widget= GUIReader::getInstance()->widgetFromJsonFile(pPath.c_str()); - ComRender *pRender = ComRender::create(widget, "GUIComponent"); - if (pComName != nullptr) - { - pRender->setName(pComName); - } - gb->addComponent(pRender); - if(_fnSelector != nullptr) - { - _fnSelector(widget, (void*)(&subDict)); - } + _fnSelector(com, (void*)(&subDict)); } } diff --git a/cocos/editor-support/cocostudio/ObjectFactory.cpp b/cocos/editor-support/cocostudio/ObjectFactory.cpp index 17015867e2..defa6c56e0 100644 --- a/cocos/editor-support/cocostudio/ObjectFactory.cpp +++ b/cocos/editor-support/cocostudio/ObjectFactory.cpp @@ -87,7 +87,7 @@ void ObjectFactory::destroyInstance() CC_SAFE_DELETE(_sharedFactory); } -Object* ObjectFactory::createObject(const char *name) +Object* ObjectFactory::createObject(const std::string &name) { Object *o = nullptr; do @@ -100,6 +100,44 @@ Object* ObjectFactory::createObject(const char *name) return o; } +Component* ObjectFactory::createComponent(std::string name) +{ + if (name == "CCSprite" || name == "CCTMXTiledMap" || name == "CCParticleSystemQuad" || name == "CCArmature" || name == "GUIComponent") + { + name = "ComRender"; + } + else if (name == "CCComAudio" || name == "CCBackgroundAudio") + { + name = "ComAudio"; + } + else if (name == "CCComController") + { + name = "ComController"; + } + else if (name == "CCComAttribute") + { + name = "ComAttribute"; + } + else if (name == "CCScene") + { + name = "CCScene"; + } + else + { + CCASSERT(false, "Unregistered Component!"); + } + Object *o = NULL; + do + { + const TInfo t = _typeMap[name]; + CC_BREAK_IF(t._fun == NULL); + o = t._fun(); + } while (0); + + return (Component*)o; + +} + void ObjectFactory::registerType(const TInfo &t) { _typeMap.insert(std::make_pair(t._class, t)); diff --git a/cocos/editor-support/cocostudio/ObjectFactory.h b/cocos/editor-support/cocostudio/ObjectFactory.h index 3cdec3cd6d..c5a2e88f38 100644 --- a/cocos/editor-support/cocostudio/ObjectFactory.h +++ b/cocos/editor-support/cocostudio/ObjectFactory.h @@ -26,7 +26,6 @@ THE SOFTWARE. #define __TRIGGERFACTORY_H__ #include "cocos2d.h" -#include "CocoStudio.h" #include #include @@ -50,7 +49,8 @@ public: static ObjectFactory* getInstance(); static void destroyInstance(); - cocos2d::Object* createObject(const char *name); + cocos2d::Object* createObject(const std::string &name); + cocos2d::Component* createComponent(std::string name); void registerType(const TInfo &t); void removeAll(); diff --git a/cocos/editor-support/cocostudio/TriggerBase.h b/cocos/editor-support/cocostudio/TriggerBase.h index 1558ff7b8a..921f6e96d4 100644 --- a/cocos/editor-support/cocostudio/TriggerBase.h +++ b/cocos/editor-support/cocostudio/TriggerBase.h @@ -27,8 +27,8 @@ THE SOFTWARE. #include "cocos2d.h" #include "cocostudio/CocoStudio.h" -#include "TriggerObj.h" #include "ObjectFactory.h" +#include "TriggerObj.h" #include "TriggerMng.h" diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index e765f2677f..70d3ac2cbd 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -410,10 +410,10 @@ void UIComponentTest::touchEvent(Object *pSender, TouchEventType type) { case TOUCH_EVENT_BEGAN: { - ComRender *pBlowFish = static_cast(_node->getChildByTag(10010)->getComponent("Armature")); + ComRender *pBlowFish = static_cast(_node->getChildByTag(10010)->getComponent("CCArmature")); pBlowFish->getNode()->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); - ComRender *pButterflyfish = static_cast(_node->getChildByTag(10011)->getComponent("Armature")); + ComRender *pButterflyfish = static_cast(_node->getChildByTag(10011)->getComponent("CCArmature")); pButterflyfish->getNode()->runAction(CCMoveBy::create(10.0f, Point(-1000.0f, 0))); } break; From aae6d27c749965c2b778498bb05dd40ccae296ef Mon Sep 17 00:00:00 2001 From: chengstory Date: Sun, 5 Jan 2014 03:11:32 +0800 Subject: [PATCH 228/428] fixed #3582 1. revert ComRender::create(cocos2d::Node *node, const char *comName). --- .../project.pbxproj.REMOVED.git-id | 2 +- cocos/editor-support/cocostudio/CCComRender.cpp | 15 ++++++++++++++- cocos/editor-support/cocostudio/CCComRender.h | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 6f628e0c6f..7d29c5ce05 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -ce0e937f5399e1b52ffc6084295bc18ceb220195 \ No newline at end of file +958c6d3c76c07e192cbb9cec6199ab0416c09dcf \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp index 50da86b4c6..ea1ce3243a 100644 --- a/cocos/editor-support/cocostudio/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -186,7 +186,6 @@ bool ComRender::serialize(void* r) return bRet; } - ComRender* ComRender::create(void) { ComRender * ret = new ComRender(); @@ -201,6 +200,20 @@ ComRender* ComRender::create(void) return ret; } +ComRender* ComRender::create(cocos2d::Node *node, const char *comName) +{ + ComRender * ret = new ComRender(node, comName); + if (ret != nullptr && ret->init()) + { + ret->autorelease(); + } + else + { + CC_SAFE_DELETE(ret); + } + return ret; +} + bool ComRender::readJson(const std::string &fileName, rapidjson::Document &doc) { bool ret = false; diff --git a/cocos/editor-support/cocostudio/CCComRender.h b/cocos/editor-support/cocostudio/CCComRender.h index 187dc9332d..44d408d21d 100644 --- a/cocos/editor-support/cocostudio/CCComRender.h +++ b/cocos/editor-support/cocostudio/CCComRender.h @@ -60,6 +60,7 @@ public: virtual void setNode(cocos2d::Node *node); static ComRender* create(void); + static ComRender* create(cocos2d::Node *node, const char *comName); private: bool readJson(const std::string &fileName, rapidjson::Document &doc); From b4118a7ccc397fb51d5d777ba81444c598284e21 Mon Sep 17 00:00:00 2001 From: chengstory Date: Sun, 5 Jan 2014 03:55:10 +0800 Subject: [PATCH 229/428] fixed #3582 1. add #include "cocostudio/CCComBase.h" into CocoStudio.h --- build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- cocos/editor-support/cocostudio/CocoStudio.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 7d29c5ce05..d3f6223954 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -958c6d3c76c07e192cbb9cec6199ab0416c09dcf \ No newline at end of file +64be2dade906f1baa9da4fdd207e4b1f9330ceb4 \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/CocoStudio.h b/cocos/editor-support/cocostudio/CocoStudio.h index caf7fbf00d..7a1b07bc99 100644 --- a/cocos/editor-support/cocostudio/CocoStudio.h +++ b/cocos/editor-support/cocostudio/CocoStudio.h @@ -49,6 +49,7 @@ #include "cocostudio/CCTransformHelp.h" #include "cocostudio/CCTweenFunction.h" #include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCComBase.h" #include "cocostudio/CCComAttribute.h" #include "cocostudio/CCComAudio.h" #include "cocostudio/CCComController.h" From 8ffb05b6c9f4a057179710952f605c2206d80202 Mon Sep 17 00:00:00 2001 From: "Daniel T. Borelli" Date: Sat, 4 Jan 2014 19:26:16 -0300 Subject: [PATCH 230/428] Linux fix missing file -> rename dir loadSceneEditorFileTest to LoadScene...; add string::npos; const correctness --- extensions/assets-manager/AssetsManager.cpp | 10 +++++----- .../Images/startMenuBG.png.REMOVED.git-id | 0 .../Misc/music_logo.mp3.REMOVED.git-id | 0 .../Misc/music_logo.wav.REMOVED.git-id | 0 .../Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 0 .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 0 .../Fish_UI/ui_logo_001-hd.png.REMOVED.git-id | 0 7 files changed, 5 insertions(+), 5 deletions(-) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/Images/startMenuBG.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/Misc/music_logo.mp3.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/Misc/music_logo.wav.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/fishes/blowFish/Blowfish0.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id (100%) diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index 52080d811c..23818d9e6d 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -319,7 +319,7 @@ bool AssetsManager::uncompress() return false; } - string fullPath = _storagePath + fileName; + const string fullPath = _storagePath + fileName; // Check if this entry is a directory or a file. const size_t filenameLength = strlen(fileName); @@ -339,15 +339,15 @@ bool AssetsManager::uncompress() //There are not directory entry in some case. //So we need to test whether the file directory exists when uncompressing file entry //, if does not exist then create directory - string fileNameStr(fileName); + const string fileNameStr(fileName); size_t startIndex=0; size_t index=fileNameStr.find("/",startIndex); - while(index!=-1) + while(index != std::string::npos) { - string dir=_storagePath+fileNameStr.substr(0,index); + const string dir=_storagePath+fileNameStr.substr(0,index); FILE *out = fopen(dir.c_str(), "r"); @@ -501,7 +501,7 @@ int assetsManagerProgressFunc(void *ptr, double totalToDownload, double nowDownl bool AssetsManager::downLoad() { // Create a file to save package. - string outFileName = _storagePath + TEMP_PACKAGE_FILE_NAME; + const string outFileName = _storagePath + TEMP_PACKAGE_FILE_NAME; FILE *fp = fopen(outFileName.c_str(), "wb"); if (! fp) { diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id From 4699eb575156b43b64b3310731ac0e31b9993304 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sun, 5 Jan 2014 10:10:51 +0800 Subject: [PATCH 231/428] Updates JS-Test submodule . --- samples/Javascript/Shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index 88c672ca3a..8f9d0b0784 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit 88c672ca3ac79ae6f0e8695fe2ae683d73d98234 +Subproject commit 8f9d0b0784ef35220b7b7385c8c5be558d1fd0b3 From 10fec47b04e268931ea868b5318df011fc42a4f4 Mon Sep 17 00:00:00 2001 From: chengstory Date: Sun, 5 Jan 2014 11:38:01 +0800 Subject: [PATCH 232/428] fixed #3582 update libCocoStudio windows project. --- .../cocostudio/proj.win32/libCocosStudio.vcxproj | 1 + .../cocostudio/proj.win32/libCocosStudio.vcxproj.filters | 3 +++ 2 files changed, 4 insertions(+) diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj index eca9c14aef..f572d6f892 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj +++ b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj @@ -75,6 +75,7 @@ + diff --git a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters index 626355b8d3..bf17c59cbb 100644 --- a/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters +++ b/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters @@ -296,5 +296,8 @@ trigger + + components + \ No newline at end of file From 49d8b76b9ee90f85b6350f2e6087ba9e374ee78c Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Sun, 5 Jan 2014 11:59:32 +0800 Subject: [PATCH 233/428] fix crash related to not support the z length modifier for size_t on vs --- cocos/2d/CCLayer.cpp | 2 +- cocos/2d/CCSpriteBatchNode.cpp | 2 +- cocos/2d/CCTMXTiledMap.cpp | 2 +- cocos/2d/CCTextureAtlas.cpp | 2 +- cocos/2d/CCTextureCache.cpp | 2 +- cocos/2d/ccCArray.cpp | 6 +++--- cocos/gui/UIPageView.cpp | 2 +- .../CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index 46f7a2ee57..488dbc3d1a 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -932,7 +932,7 @@ void LayerMultiplex::switchToAndReleaseMe(int n) std::string LayerMultiplex::getDescription() const { - return StringUtils::format("(_children.size())); } NS_CC_END diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 049934f31c..092137bb47 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -380,7 +380,7 @@ void SpriteBatchNode::increaseAtlasCapacity(void) CCLOG("cocos2d: SpriteBatchNode: resizing TextureAtlas capacity from [%d] to [%d].", static_cast(_textureAtlas->getCapacity()), - quantity); + static_cast(quantity)); if (! _textureAtlas->resizeCapacity(quantity)) { diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 259f36585f..5cd4bba307 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -247,7 +247,7 @@ Value TMXTiledMap::getPropertiesForGID(int GID) const std::string TMXTiledMap::getDescription() const { - return StringUtils::format("(_children.size())); } diff --git a/cocos/2d/CCTextureAtlas.cpp b/cocos/2d/CCTextureAtlas.cpp index c687288d3d..83dce8b3c1 100644 --- a/cocos/2d/CCTextureAtlas.cpp +++ b/cocos/2d/CCTextureAtlas.cpp @@ -226,7 +226,7 @@ void TextureAtlas::listenBackToForeground(EventCustom* event) std::string TextureAtlas::getDescription() const { - return StringUtils::format("", _totalQuads); + return StringUtils::format("", static_cast(_totalQuads)); } diff --git a/cocos/2d/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp index 686f1ef760..ecfb1c75fb 100644 --- a/cocos/2d/CCTextureCache.cpp +++ b/cocos/2d/CCTextureCache.cpp @@ -89,7 +89,7 @@ void TextureCache::purgeSharedTextureCache() std::string TextureCache::getDescription() const { - return StringUtils::format("", _textures.size()); + return StringUtils::format("", static_cast(_textures.size())); } void TextureCache::addImageAsync(const std::string &path, std::function callback) diff --git a/cocos/2d/ccCArray.cpp b/cocos/2d/ccCArray.cpp index dc89fbb93e..d9ea0ac11d 100644 --- a/cocos/2d/ccCArray.cpp +++ b/cocos/2d/ccCArray.cpp @@ -72,9 +72,9 @@ void ccArrayEnsureExtraCapacity(ccArray *arr, ssize_t extra) { while (arr->max < arr->num + extra) { - CCLOG("cocos2d: ccCArray: resizing ccArray capacity from [%zd] to [%zd].", - arr->max, - arr->max*2); + CCLOG("cocos2d: ccCArray: resizing ccArray capacity from [%d] to [%d].", + static_cast(arr->max), + static_cast(arr->max*2)); ccArrayDoubleCapacity(arr); } diff --git a/cocos/gui/UIPageView.cpp b/cocos/gui/UIPageView.cpp index b41242b32d..5e11a88918 100644 --- a/cocos/gui/UIPageView.cpp +++ b/cocos/gui/UIPageView.cpp @@ -96,7 +96,7 @@ void PageView::addWidgetToPage(Widget *widget, ssize_t pageIdx, bool forceCreate { if (pageIdx > pageCount) { - CCLOG("pageIdx is %zd, it will be added as page id [%zd]",pageIdx,pageCount); + CCLOG("pageIdx is %d, it will be added as page id [%d]",static_cast(pageIdx),static_cast(pageCount)); } Layout* newPage = createPage(); newPage->addChild(widget); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index 1ba703a1bd..a2f43dd5af 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -92,7 +92,7 @@ void UIPageViewTest::pageViewEvent(Object *pSender, PageViewEventType type) { PageView* pageView = dynamic_cast(pSender); - _displayValueLabel->setText(StringUtils::format("page = %zd", pageView->getCurPageIndex() + 1)); + _displayValueLabel->setText(StringUtils::format("page = %d", static_cast(pageView->getCurPageIndex() + 1))); } break; From bd9dc274f85388eb8458a1f0be38468d64368e90 Mon Sep 17 00:00:00 2001 From: chengstory Date: Sun, 5 Jan 2014 12:42:39 +0800 Subject: [PATCH 234/428] fixed #3482 1. add override to virtual functions. 2. replace std::string::npos to filePath.npos. 3. replace std::string to const std::string& . --- .../cocostudio/CCComAttribute.cpp | 2 +- .../cocostudio/CCComAttribute.h | 28 +++++++++---------- cocos/editor-support/cocostudio/CCComAudio.h | 12 ++++---- .../cocostudio/CCComController.h | 4 +-- .../editor-support/cocostudio/CCComRender.cpp | 6 ++-- cocos/editor-support/cocostudio/CCComRender.h | 8 +++--- .../cocostudio/ObjectFactory.cpp | 15 +++++----- .../editor-support/cocostudio/ObjectFactory.h | 2 +- 8 files changed, 38 insertions(+), 39 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp index 83606be7f9..b583952182 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -141,7 +141,7 @@ ComAttribute* ComAttribute::create(void) return pRet; } -bool ComAttribute::serialize(void* r) +bool ComAttribute::serialize(void* r) { bool bRet = false; do diff --git a/cocos/editor-support/cocostudio/CCComAttribute.h b/cocos/editor-support/cocostudio/CCComAttribute.h index da895cbd16..6d432389b9 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.h +++ b/cocos/editor-support/cocostudio/CCComAttribute.h @@ -44,21 +44,19 @@ protected: virtual ~ComAttribute(void); public: - virtual bool init(); - static ComAttribute* create(void); - virtual bool serialize(void* r); - - void setInt(const std::string& key, int value); - void setFloat(const std::string& key, float value); - void setBool(const std::string& key, bool value); - void setString(const std::string& key, const std::string& value); - - int getInt(const std::string& key, int def = 0) const; - float getFloat(const std::string& key, float def = 0.0f) const; - bool getBool(const std::string& key, bool def = false) const; - std::string getString(const std::string& key, const std::string& def = "") const; - - bool parse(const std::string &jsonFile); + static ComAttribute* create(void); + virtual bool init() override; + virtual bool serialize(void* r) override; + + void setInt(const std::string& key, int value); + void setFloat(const std::string& key, float value); + void setBool(const std::string& key, bool value); + void setString(const std::string& key, const std::string& value); + int getInt(const std::string& key, int def = 0) const; + float getFloat(const std::string& key, float def = 0.0f) const; + bool getBool(const std::string& key, bool def = false) const; + std::string getString(const std::string& key, const std::string& def = "") const; + bool parse(const std::string &jsonFile); private: cocos2d::ValueMap _dict; rapidjson::Document _doc; diff --git a/cocos/editor-support/cocostudio/CCComAudio.h b/cocos/editor-support/cocostudio/CCComAudio.h index 6378f3d87f..a80ca17604 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.h +++ b/cocos/editor-support/cocostudio/CCComAudio.h @@ -45,20 +45,20 @@ protected: virtual ~ComAudio(void); public: - virtual bool init(); + virtual bool init() override; /** * @js NA * @lua NA */ - virtual void onEnter(); + virtual void onEnter() override; /** * @js NA * @lua NA */ - virtual void onExit(); - virtual bool isEnabled() const; - virtual void setEnabled(bool b); - virtual bool serialize(void* r); + virtual void onExit() override; + virtual bool isEnabled() const override; + virtual void setEnabled(bool b) override; + virtual bool serialize(void* r) override; static ComAudio* create(void); diff --git a/cocos/editor-support/cocostudio/CCComController.h b/cocos/editor-support/cocostudio/CCComController.h index 5ae0189b19..0c77861e56 100644 --- a/cocos/editor-support/cocostudio/CCComController.h +++ b/cocos/editor-support/cocostudio/CCComController.h @@ -46,12 +46,12 @@ public: * @lua NA */ virtual ~ComController(void); - virtual bool init(); + virtual bool init() override; /** * @js NA * @lua NA */ - virtual void onEnter(); + virtual void onEnter() override; /** * @js NA * @lua NA diff --git a/cocos/editor-support/cocostudio/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp index ea1ce3243a..5ca698556b 100644 --- a/cocos/editor-support/cocostudio/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -108,15 +108,15 @@ bool ComRender::serialize(void* r) int resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); if (resType == 0) { - if (strcmp(className, "CCSprite") == 0 && filePath.find(".png") != filePath.npos) + if (strcmp(className, "CCSprite") == 0 && filePath.find(".png") != std::string::npos) { _render = Sprite::create(filePath.c_str()); } - else if(strcmp(className, "CCTMXTiledMap") == 0 && filePath.find(".tmx") != filePath.npos) + else if(strcmp(className, "CCTMXTiledMap") == 0 && filePath.find(".tmx") != std::string::npos) { _render = TMXTiledMap::create(filePath.c_str()); } - else if(strcmp(className, "CCParticleSystemQuad") == 0 && filePath.find(".plist") != filePath.npos) + else if(strcmp(className, "CCParticleSystemQuad") == 0 && filePath.find(".plist") != std::string::npos) { _render = ParticleSystemQuad::create(filePath.c_str()); _render->setPosition(Point(0.0f, 0.0f)); diff --git a/cocos/editor-support/cocostudio/CCComRender.h b/cocos/editor-support/cocostudio/CCComRender.h index 44d408d21d..255aa12e30 100644 --- a/cocos/editor-support/cocostudio/CCComRender.h +++ b/cocos/editor-support/cocostudio/CCComRender.h @@ -49,20 +49,20 @@ public: * @js NA * @lua NA */ - virtual void onEnter(); + virtual void onEnter() override; /** * @js NA * @lua NA */ - virtual void onExit(); - virtual bool serialize(void* r); + virtual void onExit() override; + virtual bool serialize(void* r) override; virtual cocos2d::Node* getNode(); virtual void setNode(cocos2d::Node *node); static ComRender* create(void); static ComRender* create(cocos2d::Node *node, const char *comName); private: - bool readJson(const std::string &fileName, rapidjson::Document &doc); + bool readJson(const std::string &fileName, rapidjson::Document &doc); private: cocos2d::Node *_render; diff --git a/cocos/editor-support/cocostudio/ObjectFactory.cpp b/cocos/editor-support/cocostudio/ObjectFactory.cpp index defa6c56e0..6759848819 100644 --- a/cocos/editor-support/cocostudio/ObjectFactory.cpp +++ b/cocos/editor-support/cocostudio/ObjectFactory.cpp @@ -100,27 +100,28 @@ Object* ObjectFactory::createObject(const std::string &name) return o; } -Component* ObjectFactory::createComponent(std::string name) +Component* ObjectFactory::createComponent(const std::string &name) { + std::string comName; if (name == "CCSprite" || name == "CCTMXTiledMap" || name == "CCParticleSystemQuad" || name == "CCArmature" || name == "GUIComponent") { - name = "ComRender"; + comName = "ComRender"; } else if (name == "CCComAudio" || name == "CCBackgroundAudio") { - name = "ComAudio"; + comName = "ComAudio"; } else if (name == "CCComController") { - name = "ComController"; + comName = "ComController"; } else if (name == "CCComAttribute") { - name = "ComAttribute"; + comName = "ComAttribute"; } else if (name == "CCScene") { - name = "CCScene"; + comName = "CCScene"; } else { @@ -129,7 +130,7 @@ Component* ObjectFactory::createComponent(std::string name) Object *o = NULL; do { - const TInfo t = _typeMap[name]; + const TInfo t = _typeMap[comName]; CC_BREAK_IF(t._fun == NULL); o = t._fun(); } while (0); diff --git a/cocos/editor-support/cocostudio/ObjectFactory.h b/cocos/editor-support/cocostudio/ObjectFactory.h index c5a2e88f38..26e2bd6447 100644 --- a/cocos/editor-support/cocostudio/ObjectFactory.h +++ b/cocos/editor-support/cocostudio/ObjectFactory.h @@ -50,7 +50,7 @@ public: static ObjectFactory* getInstance(); static void destroyInstance(); cocos2d::Object* createObject(const std::string &name); - cocos2d::Component* createComponent(std::string name); + cocos2d::Component* createComponent(const std::string &name); void registerType(const TInfo &t); void removeAll(); From 877c6dddf367cd86e8e9c278a869712d2ee0b838 Mon Sep 17 00:00:00 2001 From: chengstory Date: Sun, 5 Jan 2014 13:16:23 +0800 Subject: [PATCH 235/428] =?UTF-8?q?fixed=20=EF=BC=833582=20=09=091.=20=20C?= =?UTF-8?q?CScene=20->=20=20Scene.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/editor-support/cocostudio/ObjectFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/editor-support/cocostudio/ObjectFactory.cpp b/cocos/editor-support/cocostudio/ObjectFactory.cpp index 6759848819..268224b011 100644 --- a/cocos/editor-support/cocostudio/ObjectFactory.cpp +++ b/cocos/editor-support/cocostudio/ObjectFactory.cpp @@ -121,7 +121,7 @@ Component* ObjectFactory::createComponent(const std::string &name) } else if (name == "CCScene") { - comName = "CCScene"; + comName = "Scene"; } else { From 5f8d4f867caa81aaa6de4e766622ab470b9547cd Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sun, 5 Jan 2014 05:52:52 +0000 Subject: [PATCH 236/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index bfbc9df593..765af5ed39 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit bfbc9df5933bc2cdaba496561da584ce02a06ed3 +Subproject commit 765af5ed3956e2edd081926bbac26745c01fdb68 From 8abc54bbac5a5845877402a4a53f2c97ce7a5dc1 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Sun, 5 Jan 2014 18:12:11 +0800 Subject: [PATCH 237/428] add miss file for vs project. --- samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj | 2 ++ samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj index b69b1f411b..37fd64609a 100644 --- a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj +++ b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj @@ -189,6 +189,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ + @@ -330,6 +331,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ + diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters index a5f386187d..c8efb5f202 100644 --- a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters +++ b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters @@ -301,6 +301,9 @@ {c4dbbfb3-0e91-492f-bbbf-f03fb26f3f54} + + {1821914f-c088-4946-8c1e-19ab57b5eabc} + @@ -700,6 +703,9 @@ Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest + + Classes\UnitTest + @@ -1291,5 +1297,8 @@ Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest + + Classes\UnitTest + \ No newline at end of file From fcfa6744f4b28c94207a8790a3f9e1598ac56786 Mon Sep 17 00:00:00 2001 From: minggo Date: Sun, 5 Jan 2014 18:20:29 +0800 Subject: [PATCH 238/428] make TMXLayer::getProperties() return reference --- cocos/2d/CCTMXXMLParser.cpp | 2 +- cocos/2d/CCTMXXMLParser.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index e325707dbc..0ff3060340 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -57,7 +57,7 @@ TMXLayerInfo::~TMXLayerInfo() } } -ValueMap TMXLayerInfo::getProperties() +ValueMap& TMXLayerInfo::getProperties() { return _properties; } diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index b1f484288a..68a520a157 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -102,7 +102,7 @@ public: virtual ~TMXLayerInfo(); void setProperties(ValueMap properties); - ValueMap getProperties(); + ValueMap& getProperties(); ValueMap _properties; std::string _name; From cc4bee319cd021f51b6aa658f76c0bdaffd48f40 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sun, 5 Jan 2014 10:43:05 +0000 Subject: [PATCH 239/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 765af5ed39..f3d5f69b7b 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 765af5ed3956e2edd081926bbac26745c01fdb68 +Subproject commit f3d5f69b7b088e348e1a6a58734b949c381f9a78 From a274d350253b9157acf3a34cb6e3c2e7205568a4 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 6 Jan 2014 09:49:04 +0800 Subject: [PATCH 240/428] remove node reuse in renderTextureSave --- .../RenderTextureTest/RenderTextureTest.cpp | 25 ++++++++++--------- .../RenderTextureTest/RenderTextureTest.h | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp index cae1676dd5..9a18f256be 100644 --- a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -101,12 +101,6 @@ RenderTextureSave::RenderTextureSave() // note that the render texture is a Node, and contains a sprite of its texture for convience, // so we can just parent it to the scene like any other Node this->addChild(_target, -1); - - // create a brush image to draw into the texture with - _brush = Sprite::create("Images/fire.png"); - _brush->retain(); - _brush->setColor(Color3B::RED); - _brush->setOpacity(20); auto listener = EventListenerTouchAllAtOnce::create(); listener->onTouchesMoved = CC_CALLBACK_2(RenderTextureSave::onTouchesMoved, this); @@ -170,7 +164,6 @@ void RenderTextureSave::saveImage(cocos2d::Object *sender) RenderTextureSave::~RenderTextureSave() { - _brush->release(); _target->release(); Director::getInstance()->getTextureCache()->removeUnusedTextures(); } @@ -190,20 +183,28 @@ void RenderTextureSave::onTouchesMoved(const std::vector& touches, Event if (distance > 1) { int d = (int)distance; + _brushs.clear(); + for(int i = 0; i < d; ++i) + { + Sprite * sprite = Sprite::create("Images/fire.png"); + sprite->setColor(Color3B::RED); + sprite->setOpacity(20); + _brushs.pushBack(sprite); + } for (int i = 0; i < d; i++) { float difx = end.x - start.x; float dify = end.y - start.y; float delta = (float)i / distance; - _brush->setPosition(Point(start.x + (difx * delta), start.y + (dify * delta))); - _brush->setRotation(rand() % 360); + _brushs.at(i)->setPosition(Point(start.x + (difx * delta), start.y + (dify * delta))); + _brushs.at(i)->setRotation(rand() % 360); float r = (float)(rand() % 50 / 50.f) + 0.25f; - _brush->setScale(r); + _brushs.at(i)->setScale(r); /*_brush->setColor(Color3B(CCRANDOM_0_1() * 127 + 128, 255, 255));*/ // Use CCRANDOM_0_1() will cause error when loading libtests.so on android, I don't know why. - _brush->setColor(Color3B(rand() % 127 + 128, 255, 255)); + _brushs.at(i)->setColor(Color3B(rand() % 127 + 128, 255, 255)); // Call visit to draw the brush, don't call draw.. - _brush->visit(); + _brushs.at(i)->visit(); } } diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h index 793009e6e2..32ee7c111d 100644 --- a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h +++ b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h @@ -32,7 +32,7 @@ public: private: RenderTexture *_target; - Sprite *_brush; + Vector _brushs; }; class RenderTextureIssue937 : public RenderTextureTest From 26e10ff662f6444d50a80034635ce76044b6b5c6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 10:38:04 +0800 Subject: [PATCH 241/428] [develop] Updates JS-test submodule --- samples/Javascript/Shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index 8f9d0b0784..3dd1fa7659 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit 8f9d0b0784ef35220b7b7385c8c5be558d1fd0b3 +Subproject commit 3dd1fa765930f0307e0b89f8c048235736aed506 From 76f96d0b4178e6d656929202c0c957591233431b Mon Sep 17 00:00:00 2001 From: chengstory Date: Mon, 6 Jan 2014 10:42:17 +0800 Subject: [PATCH 242/428] fixed ActionNode memoryleak. --- cocos/editor-support/cocostudio/CCActionNode.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/editor-support/cocostudio/CCActionNode.cpp b/cocos/editor-support/cocostudio/CCActionNode.cpp index 1caacb0f05..3a174e7f47 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/CCActionNode.cpp @@ -64,6 +64,7 @@ ActionNode::~ActionNode() for (auto object : _frameArray) { object->clear(); + CC_SAFE_DELETE(object); } _frameArray.clear(); } From bf195413302f527b5fa617ed82f1a924b8293c97 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 10:45:14 +0800 Subject: [PATCH 243/428] Updates JS-test submodule after merging. --- samples/Javascript/Shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index 3dd1fa7659..bc00ab95c9 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit 3dd1fa765930f0307e0b89f8c048235736aed506 +Subproject commit bc00ab95c9c2160452930da2f263ff8c926eb2cc From ad30f8ff9677b9a40822f8437eb1868be00f5507 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Mon, 6 Jan 2014 10:56:33 +0800 Subject: [PATCH 244/428] Fixed bug of clippinglayout --- cocos/gui/UILayout.cpp | 243 ++++++++++++++++++++++++++++------------- cocos/gui/UILayout.h | 37 ++++++- 2 files changed, 204 insertions(+), 76 deletions(-) diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index 9c7085432c..2e4ba0750f 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -25,6 +25,14 @@ #include "gui/UILayout.h" #include "gui/UIHelper.h" #include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" +#include "kazmath/GL/matrix.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" +#include "CCDirector.h" +#include "CCDrawingPrimitives.h" +#include "CCRenderer.h" +#include "CCGroupCommand.h" +#include "CCCustomCommand.h" NS_CC_BEGIN @@ -34,6 +42,7 @@ static const int BACKGROUNDIMAGE_Z = (-1); static const int BCAKGROUNDCOLORRENDERER_Z = (-2); static GLint g_sStencilBits = -1; +static GLint s_layer = -1; Layout::Layout(): _clippingEnabled(false), @@ -54,11 +63,22 @@ _backGroundImageTextureSize(Size::ZERO), _layoutType(LAYOUT_ABSOLUTE), _clippingType(LAYOUT_CLIPPING_STENCIL), _clippingStencil(nullptr), -_handleScissor(false), _scissorRectDirty(false), _clippingRect(Rect::ZERO), _clippingParent(nullptr), -_doLayoutDirty(true) +_doLayoutDirty(true), +_currentStencilEnabled(GL_FALSE), +_currentStencilWriteMask(~0), +_currentStencilFunc(GL_ALWAYS), +_currentStencilRef(0), +_currentStencilValueMask(~0), +_currentStencilFail(GL_KEEP), +_currentStencilPassDepthFail(GL_KEEP), +_currentStencilPassDepthPass(GL_KEEP), +_currentDepthWriteMask(GL_TRUE), +_currentAlphaTestEnabled(GL_FALSE), +_currentAlphaTestFunc(GL_ALWAYS), +_currentAlphaTestRef(1) { _widgetType = WidgetTypeContainer; } @@ -66,6 +86,24 @@ _doLayoutDirty(true) Layout::~Layout() { } + +void Layout::onEnter() +{ + Widget::onEnter(); + if (_clippingStencil) + { + _clippingStencil->onEnter(); + } +} + +void Layout::onExit() +{ + Widget::onExit(); + if (_clippingStencil) + { + _clippingStencil->onExit(); + } +} Layout* Layout::create() { @@ -151,104 +189,150 @@ void Layout::sortAllChildren() void Layout::stencilClippingVisit() { - if (!_clippingStencil || !_clippingStencil->isVisible()) - { - Node::visit(); + if(!_visible) return; - } - if (g_sStencilBits < 1) + + kmGLPushMatrix(); + transform(); + //Add group command + + Renderer* renderer = Director::getInstance()->getRenderer(); + + _groupCommand.init(0,_vertexZ); + renderer->addCommand(&_groupCommand); + + renderer->pushGroup(_groupCommand.getRenderQueueID()); + + _beforeVisitCmdStencil.init(0,_vertexZ); + _beforeVisitCmdStencil.func = CC_CALLBACK_0(Layout::onBeforeVisitStencil, this); + renderer->addCommand(&_beforeVisitCmdStencil); + + _clippingStencil->visit(); + + _afterDrawStencilCmd.init(0,_vertexZ); + _afterDrawStencilCmd.func = CC_CALLBACK_0(Layout::onAfterDrawStencil, this); + renderer->addCommand(&_afterDrawStencilCmd); + + int i = 0; + + if(!_children.empty()) { - Node::visit(); - return; - } - static GLint layer = -1; - if (layer + 1 == g_sStencilBits) - { - static bool once = true; - if (once) + sortAllChildren(); + // draw children zOrder < 0 + for( ; i < _children.size(); i++ ) { - char warning[200] = {0}; - snprintf(warning, sizeof(warning), "Nesting more than %d stencils is not supported. Everything will be drawn without stencil for this node and its childs.", g_sStencilBits); - CCLOG("%s", warning); + auto node = _children.at(i); - once = false; + if ( node && node->getZOrder() < 0 ) + node->visit(); + else + break; } - Node::visit(); - return; + // self draw + this->draw(); + + for(auto it=_children.cbegin()+i; it != _children.cend(); ++it) + (*it)->visit(); } - layer++; - GLint mask_layer = 0x1 << layer; + else + { + this->draw(); + } + + _afterVisitCmdStencil.init(0,_vertexZ); + _afterVisitCmdStencil.func = CC_CALLBACK_0(Layout::onAfterVisitStencil, this); + renderer->addCommand(&_afterVisitCmdStencil); + + renderer->popGroup(); + + kmGLPopMatrix(); +} + +void Layout::onBeforeVisitStencil() +{ + s_layer++; + GLint mask_layer = 0x1 << s_layer; GLint mask_layer_l = mask_layer - 1; - GLint mask_layer_le = mask_layer | mask_layer_l; - GLboolean currentStencilEnabled = GL_FALSE; - GLuint currentStencilWriteMask = ~0; - GLenum currentStencilFunc = GL_ALWAYS; - GLint currentStencilRef = 0; - GLuint currentStencilValueMask = ~0; - GLenum currentStencilFail = GL_KEEP; - GLenum currentStencilPassDepthFail = GL_KEEP; - GLenum currentStencilPassDepthPass = GL_KEEP; - currentStencilEnabled = glIsEnabled(GL_STENCIL_TEST); - glGetIntegerv(GL_STENCIL_WRITEMASK, (GLint *)¤tStencilWriteMask); - glGetIntegerv(GL_STENCIL_FUNC, (GLint *)¤tStencilFunc); - glGetIntegerv(GL_STENCIL_REF, ¤tStencilRef); - glGetIntegerv(GL_STENCIL_VALUE_MASK, (GLint *)¤tStencilValueMask); - glGetIntegerv(GL_STENCIL_FAIL, (GLint *)¤tStencilFail); - glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, (GLint *)¤tStencilPassDepthFail); - glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, (GLint *)¤tStencilPassDepthPass); + _mask_layer_le = mask_layer | mask_layer_l; + _currentStencilEnabled = glIsEnabled(GL_STENCIL_TEST); + glGetIntegerv(GL_STENCIL_WRITEMASK, (GLint *)&_currentStencilWriteMask); + glGetIntegerv(GL_STENCIL_FUNC, (GLint *)&_currentStencilFunc); + glGetIntegerv(GL_STENCIL_REF, &_currentStencilRef); + glGetIntegerv(GL_STENCIL_VALUE_MASK, (GLint *)&_currentStencilValueMask); + glGetIntegerv(GL_STENCIL_FAIL, (GLint *)&_currentStencilFail); + glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, (GLint *)&_currentStencilPassDepthFail); + glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, (GLint *)&_currentStencilPassDepthPass); + glEnable(GL_STENCIL_TEST); CHECK_GL_ERROR_DEBUG(); glStencilMask(mask_layer); - GLboolean currentDepthWriteMask = GL_TRUE; - glGetBooleanv(GL_DEPTH_WRITEMASK, ¤tDepthWriteMask); + glGetBooleanv(GL_DEPTH_WRITEMASK, &_currentDepthWriteMask); glDepthMask(GL_FALSE); glStencilFunc(GL_NEVER, mask_layer, mask_layer); - glStencilOp(GL_ZERO, GL_KEEP, GL_KEEP); + glStencilOp(!false ? GL_ZERO : GL_REPLACE, GL_KEEP, GL_KEEP); kmGLMatrixMode(KM_GL_MODELVIEW); kmGLPushMatrix(); kmGLLoadIdentity(); + kmGLMatrixMode(KM_GL_PROJECTION); kmGLPushMatrix(); kmGLLoadIdentity(); + DrawPrimitives::drawSolidRect(Point(-1,-1), Point(1,1), Color4F(1, 1, 1, 1)); + kmGLMatrixMode(KM_GL_PROJECTION); kmGLPopMatrix(); kmGLMatrixMode(KM_GL_MODELVIEW); kmGLPopMatrix(); glStencilFunc(GL_NEVER, mask_layer, mask_layer); - glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP); + glStencilOp(!false ? GL_REPLACE : GL_ZERO, GL_KEEP, GL_KEEP); +} - kmGLPushMatrix(); - transform(); - _clippingStencil->visit(); - kmGLPopMatrix(); - glDepthMask(currentDepthWriteMask); - glStencilFunc(GL_EQUAL, mask_layer_le, mask_layer_le); +void Layout::onAfterDrawStencil() +{ + glDepthMask(_currentDepthWriteMask); + glStencilFunc(GL_EQUAL, _mask_layer_le, _mask_layer_le); glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); - Node::visit(); - glStencilFunc(currentStencilFunc, currentStencilRef, currentStencilValueMask); - glStencilOp(currentStencilFail, currentStencilPassDepthFail, currentStencilPassDepthPass); - glStencilMask(currentStencilWriteMask); - if (!currentStencilEnabled) +} + + +void Layout::onAfterVisitStencil() +{ + glStencilFunc(_currentStencilFunc, _currentStencilRef, _currentStencilValueMask); + glStencilOp(_currentStencilFail, _currentStencilPassDepthFail, _currentStencilPassDepthPass); + glStencilMask(_currentStencilWriteMask); + if (!_currentStencilEnabled) { glDisable(GL_STENCIL_TEST); } - layer--; + s_layer--; +} + +void Layout::onBeforeVisitScissor() +{ + Rect clippingRect = getClippingRect(); + glEnable(GL_SCISSOR_TEST); + EGLView::getInstance()->setScissorInPoints(clippingRect.origin.x, clippingRect.origin.y, clippingRect.size.width, clippingRect.size.height); +} + +void Layout::onAfterVisitScissor() +{ + glDisable(GL_SCISSOR_TEST); } void Layout::scissorClippingVisit() { - Rect clippingRect = getClippingRect(); - if (_handleScissor) - { - glEnable(GL_SCISSOR_TEST); - } - EGLView::getInstance()->setScissorInPoints(clippingRect.origin.x, clippingRect.origin.y, clippingRect.size.width, clippingRect.size.height); + Renderer* renderer = Director::getInstance()->getRenderer(); + + _beforeVisitCmdScissor.init(0, _vertexZ); + _beforeVisitCmdScissor.func = CC_CALLBACK_0(Layout::onBeforeVisitScissor, this); + renderer->addCommand(&_beforeVisitCmdScissor); + Node::visit(); - if (_handleScissor) - { - glDisable(GL_SCISSOR_TEST); - } + + _afterVisitCmdScissor.init(0, _vertexZ); + _afterVisitCmdScissor.func = CC_CALLBACK_0(Layout::onAfterVisitScissor, this); + renderer->addCommand(&_afterVisitCmdScissor); } void Layout::setClippingEnabled(bool able) @@ -263,15 +347,30 @@ void Layout::setClippingEnabled(bool able) case LAYOUT_CLIPPING_STENCIL: if (able) { - glGetIntegerv(GL_STENCIL_BITS, &g_sStencilBits); + static bool once = true; + if (once) + { + glGetIntegerv(GL_STENCIL_BITS, &g_sStencilBits); + if (g_sStencilBits <= 0) + { + CCLOG("Stencil buffer is not enabled."); + } + once = false; + } _clippingStencil = DrawNode::create(); - _clippingStencil->onEnter(); + if (_running) + { + _clippingStencil->onEnter(); + } _clippingStencil->retain(); setStencilClippingSize(_size); } else { - _clippingStencil->onExit(); + if (_running) + { + _clippingStencil->onExit(); + } _clippingStencil->release(); _clippingStencil = nullptr; } @@ -310,7 +409,6 @@ void Layout::setStencilClippingSize(const Size &size) const Rect& Layout::getClippingRect() { - _handleScissor = true; Point worldPos = convertToWorldSpace(Point::ZERO); AffineTransform t = nodeToWorldTransform(); float scissorWidth = _size.width*t.a; @@ -329,11 +427,6 @@ const Rect& Layout::getClippingRect() { _clippingParent = parent; firstClippingParentFounded = true; - } - - if (parent->_clippingType == LAYOUT_CLIPPING_SCISSOR) - { - _handleScissor = false; break; } } diff --git a/cocos/gui/UILayout.h b/cocos/gui/UILayout.h index 0feff5447e..5b0d3bd202 100644 --- a/cocos/gui/UILayout.h +++ b/cocos/gui/UILayout.h @@ -214,6 +214,9 @@ public: virtual void sortAllChildren() override; void requestDoLayout(); + + virtual void onEnter() override; + virtual void onExit() override; protected: //override "init" method of widget. virtual bool init() override; @@ -235,6 +238,14 @@ protected: void setStencilClippingSize(const Size& size); const Rect& getClippingRect(); virtual void doLayout(); + + //clipping + void onBeforeVisitStencil(); + void onAfterDrawStencil(); + void onAfterVisitStencil(); + + void onBeforeVisitScissor(); + void onAfterVisitScissor(); protected: bool _clippingEnabled; @@ -256,11 +267,35 @@ protected: LayoutType _layoutType; LayoutClippingType _clippingType; DrawNode* _clippingStencil; - bool _handleScissor; bool _scissorRectDirty; Rect _clippingRect; Layout* _clippingParent; bool _doLayoutDirty; + + //clipping + + GLboolean _currentStencilEnabled; + GLuint _currentStencilWriteMask; + GLenum _currentStencilFunc; + GLint _currentStencilRef; + GLuint _currentStencilValueMask; + GLenum _currentStencilFail; + GLenum _currentStencilPassDepthFail; + GLenum _currentStencilPassDepthPass; + GLboolean _currentDepthWriteMask; + + GLboolean _currentAlphaTestEnabled; + GLenum _currentAlphaTestFunc; + GLclampf _currentAlphaTestRef; + + GLint _mask_layer_le; + + GroupCommand _groupCommand; + CustomCommand _beforeVisitCmdStencil; + CustomCommand _afterDrawStencilCmd; + CustomCommand _afterVisitCmdStencil; + CustomCommand _beforeVisitCmdScissor; + CustomCommand _afterVisitCmdScissor; }; } From 704d05521e63dd5d890a90214501d4e3900d5ab4 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 11:09:58 +0800 Subject: [PATCH 245/428] Update AUTHORS [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 37572f6171..7b76f10faa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -702,6 +702,7 @@ Developers: daltomi Fixed a typo in Director class. + Removed an unnecessary boolean flag in CCFontAtlasCache.cpp. Retired Core Developers: WenSheng Yang From 7e279219ff376b8600bec3c8a99a83006a231e88 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 6 Jan 2014 11:12:44 +0800 Subject: [PATCH 246/428] Fix:Resolve the error that CocoStudioSceneTest load resource in android --- samples/Lua/TestLua/Classes/AppDelegate.cpp | 4 ++-- .../CocoStudioSceneTest/CocoStudioSceneTest.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/Lua/TestLua/Classes/AppDelegate.cpp b/samples/Lua/TestLua/Classes/AppDelegate.cpp index d07fb61f22..3979bbd41c 100644 --- a/samples/Lua/TestLua/Classes/AppDelegate.cpp +++ b/samples/Lua/TestLua/Classes/AppDelegate.cpp @@ -61,11 +61,11 @@ bool AppDelegate::applicationDidFinishLaunching() searchPaths.insert(searchPaths.begin(), "cocosbuilderRes"); if (screenSize.height > 320) { - searchPaths.insert(searchPaths.begin(), "hd/scenetest"); + searchPaths.insert(searchPaths.begin(), "hd/scenetest/loadSceneEdtiorFileTest"); } else { - searchPaths.insert(searchPaths.begin(), "scenetest"); + searchPaths.insert(searchPaths.begin(), "scenetest/loadSceneEdtiorFileTest"); } #if CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua index 019809580c..e70ffd6262 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua @@ -16,7 +16,7 @@ function SceneEditorTestLayer.extend(target) end function SceneEditorTestLayer:createGameScene() - local node = ccs.SceneReader:getInstance():createNodeWithSceneFile("scenetest/FishJoy2.json") + local node = ccs.SceneReader:getInstance():createNodeWithSceneFile("scenetest/loadSceneEdtiorFileTest/FishJoy2.json") if nil == node then return end From d5d213aa0aff087f09adce2e295a2181ac2d1425 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 6 Jan 2014 11:19:40 +0800 Subject: [PATCH 247/428] Fix:Update the file spelling --- samples/Lua/TestLua/Classes/AppDelegate.cpp | 4 ++-- .../CocoStudioSceneTest/CocoStudioSceneTest.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/Lua/TestLua/Classes/AppDelegate.cpp b/samples/Lua/TestLua/Classes/AppDelegate.cpp index 3979bbd41c..98f5922eec 100644 --- a/samples/Lua/TestLua/Classes/AppDelegate.cpp +++ b/samples/Lua/TestLua/Classes/AppDelegate.cpp @@ -61,11 +61,11 @@ bool AppDelegate::applicationDidFinishLaunching() searchPaths.insert(searchPaths.begin(), "cocosbuilderRes"); if (screenSize.height > 320) { - searchPaths.insert(searchPaths.begin(), "hd/scenetest/loadSceneEdtiorFileTest"); + searchPaths.insert(searchPaths.begin(), "hd/scenetest/LoadSceneEdtiorFileTest"); } else { - searchPaths.insert(searchPaths.begin(), "scenetest/loadSceneEdtiorFileTest"); + searchPaths.insert(searchPaths.begin(), "scenetest/LoadSceneEdtiorFileTest"); } #if CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua index e70ffd6262..3c453756a4 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua @@ -16,7 +16,7 @@ function SceneEditorTestLayer.extend(target) end function SceneEditorTestLayer:createGameScene() - local node = ccs.SceneReader:getInstance():createNodeWithSceneFile("scenetest/loadSceneEdtiorFileTest/FishJoy2.json") + local node = ccs.SceneReader:getInstance():createNodeWithSceneFile("scenetest/LoadSceneEdtiorFileTest/FishJoy2.json") if nil == node then return end From 381be48c56ec81d69343923d576b101c03923cae Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 6 Jan 2014 11:26:00 +0800 Subject: [PATCH 248/428] init shader on construction instead of draw in class CCSpriteBatchNode --- cocos/2d/CCSpriteBatchNode.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 092137bb47..a2f9f79682 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -97,8 +97,8 @@ bool SpriteBatchNode::initWithTexture(Texture2D *tex, ssize_t capacity) _children.reserve(capacity); _descendants.reserve(capacity); - - setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR)); + + setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP)); return true; } @@ -355,15 +355,13 @@ void SpriteBatchNode::draw() for(const auto &child: _children) child->updateTransform(); - auto shader = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP); - kmMat4 mv; kmGLGetMatrix(KM_GL_MODELVIEW, &mv); _quadCommand.init(0, _vertexZ, _textureAtlas->getTexture()->getName(), - shader, + _shaderProgram, _blendFunc, _textureAtlas->getQuads(), _textureAtlas->getTotalQuads(), From 5b317196c89aa19545100de3bddc7a0ce881275a Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 6 Jan 2014 11:45:18 +0800 Subject: [PATCH 249/428] fix TextInput not show IME on android. --- .../src/org/cocos2dx/lib/Cocos2dxEditText.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java index 289a7a20cf..fabc7e2b31 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java @@ -23,6 +23,7 @@ THE SOFTWARE. ****************************************************************************/ package org.cocos2dx.lib; +import android.app.Activity; import android.content.Context; import android.text.Editable; import android.text.TextWatcher; @@ -59,9 +60,11 @@ public class Cocos2dxEditText extends EditText { this.setOnEditorActionListener(this.mTextWatcher); ViewGroup.LayoutParams layout = - new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, + new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); - this.setLayoutParams(layout); + + Activity activity = (Activity)context; + activity.addContentView(this, layout); } // =========================================================== @@ -84,7 +87,7 @@ public class Cocos2dxEditText extends EditText { this.removeTextChangedListener(mTextWatcher); final InputMethodManager imm = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(this.getWindowToken(), 0); - Cocos2dxHelper.nativeRequestFocus(); + //Cocos2dxHelper.nativeRequestFocus(); } public void openIMEKeyboard() { @@ -96,7 +99,7 @@ public class Cocos2dxEditText extends EditText { this.addTextChangedListener(mTextWatcher); final InputMethodManager imm = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE); - imm.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT); + imm.showSoftInput(this, InputMethodManager.SHOW_FORCED); } @Override @@ -105,7 +108,7 @@ public class Cocos2dxEditText extends EditText { /* Let GlSurfaceView get focus if back key is input. */ if (keyCode == KeyEvent.KEYCODE_BACK) { - this.requestFocus(); + //Cocos2dxHelper.nativeRequestFocus(); } return true; @@ -189,7 +192,6 @@ class Cocos2dxTextInputWraper implements TextWatcher, OnEditorActionListener { @Override public void onTextChanged(final CharSequence pCharSequence, final int start, final int before, final int count) { - } @Override From 63fbec05e9957419d1672c6fbad42a8d1f7673bb Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Mon, 6 Jan 2014 12:19:59 +0800 Subject: [PATCH 250/428] Modify wrong codes --- cocos/gui/UILayout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index bc89ea0e47..1462a58545 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -269,7 +269,7 @@ void Layout::onBeforeVisitStencil() glGetBooleanv(GL_DEPTH_WRITEMASK, &_currentDepthWriteMask); glDepthMask(GL_FALSE); glStencilFunc(GL_NEVER, mask_layer, mask_layer); - glStencilOp(!false ? GL_ZERO : GL_REPLACE, GL_KEEP, GL_KEEP); + glStencilOp(GL_ZERO, GL_KEEP, GL_KEEP); kmGLMatrixMode(KM_GL_MODELVIEW); kmGLPushMatrix(); kmGLLoadIdentity(); @@ -285,7 +285,7 @@ void Layout::onBeforeVisitStencil() kmGLMatrixMode(KM_GL_MODELVIEW); kmGLPopMatrix(); glStencilFunc(GL_NEVER, mask_layer, mask_layer); - glStencilOp(!false ? GL_REPLACE : GL_ZERO, GL_KEEP, GL_KEEP); + glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP); } void Layout::onAfterDrawStencil() From e44d28ea7b22a01370fb36782ced590bd2bdbff6 Mon Sep 17 00:00:00 2001 From: chengstory Date: Mon, 6 Jan 2014 13:27:19 +0800 Subject: [PATCH 251/428] replace CC_SAFE_RELEASE to CC_SAFE_RELEASE_NULL --- cocos/editor-support/cocostudio/CCSSceneReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index 36d0adc97d..44bd667507 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -146,7 +146,7 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par } else { - CC_SAFE_RELEASE(com); + CC_SAFE_RELEASE_NULL(com); } } if(_fnSelector != nullptr) From f9f369258b274a62438dbbffb325d9f6f1b741c6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 13:47:11 +0800 Subject: [PATCH 252/428] Renames resource folder name from 'loadXXX' to 'LoadXXX' --- .../Images/startMenuBG.png.REMOVED.git-id | 0 .../Misc/music_logo.mp3.REMOVED.git-id | 0 .../Misc/music_logo.wav.REMOVED.git-id | 0 .../fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 0 .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 0 .../startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id | 0 .../startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id | 0 .../startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/Images/startMenuBG.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/Misc/music_logo.mp3.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/Misc/music_logo.wav.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/fishes/blowFish/Blowfish0.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id (100%) rename samples/Cpp/TestCpp/Resources/hd/scenetest/{loadSceneEdtiorFileTest => LoadSceneEdtiorFileTest}/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id (100%) diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/loadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id rename to samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id From 7ae83848a9f98f6f3855883faf62b9f56206c7fe Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 13:55:20 +0800 Subject: [PATCH 253/428] Updates JS-Tests submodule. --- samples/Javascript/Shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index bc00ab95c9..d4c38884a6 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit bc00ab95c9c2160452930da2f263ff8c926eb2cc +Subproject commit d4c38884a6f975073f551390732f1daaf9d41b38 From 07e51e2c86e1cd2b4d93562b847874701f784543 Mon Sep 17 00:00:00 2001 From: chuanweizhang Date: Mon, 6 Jan 2014 14:24:33 +0800 Subject: [PATCH 254/428] test template lua --- README.md | 2 +- .../HelloLua.xcodeproj/project.pbxproj | 18 ++++++++++++++++++ .../multi-platform-lua/proj.linux/build.sh | 3 ++- .../multi-platform-lua/proj.win32/HelloLua.sln | 7 +++++++ .../proj.win32/HelloLua.vcxproj | 3 +++ tools/project-creator/README.md | 8 ++++---- .../module/cocos_files.json.REMOVED.git-id | 2 +- tools/project-creator/module/core.py | 2 +- 8 files changed, 37 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7c71a9a713..92e6e9c9a3 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ How to start a new game Example: $ cd cocos2d-x/tools/project-creator - $ ./project-creator.pyw -n mygame -k com.your_company.mygame -l cpp -p /home/mygame + $ ./project-creator.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame $ cd /home/mygame diff --git a/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj b/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj index 76f9c16c73..eecc14f8cb 100644 --- a/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj +++ b/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj @@ -7,6 +7,12 @@ objects = { /* Begin PBXBuildFile section */ + 01A8D331187A504A001CC002 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32E187A5049001CC002 /* CocoStudio.lua */; }; + 01A8D332187A504A001CC002 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32E187A5049001CC002 /* CocoStudio.lua */; }; + 01A8D333187A504A001CC002 /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32F187A504A001CC002 /* extern.lua */; }; + 01A8D334187A504A001CC002 /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32F187A504A001CC002 /* extern.lua */; }; + 01A8D335187A504A001CC002 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D330187A504A001CC002 /* GuiConstants.lua */; }; + 01A8D336187A504A001CC002 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D330187A504A001CC002 /* GuiConstants.lua */; }; 15A8A4441834C43700142BE0 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4291834BDA200142BE0 /* libchipmunk iOS.a */; }; 15A8A4451834C43700142BE0 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4251834BDA200142BE0 /* libcocos2dx iOS.a */; }; 15A8A4461834C43700142BE0 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4271834BDA200142BE0 /* libcocos2dx-extensions iOS.a */; }; @@ -219,6 +225,9 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 01A8D32E187A5049001CC002 /* CocoStudio.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CocoStudio.lua; path = ../cocos2d/cocos/scripting/lua/script/CocoStudio.lua; sourceTree = ""; }; + 01A8D32F187A504A001CC002 /* extern.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = extern.lua; path = ../cocos2d/cocos/scripting/lua/script/extern.lua; sourceTree = ""; }; + 01A8D330187A504A001CC002 /* GuiConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = GuiConstants.lua; path = ../cocos2d/cocos/scripting/lua/script/GuiConstants.lua; sourceTree = ""; }; 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../cocos2d/build/cocos2d_libs.xcodeproj; sourceTree = ""; }; 15A8A4551834C6AD00142BE0 /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AudioEngine.lua; path = ../cocos2d/cocos/scripting/lua/script/AudioEngine.lua; sourceTree = ""; }; 15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CCBReaderLoad.lua; path = ../cocos2d/cocos/scripting/lua/script/CCBReaderLoad.lua; sourceTree = ""; }; @@ -370,6 +379,9 @@ 1A0227A417A3AA1A00B867AD /* Lua Common */ = { isa = PBXGroup; children = ( + 01A8D32E187A5049001CC002 /* CocoStudio.lua */, + 01A8D32F187A504A001CC002 /* extern.lua */, + 01A8D330187A504A001CC002 /* GuiConstants.lua */, 15A8A4551834C6AD00142BE0 /* AudioEngine.lua */, 15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */, 15A8A4571834C6AD00142BE0 /* Cocos2d.lua */, @@ -722,6 +734,9 @@ 5023815717EBBCE400990C9B /* menu2.png in Resources */, 5023817617EBBE3400990C9B /* Icon.icns in Resources */, 15A8A4651834C6AD00142BE0 /* AudioEngine.lua in Resources */, + 01A8D332187A504A001CC002 /* CocoStudio.lua in Resources */, + 01A8D334187A504A001CC002 /* extern.lua in Resources */, + 01A8D336187A504A001CC002 /* GuiConstants.lua in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -772,6 +787,9 @@ 5023811A17EBBCAC00990C9B /* Default.png in Resources */, 5091733817ECE17A00D62437 /* Icon-50.png in Resources */, 5023812117EBBCAC00990C9B /* Icon-72.png in Resources */, + 01A8D331187A504A001CC002 /* CocoStudio.lua in Resources */, + 01A8D333187A504A001CC002 /* extern.lua in Resources */, + 01A8D335187A504A001CC002 /* GuiConstants.lua in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/template/multi-platform-lua/proj.linux/build.sh b/template/multi-platform-lua/proj.linux/build.sh index 99dcf294d3..d1408e62a4 100755 --- a/template/multi-platform-lua/proj.linux/build.sh +++ b/template/multi-platform-lua/proj.linux/build.sh @@ -12,7 +12,7 @@ cd ../cocos2d sudo ./build/install-deps-linux.sh mkdir -p linux-build cd linux-build -cmake .. -DBUILD_LIBS_LUA=OFF -DBUILD_HelloCpp=OFF -DBUILD_TestCpp=OFF -DBUILD_HelloLua=OFF -DBUILD_TestLua=OFF +cmake .. -DBUILD_HelloCpp=OFF -DBUILD_TestCpp=OFF -DBUILD_HelloLua=OFF -DBUILD_TestLua=OFF make -j4 #make bin @@ -24,3 +24,4 @@ cmake ../.. make -j4 cd .. mv ../bin bin +cp ../cocos2d/cocos/scripting/lua/script/* bin/Resources diff --git a/template/multi-platform-lua/proj.win32/HelloLua.sln b/template/multi-platform-lua/proj.win32/HelloLua.sln index 1da75a564c..5f6caa40b0 100644 --- a/template/multi-platform-lua/proj.win32/HelloLua.sln +++ b/template/multi-platform-lua/proj.win32/HelloLua.sln @@ -4,6 +4,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "HelloLua.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}" ProjectSection(ProjectDependencies) = postProject {21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28} + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE} = {B7C2A162-DEC9-4418-972E-240AB3CBFCAE} {DDC3E27F-004D-4DD4-9DD3-931A013D2159} = {DDC3E27F-004D-4DD4-9DD3-931A013D2159} {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} @@ -33,6 +34,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosStudio", "..\cocos2 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGUI", "..\cocos2d\cocos\gui\proj.win32\libGUI.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos2d\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -79,6 +82,10 @@ Global {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.Build.0 = Debug|Win32 {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.ActiveCfg = Release|Win32 {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.Build.0 = Release|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/template/multi-platform-lua/proj.win32/HelloLua.vcxproj b/template/multi-platform-lua/proj.win32/HelloLua.vcxproj index df4d1907a2..dade088c62 100644 --- a/template/multi-platform-lua/proj.win32/HelloLua.vcxproj +++ b/template/multi-platform-lua/proj.win32/HelloLua.vcxproj @@ -186,6 +186,9 @@ xcopy /Y /Q "$(ProjectDir)..\cocos2d\external\websockets\prebuilt\win32\*.*" "$( {b57cf53f-2e49-4031-9822-047cc0e6bde2} + + + {b7c2a162-dec9-4418-972e-240ab3cbfcae} {7e06e92c-537a-442b-9e4a-4761c84f8a1a} diff --git a/tools/project-creator/README.md b/tools/project-creator/README.md index 06fb84e3ba..a7f888fbfd 100644 --- a/tools/project-creator/README.md +++ b/tools/project-creator/README.md @@ -5,11 +5,11 @@ First you need install python environment. There have double ways create new cocos project. Notice:The best of generate path is english path. ##1.UI -* Windows: double click "create_project.pyw" file -* Mac: ./create_project.pyw +* Windows: double click "create_project.py" file +* Mac: ./create_project.py * Linux: The tkinter was not installed in the linux's default python,therefore, in order to use the gui operate, you have to install the tkinter libaray manually. There is another way to create project by command line. see below for details ##2.console $ cd cocos2d-x/tools/project-creator - $ ./project-creator.pyw --help - $ ./project-creator.pyw -n mygame -k com.your_company.mygame -l cpp -p /home/mygame + $ ./project-creator.py --help + $ ./project-creator.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame $ cd /home/mygame \ No newline at end of file diff --git a/tools/project-creator/module/cocos_files.json.REMOVED.git-id b/tools/project-creator/module/cocos_files.json.REMOVED.git-id index 60eb92e773..cf2d710a7d 100644 --- a/tools/project-creator/module/cocos_files.json.REMOVED.git-id +++ b/tools/project-creator/module/cocos_files.json.REMOVED.git-id @@ -1 +1 @@ -6b36f5d803952b11046d0b2395c232fe66301b2f \ No newline at end of file +96eb4f261ce2c1be3899e53508952d57bbd19d5d \ No newline at end of file diff --git a/tools/project-creator/module/core.py b/tools/project-creator/module/core.py index fbbe0d43bd..f12ce71553 100644 --- a/tools/project-creator/module/core.py +++ b/tools/project-creator/module/core.py @@ -197,7 +197,7 @@ class CocosProject: else: if os.path.exists(dstfile): os.remove(dstfile) - shutil.copyfile(srcfile, dstfile) + shutil.copy(srcfile, dstfile) self.step = self.step + 1 if self.callbackfun and self.step%int(self.totalStep/50) == 0: self.callbackfun(self.step,self.totalStep,fileList[index]) From 16bff3da1ceb774c0d717d3212054fec1ce13170 Mon Sep 17 00:00:00 2001 From: user Date: Mon, 6 Jan 2014 01:31:36 -0500 Subject: [PATCH 255/428] add 755 --- tools/project-creator/config-create/create_config.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/project-creator/config-create/create_config.py diff --git a/tools/project-creator/config-create/create_config.py b/tools/project-creator/config-create/create_config.py old mode 100644 new mode 100755 From 22fa5319a902105b08beb4122181e4b790783011 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 14:49:32 +0800 Subject: [PATCH 256/428] Wrong search path fix for CocoStudioTest/SceneTest --- samples/Cpp/TestCpp/Classes/AppDelegate.cpp | 4 ++-- samples/Javascript/TestJavascript/Classes/AppDelegate.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp index 7b6abad014..3243c8f05c 100644 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp +++ b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp @@ -49,7 +49,7 @@ bool AppDelegate::applicationDidFinishLaunching() searchPaths.push_back("hd/scenetest/AttributeComponentTest"); searchPaths.push_back("hd/scenetest/BackgroundComponentTest"); searchPaths.push_back("hd/scenetest/EffectComponentTest"); - searchPaths.push_back("hd/scenetest/loadSceneEdtiorFileTest"); + searchPaths.push_back("hd/scenetest/LoadSceneEdtiorFileTest"); searchPaths.push_back("hd/scenetest/ParticleComponentTest"); searchPaths.push_back("hd/scenetest/SpriteComponentTest"); searchPaths.push_back("hd/scenetest/TmxMapComponentTest"); @@ -63,7 +63,7 @@ bool AppDelegate::applicationDidFinishLaunching() searchPaths.push_back("scenetest/AttributeComponentTest"); searchPaths.push_back("scenetest/BackgroundComponentTest"); searchPaths.push_back("scenetest/EffectComponentTest"); - searchPaths.push_back("scenetest/loadSceneEdtiorFileTest"); + searchPaths.push_back("scenetest/LoadSceneEdtiorFileTest"); searchPaths.push_back("scenetest/ParticleComponentTest"); searchPaths.push_back("scenetest/SpriteComponentTest"); searchPaths.push_back("scenetest/TmxMapComponentTest"); diff --git a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp index 5d985b57ea..d5d37f513a 100644 --- a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp +++ b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp @@ -59,7 +59,7 @@ bool AppDelegate::applicationDidFinishLaunching() "res/scenetest/AttributeComponentTest", "res/scenetest/BackgroundComponentTest", "res/scenetest/EffectComponentTest", - "res/scenetest/loadSceneEdtiorFileTest", + "res/scenetest/LoadSceneEdtiorFileTest", "res/scenetest/ParticleComponentTest", "res/scenetest/SpriteComponentTest", "res/scenetest/TmxMapComponentTest", From 4d1d225bd17112fac862157b58f684fe99338c61 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Mon, 6 Jan 2014 15:07:04 +0800 Subject: [PATCH 257/428] Fixed bugs and memory leak --- cocos/gui/UILayout.cpp | 1 + cocos/gui/UIText.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index 1462a58545..c9dffd1818 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -85,6 +85,7 @@ _currentAlphaTestRef(1) Layout::~Layout() { + setClippingEnabled(false); } void Layout::onEnter() diff --git a/cocos/gui/UIText.cpp b/cocos/gui/UIText.cpp index 91815575b1..a6f22997bf 100644 --- a/cocos/gui/UIText.cpp +++ b/cocos/gui/UIText.cpp @@ -140,13 +140,11 @@ void Text::setScale(float fScale) void Text::setScaleX(float fScaleX) { Widget::setScaleX(fScaleX); - _normalScaleValueX = fScaleX; } void Text::setScaleY(float fScaleY) { Widget::setScaleY(fScaleY); - _normalScaleValueY = fScaleY; } bool Text::isTouchScaleChangeEnabled() @@ -169,6 +167,8 @@ void Text::onPressStateChangedToPressed() { return; } + _normalScaleValueX = getScaleX(); + _normalScaleValueY = getScaleY(); clickScale(_normalScaleValueX + _onSelectedScaleOffset, _normalScaleValueY + _onSelectedScaleOffset); } From 4261a441dece073c70360909adffdc75f6404f65 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 6 Jan 2014 15:19:47 +0800 Subject: [PATCH 258/428] fix crash in UnitTest.cpp on vs. --- samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp index 5de0e623dc..2783d8d84e 100644 --- a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp +++ b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp @@ -343,7 +343,9 @@ void TemplateMapTest::onEnter() Map map1; CCASSERT(map1.empty(), ""); CCASSERT(map1.size() == 0, ""); +#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) CCASSERT(map1.bucketCount() == 0, ""); +#endif CCASSERT(map1.keys().empty(), ""); CCASSERT(map1.keys(Node::create()).empty(), ""); From 60b340f2cdbdb37b1917c256fdb441adcdfb1cd3 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Mon, 6 Jan 2014 15:59:21 +0800 Subject: [PATCH 259/428] Modify wrong codes --- cocos/gui/UILayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index c9dffd1818..2cc1929ebd 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -85,7 +85,7 @@ _currentAlphaTestRef(1) Layout::~Layout() { - setClippingEnabled(false); + CC_SAFE_RELEASE(_clippingStencil); } void Layout::onEnter() From c40cedc804022d6e5c6ebe3b60318b8547d01561 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 16:09:01 +0800 Subject: [PATCH 260/428] Don't test Map::bucketCount since it's platform dependence. --- samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp index 2783d8d84e..5027ac3c43 100644 --- a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp +++ b/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp @@ -343,9 +343,6 @@ void TemplateMapTest::onEnter() Map map1; CCASSERT(map1.empty(), ""); CCASSERT(map1.size() == 0, ""); -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) - CCASSERT(map1.bucketCount() == 0, ""); -#endif CCASSERT(map1.keys().empty(), ""); CCASSERT(map1.keys(Node::create()).empty(), ""); From 94e0b03d47265db795c668c74feb7f46dc4fbad2 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 6 Jan 2014 16:28:15 +0800 Subject: [PATCH 261/428] don't release autoreleased object --- samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp index 18f9c8a4bd..54a2095f42 100644 --- a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp @@ -1568,8 +1568,6 @@ void MultipleParticleSystemsBatched::onEnter() batchNode->addChild(particleSystem); } - batchNode->release(); - _emitter = NULL; } From 573737df4077650fb1ed8b19e4ca4fe704c23337 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Mon, 6 Jan 2014 16:32:39 +0800 Subject: [PATCH 262/428] Add Trigger code to sceneTest on cocos2dx 3.x. --- .../Cpp/TestCpp/proj.win32/TestCpp.vcxproj | 5 ++++ .../proj.win32/TestCpp.vcxproj.filters | 30 +++++++++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj index 37fd64609a..2815c3c7f3 100644 --- a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj +++ b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj @@ -168,6 +168,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ + + @@ -311,6 +313,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ + + + diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters index c8efb5f202..a6990872b6 100644 --- a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters +++ b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters @@ -304,6 +304,9 @@ {1821914f-c088-4946-8c1e-19ab57b5eabc} + + {5ff3af4e-0610-480b-b297-8f407e12f369} + @@ -627,9 +630,6 @@ Classes\ExtensionsTest\CocoStudioComponentsTest - - Classes\ExtensionsTest\CocoStudioSceneTest - Classes\NewEventDispatcherTest @@ -706,6 +706,15 @@ Classes\UnitTest + + Classes\ExtensionsTest\CocoStudioSceneTest + + + Classes\ExtensionsTest\CocoStudioSceneTest\TriggerCode + + + Classes\ExtensionsTest\CocoStudioSceneTest\TriggerCode + @@ -1206,9 +1215,6 @@ Classes\ExtensionsTest\CocoStudioComponentsTest - - Classes\ExtensionsTest\CocoStudioSceneTest - Classes\NewEventDispatcherTest @@ -1300,5 +1306,17 @@ Classes\UnitTest + + Classes\ExtensionsTest\CocoStudioSceneTest + + + Classes\ExtensionsTest\CocoStudioSceneTest\TriggerCode + + + Classes\ExtensionsTest\CocoStudioSceneTest\TriggerCode + + + Classes\ExtensionsTest\CocoStudioSceneTest\TriggerCode + \ No newline at end of file From 63ad431349a0888107ee96e16203272ad0c78e73 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 6 Jan 2014 16:41:42 +0800 Subject: [PATCH 263/428] don't assign last element with (null, null) --- samples/Cpp/TestCpp/Classes/Box2DTestBed/TestEntries.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/TestEntries.cpp b/samples/Cpp/TestCpp/Classes/Box2DTestBed/TestEntries.cpp index 5fb831212a..2d6f22f65c 100644 --- a/samples/Cpp/TestCpp/Classes/Box2DTestBed/TestEntries.cpp +++ b/samples/Cpp/TestCpp/Classes/Box2DTestBed/TestEntries.cpp @@ -120,7 +120,6 @@ TestEntry g_testEntries[] = {"Slider Crank", SliderCrank::Create}, {"Varying Friction", VaryingFriction::Create}, {"Add Pair Stress Test", AddPair::Create}, - {NULL, NULL} }; int g_totalEntries = sizeof(g_testEntries) / sizeof(g_testEntries[0]); From 7b55c3da1eaeba8c5d0cd2414ef1575f83dc167e Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 6 Jan 2014 17:03:24 +0800 Subject: [PATCH 264/428] don't release autoreleased objec --- .../Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp index d7fa2eba2c..96a3aeb67a 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp @@ -978,5 +978,4 @@ void runNodeChildrenTest() scene->initWithQuantityOfNodes(kNodesIncrease); Director::getInstance()->replaceScene(scene); - scene->release(); } From 4033ecea77109872f157488083a5a7676ce0b949 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 6 Jan 2014 17:20:42 +0800 Subject: [PATCH 265/428] don't rlease autoreleased object --- .../Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp index 4b104da5ea..f14ca83fac 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp @@ -477,5 +477,4 @@ void runAllocPerformanceTest() scene->initWithQuantityOfNodes(kNodesIncrease); Director::getInstance()->replaceScene(scene); - scene->release(); } From 5786c8aa4131fab6f5ee6da53360bed9b506c210 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 6 Jan 2014 17:31:49 +0800 Subject: [PATCH 266/428] fix crash in TouchesTest.cpp on vs --- samples/Cpp/TestCpp/Classes/TouchesTest/TouchesTest.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/TouchesTest/TouchesTest.cpp b/samples/Cpp/TestCpp/Classes/TouchesTest/TouchesTest.cpp index d46d4a15c2..5f4baf3d37 100644 --- a/samples/Cpp/TestCpp/Classes/TouchesTest/TouchesTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TouchesTest/TouchesTest.cpp @@ -43,7 +43,6 @@ PongLayer::PongLayer() _ball->setPosition( VisibleRect::center() ); _ball->setVelocity( _ballStartingVelocity ); addChild( _ball ); - _ball->retain(); auto paddleTexture = Director::getInstance()->getTextureCache()->addImage(s_Paddle); @@ -77,7 +76,6 @@ PongLayer::PongLayer() PongLayer::~PongLayer() { - _ball->release(); } void PongLayer::resetAndScoreBallForPlayer(int player) @@ -102,7 +100,6 @@ void PongLayer::doStep(float delta) resetAndScoreBallForPlayer( kLowPlayer ); else if (_ball->getPosition().y < VisibleRect::bottom().y-_ball->radius()) resetAndScoreBallForPlayer( kHighPlayer ); - _ball->draw(); } void PongScene::runThisTest() From 8e3eb8580f6fcca53dc61d39c8656eb937f613cc Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 6 Jan 2014 18:00:52 +0800 Subject: [PATCH 267/428] fix crash in NewEventDispatcherTest.cpp on vs --- .../Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index 5f41c4fdd9..b74ff5aaed 100644 --- a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -753,6 +753,10 @@ void DirectorEventTest::onEnter() { EventDispatcherTestDemo::onEnter(); + _count1 = 0; + _count2 = 0; + _count3 = 0; + _count4 = 0; Size s = Director::getInstance()->getWinSize(); _label1 = Label::createWithTTF("Update: 0", "fonts/arial.ttf", 20); From 4806ef5c6f167b4195e6f03d547de42e8f06593b Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 6 Jan 2014 18:26:14 +0800 Subject: [PATCH 268/428] change time of initialization --- .../NewEventDispatcherTest.cpp | 13 +++++++++---- .../NewEventDispatcherTest/NewEventDispatcherTest.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index b74ff5aaed..d23091db12 100644 --- a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -749,14 +749,19 @@ std::string RemoveListenerAfterAddingTest::subtitle() const // //DirectorEventTest // +DirectorEventTest::DirectorEventTest() +:_count1(0) +,_count2(0) +,_count3(0) +,_count4(0) +{ + +} + void DirectorEventTest::onEnter() { EventDispatcherTestDemo::onEnter(); - _count1 = 0; - _count2 = 0; - _count3 = 0; - _count4 = 0; Size s = Director::getInstance()->getWinSize(); _label1 = Label::createWithTTF("Update: 0", "fonts/arial.ttf", 20); diff --git a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h index 0512b3c31d..2de772a6af 100644 --- a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h +++ b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h @@ -117,6 +117,7 @@ class DirectorEventTest : public EventDispatcherTestDemo { public: CREATE_FUNC(DirectorEventTest); + DirectorEventTest(); virtual void onEnter() override; virtual void onExit() override; From 4087afaf4e7ce6203d9c2843b19f70ed90f28128 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 6 Jan 2014 19:55:29 +0800 Subject: [PATCH 269/428] fix compiling error on vs project. --- samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj index aae3a8cf1f..dc57ee0d68 100644 --- a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj +++ b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj @@ -168,6 +168,9 @@ {b57cf53f-2e49-4031-9822-047cc0e6bde2} + + {b7c2a162-dec9-4418-972e-240ab3cbfcae} + {7e06e92c-537a-442b-9e4a-4761c84f8a1a} From ea60dbb64007996c11fe3faa0ee32846caa22b4f Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 19:55:59 +0800 Subject: [PATCH 270/428] =?UTF-8?q?Fixing=20=E2=80=98ActionTest->Animation?= =?UTF-8?q?Test=E2=80=99=20crashes.=20It=20should=20return=20empty=20Value?= =?UTF-8?q?Map/ValueVector=20when=20Value::asValueVector/Map=20is=20invoke?= =?UTF-8?q?d=20in=20empty=20Value.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/base/CCValue.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++ cocos/base/CCValue.h | 12 +++++------ 2 files changed, 51 insertions(+), 6 deletions(-) diff --git a/cocos/base/CCValue.cpp b/cocos/base/CCValue.cpp index e2a6112716..b94454eb3f 100644 --- a/cocos/base/CCValue.cpp +++ b/cocos/base/CCValue.cpp @@ -594,6 +594,51 @@ std::string Value::asString() const return ret.str(); } +ValueVector& Value::asValueVector() +{ + if (nullptr == _vectorData) + _vectorData = new ValueVector(); + return *_vectorData; +} + +const ValueVector& Value::asValueVector() const +{ + static const ValueVector EMPTY_VALUEVECTOR; + if (nullptr == _vectorData) + return EMPTY_VALUEVECTOR; + return *_vectorData; +} + +ValueMap& Value::asValueMap() +{ + if (nullptr == _mapData) + _mapData = new ValueMap(); + return *_mapData; +} + +const ValueMap& Value::asValueMap() const +{ + static const ValueMap EMPTY_VALUEMAP; + if (nullptr == _mapData) + return EMPTY_VALUEMAP; + return *_mapData; +} + +ValueMapIntKey& Value::asIntKeyMap() +{ + if (nullptr == _intKeyMapData) + _intKeyMapData = new ValueMapIntKey(); + return *_intKeyMapData; +} + +const ValueMapIntKey& Value::asIntKeyMap() const +{ + static const ValueMapIntKey EMPTY_VALUEMAP_INT_KEY; + if (nullptr == _intKeyMapData) + return EMPTY_VALUEMAP_INT_KEY; + return *_intKeyMapData; +} + static std::string getTabs(int depth) { std::string tabWidth; diff --git a/cocos/base/CCValue.h b/cocos/base/CCValue.h index 4aa0a8daa2..f4bd0ab59a 100644 --- a/cocos/base/CCValue.h +++ b/cocos/base/CCValue.h @@ -94,14 +94,14 @@ public: bool asBool() const; std::string asString() const; - inline ValueVector& asValueVector() { return *_vectorData; } - inline const ValueVector& asValueVector() const { return *_vectorData; } + ValueVector& asValueVector(); + const ValueVector& asValueVector() const; - inline ValueMap& asValueMap() { return *_mapData; } - inline const ValueMap& asValueMap() const { return *_mapData; } + ValueMap& asValueMap(); + const ValueMap& asValueMap() const; - inline ValueMapIntKey& asIntKeyMap() { return *_intKeyMapData; } - inline const ValueMapIntKey& asIntKeyMap() const { return *_intKeyMapData; } + ValueMapIntKey& asIntKeyMap(); + const ValueMapIntKey& asIntKeyMap() const; inline bool isNull() const { return _type == Type::NONE; } From f36d4a9236292c88a83ae202fe6d2a2aa6d00577 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 6 Jan 2014 19:59:31 +0800 Subject: [PATCH 271/428] Fix:Resolve the lua android template errors --- .../multi-platform-lua/proj.android/AndroidManifest.xml | 2 +- template/multi-platform-lua/proj.android/jni/Android.mk | 6 ++---- .../org/cocos2dx/{hellolua => lua}/Cocos2dxActivity.java | 2 +- tools/project-creator/config-create/config.gitingore | 1 - .../project-creator/module/cocos_files.json.REMOVED.git-id | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) rename template/multi-platform-lua/proj.android/src/org/cocos2dx/{hellolua => lua}/Cocos2dxActivity.java (96%) diff --git a/template/multi-platform-lua/proj.android/AndroidManifest.xml b/template/multi-platform-lua/proj.android/AndroidManifest.xml index cc4318ba23..fb69c258c2 100644 --- a/template/multi-platform-lua/proj.android/AndroidManifest.xml +++ b/template/multi-platform-lua/proj.android/AndroidManifest.xml @@ -10,7 +10,7 @@ - Date: Mon, 6 Jan 2014 20:01:28 +0800 Subject: [PATCH 272/428] Warning fix in CCTextFieldTTF.cpp. --- cocos/2d/CCTextFieldTTF.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp index 4c26627956..34240535ca 100644 --- a/cocos/2d/CCTextFieldTTF.cpp +++ b/cocos/2d/CCTextFieldTTF.cpp @@ -216,7 +216,7 @@ void TextFieldTTF::deleteBackward() ++deleteLen; } - if (_delegate && _delegate->onTextFieldDeleteBackward(this, _inputText.c_str() + len - deleteLen, deleteLen)) + if (_delegate && _delegate->onTextFieldDeleteBackward(this, _inputText.c_str() + len - deleteLen, static_cast(deleteLen))) { // delegate doesn't wan't to delete backwards return; From 1bd0f904376692e89e3e5bf4ffe8361afaa33526 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 20:02:01 +0800 Subject: [PATCH 273/428] Warning fix in js_manual_conversions.cpp/h --- .../bindings/js_manual_conversions.cpp | 70 +++++++++---------- .../bindings/js_manual_conversions.h | 4 +- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/cocos/scripting/javascript/bindings/js_manual_conversions.cpp b/cocos/scripting/javascript/bindings/js_manual_conversions.cpp index fe3c22d985..43bf044b8a 100644 --- a/cocos/scripting/javascript/bindings/js_manual_conversions.cpp +++ b/cocos/scripting/javascript/bindings/js_manual_conversions.cpp @@ -1270,7 +1270,7 @@ JSBool jsval_to_std_vector_int( JSContext *cx, jsval vp, std::vector* ret) // native --> jsval -jsval ccarray_to_jsval(JSContext* cx, Array *arr) +jsval ccarray_to_jsval(JSContext* cx, __Array *arr) { JSObject *jsretArr = JS_NewArrayObject(cx, 0, NULL); @@ -1286,27 +1286,27 @@ jsval ccarray_to_jsval(JSContext* cx, Array *arr) arrElement = OBJECT_TO_JSVAL(jsproxy->obj); } else { - String* strVal = NULL; - Dictionary* dictVal = NULL; - Array* arrVal = NULL; - Double* doubleVal = NULL; - Bool* boolVal = NULL; - Float* floatVal = NULL; - Integer* intVal = NULL; + __String* strVal = NULL; + __Dictionary* dictVal = NULL; + __Array* arrVal = NULL; + __Double* doubleVal = NULL; + __Bool* boolVal = NULL; + __Float* floatVal = NULL; + __Integer* intVal = NULL; - if ((strVal = dynamic_cast(obj))) { + if ((strVal = dynamic_cast(obj))) { arrElement = c_string_to_jsval(cx, strVal->getCString()); - } else if ((dictVal = dynamic_cast(obj))) { + } else if ((dictVal = dynamic_cast(obj))) { arrElement = ccdictionary_to_jsval(cx, dictVal); - } else if ((arrVal = dynamic_cast(obj))) { + } else if ((arrVal = dynamic_cast(obj))) { arrElement = ccarray_to_jsval(cx, arrVal); - } else if ((doubleVal = dynamic_cast(obj))) { + } else if ((doubleVal = dynamic_cast<__Double*>(obj))) { arrElement = DOUBLE_TO_JSVAL(doubleVal->getValue()); - } else if ((floatVal = dynamic_cast(obj))) { + } else if ((floatVal = dynamic_cast<__Float*>(obj))) { arrElement = DOUBLE_TO_JSVAL(floatVal->getValue()); - } else if ((intVal = dynamic_cast(obj))) { + } else if ((intVal = dynamic_cast<__Integer*>(obj))) { arrElement = INT_TO_JSVAL(intVal->getValue()); - } else if ((boolVal = dynamic_cast(obj))) { + } else if ((boolVal = dynamic_cast<__Bool*>(obj))) { arrElement = BOOLEAN_TO_JSVAL(boolVal->getValue() ? JS_TRUE : JS_FALSE); } else { CCASSERT(false, "the type isn't suppored."); @@ -1320,7 +1320,7 @@ jsval ccarray_to_jsval(JSContext* cx, Array *arr) return OBJECT_TO_JSVAL(jsretArr); } -jsval ccdictionary_to_jsval(JSContext* cx, Dictionary* dict) +jsval ccdictionary_to_jsval(JSContext* cx, __Dictionary* dict) { JSObject* jsRet = JS_NewObject(cx, NULL, NULL, NULL); DictElement* pElement = NULL; @@ -1334,27 +1334,27 @@ jsval ccdictionary_to_jsval(JSContext* cx, Dictionary* dict) dictElement = OBJECT_TO_JSVAL(jsproxy->obj); } else { - String* strVal = NULL; - Dictionary* dictVal = NULL; - Array* arrVal = NULL; - Double* doubleVal = NULL; - Bool* boolVal = NULL; - Float* floatVal = NULL; - Integer* intVal = NULL; + __String* strVal = NULL; + __Dictionary* dictVal = NULL; + __Array* arrVal = NULL; + __Double* doubleVal = NULL; + __Bool* boolVal = NULL; + __Float* floatVal = NULL; + __Integer* intVal = NULL; - if ((strVal = dynamic_cast(obj))) { + if ((strVal = dynamic_cast(obj))) { dictElement = c_string_to_jsval(cx, strVal->getCString()); - } else if ((dictVal = dynamic_cast(obj))) { + } else if ((dictVal = dynamic_cast<__Dictionary*>(obj))) { dictElement = ccdictionary_to_jsval(cx, dictVal); - } else if ((arrVal = dynamic_cast(obj))) { + } else if ((arrVal = dynamic_cast<__Array*>(obj))) { dictElement = ccarray_to_jsval(cx, arrVal); - } else if ((doubleVal = dynamic_cast(obj))) { + } else if ((doubleVal = dynamic_cast<__Double*>(obj))) { dictElement = DOUBLE_TO_JSVAL(doubleVal->getValue()); - } else if ((floatVal = dynamic_cast(obj))) { + } else if ((floatVal = dynamic_cast<__Float*>(obj))) { dictElement = DOUBLE_TO_JSVAL(floatVal->getValue()); - } else if ((intVal = dynamic_cast(obj))) { + } else if ((intVal = dynamic_cast<__Integer*>(obj))) { dictElement = INT_TO_JSVAL(intVal->getValue()); - } else if ((boolVal = dynamic_cast(obj))) { + } else if ((boolVal = dynamic_cast<__Bool*>(obj))) { dictElement = BOOLEAN_TO_JSVAL(boolVal->getValue() ? JS_TRUE : JS_FALSE); } else { CCASSERT(false, "the type isn't suppored."); @@ -1369,7 +1369,7 @@ jsval ccdictionary_to_jsval(JSContext* cx, Dictionary* dict) return OBJECT_TO_JSVAL(jsRet); } -JSBool jsval_to_ccdictionary(JSContext* cx, jsval v, Dictionary** ret) +JSBool jsval_to_ccdictionary(JSContext* cx, jsval v, __Dictionary** ret) { if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v)) { @@ -1384,7 +1384,7 @@ JSBool jsval_to_ccdictionary(JSContext* cx, jsval v, Dictionary** ret) } JSObject* it = JS_NewPropertyIterator(cx, tmp); - Dictionary* dict = NULL; + __Dictionary* dict = NULL; while (true) { @@ -1404,7 +1404,7 @@ JSBool jsval_to_ccdictionary(JSContext* cx, jsval v, Dictionary** ret) JSStringWrapper keyWrapper(JSVAL_TO_STRING(key), cx); if (!dict) { - dict = Dictionary::create(); + dict = __Dictionary::create(); } JS::RootedValue value(cx); @@ -1423,7 +1423,7 @@ JSBool jsval_to_ccdictionary(JSContext* cx, jsval v, Dictionary** ret) } else if (!JS_IsArrayObject(cx, tmp)){ // It's a normal js object. - Dictionary* dictVal = NULL; + __Dictionary* dictVal = NULL; JSBool ok = jsval_to_ccdictionary(cx, value, &dictVal); if (ok) { dict->setObject(dictVal, keyWrapper.get()); @@ -1431,7 +1431,7 @@ JSBool jsval_to_ccdictionary(JSContext* cx, jsval v, Dictionary** ret) } else { // It's a js array object. - Array* arrVal = NULL; + __Array* arrVal = NULL; JSBool ok = jsval_to_ccarray(cx, value, &arrVal); if (ok) { dict->setObject(arrVal, keyWrapper.get()); diff --git a/cocos/scripting/javascript/bindings/js_manual_conversions.h b/cocos/scripting/javascript/bindings/js_manual_conversions.h index 751cd995ee..4820c13bea 100644 --- a/cocos/scripting/javascript/bindings/js_manual_conversions.h +++ b/cocos/scripting/javascript/bindings/js_manual_conversions.h @@ -224,8 +224,8 @@ jsval ccsize_to_jsval(JSContext* cx, const cocos2d::Size& v); jsval cccolor4b_to_jsval(JSContext* cx, const cocos2d::Color4B& v); jsval cccolor4f_to_jsval(JSContext* cx, const cocos2d::Color4F& v); jsval cccolor3b_to_jsval(JSContext* cx, const cocos2d::Color3B& v); -jsval ccdictionary_to_jsval(JSContext* cx, cocos2d::Dictionary *dict); -jsval ccarray_to_jsval(JSContext* cx, cocos2d::Array *arr); +jsval ccdictionary_to_jsval(JSContext* cx, cocos2d::__Dictionary *dict); +jsval ccarray_to_jsval(JSContext* cx, cocos2d::__Array *arr); jsval ccacceleration_to_jsval(JSContext* cx, const cocos2d::Acceleration& v); jsval ccaffinetransform_to_jsval(JSContext* cx, const cocos2d::AffineTransform& t); jsval FontDefinition_to_jsval(JSContext* cx, const cocos2d::FontDefinition& t); From 75804ac8a2aea17f57242efea93af54ddc14b1a6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 20:04:09 +0800 Subject: [PATCH 274/428] Warning fix in ccUTF8.cpp/h --- cocos/2d/ccUTF8.cpp | 4 ++-- cocos/2d/ccUTF8.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/2d/ccUTF8.cpp b/cocos/2d/ccUTF8.cpp index 3436d981d7..ba639eef37 100644 --- a/cocos/2d/ccUTF8.cpp +++ b/cocos/2d/ccUTF8.cpp @@ -399,8 +399,8 @@ cc_unichar_to_utf8 (unsigned int c, char * cc_utf16_to_utf8 (const unsigned short *str, int len, - int *items_read, - int *items_written) + long *items_read, + long *items_written) { /* This function and g_utf16_to_ucs4 are almost exactly identical - The lines that differ * are marked. diff --git a/cocos/2d/ccUTF8.h b/cocos/2d/ccUTF8.h index 5065785732..86bf8b3e65 100644 --- a/cocos/2d/ccUTF8.h +++ b/cocos/2d/ccUTF8.h @@ -81,8 +81,8 @@ CC_DLL unsigned short* cc_utf8_to_utf16(const char* str_old, int length = -1, in CC_DLL char * cc_utf16_to_utf8 (const unsigned short *str, int len, - int *items_read, - int *items_written); + long *items_read, + long *items_written); NS_CC_END From 2949ab754f6afc156672efee354709d10606fb06 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 6 Jan 2014 20:11:44 +0800 Subject: [PATCH 275/428] Fix:Regeneration cocos_files.json --- tools/project-creator/module/cocos_files.json.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/project-creator/module/cocos_files.json.REMOVED.git-id b/tools/project-creator/module/cocos_files.json.REMOVED.git-id index 9224daf771..de718a692d 100644 --- a/tools/project-creator/module/cocos_files.json.REMOVED.git-id +++ b/tools/project-creator/module/cocos_files.json.REMOVED.git-id @@ -1 +1 @@ -38cec06f1800d6da4cd716605c71efaac195bae5 \ No newline at end of file +83d4ef65b31281ef8759505d8f90b3172b99992b \ No newline at end of file From aec4045797cd3d3e65d3a306e7525079d2abf6da Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 6 Jan 2014 20:23:45 +0800 Subject: [PATCH 276/428] fix error for load spriteFrames from plist in CCAnimationCache class. --- cocos/2d/CCAnimationCache.cpp | 7 ++++--- cocos/2d/CCAnimationCache.h | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cocos/2d/CCAnimationCache.cpp b/cocos/2d/CCAnimationCache.cpp index 59d9144252..0461054dcb 100644 --- a/cocos/2d/CCAnimationCache.cpp +++ b/cocos/2d/CCAnimationCache.cpp @@ -187,7 +187,7 @@ void AnimationCache::parseVersion2(const ValueMap& animations) } } -void AnimationCache::addAnimationsWithDictionary(const ValueMap& dictionary) +void AnimationCache::addAnimationsWithDictionary(const ValueMap& dictionary,const std::string& plist) { if ( dictionary.find("animations") == dictionary.end() ) { @@ -205,7 +205,8 @@ void AnimationCache::addAnimationsWithDictionary(const ValueMap& dictionary) const ValueVector& spritesheets = properties.at("spritesheets").asValueVector(); for(const auto &value : spritesheets) { - SpriteFrameCache::getInstance()->addSpriteFramesWithFile(value.asString()); + std::string path = FileUtils::getInstance()->fullPathFromRelativeFile(value.asString(),plist); + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(path); } } @@ -231,7 +232,7 @@ void AnimationCache::addAnimationsWithFile(const std::string& plist) CCASSERT( !dict.empty(), "CCAnimationCache: File could not be found"); - addAnimationsWithDictionary(dict); + addAnimationsWithDictionary(dict,plist); } diff --git a/cocos/2d/CCAnimationCache.h b/cocos/2d/CCAnimationCache.h index 6e60201882..c604f11bd9 100644 --- a/cocos/2d/CCAnimationCache.h +++ b/cocos/2d/CCAnimationCache.h @@ -102,9 +102,10 @@ public: /** Adds an animation from an NSDictionary Make sure that the frames were previously loaded in the SpriteFrameCache. + @param plist The path of the relative file,it use to find the plist path for load SpriteFrames. @since v1.1 */ - void addAnimationsWithDictionary(const ValueMap& dictionary); + void addAnimationsWithDictionary(const ValueMap& dictionary,const std::string& plist); /** Adds an animation from a plist file. Make sure that the frames were previously loaded in the SpriteFrameCache. From bc5303f6f20b9d0a1440d6dc152d6aa412447d95 Mon Sep 17 00:00:00 2001 From: heliclei Date: Mon, 6 Jan 2014 20:58:00 +0800 Subject: [PATCH 278/428] build all android targets --- tools/jenkins-scripts/create-job.py | 30 +++++++++++++++++++ tools/jenkins-scripts/ghprb.py | 45 +++++++++++++++++++++-------- 2 files changed, 63 insertions(+), 12 deletions(-) create mode 100644 tools/jenkins-scripts/create-job.py diff --git a/tools/jenkins-scripts/create-job.py b/tools/jenkins-scripts/create-job.py new file mode 100644 index 0000000000..ec161ae67b --- /dev/null +++ b/tools/jenkins-scripts/create-job.py @@ -0,0 +1,30 @@ +#create ghprb job by pr number + +import os +import sys +import json +import requests + +#get pr number from cmd +pr_num = sys.argv[1] + +#get github access token +access_token = os.environ['GITHUB_ACCESS_TOKEN'] + +#get pr data via github api + +api_get_pr = "https://api.github.com/repos/cocos2d/cocos2d-x/pulls/"+str(pr_num)+"?access_token="+access_token + +r = requests.get(api_get_pr) +pr = r.json() + +#forge a payload +payload = {"action":"open","number":"","pull_request":""} +payload['number']=pr_num +payload['pull_request']=pr + +jenkins_trigger_url="http://ci.cocos2d-x.org:8000/job/cocos-2dx-pull-request-build/buildWithParameters?token="+access_token + +#send trigger and payload +post_data = "payload:"+json.dumps(payload +requests.post(jenkins_trigger_url, data=post_data) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index b0d3669997..360986f40a 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -9,12 +9,13 @@ import base64 import requests import sys import traceback +import platform #set Jenkins build description using submitDescription to mock browser behavior #TODO: need to set parent build description -def set_description(desc): +def set_description(desc, url): req_data = urllib.urlencode({'description': desc}) - req = urllib2.Request(os.environ['BUILD_URL'] + 'submitDescription', req_data) + req = urllib2.Request(url + 'submitDescription', req_data) #print(os.environ['BUILD_URL']) req.add_header('Content-Type', 'application/x-www-form-urlencoded') base64string = base64.encodestring(os.environ['JENKINS_ADMIN']+ ":" + os.environ['JENKINS_ADMIN_PW']).replace('\n', '') @@ -36,16 +37,15 @@ def main(): #build for pull request action 'open' and 'synchronize', skip 'close' action = payload['action'] print 'action: ' + action - if((action != 'opened') and (action != 'synchronize')): - print 'pull request #' + str(pr_num) + ' is closed, no build triggered' - exit(0) + pr = payload['pull_request'] url = pr['html_url'] print "url:" + url - pr_desc = '

pr#' + str(pr_num) + '

' - set_description(pr_desc) + pr_desc = '

pr#' + str(pr_num) + ' is '+ action +'

' + + #get statuses url statuses_url = pr['statuses_url'] @@ -55,6 +55,13 @@ def main(): #set commit status to pending target_url = os.environ['BUILD_URL'] + + set_description(pr_desc, target_url) + + if((action != 'opened') and (action != 'synchronize')): + print 'pull request #' + str(pr_num) + ' is '+action+', no build triggered' + return(0) + data = {"state":"pending", "target_url":target_url} access_token = os.environ['GITHUB_ACCESS_TOKEN'] Headers = {"Authorization":"token " + access_token} @@ -78,7 +85,18 @@ def main(): #update submodule git_update_submodule = "git submodule update --init --force" os.system(git_update_submodule) - + + #add symbol link + PROJECTS=["Cpp/HelloCpp","Cpp/TestCpp","Cpp/SimpleGame","Cpp/AssetsManagerTest", + "Javascript/TestJavascript","Javascript/CocosDragonJS","Javascript/CrystalCraze", + "Javascript/MoonWarriors","Javascript/WatermelonWithMe","Lua/HelloLua","Lua/TestLua"] + if(platform.system == 'Darwin'): + for item in PROJECTS: + os.System("ln -s "+os.environ['WORKSPACE']+"/android_build_objs " + os.environ['WORKSPACE']+"/samples/"+item+"/proj.android/obj") + elif(platform.system == 'Windows'): + for item in PROJECTS: + os.System("mklink /J "+os.environ['WORKSPACE']+os.sep+"samples"+os.sep +item+os.sep+"proj.android/obj " + os.environ['WORKSPACE']+os.sep+"android_build_objs") + #build #TODO: support android-mac build currently #TODO: add android-windows7 build @@ -87,7 +105,7 @@ def main(): #TODO: add mac build #TODO: add win32 build if(branch == 'develop'): - ret = os.system("python build/android-build.py -n -j5 testcpp") + ret = os.system("python build/android-build.py -n -j10 all") elif(branch == 'master'): ret = os.system("samples/Cpp/TestCpp/proj.android/build_native.sh") @@ -113,12 +131,15 @@ def main(): os.system("git checkout develop") os.system("git branch -D pull" + str(pr_num)) - exit(exit_code) + return(exit_code) # -------------- main -------------- if __name__ == '__main__': + sys_ret = 0 try: - main() + sys_ret = main() except: traceback.print_exc() - exit(1) + sys_ret = 1 + finally: + sys.exit(sys_ret) From eaa3041a97b316b998ba5ae4891756b2efe2a28c Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 6 Jan 2014 22:19:40 +0800 Subject: [PATCH 279/428] issue #3401: physical lua banding script, add testlua->physics test --- cocos/physics/CCPhysicsShape.h | 1 + .../lua/bindings/LuaBasicConversions.cpp | 63 ++ .../lua/bindings/LuaBasicConversions.h | 2 + .../bindings/lua_cocos2dx_physics_manual.cpp | 932 +++++++++++++++++- cocos/scripting/lua/script/Cocos2d.lua | 6 + .../scripting/lua/script/Cocos2dConstants.lua | 5 +- .../luaScript/PhysicsTest/PhysicsTest.lua | 620 ++++++++++++ .../TestLua/Resources/luaScript/helper.lua | 8 +- .../TestLua/Resources/luaScript/mainMenu.lua | 2 + tools/tolua/cocos2dx_physics.ini | 67 ++ 10 files changed, 1678 insertions(+), 28 deletions(-) create mode 100644 samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua create mode 100644 tools/tolua/cocos2dx_physics.ini diff --git a/cocos/physics/CCPhysicsShape.h b/cocos/physics/CCPhysicsShape.h index 49398fbbe2..de3c924b2e 100644 --- a/cocos/physics/CCPhysicsShape.h +++ b/cocos/physics/CCPhysicsShape.h @@ -212,6 +212,7 @@ public: virtual float calculateDefaultMoment() override; void getPoints(Point* outPoints) const; + int getPointsCount() const { return 4; } Size getSize() const; virtual Point getOffset() override { return _offset; } diff --git a/cocos/scripting/lua/bindings/LuaBasicConversions.cpp b/cocos/scripting/lua/bindings/LuaBasicConversions.cpp index f5629705e6..4912c7541a 100644 --- a/cocos/scripting/lua/bindings/LuaBasicConversions.cpp +++ b/cocos/scripting/lua/bindings/LuaBasicConversions.cpp @@ -1539,6 +1539,19 @@ bool luaval_to_std_vector_int(lua_State* L, int lo, std::vector* ret) return ok; } +void points_to_luaval(lua_State* L,const Point* pt, int count) +{ + if (NULL == L) + return; + lua_newtable(L); + for (int i = 1; i <= count; ++i) + { + lua_pushnumber(L, i); + point_to_luaval(L, pt[i-1]); + lua_rawset(L, -3); + } +} + void point_to_luaval(lua_State* L,const Point& pt) { if (NULL == L) @@ -1568,6 +1581,56 @@ void physics_material_to_luaval(lua_State* L,const PhysicsMaterial& pm) lua_rawset(L, -3); /* table[key] = value, L: table */ } +void physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo& info) +{ + if (NULL == L) + return; + + lua_newtable(L); /* L: table */ + + lua_pushstring(L, "shape"); /* L: table key */ + PhysicsShape* shape = info.shape; + if (shape == nullptr) + { + lua_pushnil(L); + }else + { + std::string hashName = typeid(*shape).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsShape"; + } + + int ID = (int)(shape->_ID); + int* luaID = &(shape->_luaID); + toluafix_pushusertype_ccobject(L, ID, luaID, (void*)shape,className.c_str()); + } + lua_rawset(L, -3); /* table[key] = value, L: table */ + + lua_pushstring(L, "start"); /* L: table key */ + point_to_luaval(L, info.start); + lua_rawset(L, -3); /* table[key] = value, L: table */ + + lua_pushstring(L, "end"); /* L: table key */ + point_to_luaval(L, info.end); + lua_rawset(L, -3); /* table[key] = value, L: table */ + + lua_pushstring(L, "contact"); /* L: table key */ + point_to_luaval(L, info.contact); + lua_rawset(L, -3); /* table[key] = value, L: table */ + + lua_pushstring(L, "normal"); /* L: table key */ + point_to_luaval(L, info.normal); + lua_rawset(L, -3); /* table[key] = value, L: table */ + + lua_pushstring(L, "fraction"); /* L: table key */ + lua_pushnumber(L, (lua_Number) info.fraction); /* L: table key value*/ + lua_rawset(L, -3); /* table[key] = value, L: table */ +} + void size_to_luaval(lua_State* L,const Size& sz) { if (NULL == L) diff --git a/cocos/scripting/lua/bindings/LuaBasicConversions.h b/cocos/scripting/lua/bindings/LuaBasicConversions.h index 5eb00223fd..9636e5ff06 100644 --- a/cocos/scripting/lua/bindings/LuaBasicConversions.h +++ b/cocos/scripting/lua/bindings/LuaBasicConversions.h @@ -173,12 +173,14 @@ extern bool luaval_to_ccvaluevector(lua_State* L, int lo, cocos2d::ValueVector* // from native extern void point_to_luaval(lua_State* L,const Point& pt); +extern void points_to_luaval(lua_State* L,const Point* pt, int count); extern void size_to_luaval(lua_State* L,const Size& sz); extern void rect_to_luaval(lua_State* L,const Rect& rt); extern void color3b_to_luaval(lua_State* L,const Color3B& cc); extern void color4b_to_luaval(lua_State* L,const Color4B& cc); extern void color4f_to_luaval(lua_State* L,const Color4F& cc); extern void physics_material_to_luaval(lua_State* L,const PhysicsMaterial& pm); +extern void physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo& info); extern void affinetransform_to_luaval(lua_State* L,const AffineTransform& inValue); extern void fontdefinition_to_luaval(lua_State* L,const FontDefinition& inValue); extern void array_to_luaval(lua_State* L,Array* inValue); diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp index 492bd1d5ef..0d11f0f9b4 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp @@ -14,6 +14,10 @@ extern "C" { #include "CCLuaValue.h" #include "CCLuaEngine.h" +#ifndef CC_SAFE_FREE +#define CC_SAFE_FREE(p) { if(p) free(p); p = nullptr; } +#endif + int lua_cocos2dx_physics_PhysicsBody_getJoints(lua_State* tolua_S) { int argc = 0; @@ -172,15 +176,15 @@ int lua_cocos2dx_physics_PhysicsWorld_rayCast(lua_State* tolua_S) #endif argc = lua_gettop(tolua_S)-1; - if (argc == 4) + if (argc == 3) { std::function arg0; cocos2d::Point arg1; cocos2d::Point arg2; + LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0); do { - arg0 = [tolua_S](cocos2d::PhysicsWorld &world, const cocos2d::PhysicsRayCastInfo &info, void * data) -> bool + arg0 = [handler, tolua_S](cocos2d::PhysicsWorld &world, const cocos2d::PhysicsRayCastInfo &info, void * data) -> bool { - LuaStack* stack = LuaStack::create(); std::string hashName = typeid(&world).name(); auto iter = g_luaType.find(hashName); std::string className = ""; @@ -191,19 +195,17 @@ int lua_cocos2dx_physics_PhysicsWorld_rayCast(lua_State* tolua_S) } tolua_pushusertype(tolua_S, (void*)(&world), className.c_str()); - tolua_pushusertype(tolua_S, (void*)(&info), "PhysicsRayCastInfo"); - bool ret = stack->executeFunction(2); - stack->clean(); - return ret; + physics_raycastinfo_to_luaval(tolua_S, info); + return LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 2); }; - } while(0) - ; + } while(0); + ok &= luaval_to_point(tolua_S, 3, &arg1); ok &= luaval_to_point(tolua_S, 4, &arg2); -#pragma warning NO CONVERSION TO NATIVE FOR void*; if(!ok) return 0; cobj->rayCast(arg0, arg1, arg2, nullptr); + toluafix_remove_function_by_refid(tolua_S, handler); return 0; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "rayCast",argc, 4); @@ -241,14 +243,14 @@ int lua_cocos2dx_physics_PhysicsWorld_queryRect(lua_State* tolua_S) #endif argc = lua_gettop(tolua_S)-1; - if (argc == 3) + if (argc == 2) { std::function arg0; cocos2d::Rect arg1; + LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0); do { - arg0 = [tolua_S](cocos2d::PhysicsWorld &world, cocos2d::PhysicsShape &shape, void * data) -> bool + arg0 = [handler, tolua_S](cocos2d::PhysicsWorld &world, cocos2d::PhysicsShape &shape, void * data) -> bool { - LuaStack* stack = LuaStack::create(); std::string hashName = typeid(&world).name(); auto iter = g_luaType.find(hashName); std::string className = ""; @@ -259,18 +261,25 @@ int lua_cocos2dx_physics_PhysicsWorld_queryRect(lua_State* tolua_S) } tolua_pushusertype(tolua_S, (void*)(&world), className.c_str()); - stack->pushObject(&shape, "PhysicsShape"); - bool ret = stack->executeFunction(2); - stack->clean(); - return ret; + + hashName = typeid(&shape).name(); + iter = g_luaType.find(hashName); + className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsShape"; + } + toluafix_pushusertype_ccobject(tolua_S, shape._ID, &shape._luaID, (void*)(&shape), className.c_str()); + return LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 2); }; } while(0); ok &= luaval_to_rect(tolua_S, 3, &arg1); -#pragma warning NO CONVERSION TO NATIVE FOR void*; if(!ok) return 0; cobj->queryRect(arg0, arg1, nullptr); + toluafix_remove_function_by_refid(tolua_S, handler); return 0; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "queryRect",argc, 3); @@ -310,14 +319,14 @@ int lua_cocos2dx_physics_PhysicsWorld_queryPoint(lua_State* tolua_S) #endif argc = lua_gettop(tolua_S)-1; - if (argc == 3) + if (argc == 2) { std::function arg0; cocos2d::Point arg1; + LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0); do { - arg0 = [tolua_S](cocos2d::PhysicsWorld &world, cocos2d::PhysicsShape &shape, void * data) -> bool + arg0 = [handler, tolua_S](cocos2d::PhysicsWorld &world, cocos2d::PhysicsShape &shape, void * data) -> bool { - LuaStack* stack = LuaStack::create(); std::string hashName = typeid(&world).name(); auto iter = g_luaType.find(hashName); std::string className = ""; @@ -328,19 +337,26 @@ int lua_cocos2dx_physics_PhysicsWorld_queryPoint(lua_State* tolua_S) } tolua_pushusertype(tolua_S, (void*)(&world), className.c_str()); - stack->pushObject(&shape, "PhysicsShape"); - bool ret = stack->executeFunction(2); - stack->clean(); - return ret; + + hashName = typeid(&shape).name(); + iter = g_luaType.find(hashName); + className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsShape"; + } + toluafix_pushusertype_ccobject(tolua_S, shape._ID, &shape._luaID, (void*)(&shape), className.c_str()); + return LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 2); }; assert(false); } while(0) ; ok &= luaval_to_point(tolua_S, 3, &arg1); -#pragma warning NO CONVERSION TO NATIVE FOR void*; if(!ok) return 0; cobj->queryPoint(arg0, arg1, nullptr); + toluafix_remove_function_by_refid(tolua_S, handler); return 0; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "queryPoint",argc, 3); @@ -354,6 +370,779 @@ tolua_lerror: return 0; } +int lua_cocos2dx_physics_PhysicsBody_createPolygon(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,"PhysicsBody",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::Point* arg0 = nullptr; + int arg1 = 0; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1); + CC_SAFE_FREE(arg0); + do { + if (NULL != ret){ + std::string hashName = typeid(*ret).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsBody"; + } + cocos2d::Object *dynObject = dynamic_cast((cocos2d::PhysicsBody*)ret); + if (NULL != dynObject) { + int ID = ret ? (int)(dynObject->_ID) : -1; + int* luaID = ret ? &(dynObject->_luaID) : NULL; + toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str()); + } else { + tolua_pushusertype(tolua_S,(void*)ret,className.c_str()); + }} else { + lua_pushnil(tolua_S); + } + } while (0); + return 1; + } + if (argc == 2) + { + cocos2d::Point* arg0; + int arg1 = 0; + cocos2d::PhysicsMaterial arg2; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + ok &= luaval_to_physics_material(tolua_S, 3, &arg2); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1, arg2); + CC_SAFE_FREE(arg0); + do { + if (NULL != ret){ + std::string hashName = typeid(*ret).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsBody"; + } + cocos2d::Object *dynObject = dynamic_cast((cocos2d::PhysicsBody*)ret); + if (NULL != dynObject) { + int ID = ret ? (int)(dynObject->_ID) : -1; + int* luaID = ret ? &(dynObject->_luaID) : NULL; + toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str()); + } else { + tolua_pushusertype(tolua_S,(void*)ret,className.c_str()); + }} else { + lua_pushnil(tolua_S); + } + } while (0); + return 1; + } + if (argc == 3) + { + cocos2d::Point* arg0; + int arg1 = 0; + cocos2d::PhysicsMaterial arg2; + cocos2d::Point arg3; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + ok &= luaval_to_physics_material(tolua_S, 3, &arg2); + ok &= luaval_to_point(tolua_S, 4, &arg3); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1, arg2, arg3); + CC_SAFE_FREE(arg0); + do { + if (NULL != ret){ + std::string hashName = typeid(*ret).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsBody"; + } + cocos2d::Object *dynObject = dynamic_cast((cocos2d::PhysicsBody*)ret); + if (NULL != dynObject) { + int ID = ret ? (int)(dynObject->_ID) : -1; + int* luaID = ret ? &(dynObject->_luaID) : NULL; + toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str()); + } else { + tolua_pushusertype(tolua_S,(void*)ret,className.c_str()); + }} else { + lua_pushnil(tolua_S); + } + } while (0); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "createPolygon",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createPolygon'.",&tolua_err); +#endif + return 0; +} + +int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(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,"PhysicsBody",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::Point* arg0; + int arg1; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1); + CC_SAFE_FREE(arg0); + do { + if (NULL != ret){ + std::string hashName = typeid(*ret).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsBody"; + } + cocos2d::Object *dynObject = dynamic_cast((cocos2d::PhysicsBody*)ret); + if (NULL != dynObject) { + int ID = ret ? (int)(dynObject->_ID) : -1; + int* luaID = ret ? &(dynObject->_luaID) : NULL; + toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str()); + } else { + tolua_pushusertype(tolua_S,(void*)ret,className.c_str()); + }} else { + lua_pushnil(tolua_S); + } + } while (0); + return 1; + } + if (argc == 2) + { + cocos2d::Point* arg0; + int arg1; + cocos2d::PhysicsMaterial arg2; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + ok &= luaval_to_physics_material(tolua_S, 3, &arg2); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1, arg2); + CC_SAFE_FREE(arg0); + do { + if (NULL != ret){ + std::string hashName = typeid(*ret).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsBody"; + } + cocos2d::Object *dynObject = dynamic_cast((cocos2d::PhysicsBody*)ret); + if (NULL != dynObject) { + int ID = ret ? (int)(dynObject->_ID) : -1; + int* luaID = ret ? &(dynObject->_luaID) : NULL; + toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str()); + } else { + tolua_pushusertype(tolua_S,(void*)ret,className.c_str()); + }} else { + lua_pushnil(tolua_S); + } + } while (0); + return 1; + } + if (argc == 3) + { + cocos2d::Point* arg0; + int arg1; + cocos2d::PhysicsMaterial arg2; + double arg3; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + ok &= luaval_to_physics_material(tolua_S, 3, &arg2); + ok &= luaval_to_number(tolua_S, 4,&arg3); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1, arg2, arg3); + CC_SAFE_FREE(arg0); + do { + if (NULL != ret){ + std::string hashName = typeid(*ret).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsBody"; + } + cocos2d::Object *dynObject = dynamic_cast((cocos2d::PhysicsBody*)ret); + if (NULL != dynObject) { + int ID = ret ? (int)(dynObject->_ID) : -1; + int* luaID = ret ? &(dynObject->_luaID) : NULL; + toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str()); + } else { + tolua_pushusertype(tolua_S,(void*)ret,className.c_str()); + }} else { + lua_pushnil(tolua_S); + } + } while (0); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "createEdgePolygon",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createEdgePolygon'.",&tolua_err); +#endif + return 0; +} + +int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(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,"PhysicsBody",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::Point* arg0; + int arg1; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1); + CC_SAFE_FREE(arg0); + do { + if (NULL != ret){ + std::string hashName = typeid(*ret).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsBody"; + } + cocos2d::Object *dynObject = dynamic_cast((cocos2d::PhysicsBody*)ret); + if (NULL != dynObject) { + int ID = ret ? (int)(dynObject->_ID) : -1; + int* luaID = ret ? &(dynObject->_luaID) : NULL; + toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str()); + } else { + tolua_pushusertype(tolua_S,(void*)ret,className.c_str()); + }} else { + lua_pushnil(tolua_S); + } + } while (0); + return 1; + } + if (argc == 2) + { + cocos2d::Point* arg0; + int arg1; + cocos2d::PhysicsMaterial arg2; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + ok &= luaval_to_physics_material(tolua_S, 3, &arg2); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1, arg2); + CC_SAFE_FREE(arg0); + do { + if (NULL != ret){ + std::string hashName = typeid(*ret).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsBody"; + } + cocos2d::Object *dynObject = dynamic_cast((cocos2d::PhysicsBody*)ret); + if (NULL != dynObject) { + int ID = ret ? (int)(dynObject->_ID) : -1; + int* luaID = ret ? &(dynObject->_luaID) : NULL; + toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str()); + } else { + tolua_pushusertype(tolua_S,(void*)ret,className.c_str()); + }} else { + lua_pushnil(tolua_S); + } + } while (0); + return 1; + } + if (argc == 3) + { + cocos2d::Point* arg0; + int arg1; + cocos2d::PhysicsMaterial arg2; + double arg3; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + ok &= luaval_to_physics_material(tolua_S, 3, &arg2); + ok &= luaval_to_number(tolua_S, 4,&arg3); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1, arg2, arg3); + CC_SAFE_FREE(arg0); + do { + if (NULL != ret){ + std::string hashName = typeid(*ret).name(); + auto iter = g_luaType.find(hashName); + std::string className = ""; + if(iter != g_luaType.end()){ + className = iter->second.c_str(); + } else { + className = "PhysicsBody"; + } + cocos2d::Object *dynObject = dynamic_cast((cocos2d::PhysicsBody*)ret); + if (NULL != dynObject) { + int ID = ret ? (int)(dynObject->_ID) : -1; + int* luaID = ret ? &(dynObject->_luaID) : NULL; + toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str()); + } else { + tolua_pushusertype(tolua_S,(void*)ret,className.c_str()); + }} else { + lua_pushnil(tolua_S); + } + } while (0); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "createEdgeChain",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createEdgeChain'.",&tolua_err); +#endif + return 0; +} + +int lua_cocos2dx_physics_PhysicsShape_recenterPoints(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,"PhysicsShape",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::Point* arg0; + int arg1 = 0; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::PhysicsShape::recenterPoints(arg0, arg1); + points_to_luaval(tolua_S, arg0, arg1); + CC_SAFE_FREE(arg0); + + return 0; + } + if (argc == 2) + { + cocos2d::Point* arg0; + int arg1 = 0; + cocos2d::Point arg2; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + ok &= luaval_to_point(tolua_S, 3, &arg2); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::PhysicsShape::recenterPoints(arg0, arg1, arg2); + points_to_luaval(tolua_S, arg0, arg1); + CC_SAFE_FREE(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "recenterPoints",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_recenterPoints'.",&tolua_err); +#endif + return 0; +} + +int lua_cocos2dx_physics_PhysicsShape_getPolyonCenter(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,"PhysicsShape",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::Point* arg0; + int arg1 = 0; + do { + ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1); + if (nullptr == arg0){ + LUA_PRECONDITION( arg0, "Invalid Native Object"); + }} while (0); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1); + if(!ok) + { + CC_SAFE_FREE(arg0); + return 0; + } + cocos2d::Point ret = cocos2d::PhysicsShape::getPolyonCenter(arg0, arg1); + CC_SAFE_FREE(arg0); + point_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "getPolyonCenter",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getPolyonCenter'.",&tolua_err); +#endif + return 0; +} + +int lua_cocos2dx_physics_PhysicsShapeBox_getPoints(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsShapeBox* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"PhysicsShapeBox",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsShapeBox*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeBox_getPoints'", NULL); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + cocos2d::Point arg0[4]; + cobj->getPoints(arg0); + points_to_luaval(tolua_S, arg0, 4); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoints",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeBox_getPoints'.",&tolua_err); +#endif + + return 0; +} + +int lua_cocos2dx_physics_PhysicsShapePolygon_getPoints(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsShapePolygon* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"PhysicsShapePolygon",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsShapePolygon*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapePolygon_getPoints'", NULL); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + int count = cobj->getPointsCount(); + cocos2d::Point* arg0 = new cocos2d::Point[count]; + cobj->getPoints(arg0); + points_to_luaval(tolua_S, arg0, count); + CC_SAFE_FREE(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoints",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_getPoints'.",&tolua_err); +#endif + + return 0; +} + +int lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsShapeEdgeBox* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"PhysicsShapeEdgeBox",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsShapeEdgeBox*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints'", NULL); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + int count = cobj->getPointsCount(); + cocos2d::Point* arg0 = new cocos2d::Point[count]; + cobj->getPoints(arg0); + points_to_luaval(tolua_S, arg0, count); + CC_SAFE_FREE(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoints",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints'.",&tolua_err); +#endif + + return 0; +} + +int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsShapeEdgePolygon* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"PhysicsShapeEdgePolygon",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsShapeEdgePolygon*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints'", NULL); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + int count = cobj->getPointsCount(); + cocos2d::Point* arg0 = new cocos2d::Point[count]; + cobj->getPoints(arg0); + points_to_luaval(tolua_S, arg0, count); + CC_SAFE_FREE(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoints",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints'.",&tolua_err); +#endif + + return 0; +} + +int lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PhysicsShapeEdgeChain* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"PhysicsShapeEdgeChain",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PhysicsShapeEdgeChain*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints'", NULL); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + int count = cobj->getPointsCount(); + cocos2d::Point* arg0 = new cocos2d::Point[count]; + cobj->getPoints(arg0); + points_to_luaval(tolua_S, arg0, count); + CC_SAFE_FREE(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoints",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints'.",&tolua_err); +#endif + + return 0; +} + int register_all_cocos2dx_physics_manual(lua_State* tolua_S) { lua_pushstring(tolua_S, "PhysicsBody"); @@ -363,6 +1152,78 @@ int register_all_cocos2dx_physics_manual(lua_State* tolua_S) lua_pushstring(tolua_S,"getJoints"); lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsBody_getJoints ); lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S,"createPolygon"); + lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsBody_createPolygon ); + lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S,"createEdgeChain"); + lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsBody_createEdgeChain ); + lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S,"createEdgePolygon"); + lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsBody_createEdgePolygon ); + lua_rawset(tolua_S,-3); + } + lua_pop(tolua_S, 1); + + lua_pushstring(tolua_S, "PhysicsShape"); + lua_rawget(tolua_S, LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + lua_pushstring(tolua_S,"recenterPoints"); + lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShape_recenterPoints ); + lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S,"getPolyonCenter"); + lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShape_getPolyonCenter ); + lua_rawset(tolua_S,-3); + } + lua_pop(tolua_S, 1); + + lua_pushstring(tolua_S, "PhysicsShapeBox"); + lua_rawget(tolua_S, LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + lua_pushstring(tolua_S,"getPoints"); + lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShapeBox_getPoints ); + lua_rawset(tolua_S,-3); + } + lua_pop(tolua_S, 1); + + lua_pushstring(tolua_S, "PhysicsShapeEdgeBox"); + lua_rawget(tolua_S, LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + lua_pushstring(tolua_S,"getPoints"); + lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints ); + lua_rawset(tolua_S,-3); + } + lua_pop(tolua_S, 1); + + lua_pushstring(tolua_S, "PhysicsShapePolygon"); + lua_rawget(tolua_S, LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + lua_pushstring(tolua_S,"getPoints"); + lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShapePolygon_getPoints ); + lua_rawset(tolua_S,-3); + } + lua_pop(tolua_S, 1); + + lua_pushstring(tolua_S, "PhysicsShapeEdgePolygon"); + lua_rawget(tolua_S, LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + lua_pushstring(tolua_S,"getPoints"); + lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints ); + lua_rawset(tolua_S,-3); + } + lua_pop(tolua_S, 1); + + lua_pushstring(tolua_S, "PhysicsShapeEdgeChain"); + lua_rawget(tolua_S, LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + lua_pushstring(tolua_S,"getPoints"); + lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints); + lua_rawset(tolua_S,-3); } lua_pop(tolua_S, 1); @@ -382,8 +1243,27 @@ int register_all_cocos2dx_physics_manual(lua_State* tolua_S) lua_pushstring(tolua_S,"rayCast"); lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_rayCast ); lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S, "DEBUGDRAW_NONE"); + lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_NONE); + lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S, "DEBUGDRAW_SHAPE"); + lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_SHAPE); + lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S, "DEBUGDRAW_JOINT"); + lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_JOINT); + lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S, "DEBUGDRAW_CONTACT"); + lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_CONTACT); + lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S, "DEBUGDRAW_ALL"); + lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_ALL); + lua_rawset(tolua_S,-3); } + lua_pop(tolua_S, 1); + + tolua_constant(tolua_S, "PHYSICS_INFINITY", PHYSICS_INFINITY); + return 0; } diff --git a/cocos/scripting/lua/script/Cocos2d.lua b/cocos/scripting/lua/script/Cocos2d.lua index 1445a271fe..793fa064ec 100644 --- a/cocos/scripting/lua/script/Cocos2d.lua +++ b/cocos/scripting/lua/script/Cocos2d.lua @@ -360,3 +360,9 @@ end function cc.AnimationFrameData( _texCoords, _delay, _size) return { texCoords = _texCoords, delay = _delay, size = _size } end + +--PhysicsMaterial +function cc.PhysicsMaterial(_density, _restitution, _friction) + return { density = _density, restitution = _restitution, friction = _friction } +end + diff --git a/cocos/scripting/lua/script/Cocos2dConstants.lua b/cocos/scripting/lua/script/Cocos2dConstants.lua index 7534f6c24e..3bed698e26 100644 --- a/cocos/scripting/lua/script/Cocos2dConstants.lua +++ b/cocos/scripting/lua/script/Cocos2dConstants.lua @@ -351,4 +351,7 @@ cc.EVENT_KEYBOARD = 3 cc.EVENT_MOUSE = 4 cc.EVENT_ACCELERATION = 5 cc.EVENT_CUSTOM = 6 - \ No newline at end of file + +cc.PHYSICSSHAPE_MATERIAL_DEFAULT = {0.0, 0.5, 0.5} +cc.PHYSICSBODY_MATERIAL_DEFAULT = {0.1, 0.5, 0.5} + diff --git a/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua b/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua new file mode 100644 index 0000000000..0434b0a3c4 --- /dev/null +++ b/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua @@ -0,0 +1,620 @@ +local size = cc.Director:getInstance():getWinSize() +local MATERIAL_DEFAULT = cc.PhysicsMaterial(0.1, 0.5, 0.5) +local curLayer = nil +local STATIC_COLOR = cc.c4f(1.0, 0.0, 0.0, 1.0) +local DRAG_BODYS_TAG = 0x80 + +local function range(from, to, step) + step = step or 1 + return function(_, lastvalue) + local nextvalue = lastvalue + step + if step > 0 and nextvalue <= to or step < 0 and nextvalue >= to or + step == 0 + then + return nextvalue + end + end, nil, from - step +end + +local function initWithLayer(layer, callback) + curLayer = layer + layer.spriteTexture = cc.SpriteBatchNode:create("Images/grossini_dance_atlas.png", 100):getTexture() + + local debug = false + local function toggleDebugCallback(sender) + debug = not debug + cc.Director:getInstance():getRunningScene():getPhysicsWorld():setDebugDrawMask(debug and cc.PhysicsWorld.DEBUGDRAW_ALL or cc.PhysicsWorld.DEBUGDRAW_NONE) + end + + layer.toggleDebug = toggleDebugCallback; + cc.MenuItemFont:setFontSize(18) + local item = cc.MenuItemFont:create("Toogle debug") + item:registerScriptTapHandler(toggleDebugCallback) + local menu = cc.Menu:create(item) + layer:addChild(menu) + menu:setPosition(size.width - 50, size.height - 10) + Helper.initWithLayer(layer) + + local function onNodeEvent(event) + if "enter" == event then + callback() + end + end + layer:registerScriptHandler(onNodeEvent) +end + +local function addGrossiniAtPosition(layer, p, scale) + scale = scale or 1.0 + + local posx = math.random() * 200.0 + local posy = math.random() * 100.0 + posx = (math.floor(posx) % 4) * 85 + posy = (math.floor(posy) % 3) * 121 + + local sp = cc.Sprite:createWithTexture(layer.spriteTexture, cc.rect(posx, posy, 85, 121)) + sp:setScale(scale) + sp:setPhysicsBody(cc.PhysicsBody:createBox(cc.size(48.0*scale, 108.0*scale))) + layer:addChild(sp) + sp:setPosition(p) + return sp +end + +local function onTouchBegan(touch, event) + local location = touch:getLocation() + local arr = cc.Director:getInstance():getRunningScene():getPhysicsWorld():getShapes(location) + + local body + for _, obj in ipairs(arr) do + if bit.band(obj:getBody():getTag(), DRAG_BODYS_TAG) ~= 0 then + body = obj:getBody(); + break; + end + end + + if body then + local mouse = cc.Node:create(); + mouse:setPhysicsBody(cc.PhysicsBody:create(PHYSICS_INFINITY, PHYSICS_INFINITY)); + mouse:getPhysicsBody():setDynamic(false); + mouse:setPosition(location); + curLayer:addChild(mouse); + local joint = cc.PhysicsJointPin:construct(mouse:getPhysicsBody(), body, location); + joint:setMaxForce(5000.0 * body:getMass()); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():addJoint(joint); + touch.mouse = mouse + + return true; + end + + return false; +end + +local function onTouchMoved(touch, event) + if touch.mouse then + touch.mouse:setPosition(touch:getLocation()); + end +end + +local function onTouchEnded(touch, event) + if touch.mouse then + curLayer:removeChild(touch.mouse) + touch.mouse = nil + end +end + +local function makeBall(layer, point, radius, material) + material = material or MATERIAL_DEFAULT + + local ball + if layer.ball then + ball = cc.Sprite:createWithTexture(layer.ball:getTexture()) + else + ball = cc.Sprite:create("Images/ball.png") + end + + ball:setScale(0.13 * radius) + + local body = cc.PhysicsBody:createCircle(radius, material) + ball:setPhysicsBody(body) + ball:setPosition(point) + + return ball +end + +local function makeBox(point, size, material) + material = material or DEFAULT_MATERIAL + local box = math.random() > 0.5 and cc.Sprite:create("Images/YellowSquare.png") or cc.Sprite:create("Images/CyanSquare.png"); + + box:setScaleX(size.width/100.0); + box:setScaleY(size.height/100.0); + + local body = cc.PhysicsBody:createBox(size); + box:setPhysicsBody(body); + box:setPosition(cc.p(point.x, point.y)); + + return box; +end + +local function makeTriangle(point, size, material) + material = material or DEFAULT_MATERIAL + local triangle = math.random() > 0.5 and cc.Sprite:create("Images/YellowTriangle.png") or cc.Sprite:create("Images/CyanTriangle.png"); + + if size.height == 0 then + triangle:setScale(size.width/100.0); + else + triangle:setScaleX(size.width/50.0) + triangle:setScaleY(size.height/43.5) + end + + vers = { cc.p(0, size.height/2), cc.p(size.width/2, -size.height/2), cc.p(-size.width/2, -size.height/2)}; + + local body = cc.PhysicsBody:createPolygon(vers); + triangle:setPhysicsBody(body); + triangle:setPosition(point); + + return triangle; +end + +local function PhysicsDemoClickAdd() + local layer = cc.Layer:create() + local function onEnter() + local function onTouchEnded(touch, event) + local location = touch:getLocation(); + addGrossiniAtPosition(layer, location) + end + + local touchListener = cc.EventListenerTouchOneByOne:create() + touchListener:registerScriptHandler(function() return true end, cc.Handler.EVENT_TOUCH_BEGAN) + touchListener:registerScriptHandler(onTouchEnded, cc.Handler.EVENT_TOUCH_ENDED) + local eventDispatcher = layer:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(touchListener, layer) + + addGrossiniAtPosition(layer, VisibleRect:center()) + + local node = cc.Node:create() + node:setPhysicsBody(cc.PhysicsBody:createEdgeBox(cc.size(VisibleRect:getVisibleRect().width, VisibleRect:getVisibleRect().height))) + node:setPosition(VisibleRect:center()) + layer:addChild(node) + end + initWithLayer(layer, onEnter) + Helper.titleLabel:setString("Grossini") + Helper.subtitleLabel:setString("multi touch to add grossini") + + return layer +end + +local function PhysicsDemoLogoSmash() + local layer = cc.Layer:create() + + local function onEnter() + local logo_width = 188.0 + local logo_height = 35.0 + local logo_raw_length = 24.0 + local logo_image = { + 15,-16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,-64,15,63,-32,-2,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,31,-64,15,127,-125,-1,-128,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,127,-64,15,127,15,-1,-64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,-1,-64,15,-2, + 31,-1,-64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,-1,-64,0,-4,63,-1,-32,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,1,-1,-64,15,-8,127,-1,-32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,-1,-64,0,-8,-15,-1,-32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,-31,-1,-64,15,-8,-32, + -1,-32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,-15,-1,-64,9,-15,-32,-1,-32,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,31,-15,-1,-64,0,-15,-32,-1,-32,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,63,-7,-1,-64,9,-29,-32,127,-61,-16,63,15,-61,-1,-8,31,-16,15,-8,126,7,-31, + -8,31,-65,-7,-1,-64,9,-29,-32,0,7,-8,127,-97,-25,-1,-2,63,-8,31,-4,-1,15,-13, + -4,63,-1,-3,-1,-64,9,-29,-32,0,7,-8,127,-97,-25,-1,-2,63,-8,31,-4,-1,15,-13, + -2,63,-1,-3,-1,-64,9,-29,-32,0,7,-8,127,-97,-25,-1,-1,63,-4,63,-4,-1,15,-13, + -2,63,-33,-1,-1,-32,9,-25,-32,0,7,-8,127,-97,-25,-1,-1,63,-4,63,-4,-1,15,-13, + -1,63,-33,-1,-1,-16,9,-25,-32,0,7,-8,127,-97,-25,-1,-1,63,-4,63,-4,-1,15,-13, + -1,63,-49,-1,-1,-8,9,-57,-32,0,7,-8,127,-97,-25,-8,-1,63,-2,127,-4,-1,15,-13, + -1,-65,-49,-1,-1,-4,9,-57,-32,0,7,-8,127,-97,-25,-8,-1,63,-2,127,-4,-1,15,-13, + -1,-65,-57,-1,-1,-2,9,-57,-32,0,7,-8,127,-97,-25,-8,-1,63,-2,127,-4,-1,15,-13, + -1,-1,-57,-1,-1,-1,9,-57,-32,0,7,-1,-1,-97,-25,-8,-1,63,-1,-1,-4,-1,15,-13,-1, + -1,-61,-1,-1,-1,-119,-57,-32,0,7,-1,-1,-97,-25,-8,-1,63,-1,-1,-4,-1,15,-13,-1, + -1,-61,-1,-1,-1,-55,-49,-32,0,7,-1,-1,-97,-25,-8,-1,63,-1,-1,-4,-1,15,-13,-1, + -1,-63,-1,-1,-1,-23,-49,-32,127,-57,-1,-1,-97,-25,-1,-1,63,-1,-1,-4,-1,15,-13, + -1,-1,-63,-1,-1,-1,-16,-49,-32,-1,-25,-1,-1,-97,-25,-1,-1,63,-33,-5,-4,-1,15, + -13,-1,-1,-64,-1,-9,-1,-7,-49,-32,-1,-25,-8,127,-97,-25,-1,-1,63,-33,-5,-4,-1, + 15,-13,-1,-1,-64,-1,-13,-1,-32,-49,-32,-1,-25,-8,127,-97,-25,-1,-2,63,-49,-13, + -4,-1,15,-13,-1,-1,-64,127,-7,-1,-119,-17,-15,-1,-25,-8,127,-97,-25,-1,-2,63, + -49,-13,-4,-1,15,-13,-3,-1,-64,127,-8,-2,15,-17,-1,-1,-25,-8,127,-97,-25,-1, + -8,63,-49,-13,-4,-1,15,-13,-3,-1,-64,63,-4,120,0,-17,-1,-1,-25,-8,127,-97,-25, + -8,0,63,-57,-29,-4,-1,15,-13,-4,-1,-64,63,-4,0,15,-17,-1,-1,-25,-8,127,-97, + -25,-8,0,63,-57,-29,-4,-1,-1,-13,-4,-1,-64,31,-2,0,0,103,-1,-1,-57,-8,127,-97, + -25,-8,0,63,-57,-29,-4,-1,-1,-13,-4,127,-64,31,-2,0,15,103,-1,-1,-57,-8,127, + -97,-25,-8,0,63,-61,-61,-4,127,-1,-29,-4,127,-64,15,-8,0,0,55,-1,-1,-121,-8, + 127,-97,-25,-8,0,63,-61,-61,-4,127,-1,-29,-4,63,-64,15,-32,0,0,23,-1,-2,3,-16, + 63,15,-61,-16,0,31,-127,-127,-8,31,-1,-127,-8,31,-128,7,-128,0,0 + }; + + local function get_pixel(x, y) + return bit.band(bit.rshift(logo_image[bit.rshift(x, 3) + y*logo_raw_length + 1], bit.band(bit.bnot(x), 0x07)), 1) + end + + cc.Director:getInstance():getRunningScene():getPhysicsWorld():setGravity(cc.p(0, 0)); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():setUpdateRate(5.0); + + layer.ball = cc.SpriteBatchNode:create("Images/ball.png", #logo_image); + layer:addChild(layer.ball); + for y in range(0, logo_height-1) do + for x in range(0, logo_width-1) do + if get_pixel(x, y) == 1 then + local x_jitter = 0.05*math.random(); + local y_jitter = 0.05*math.random(); + + local ball = makeBall(layer, cc.p(2*(x - logo_width/2 + x_jitter) + VisibleRect:getVisibleRect().width/2, + 2*(logo_height-y + y_jitter) + VisibleRect:getVisibleRect().height/2 - logo_height/2), + 0.95, cc.PhysicsMaterial(0.01, 0.0, 0.0)); + + ball:getPhysicsBody():setMass(1.0); + ball:getPhysicsBody():setMoment(PHYSICS_INFINITY); + + layer.ball:addChild(ball); + end + end + end + + local bullet = makeBall(layer, cc.p(400, 0), 10, cc.PhysicsMaterial(PHYSICS_INFINITY, 0, 0)); + bullet:getPhysicsBody():setVelocity(cc.p(200, 0)); + bullet:setPosition(cc.p(-500, VisibleRect:getVisibleRect().height/2)) + layer.ball:addChild(bullet); + end + + initWithLayer(layer, onEnter) + Helper.titleLabel:setString("Logo Smash") + + return layer +end + +local function PhysicsDemoJoints() + local layer = cc.Layer:create() + local function onEnter() + layer:toggleDebug(); + + local touchListener = cc.EventListenerTouchOneByOne:create() + touchListener:registerScriptHandler(onTouchBegan, cc.Handler.EVENT_TOUCH_BEGAN) + touchListener:registerScriptHandler(onTouchMoved, cc.Handler.EVENT_TOUCH_MOVED) + touchListener:registerScriptHandler(onTouchEnded, cc.Handler.EVENT_TOUCH_ENDED) + local eventDispatcher = layer:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(touchListener, layer) + + local width = (VisibleRect:getVisibleRect().width - 10) / 4; + local height = (VisibleRect:getVisibleRect().height - 50) / 4; + + local node = cc.Node:create(); + local box = cc.PhysicsBody:create(); + node:setPhysicsBody(box); + box:setDynamic(false); + node:setPosition(cc.p(0, 0)); + layer:addChild(node); + + local scene = cc.Director:getInstance():getRunningScene(); + for i in range(0, 3) do + for j in range(0, 3) do + local offset = cc.p(VisibleRect:leftBottom().x + 5 + j * width + width/2, VisibleRect:leftBottom().y + 50 + i * height + height/2); + box:addShape(cc.PhysicsShapeEdgeBox:create(cc.size(width, height), cc.PHYSICSSHAPE_MATERIAL_DEFAULT, 1, offset)); + print("i,j") + print(i) + print(j) + local index = i*4 + j + if index == 0 then + local sp1 = makeBall(layer, cc.p(offset.x - 30, offset.y), 10); + sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); + local sp2 = makeBall(layer, cc.p(offset.x + 30, offset.y), 10); + sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); + + local joint = cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), offset); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():addJoint(joint); + + layer:addChild(sp1); + layer:addChild(sp2); + elseif index == 1 then + local sp1 = makeBall(layer, cc.p(offset.x - 30, offset.y), 10); + sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); + local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); + sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); + + local joint = cc.PhysicsJointFixed:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), offset); + scene:getPhysicsWorld():addJoint(joint); + + layer:addChild(sp1); + layer:addChild(sp2); + elseif index == 2 then + local sp1 = makeBall(layer, cc.p(offset.x - 30, offset.y), 10); + sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); + local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); + sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); + + local joint = cc.PhysicsJointDistance:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), cc.p(0, 0), cc.p(0, 0)); + scene:getPhysicsWorld():addJoint(joint); + + layer:addChild(sp1); + layer:addChild(sp2); + elseif index == 3 then + local sp1 = makeBall(layer, cc.p(offset.x - 30, offset.y), 10); + sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); + local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); + sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); + + local joint = cc.PhysicsJointLimit:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), cc.p(0, 0), cc.p(0, 0), 30.0, 60.0); + scene:getPhysicsWorld():addJoint(joint); + + layer:addChild(sp1); + layer:addChild(sp2); + elseif index == 4 then + local sp1 = makeBall(layer, cc.p(offset.x - 30, offset.y), 10); + sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); + local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); + sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); + + local joint = cc.PhysicsJointSpring:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), cc.p(0, 0), cc.p(0, 0), 500.0, 0.3); + scene:getPhysicsWorld():addJoint(joint); + + layer:addChild(sp1); + layer:addChild(sp2); + elseif index == 5 then + local sp1 = makeBall(layer, cc.p(offset.x - 30, offset.y), 10); + sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); + local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); + sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); + + local joint = cc.PhysicsJointGroove:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), cc.p(30, 15), cc.p(30, -15), cc.p(-30, 0)) + scene:getPhysicsWorld():addJoint(joint); + + layer:addChild(sp1); + layer:addChild(sp2); + elseif index == 6 then + local sp1 = makeBox(cc.p(offset.x - 30, offset.y), cc.size(30, 10)); + sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); + local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); + sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); + local joint = cc.PhysicsJointRotarySpring:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), 3000.0, 60.0); + scene:getPhysicsWorld():addJoint(joint); + + layer:addChild(sp1); + layer:addChild(sp2); + elseif index == 7 then + local sp1 = makeBox(cc.p(offset.x - 30, offset.y), cc.size(30, 10)); + sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); + local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); + sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); + + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); + local joint = cc.PhysicsJointRotaryLimit:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), 0.0, math.pi/2); + scene:getPhysicsWorld():addJoint(joint); + + layer:addChild(sp1); + layer:addChild(sp2); + elseif index == 8 then + local sp1 = makeBox(cc.p(offset.x - 30, offset.y), cc.size(30, 10)); + sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); + local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); + sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); + + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); + local joint = cc.PhysicsJointRatchet:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), 0.0, math.pi/2); + scene:getPhysicsWorld():addJoint(joint); + + layer:addChild(sp1); + layer:addChild(sp2); + elseif index == 9 then + local sp1 = makeBox(cc.p(offset.x - 30, offset.y), cc.size(30, 10)); + sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); + local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); + sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); + + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); + local joint = cc.PhysicsJointGear:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), 0.0, 2.0); + scene:getPhysicsWorld():addJoint(joint); + + layer:addChild(sp1); + layer:addChild(sp2); + elseif index == 10 then + local sp1 = makeBox(cc.p(offset.x - 30, offset.y), cc.size(30, 10)); + sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); + local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); + sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); + + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); + local joint = cc.PhysicsJointMotor:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), math.pi/2); + scene:getPhysicsWorld():addJoint(joint); + + layer:addChild(sp1); + layer:addChild(sp2); + end + end + end + end + + initWithLayer(layer, onEnter) + Helper.titleLabel:setString("Joints") + return layer +end + +local function PhysicsDemoPyramidStack() + local layer = cc.Layer:create() + + local function onEnter() + local touchListener = cc.EventListenerTouchOneByOne:create(); + touchListener:registerScriptHandler(onTouchBegan, cc.Handler.EVENT_TOUCH_BEGAN); + touchListener:registerScriptHandler(onTouchMoved, cc.Handler.EVENT_TOUCH_MOVED); + touchListener:registerScriptHandler(onTouchEnded, cc.Handler.EVENT_TOUCH_ENDED); + local eventDispatcher = layer:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(touchListener, layer); + + local node = cc.Node:create(); + node:setPhysicsBody(cc.PhysicsBody:createEdgeSegment(cc.p(VisibleRect:leftBottom().x, VisibleRect:leftBottom().y + 50), cc.p(VisibleRect:rightBottom().x, VisibleRect:rightBottom().y + 50))); + layer:addChild(node); + + local ball = cc.Sprite:create("Images/ball.png"); + ball:setScale(1); + ball:setPhysicsBody(cc.PhysicsBody:createCircle(10)); + ball:getPhysicsBody():setTag(DRAG_BODYS_TAG); + ball:setPosition(cc.p(VisibleRect:bottom().x, VisibleRect:bottom().y + 60)); + layer:addChild(ball); + + for i in range(0, 13) do + for j in range(0, i) do + local x = VisibleRect:bottom().x + (i/2 - j) * 11 + local y = VisibleRect:bottom().y + (14 - i) * 23 + 100 + local sp = addGrossiniAtPosition(layer, cc.p(x, y), 0.2); + sp:getPhysicsBody():setTag(DRAG_BODYS_TAG); + end + end + end + + initWithLayer(layer, onEnter) + Helper.titleLabel:setString("Pyramid Stack") + + return layer +end + +local function PhysicsDemoRayCast() + local layer = cc.Layer:create() + + local function onEnter() + local function onTouchEnded(touch, event) + local location = touch:getLocation(); + + local r = math.random(3); + if r ==1 then + layer:addChild(makeBall(layer, location, 5 + math.random()*10)); + elseif r == 2 then + layer:addChild(makeBox(location, cc.size(10 + math.random()*15, 10 + math.random()*15))); + elseif r == 3 then + layer:addChild(makeTriangle(location, cc.size(10 + math.random()*20, 10 + math.random()*20))); + end + end + + local touchListener = cc.EventListenerTouchOneByOne:create(); + touchListener:registerScriptHandler(function() return true end, cc.Handler.EVENT_TOUCH_BEGAN); + touchListener:registerScriptHandler(onTouchEnded, cc.Handler.EVENT_TOUCH_ENDED); + local eventDispatcher = layer:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(touchListener, layer); + + cc.Director:getInstance():getRunningScene():getPhysicsWorld():setGravity(cc.p(0,0)); + + local node = cc.DrawNode:create(); + node:setPhysicsBody(cc.PhysicsBody:createEdgeSegment(cc.p(VisibleRect:leftBottom().x, VisibleRect:leftBottom().y + 50), cc.p(VisibleRect:rightBottom().x, VisibleRect:rightBottom().y + 50))) + node:drawSegment(cc.p(VisibleRect:leftBottom().x, VisibleRect:leftBottom().y + 50), cc.p(VisibleRect:rightBottom().x, VisibleRect:rightBottom().y + 50), 1, STATIC_COLOR); + layer:addChild(node); + + local mode = 0 + cc.MenuItemFont:setFontSize(18); + local item = cc.MenuItemFont:create("Toogle debugChange Mode(any)") + local function changeModeCallback(sender) + mode = (mode + 1) % 3; + + if mode == 0 then + item:setString("Change Mode(any)"); + elseif mode == 1 then + item:setString("Change Mode(nearest)"); + elseif mode == 2 then + item:setString("Change Mode(multiple)"); + end + end + + item:registerScriptTapHandler(changeModeCallback) + + local menu = cc.Menu:create(item); + layer:addChild(menu); + menu:setPosition(cc.p(VisibleRect:left().x+100, VisibleRect:top().y-10)); + + local angle = 0 + local drawNode = nil + local function update(delta) + local L = 150.0; + local point1 = VisibleRect:center() + local d = cc.p(L * math.cos(angle), L * math.sin(angle)); + local point2 = cc.p(point1.x + d.x, point1.y + d.y) + + if drawNode then layer:removeChild(drawNode); end + drawNode = cc.DrawNode:create(); + if mode == 0 then + local point3 = cc.p(point2.x, point2.y) + local function func(world, info) + point3 = info.contact + return false + end + + cc.Director:getInstance():getRunningScene():getPhysicsWorld():rayCast(func, point1, point2); + drawNode:drawSegment(point1, point3, 1, STATIC_COLOR); + + if point2.x ~= point3.x or point2.y ~= point3.y then + drawNode:drawDot(point3, 2, cc.c4f(1.0, 1.0, 1.0, 1.0)); + end + layer:addChild(drawNode); + elseif mode == 1 then + local point3 = cc.p(point2.x, point2.y) + local friction = 1.0; + local function func(world, info) + if friction > info.fraction then + point3 = info.contact; + friction = info.fraction; + end + return true; + end + + cc.Director:getInstance():getRunningScene():getPhysicsWorld():rayCast(func, point1, point2); + drawNode:drawSegment(point1, point3, 1, STATIC_COLOR); + + if point2.x ~= point3.x or point2.y ~= point3.y then + drawNode:drawDot(point3, 2, cc.c4f(1.0, 1.0, 1.0, 1.0)); + end + layer:addChild(drawNode); + elseif mode == 2 then + local points = {} + + local function func(world, info) + points[#points + 1] = info.contact; + return true; + end + + cc.Director:getInstance():getRunningScene():getPhysicsWorld():rayCast(func, point1, point2); + drawNode:drawSegment(point1, point2, 1, STATIC_COLOR); + + for _, p in ipairs(points) do + drawNode:drawDot(p, 2, cc.c4f(1.0, 1.0, 1.0, 1.0)); + end + + layer:addChild(drawNode); + end + + angle = angle + 0.25 * math.pi / 180.0; + + end + + layer:scheduleUpdateWithPriorityLua(update, 0); + end + + initWithLayer(layer, onEnter) + Helper.titleLabel:setString("Ray Cast") + + return layer +end + +local function registerOnEnter() + layer:registerOn(PhysicsDemoLogoSmash) +end + +function PhysicsTest() + cclog("PhysicsTest") + local scene = cc.Scene:createWithPhysics() + + Helper.usePhysics = true + Helper.createFunctionTable = { + PhysicsDemoLogoSmash, + PhysicsDemoPyramidStack, + PhysicsDemoClickAdd, + PhysicsDemoRayCast, + PhysicsDemoJoints, + } + + scene:addChild(Helper.createFunctionTable[1]()) + scene:addChild(CreateBackMenuItem()) + return scene +end diff --git a/samples/Lua/TestLua/Resources/luaScript/helper.lua b/samples/Lua/TestLua/Resources/luaScript/helper.lua index 911924f1fe..c2706d02d3 100644 --- a/samples/Lua/TestLua/Resources/luaScript/helper.lua +++ b/samples/Lua/TestLua/Resources/luaScript/helper.lua @@ -31,6 +31,7 @@ end -- back menu callback local function MainMenuCallback() + Helper.usePhysics = false local scene = cc.Scene:create() scene:addChild(CreateTestMenu()) @@ -82,7 +83,12 @@ function Helper.restartAction() end function Helper.newScene() - local scene = cc.Scene:create() + local scene + if Helper.usePhysics then + scene = cc.Scene:createWithPhysics() + else + scene = cc.Scene:create() + end Helper.currentLayer = Helper.createFunctionTable[Helper.index]() scene:addChild(Helper.currentLayer) scene:addChild(CreateBackMenuItem()) diff --git a/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua b/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua index bba1c79a98..1e191f8726 100644 --- a/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua +++ b/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua @@ -51,6 +51,7 @@ require "luaScript/UserDefaultTest/UserDefaultTest" require "luaScript/ZwoptexTest/ZwoptexTest" require "luaScript/LuaBridgeTest/LuaBridgeTest" require "luaScript/XMLHttpRequestTest/XMLHttpRequestTest" +require "luaScript/PhysicsTest/PhysicsTest" local LINE_SPACE = 40 @@ -95,6 +96,7 @@ local _allTests = { { isSupported = true, name = "ParallaxTest" , create_func = ParallaxTestMain }, { isSupported = true, name = "ParticleTest" , create_func = ParticleTest }, { isSupported = true, name = "PerformanceTest" , create_func= PerformanceTestMain }, + { isSupported = true, name = "PhysicsTest" , create_func = PhysicsTest }, { isSupported = true, name = "RenderTextureTest" , create_func = RenderTextureTestMain }, { isSupported = true, name = "RotateWorldTest" , create_func = RotateWorldTest }, { isSupported = true, name = "SceneTest" , create_func = SceneTestMain }, diff --git a/tools/tolua/cocos2dx_physics.ini b/tools/tolua/cocos2dx_physics.ini new file mode 100644 index 0000000000..7c6c3ed78f --- /dev/null +++ b/tools/tolua/cocos2dx_physics.ini @@ -0,0 +1,67 @@ +[cocos2dx_physics] +# the prefix to be added to the generated functions. You might or might not use this in your own +# templates +prefix = cocos2dx_physics + +# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`) +# all classes will be embedded in that namespace +target_namespace = cc + +android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include +android_flags = -D_SIZE_T_DEFINED_ + +clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include +clang_flags = -nostdinc -x c++ -std=c++11 + +cocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/cocos/physics +cocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT -DCC_USE_PHYSICS=1 + +cxxgenerator_headers = + +# extra arguments for clang +extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s + +# what headers to parse +headers = %(cocosdir)s/cocos/2d/cocos2d.h + +# what classes to produce code for. You can use regular expressions here. When testing the regular +# expression, it will be enclosed in "^$", like this: "^Menu*$". +classes = Event(.*(Physics).*) Physics.* + +# what should we skip? in the format ClassName::[function function] +# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also +# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just +# add a single "*" as functions. See bellow for several examples. A special class name is "*", which +# will apply to all class names. This is a convenience wildcard to be able to skip similar named +# functions from all classes. + +skip = PhysicsBody::[getJoints createPolygon createEdgeChain createEdgePolygon], + PhysicsShape::[recenterPoints getPolyonCenter], + PhysicsShapeBox::[getPoints], + PhysicsShapeEdgeBox::[getPoints], + PhysicsShapePolygon::[getPoints], + PhysicsShapeEdgePolygon::[getPoints], + PhysicsShapeEdgeChain::[getPoints], + PhysicsWorld::[getScene queryPoint queryRect rayCast] + + +rename_functions = + +rename_classes = + +# for all class names, should we remove something when registering in the target VM? +remove_prefix = + +# classes for which there will be no "parent" lookup +classes_have_no_parents = PhysicsWorld PhysicsJoint PhysicsContactPreSolve PhysicsContactPostSolve + +# base classes which will be skipped when their sub-classes found them. +base_classes_to_skip = + +# classes that create no constructor +# Set is special and we will use a hand-written constructor +abstract_classes = + +# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. +script_control_cpp = no + From 4c2fe530f934d23e46836c8150e7a6cb3c00e7c7 Mon Sep 17 00:00:00 2001 From: heliclei Date: Mon, 6 Jan 2014 22:24:47 +0800 Subject: [PATCH 280/428] fix post data format --- tools/jenkins-scripts/create-job.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/jenkins-scripts/create-job.py b/tools/jenkins-scripts/create-job.py index ec161ae67b..ef3e386368 100644 --- a/tools/jenkins-scripts/create-job.py +++ b/tools/jenkins-scripts/create-job.py @@ -26,5 +26,6 @@ payload['pull_request']=pr jenkins_trigger_url="http://ci.cocos2d-x.org:8000/job/cocos-2dx-pull-request-build/buildWithParameters?token="+access_token #send trigger and payload -post_data = "payload:"+json.dumps(payload +post_data = {'payload':""} +post_data['payload']=json.dumps(payload) requests.post(jenkins_trigger_url, data=post_data) From 11ad6cd9742f920227a95f38d6a632b7947e3334 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 6 Jan 2014 14:24:24 -0800 Subject: [PATCH 281/428] Adds release date to CHANGELOG --- CHANGELOG | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 422541293f..fa443fca76 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -cocos2d-x-3.0beta ?? 2013 +cocos2d-x-3.0beta Jan.7 2014 [All] [NEW] Upgrated Box2D to 2.3.0 [NEW] SChedule::performFunctionInCocosThread() @@ -8,7 +8,7 @@ cocos2d-x-3.0beta ?? 2013 [FIX] Used c++11 range loop(highest performance) instead of other types of loop. [FIX] Removed most hungarian notations. [FIX] Merged NodeRGBA to Node. - [NEW] New renderer support. + [NEW] New renderer: Scene graph and Renderer are decoupled now. [FIX] Potential hash collision fix. [FIX] Updates spine runtime to the latest version. [FIX] Uses `const std::string&` instead of `const char*`. From df3e83094bd6b0a69de78d38020a9079fb43eab5 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 6 Jan 2014 16:23:06 -0800 Subject: [PATCH 282/428] Adds RELEASE_NOTES.md to repo --- docs/RELEASE_NOTES.md | 621 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 621 insertions(+) create mode 100644 docs/RELEASE_NOTES.md diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md new file mode 100644 index 0000000000..b46523e38f --- /dev/null +++ b/docs/RELEASE_NOTES.md @@ -0,0 +1,621 @@ +# cocos2d-x v3.0 Release Notes # + + +# Misc Information + +* Download: http://cdn.cocos2d-x.org/cocos2d-x-3.0alpha1.zip +* Full Changelog: https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.0alph1/CHANGELOG +* API Reference: http://www.cocos2d-x.org/reference/native-cpp/V3.0alpha1/index.html + +# Requirements + +## Runtime Requirements + +* Android 2.3 or newer +* iOS 5.0 or newer +* OS X 10.7 or newer +* Windows 7 or newer +* ~~Windows Phone 8 or newer~~ N/A for the moment +* Linux Ubuntu 12.04 (or newer) +* ~~Browsers via Emscripten~~ N/A for the moment +* ~~Marmalade~~ N/A for the moment +* ~~BlackBerry~~ N/A for the moment + +## Compiler Requirements + +* Xcode 4.6 (for iOS or Mac) +* gcc 4.7 for Linux or Android. For Android ndk-r9 or newer is required. +* Visual Studio 2012 (for Windows) + +# Highlights of v3.0.0 + +* Replaced Objective-C patters with C++ (C++11) patterns and best practices +* Improved Labels +* Improved renderer +* New Event Dispatcher +* Physics integration +* New GUI +* Javascript remote debugger +* Console module +* Refactor Image - release memory in time and uniform the api of supported file format +* Automatically generated lua bindings, add LuaJavaBridge and LuaObjcBridge +* Templated containers + +# Features in detail + +## C++11 features + +_Feature added in v3.0-pre-alpha0_ + +A subset of C++11 features are being used in cocos2d-x: + +* `std::function`, including lambda objects for callbacks +* strongly typed enums, for most of the cocos2d-x enums and constants +* `std::thread` for threading +* `override` context keyword, for overriden methods + + +### std::function + +* `CallFunc` can be created with an `std::function` +* `CallFuncN` can be created with an `std::function` +* `CallFuncND` and `CallFuncO` were removed since it can be created with simulated with `CallFuncN` and `CallFunc`. See ActionsTest.cpp for more examples +* `MenuItem` supports `std::function` as callbacks + +`CallFunc` example: + +```cpp +// in v2.1 +CCCallFunc *action1 = CCCallFunc::create( this, callfunc_selector( MyClass::callback_0 ) ); + +// in v3.0 (short version) +auto action1 = CallFunc::create( CC_CALLBACK_0(MyClass::callback_0,this)); +auto action2 = CallFunc::create( CC_CALLBACK_0(MyClass::callback_1,this, additional_parameters)); + +// in v3.0 (long version) +auto action1 = CallFunc::create( std::bind( &MyClass::callback_0, this)); +auto action2 = CallFunc::create( std::bind( &MyClass::callback_1, this, additional_parameters)); + +// in v3.0 you can also use lambdas or any other "Function" object +auto action1 = CallFunc::create( + [&](){ + auto s = Director::sharedDirector()->getWinSize(); + auto label = LabelTTF::create("called:lambda callback", "Marker Felt", 16); + label->setPosition(ccp( s.width/4*1,s.height/2-40)); + this->addChild(label); + } ); +``` + +`MenuItem` example: +```c++ +// in v2.1 +CCMenuItemLabel *item = CCMenuItemLabel::create(label, this, menu_selector(MyClass::callback)); + +// in v3.0 (short version) +auto item = MenuItemLabel::create(label, CC_CALLBACK_1(MyClass::callback, this)); + +// in v3.0 (long version) +auto item = MenuItemLabel::create(label, std::bind(&MyClass::callback, this, std::placeholders::_1)); + +// in v3.0 you can use lambdas or any other "Function" object +auto item = MenuItemLabel::create(label, + [&](Object *sender) { + // do something. Item "sender" clicked + }); +``` + +### strongly typed enums + +_Feature added in v3.0-pre-alpha0_ + +Constants and enums that started with `k`, and that usually were defined as `int` or as simple `enum` where replaced with strongly typed enums ( `enum class` ) to prevent collisions and type errors. +The new format is: + +| *v2.1* | *v3.0* | +| `kTypeValue` | `Type::VALUE` | + +Examples: +| *v2.1* | *v3.0* | +| `kCCTexture2DPixelFormat_RGBA8888` | `Texture2D::PixelFormat::RGBA8888` | +| `kCCDirectorProjectionCustom` | `Director::Projection::CUSTOM` | +| `ccGREEN` | `Color3B::GREEN` | +| `CCPointZero` | `Point::ZERO` | +| `CCSizeZero` | `Size::ZERO` | + +The old values can still be used, but are not deprecated. + +### override + +To catch possible errors while overriding methods, subclasses with override methods have the `override` context keyword. +Example: +```c++ +class Sprite : public Node { + bool isFlipY(void) const; + void setFlipY(bool bFlipY); + + // Overrides + virtual void setTexture(Texture2D *texture) override; + virtual Texture2D* getTexture() const override; + inline void setBlendFunc(const BlendFunc &blendFunc) override; + inline const BlendFunc& getBlendFunc() const override; +} +``` + +## Removed Objective-C patterns + +_Feature added in v3.0-pre-alpha0_ + +### No more 'CC' prefix for C++ classes and free functions + +*Changes in classes* + +Since cocos2d-x already uses the `cocos2d` namespace, there is not need to add the prefix `CC` to all its classes. + +Examples: + +| *v2.1* | *v3.0* | +| `CCSprite` | `Sprite` | +| `CCNode` | `Node` | +| `CCDirector` | `Director` | +| etc... | + +v2.1 class names are still available, but they were tagged as deprecated. + +*Changes in free functions* + +For the *drawing primitives*: +* They were added in the `DrawPrimitives` namespace +* The `cc` prefix was removed + +For the *gl proxy functions*: +* They were added in the `GL` namespace +* The `ccGL` prefix was removed + +Examples: +| *v2.1* | *v3.0* | +| `ccDrawPoint()` | `DrawPrimitives::drawPoint()` | +| `ccDrawCircle()` | `DrawPrimitives::drawCircle()` | +| `ccGLBlendFunc()` | `GL::blendFunc()` | +| `ccGLBindTexture2D()` | `GL::bindTexture2D()` | +| etc... | + +v2.1 free functions are still available, but they were tagged as deprecated. + + +### clone() instead of copy() + +`clone()` returns an autoreleased version of the copy. + +`copy()` is no longer supported. If you use it, it will compile, but the code will crash. + +Example: +```c++ +// v2.1 +CCMoveBy *action = (CCMoveBy*) move->copy(); +action->autorelease(); + +// v3.0 +// No need to do autorelease, no need to do casting. +auto action = move->clone(); +``` + +### Singletons use getInstance() and destroyInstance() + +All singletons use `getInstance()` and `destroyInstance()` (if applicable) to get and destroy the instance. + +Examples: + +| *v2.1* | *v3.0* | +| `CCDirector->sharedDirector()` | `Director->getInstance()` | +| `CCDirector->endDirector()` | `Director->destroyInstance()` | +| etc... | + + +v2.1 methods are still available, but they were tagged as deprecated. + +### getters + +Getters now use the `get` prefix. + +Examples: + +| *v2.1* | *v3.0* | +| `node->boundingBox()` | `node->getBoundingBox()` | +| `sprite->nodeToParentTransform()` | `sprite->getNodeToParentTransform()` | +| etc... | + +And getters were also tagged as `const` in their declaration. Example: + +```c++ +// v2.1 +virtual float getScale(); + +// v3.0 +virtual float getScale() const; +``` + +v2.1 methods are still available, but they were tagged as deprecated. + +### POD types + +Methods that were receiving POD types as arguments (eg: `TexParams`, `Point`, `Size`, etc.) are being passed as `const` reference. + +Example: +```c++ +// v2.1 +void setTexParameters(ccTexParams* texParams); + +// v3.0 +void setTexParameters(const ccTexParams& texParams); +``` + + +## New renderer + +NOT ADDED YET + +## Improved LabelTTF / LabelBMFont + +_Feature added in v3.0-alpha0_ + +## New EventDispatcher + +_Feature added in v3.0-alpha0_ + +All events like touch event, keyboard event, acceleration event and custom event are dispatched by `EventDispatcher`. +`TouchDispatcher`, `KeypadDispatcher`, `KeyboardDispatcher`, `AccelerometerDispatcher` were removed. + +### Adding Touch Event Listener + +```c++ +auto sprite = Sprite::create("file.png"); +... +auto listener = EventListenerTouch::create(Touch::DispatchMode::ONE_BY_ONE); +listener->setSwallowTouch(true); +listener->onTouchBegan = [](Touch* touch, Event* event) { do_some_thing(); return true; }; +listener->onTouchMoved = [](Touch* touch, Event* event) { do_some_thing(); }; +listener->onTouchEnded = [](Touch* touch, Event* event) { do_some_thing(); }; +listener->onTouchCancelled = [](Touch* touch, Event* event) { do_some_thing(); }; +// The priority of the touch listener is based on the draw order of sprite +EventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, sprite); +// Or the priority of the touch listener is a fixed value +EventDispatcher::getInstance()->addEventListenerWithFixedPriority(listener, 100); // 100 is a fixed value +``` + +### Adding A Keyboard Event Listener + +```c++ +auto listener = EventListenerKeyboard::create(); +listener->onKeyPressed = CC_CALLBACK_2(SomeClass::onKeyPressed, this); +listener->onKeyReleased = CC_CALLBACK_2(SomeClass::onKeyReleased, this); +EventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, this); +``` + +### Adding An Acceleration Event Listener + +```c++ +auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(SomeClass::onAcceleration, this)); +EventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, this); +``` + +### Adding A Custom Event Listener + +```c++ +auto listener = EventListenerCustom::create("game_custom_event", [=](EventCustom* event){ + void* userData= event->getUserData(); + do_some_with_user_data(); +}); +dispatcher->addEventListenerWithFixedPriority(listener, 1); +``` + +### Dispatching A Custom Event + +```c++ +EventCustom event("game_custom_event"); +event.setUserData(some_data); +dispatcher->dispatchEvent(&event); +``` + +### Setting Fixed Priority For A Listener + +```c++ +dispatcher->setPriority(fixedPriorityListener, 200); +``` + +### Removing Event Listener + +#### Removing A Specified Event Listener + +```c++ +dispatcher->removeEventListener(listener); +``` + +#### Removing All Listeners For An Event Type + +```c++ +dispatcher->removeListenersForEventType("event_name"); +``` + +#### Removing All Listeners + +```c++ +dispatcher->removeAllListeners(); +``` + +## Physics Integration + +_Feature added in v3.0-pre-alpha0_ + +Physics integration have five concepts: `PhysicsWorld`, `PhysicsBody`, `PhysicsShape`, `PhysicsJoint` and `PhysicsContact`. +You must define `CC_USE_PHYSICS` macro in `ccConfig.h` to use the physics API. + +### PhysicsWorld + +A `PhysicsWorld` object simulates collisions and other physical properties, you do not create it directly, you can get it from scene which create with physics. +```c++ +Scene* scene = Scene::createWithPhysics(); +PhysicsWorld* world = scene->getPhysicsWorld(); +``` + +### PhysicsBody + +A `PhysicsBody` object is used to add physics simulation to a node. If you create a `PhysicsBody` and set it to a node, and add the node the a scene which create with physics, it will perform the physics simulation when update. +```c++ +PhysicsBody* body = PhysicsBody::createCircle(5.0f); +Node* node = Node::create(); +node->setPhysicsBody(body); +scene->addChild(node); +``` + +### PhysicsShape + +A `PhysicsShape` object is a shape that make the body can have collisions. you can add one or more `PhysicsShape` to a `PhysicsBody`. +Shape classes: `PhysicsShapeCircle`, `PhysicsShapeBox`, `PhysicsShapePolygon`, `PhysicsShapeEdgeSegment`, `PhysicsShapeEdgeBox`, `PhysicsShapeEdgePolygon`, `PhysicsShapeEdgeChain`. +```c++ +PhysicsShape* shape = PhysicsShapeBox::create(Size(5.0f, 10.0f); +body->addShape(shape); +``` + +### PhysicsJoint + +A `PhysicsJoint` object connects two physics bodies together so that they are simulated together by the physics world. +Joint classes: `PhysicsJointFixed`, `PhysicsJointLimit`, `PhysicsJointPin`, `PhysicsJointDistance`, `PhysicsJointSpring`, `PhysicsJointGroove`, `PhysicsJointRotarySpring`, `PhysicsJointRotaryLimit`, `PhysicsJointRatchet`, `PhysicsJointGear`, `PhysicsJointMotor`. +```c++ +PhysicsJoint* joint = PhysicsJointDistance::construct(bodyA, bodyB, Point::ZERO, Point::ZERO); +world->addJoint(joint); +``` + +### PhysicsContact + +A `PhysicsContact` object is created automatically to describes a contact between two physical bodies in a `PhysicsWorld`. you can control the contact behavior from the physics contact event listener. +Other classes contain the contact information: `PhysicsContactPreSolve`, `PhysicsContactPostSolve`. +The event listener for physics: `EventListenerPhysicsContact`, `EventListenerPhysicsContactWithBodies`, `EventListenerPhysicsContactWithShapes`, `EventListenerPhysicsContactWithGroup`. +```c++ +auto contactListener = EventListenerPhysicsContactWithBodies::create(bodyA, bodyB); +contactListener->onContactBegin = [](EventCustom* event, const PhysicsContact& contact) -> bool +{ +doSomething(); +return true; +}; +_eventDispatcher->addEventListenerWithSceneGraphPriority(contactListener, this); +``` + + +# Misc API Changes + +## `ccTypes.h` + +Remove *cc* prefix for structure names in ccTypes.h, move global functions into static member functions, and move global constants into const static member variables. + +| *structure name before changing* | *structure name after changing* | +| `ccColor3B` | `Color3B` | +| `ccColor4B` | `Color4B` | +| `ccColor4F` | `Color4F` | +| `ccVertex2F` | `Vertex2F` | +| `ccVertex3F` | `Vertex3F` | +| `ccTex2F` | `Tex2F` | +| `ccPointSprite` | `PointSprite` | +| `ccQuad2` | `Quad2` | +| `ccQuad3` | `Quad3` | +| `ccV2F_C4B_T2F` | `V2F_C4B_T2F` | +| `ccV2F_C4F_T2F` | `V2F_C4F_T2F` | +| `ccV3F_C4B_T2F` | `V3F_C4B_T2F` | +| `ccV2F_C4B_T2F_Triangle` | `V2F_C4B_T2F_Triangle` | +| `ccV2F_C4B_T2F_Quad` | `V2F_C4B_T2F_Quad` | +| `ccV3F_C4B_T2F_Quad` | `V3F_C4B_T2F_Quad` | +| `ccV2F_C4F_T2F_Quad` | `V2F_C4F_T2F_Quad` | +| `ccBlendFunc` | `BlendFunc` | +| `ccT2F_Quad` | `T2F_Quad` | +| `ccAnimationFrameData` | `AnimationFrameData` | + +Global functions changed example +```c++ +// in v2.1 +ccColor3B color3B = ccc3(0, 0, 0); +ccc3BEqual(color3B, ccc3(1, 1, 1)); +ccColor4B color4B = ccc4(0, 0, 0, 0); +ccColor4F color4F = ccc4f(0, 0, 0, 0); +color4F = ccc4FFromccc3B(color3B); +color4F = ccc4FFromccc4B(color4B); +ccc4FEqual(color4F, ccc4F(1, 1, 1, 1)); +color4B = ccc4BFromccc4F(color4F); + +color3B = ccWHITE; + +// in v3.0 +Color3B color3B = Color3B(0, 0, 0); +color3B.equals(Color3B(1, 1, 1)); +Color4B color4B = Color4B(0, 0, 0, 0); +Color4F color4F = Color4F(0, 0, 0, 0); +color4F = Color4F(color3B); +color4F = Color4F(color4B); +color4F.equals(Color4F(1, 1, 1, 1)); +color4B = Color4B(color4F); + +color3B = Color3B::WHITE; +``` + +## deprecated functions and global variables + +|*old name*|*new name*| +| `ccp` | `Point` | +| `ccpNeg` | `Point::-` | +| `ccpAdd` | `Point::+` | +| `ccpSub` | `Point::-` | +| `ccpMult` | `Point::*` | +| `ccpMidpoint` | `Point::getMidpoint` | +| `ccpDot` | `Point::dot` | +| `ccpCrosss` | `Point::cross` | +| `ccpPerp` | `Point::getPerp` | +| `ccpRPerp` | `Point::getRPerp` | +| `ccpProject` | `Point::project` | +| `ccpRotate` | `Point::rotate` | +| `ccpUnrotate` | `Point::unrotate` | +| `ccpLengthSQ` | `Point::getLengthSq()` | +| `ccpDistanceSQ` | `Point::getDistanceSq` | +| `ccpLength` | `Point::getLength` | +| `ccpDistance` | `Point::getDistance` | +| `ccpNormalize` | `Point::normalize` | +| `ccpForAngle` | `Point::forAngle` | +| `ccpToAngle` | `Point::getAngle` | +| `ccpClamp` | `Point::getClampPoint` | +| `ccpFromSize` | `Point::Point` | +| `ccpCompOp` | `Point::compOp` | +| `ccpLerp` | `Point::lerp` | +| `ccpFuzzyEqual` | `Point::fuzzyEqual` | +| `ccpCompMult` | `Point::Point` | +| `ccpAngleSigned` | `Point::getAngle` | +| `ccpAngle` | `Point::getAngle` | +| `ccpRotateByAngle` | `Point::rotateByAngle` | +| `ccpLineInersect` | `Point::isLineIntersect` | +| `ccpSegmentIntersect` | `Point::isSegmentIntersect` | +| `ccpIntersectPoint` | `Point::getIntersectPoint` | +| `CCPointMake` | `Point::Point` | +| `CCSizeMake` | `Size::Size` | +| `CCRectMake` | `Rect::Rect` | +| `PointZero` | `Point::ZERO` | +| `SizeZero` | `Size::ZERO` | +| `RectZero` | `Rect::ZERO` | +| `TiledGrid3DAction::tile` | `TiledGrid3DAction::getTile` | +| `TiledGrid3DAction::originalTile` | `TiledGrid3DAction::getOriginalTile` | +| `TiledGrid3D::tile` | `TiledGrid3D::getTile` | +| `TiledGrid3D::originalTile` | `TiledGrid3D::getOriginalTile` | +| `Grid3DAction::vertex` | `Grid3DAction::getVertex` | +| `Grid3DAction::originalVertex` | `Grid3DAction::getOriginalVertex` | +| `Grid3D::vertex` | `Grid3D::getVertex` | +| `Grid3D::originalVertex` | `Grid3D::getOriginalVertex` | +| `Configuration::sharedConfiguration` | `Configuration::getInstance` | +| `Configuration::purgeConfiguration` | `Configuration::destroyInstance()` | +| `Director::sharedDirector()` | `Director::getInstance()` | +| `FileUtils::sharedFileUtils` | `FileUtils::getInstance` | +| `FileUtils::purgeFileUtils` | `FileUtils::destroyInstance` | +| `EGLView::sharedOpenGLView` | `EGLView::getInstance` | +| `ShaderCache::sharedShaderCache` | `ShaderCache::getInstance` | +| `ShaderCache::purgeSharedShaderCache` | `ShaderCache::destroyInstance` | +| `AnimationCache::sharedAnimationCache` | `AnimationCache::getInstance` | +| `AnimationCache::purgeSharedAnimationCache` | `AnimationCache::destroyInstance` | +| `SpriteFrameCache::sharedSpriteFrameCache` | `SpriteFrameCache::getInstance` | +| `SpriteFrameCache:: purgeSharedSpriteFrameCache` | `SpriteFrameCache::destroyInstance` | +| `NotificationCenter::sharedNotificationCenter` | `NotificationCenter::getInstance` | +| `NotificationCenter:: purgeNotificationCenter` | `NotificationCenter::destroyInstance` | +| `Profiler::sharedProfiler` | `Profiler::getInstance` | +| `UserDefault::sharedUserDefault` | `UserDefault::getInstance` | +| `UserDefault::purgeSharedUserDefault` | `UserDefault::destroyInstance` | +| `Application::sharedApplication` | `Application::getInstance` | +| `ccc3()` | `Color3B()` | +| `ccc3BEqual()` | `Color3B::equals()` | +| `ccc4()` | `Color4B()` | +| `ccc4FFromccc3B()` | `Color4F()` | +| `ccc4f()` | `Color4F()` | +| `ccc4FFromccc4B()` | `Color4F()` | +| `ccc4BFromccc4F()` | `Color4B()` | +| `ccc4FEqual()` | `Color4F::equals()` | +| `ccWHITE` | `Color3B::WHITE` | +| `ccYELLOW` | `Color3B::YELLOW` | +| `ccBLUE` | `Color3B::BLUE` | +| `ccGREEN` | `Color3B::GREEN` | +| `ccRED` | `Color3B::RED` | +| `ccMAGENTA` | `Color3B::MAGENTA` | +| `ccBLACK` | `Color3B::BLACK` | +| `ccORANGE` | `Color3B::ORANGE` | +| `ccGRAY` | `Color3B::GRAY` | +| `kBlendFuncDisable` | `BlendFunc::BLEND_FUNC_DISABLE` | + +## Changes in the Lua bindings + +### Use bindings-generator tool for Lua binding + +Only configurating the *.ini files in the tools/tolua folder,not to write a lot of *.pkg files + +### Use ScriptHandlerMgr to manage the register and unregister of lua function + +When we want to add register and unregister functions of lua function for class, we need to change the declarative and defined files and then bind to Lua. +In v3.0, we use the `ScriptHandlerMgr`. As an example, lets see the `MenuItem` class: +In the 2.x version, we needed to add a declaration in the MenuItem header file: +```c++ + virtual void registerScriptTapHandler(int nHandler); + virtual void unregisterScriptTapHandler(void); +``` +then implement them in the .cpp file. In the Lua script ,we use it as follow: +```lua +menuItem:registerScriptTapHandler(luafunction) +``` + +In v3.0 version, we only need to add the `HandlerType` enum in the `ScriptHandlerMgr`, and the implementation in luascript as follow: +```lua +ScriptHandlerMgr:getInstance():registerScriptHandler(menuItem, luafunction,cc.HANDLERTYPE_MENU_CLICKED) +``` + +### Use "cc" and "ccs" as module name + +```lua +// v2.x +CCSprite:create(s_pPathGrossini) +CCEaseIn:create(createSimpleMoveBy(), 2.5) + +UILayout:create() + +// v3.0 +cc.Director:getInstance():getWinSize() +cc.EaseIn:create(createSimpleMoveBy(), 2.5) + +ccs.UILayer:create() +``` + +### Deprecated funtions, tables and classes + +Add a lot of deprecate funtionsã€table and classes to support 2.x version as far as possible +Note: `Rect does not support the origin and size member variables` + +### Use the lua table instead of the some structs and classes binding + +Pointã€Sizeã€Rectã€Color3bã€Color4bã€Color4Fã€AffineTransformã€FontDefinitionã€Arrayã€Dictionaryã€PointArray are not bound. +The difference is as follow: +```lua +// v2.x +local pt = CCPoint(0 , 0) +local rect = CCRect(0, 0, 0, 0) +// v3.0 +local pt = cc.p(0, 0) +local rect = cc.rect(0,0,0,0) +``` + +Global functions about these classes are changed as follow: +```lua +// in v2.x +local pt = ccp(0,0) +local color3B = ccc3(0, 0, 0) +local color4B = ccc4(0, 0, 0, 0) + +// in v3.0 +local pt = cc.p(0,0) +local color3B = cc.c3b(0,0,0) +local color4B = cc.c4b(0,0,0,0) +``` + +Through the funtions of the LuaBasicConversion file,they can be converted the lua table when they are as a parameter in the bindings generator. + + +## Known issues + +You can find all the known issues "here":http://www.cocos2d-x.org/projects/native/issues From df44a69caa93ad9a3dd37f00f94d604f1e357824 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 6 Jan 2014 16:26:48 -0800 Subject: [PATCH 283/428] Adds TOC --- docs/RELEASE_NOTES.md | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index b46523e38f..e24a5b0b22 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -1,3 +1,52 @@ +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [cocos2d-x v3.0 Release Notes](#cocos2d-x-v30-release-notes) +- [Misc Information](#misc-information) +- [Requirements](#requirements) + - [Runtime Requirements](#runtime-requirements) + - [Compiler Requirements](#compiler-requirements) +- [Highlights of v3.0.0](#highlights-of-v300) +- [Features in detail](#features-in-detail) + - [C++11 features](#c++11-features) + - [std::function](#stdfunction) + - [strongly typed enums](#strongly-typed-enums) + - [override](#override) + - [Removed Objective-C patterns](#removed-objective-c-patterns) + - [No more 'CC' prefix for C++ classes and free functions](#no-more-'cc'-prefix-for-c++-classes-and-free-functions) + - [clone() instead of copy()](#clone-instead-of-copy) + - [Singletons use getInstance() and destroyInstance()](#singletons-use-getinstance-and-destroyinstance) + - [getters](#getters) + - [POD types](#pod-types) + - [New renderer](#new-renderer) + - [Improved LabelTTF / LabelBMFont](#improved-labelttf--labelbmfont) + - [New EventDispatcher](#new-eventdispatcher) + - [Adding Touch Event Listener](#adding-touch-event-listener) + - [Adding A Keyboard Event Listener](#adding-a-keyboard-event-listener) + - [Adding An Acceleration Event Listener](#adding-an-acceleration-event-listener) + - [Adding A Custom Event Listener](#adding-a-custom-event-listener) + - [Dispatching A Custom Event](#dispatching-a-custom-event) + - [Setting Fixed Priority For A Listener](#setting-fixed-priority-for-a-listener) + - [Removing Event Listener](#removing-event-listener) + - [Removing A Specified Event Listener](#removing-a-specified-event-listener) + - [Removing All Listeners For An Event Type](#removing-all-listeners-for-an-event-type) + - [Removing All Listeners](#removing-all-listeners) + - [Physics Integration](#physics-integration) + - [PhysicsWorld](#physicsworld) + - [PhysicsBody](#physicsbody) + - [PhysicsShape](#physicsshape) + - [PhysicsJoint](#physicsjoint) + - [PhysicsContact](#physicscontact) +- [Misc API Changes](#misc-api-changes) + - [`ccTypes.h`](#cctypesh) + - [deprecated functions and global variables](#deprecated-functions-and--global-variables) + - [Changes in the Lua bindings](#changes-in-the-lua-bindings) + - [Use bindings-generator tool for Lua binding](#use-bindings-generator-tool-for-lua-binding) + - [Use ScriptHandlerMgr to manage the register and unregister of lua function](#use-scripthandlermgr-to-manage-the-register-and-unregister-of-lua-function) + - [Use "cc" and "ccs" as module name](#use-cc-and-ccs-as-module-name) + - [Deprecated funtions, tables and classes](#deprecated-funtions-tables-and-classes) + - [Use the lua table instead of the some structs and classes binding](#use-the-lua-table-instead-of-the-some-structs-and-classes-binding) + - [Known issues](#known-issues) + # cocos2d-x v3.0 Release Notes # From d15768d6306948452d871c264d24a9fabdbff625 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 6 Jan 2014 16:28:24 -0800 Subject: [PATCH 284/428] Removes RELASE_NOTES --- build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- docs/RELEASE_NOTES | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 docs/RELEASE_NOTES diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index d3f6223954..c4528a1caf 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -64be2dade906f1baa9da4fdd207e4b1f9330ceb4 \ No newline at end of file +d7aac7ce0972156e068cbfb28054d2961068f295 \ No newline at end of file diff --git a/docs/RELEASE_NOTES b/docs/RELEASE_NOTES deleted file mode 100644 index f10872da6c..0000000000 --- a/docs/RELEASE_NOTES +++ /dev/null @@ -1,4 +0,0 @@ -===== cocos2d-x 3.0 Release Notes ===== - -Please, read the online release notes document: -http://www.cocos2d-x.org/wiki/Release_Notes_for_Cocos2d-x_v300 \ No newline at end of file From a5f5104ab70b31157cfc159e31fffb05a156cf22 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 6 Jan 2014 16:33:14 -0800 Subject: [PATCH 285/428] misc changes --- docs/RELEASE_NOTES.md | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index e24a5b0b22..8b4fe1c68e 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -1,3 +1,5 @@ +# cocos2d-x v3.0 Release Notes # + **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* - [cocos2d-x v3.0 Release Notes](#cocos2d-x-v30-release-notes) @@ -47,9 +49,6 @@ - [Use the lua table instead of the some structs and classes binding](#use-the-lua-table-instead-of-the-some-structs-and-classes-binding) - [Known issues](#known-issues) -# cocos2d-x v3.0 Release Notes # - - # Misc Information * Download: http://cdn.cocos2d-x.org/cocos2d-x-3.0alpha1.zip @@ -76,7 +75,7 @@ * gcc 4.7 for Linux or Android. For Android ndk-r9 or newer is required. * Visual Studio 2012 (for Windows) -# Highlights of v3.0.0 +# Highlights of v3.0 * Replaced Objective-C patters with C++ (C++11) patterns and best practices * Improved Labels @@ -84,10 +83,10 @@ * New Event Dispatcher * Physics integration * New GUI -* Javascript remote debugger -* Console module +* JavaScript remote debugger +* Remote Console support * Refactor Image - release memory in time and uniform the api of supported file format -* Automatically generated lua bindings, add LuaJavaBridge and LuaObjcBridge +* Automatically generated Lua bindings, add LuaJavaBridge and LuaObjcBridge * Templated containers # Features in detail @@ -299,9 +298,15 @@ void setTexParameters(const ccTexParams& texParams); ``` -## New renderer +## New Renderer -NOT ADDED YET +_Feature added in v3.0-beta_ + +The renderer functionality has been decoupled from the Scene graph / Node logic. A new object called `Renderer` is responsible for rendering the object. + +Auto-batching and auto-culling support has been added. + +Please, see this document for detail information about its internal funcitonality: https://docs.google.com/document/d/17zjC55vbP_PYTftTZEuvqXuMb9PbYNxRFu0EGTULPK8/edit ## Improved LabelTTF / LabelBMFont @@ -596,9 +601,9 @@ color3B = Color3B::WHITE; Only configurating the *.ini files in the tools/tolua folder,not to write a lot of *.pkg files -### Use ScriptHandlerMgr to manage the register and unregister of lua function +### Use ScriptHandlerMgr to manage the register and unregister of Lua function -When we want to add register and unregister functions of lua function for class, we need to change the declarative and defined files and then bind to Lua. +When we want to add register and unregister functions of Lua function for class, we need to change the declarative and defined files and then bind to Lua. In v3.0, we use the `ScriptHandlerMgr`. As an example, lets see the `MenuItem` class: In the 2.x version, we needed to add a declaration in the MenuItem header file: ```c++ @@ -636,7 +641,7 @@ ccs.UILayer:create() Add a lot of deprecate funtionsã€table and classes to support 2.x version as far as possible Note: `Rect does not support the origin and size member variables` -### Use the lua table instead of the some structs and classes binding +### Use the Lua table instead of the some structs and classes binding Pointã€Sizeã€Rectã€Color3bã€Color4bã€Color4Fã€AffineTransformã€FontDefinitionã€Arrayã€Dictionaryã€PointArray are not bound. The difference is as follow: @@ -662,7 +667,7 @@ local color3B = cc.c3b(0,0,0) local color4B = cc.c4b(0,0,0,0) ``` -Through the funtions of the LuaBasicConversion file,they can be converted the lua table when they are as a parameter in the bindings generator. +Through the funtions of the LuaBasicConversion file,they can be converted the Lua table when they are as a parameter in the bindings generator. ## Known issues From 957c3b41daaeff4c4aa39cced7c34c99da189e72 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 6 Jan 2014 17:04:12 -0800 Subject: [PATCH 286/428] Tables fixes Since markdown doesn't support tables, it is using "fended" blocks to simulate tables --- docs/RELEASE_NOTES.md | 263 +++++++++++++++++++++--------------------- 1 file changed, 133 insertions(+), 130 deletions(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 8b4fe1c68e..6c0acc8777 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -159,16 +159,17 @@ _Feature added in v3.0-pre-alpha0_ Constants and enums that started with `k`, and that usually were defined as `int` or as simple `enum` where replaced with strongly typed enums ( `enum class` ) to prevent collisions and type errors. The new format is: -| *v2.1* | *v3.0* | -| `kTypeValue` | `Type::VALUE` | + | v2.1 | v3.0 | + | kTypeValue | Type::VALUE | Examples: -| *v2.1* | *v3.0* | -| `kCCTexture2DPixelFormat_RGBA8888` | `Texture2D::PixelFormat::RGBA8888` | -| `kCCDirectorProjectionCustom` | `Director::Projection::CUSTOM` | -| `ccGREEN` | `Color3B::GREEN` | -| `CCPointZero` | `Point::ZERO` | -| `CCSizeZero` | `Size::ZERO` | + + | v2.1 | v3.0 | + | kCCTexture2DPixelFormat_RGBA8888 | Texture2D::PixelFormat::RGBA8888 | + | kCCDirectorProjectionCustom | Director::Projection::CUSTOM | + | ccGREEN | Color3B::GREEN | + | CCPointZero | Point::ZERO | + | CCSizeZero | Size::ZERO | The old values can still be used, but are not deprecated. @@ -201,11 +202,11 @@ Since cocos2d-x already uses the `cocos2d` namespace, there is not need to add t Examples: -| *v2.1* | *v3.0* | -| `CCSprite` | `Sprite` | -| `CCNode` | `Node` | -| `CCDirector` | `Director` | -| etc... | + | v2.1 | v3.0 | + | CCSprite | Sprite | + | CCNode | Node | + | CCDirector | Director | + | etc... | v2.1 class names are still available, but they were tagged as deprecated. @@ -220,12 +221,13 @@ For the *gl proxy functions*: * The `ccGL` prefix was removed Examples: -| *v2.1* | *v3.0* | -| `ccDrawPoint()` | `DrawPrimitives::drawPoint()` | -| `ccDrawCircle()` | `DrawPrimitives::drawCircle()` | -| `ccGLBlendFunc()` | `GL::blendFunc()` | -| `ccGLBindTexture2D()` | `GL::bindTexture2D()` | -| etc... | + + | v2.1 | v3.0 | + | ccDrawPoint() | DrawPrimitives::drawPoint() | + | ccDrawCircle() | DrawPrimitives::drawCircle() | + | ccGLBlendFunc() | GL::blendFunc() | + | ccGLBindTexture2D() | GL::bindTexture2D() | + | etc... | v2.1 free functions are still available, but they were tagged as deprecated. @@ -253,10 +255,10 @@ All singletons use `getInstance()` and `destroyInstance()` (if applicable) to ge Examples: -| *v2.1* | *v3.0* | -| `CCDirector->sharedDirector()` | `Director->getInstance()` | -| `CCDirector->endDirector()` | `Director->destroyInstance()` | -| etc... | + | v2.1 | v3.0 | + | CCDirector->sharedDirector() | Director->getInstance() | + | CCDirector->endDirector() | Director->destroyInstance() | + | etc... | v2.1 methods are still available, but they were tagged as deprecated. @@ -267,10 +269,10 @@ Getters now use the `get` prefix. Examples: -| *v2.1* | *v3.0* | -| `node->boundingBox()` | `node->getBoundingBox()` | -| `sprite->nodeToParentTransform()` | `sprite->getNodeToParentTransform()` | -| etc... | + | v2.1 | v3.0* | + | node->boundingBox() | node->getBoundingBox() | + | sprite->nodeToParentTransform() | sprite->getNodeToParentTransform() | + | etc... | And getters were also tagged as `const` in their declaration. Example: @@ -461,26 +463,26 @@ _eventDispatcher->addEventListenerWithSceneGraphPriority(contactListener, this); Remove *cc* prefix for structure names in ccTypes.h, move global functions into static member functions, and move global constants into const static member variables. -| *structure name before changing* | *structure name after changing* | -| `ccColor3B` | `Color3B` | -| `ccColor4B` | `Color4B` | -| `ccColor4F` | `Color4F` | -| `ccVertex2F` | `Vertex2F` | -| `ccVertex3F` | `Vertex3F` | -| `ccTex2F` | `Tex2F` | -| `ccPointSprite` | `PointSprite` | -| `ccQuad2` | `Quad2` | -| `ccQuad3` | `Quad3` | -| `ccV2F_C4B_T2F` | `V2F_C4B_T2F` | -| `ccV2F_C4F_T2F` | `V2F_C4F_T2F` | -| `ccV3F_C4B_T2F` | `V3F_C4B_T2F` | -| `ccV2F_C4B_T2F_Triangle` | `V2F_C4B_T2F_Triangle` | -| `ccV2F_C4B_T2F_Quad` | `V2F_C4B_T2F_Quad` | -| `ccV3F_C4B_T2F_Quad` | `V3F_C4B_T2F_Quad` | -| `ccV2F_C4F_T2F_Quad` | `V2F_C4F_T2F_Quad` | -| `ccBlendFunc` | `BlendFunc` | -| `ccT2F_Quad` | `T2F_Quad` | -| `ccAnimationFrameData` | `AnimationFrameData` | + | v2.1 struct names | v3.0 struct names | + | ccColor3B | Color3B | + | ccColor4B | Color4B | + | ccColor4F | Color4F | + | ccVertex2F | Vertex2F | + | ccVertex3F | Vertex3F | + | ccTex2F | Tex2F | + | ccPointSprite | PointSprite | + | ccQuad2 | Quad2 | + | ccQuad3 | Quad3 | + | ccV2F_C4B_T2F | V2F_C4B_T2F | + | ccV2F_C4F_T2F | V2F_C4F_T2F | + | ccV3F_C4B_T2F | V3F_C4B_T2F | + | ccV2F_C4B_T2F_Triangle | V2F_C4B_T2F_Triangle | + | ccV2F_C4B_T2F_Quad | V2F_C4B_T2F_Quad | + | ccV3F_C4B_T2F_Quad | V3F_C4B_T2F_Quad | + | ccV2F_C4F_T2F_Quad | V2F_C4F_T2F_Quad | + | ccBlendFunc | BlendFunc | + | ccT2F_Quad | T2F_Quad | + | ccAnimationFrameData | AnimationFrameData | Global functions changed example ```c++ @@ -511,89 +513,89 @@ color3B = Color3B::WHITE; ## deprecated functions and global variables -|*old name*|*new name*| -| `ccp` | `Point` | -| `ccpNeg` | `Point::-` | -| `ccpAdd` | `Point::+` | -| `ccpSub` | `Point::-` | -| `ccpMult` | `Point::*` | -| `ccpMidpoint` | `Point::getMidpoint` | -| `ccpDot` | `Point::dot` | -| `ccpCrosss` | `Point::cross` | -| `ccpPerp` | `Point::getPerp` | -| `ccpRPerp` | `Point::getRPerp` | -| `ccpProject` | `Point::project` | -| `ccpRotate` | `Point::rotate` | -| `ccpUnrotate` | `Point::unrotate` | -| `ccpLengthSQ` | `Point::getLengthSq()` | -| `ccpDistanceSQ` | `Point::getDistanceSq` | -| `ccpLength` | `Point::getLength` | -| `ccpDistance` | `Point::getDistance` | -| `ccpNormalize` | `Point::normalize` | -| `ccpForAngle` | `Point::forAngle` | -| `ccpToAngle` | `Point::getAngle` | -| `ccpClamp` | `Point::getClampPoint` | -| `ccpFromSize` | `Point::Point` | -| `ccpCompOp` | `Point::compOp` | -| `ccpLerp` | `Point::lerp` | -| `ccpFuzzyEqual` | `Point::fuzzyEqual` | -| `ccpCompMult` | `Point::Point` | -| `ccpAngleSigned` | `Point::getAngle` | -| `ccpAngle` | `Point::getAngle` | -| `ccpRotateByAngle` | `Point::rotateByAngle` | -| `ccpLineInersect` | `Point::isLineIntersect` | -| `ccpSegmentIntersect` | `Point::isSegmentIntersect` | -| `ccpIntersectPoint` | `Point::getIntersectPoint` | -| `CCPointMake` | `Point::Point` | -| `CCSizeMake` | `Size::Size` | -| `CCRectMake` | `Rect::Rect` | -| `PointZero` | `Point::ZERO` | -| `SizeZero` | `Size::ZERO` | -| `RectZero` | `Rect::ZERO` | -| `TiledGrid3DAction::tile` | `TiledGrid3DAction::getTile` | -| `TiledGrid3DAction::originalTile` | `TiledGrid3DAction::getOriginalTile` | -| `TiledGrid3D::tile` | `TiledGrid3D::getTile` | -| `TiledGrid3D::originalTile` | `TiledGrid3D::getOriginalTile` | -| `Grid3DAction::vertex` | `Grid3DAction::getVertex` | -| `Grid3DAction::originalVertex` | `Grid3DAction::getOriginalVertex` | -| `Grid3D::vertex` | `Grid3D::getVertex` | -| `Grid3D::originalVertex` | `Grid3D::getOriginalVertex` | -| `Configuration::sharedConfiguration` | `Configuration::getInstance` | -| `Configuration::purgeConfiguration` | `Configuration::destroyInstance()` | -| `Director::sharedDirector()` | `Director::getInstance()` | -| `FileUtils::sharedFileUtils` | `FileUtils::getInstance` | -| `FileUtils::purgeFileUtils` | `FileUtils::destroyInstance` | -| `EGLView::sharedOpenGLView` | `EGLView::getInstance` | -| `ShaderCache::sharedShaderCache` | `ShaderCache::getInstance` | -| `ShaderCache::purgeSharedShaderCache` | `ShaderCache::destroyInstance` | -| `AnimationCache::sharedAnimationCache` | `AnimationCache::getInstance` | -| `AnimationCache::purgeSharedAnimationCache` | `AnimationCache::destroyInstance` | -| `SpriteFrameCache::sharedSpriteFrameCache` | `SpriteFrameCache::getInstance` | -| `SpriteFrameCache:: purgeSharedSpriteFrameCache` | `SpriteFrameCache::destroyInstance` | -| `NotificationCenter::sharedNotificationCenter` | `NotificationCenter::getInstance` | -| `NotificationCenter:: purgeNotificationCenter` | `NotificationCenter::destroyInstance` | -| `Profiler::sharedProfiler` | `Profiler::getInstance` | -| `UserDefault::sharedUserDefault` | `UserDefault::getInstance` | -| `UserDefault::purgeSharedUserDefault` | `UserDefault::destroyInstance` | -| `Application::sharedApplication` | `Application::getInstance` | -| `ccc3()` | `Color3B()` | -| `ccc3BEqual()` | `Color3B::equals()` | -| `ccc4()` | `Color4B()` | -| `ccc4FFromccc3B()` | `Color4F()` | -| `ccc4f()` | `Color4F()` | -| `ccc4FFromccc4B()` | `Color4F()` | -| `ccc4BFromccc4F()` | `Color4B()` | -| `ccc4FEqual()` | `Color4F::equals()` | -| `ccWHITE` | `Color3B::WHITE` | -| `ccYELLOW` | `Color3B::YELLOW` | -| `ccBLUE` | `Color3B::BLUE` | -| `ccGREEN` | `Color3B::GREEN` | -| `ccRED` | `Color3B::RED` | -| `ccMAGENTA` | `Color3B::MAGENTA` | -| `ccBLACK` | `Color3B::BLACK` | -| `ccORANGE` | `Color3B::ORANGE` | -| `ccGRAY` | `Color3B::GRAY` | -| `kBlendFuncDisable` | `BlendFunc::BLEND_FUNC_DISABLE` | + | v2.1 names | v3.0 names | + | ccp | Point | + | ccpNeg | Point::- | + | ccpAdd | Point::+ | + | ccpSub | Point::- | + | ccpMult | Point::* | + | ccpMidpoint | Point::getMidpoint | + | ccpDot | Point::dot | + | ccpCrosss | Point::cross | + | ccpPerp | Point::getPerp | + | ccpRPerp | Point::getRPerp | + | ccpProject | Point::project | + | ccpRotate | Point::rotate | + | ccpUnrotate | Point::unrotate | + | ccpLengthSQ | Point::getLengthSq() | + | ccpDistanceSQ | Point::getDistanceSq | + | ccpLength | Point::getLength | + | ccpDistance | Point::getDistance | + | ccpNormalize | Point::normalize | + | ccpForAngle | Point::forAngle | + | ccpToAngle | Point::getAngle | + | ccpClamp | Point::getClampPoint | + | ccpFromSize | Point::Point | + | ccpCompOp | Point::compOp | + | ccpLerp | Point::lerp | + | ccpFuzzyEqual | Point::fuzzyEqual | + | ccpCompMult | Point::Point | + | ccpAngleSigned | Point::getAngle | + | ccpAngle | Point::getAngle | + | ccpRotateByAngle | Point::rotateByAngle | + | ccpLineInersect | Point::isLineIntersect | + | ccpSegmentIntersect | Point::isSegmentIntersect | + | ccpIntersectPoint | Point::getIntersectPoint | + | CCPointMake | Point::Point | + | CCSizeMake | Size::Size | + | CCRectMake | Rect::Rect | + | PointZero | Point::ZERO | + | SizeZero | Size::ZERO | + | RectZero | Rect::ZERO | + | TiledGrid3DAction::tile | TiledGrid3DAction::getTile | + | TiledGrid3DAction::originalTile | TiledGrid3DAction::getOriginalTile | + | TiledGrid3D::tile | TiledGrid3D::getTile | + | TiledGrid3D::originalTile | TiledGrid3D::getOriginalTile | + | Grid3DAction::vertex | Grid3DAction::getVertex | + | Grid3DAction::originalVertex | Grid3DAction::getOriginalVertex | + | Grid3D::vertex | Grid3D::getVertex | + | Grid3D::originalVertex | Grid3D::getOriginalVertex | + | Configuration::sharedConfiguration | Configuration::getInstance | + | Configuration::purgeConfiguration | Configuration::destroyInstance() | + | Director::sharedDirector() | Director::getInstance() | + | FileUtils::sharedFileUtils | FileUtils::getInstance | + | FileUtils::purgeFileUtils | FileUtils::destroyInstance | + | EGLView::sharedOpenGLView | EGLView::getInstance | + | ShaderCache::sharedShaderCache | ShaderCache::getInstance | + | ShaderCache::purgeSharedShaderCache | ShaderCache::destroyInstance | + | AnimationCache::sharedAnimationCache | AnimationCache::getInstance | + | AnimationCache::purgeSharedAnimationCache | AnimationCache::destroyInstance | + | SpriteFrameCache::sharedSpriteFrameCache | SpriteFrameCache::getInstance | + | SpriteFrameCache:: purgeSharedSpriteFrameCache | SpriteFrameCache::destroyInstance | + | NotificationCenter::sharedNotificationCenter | NotificationCenter::getInstance | + | NotificationCenter:: purgeNotificationCenter | NotificationCenter::destroyInstance | + | Profiler::sharedProfiler | Profiler::getInstance | + | UserDefault::sharedUserDefault | UserDefault::getInstance | + | UserDefault::purgeSharedUserDefault | UserDefault::destroyInstance | + | Application::sharedApplication | Application::getInstance | + | ccc3() | Color3B() | + | ccc3BEqual() | Color3B::equals() | + | ccc4() | Color4B() | + | ccc4FFromccc3B() | Color4F() | + | ccc4f() | Color4F() | + | ccc4FFromccc4B() | Color4F() | + | ccc4BFromccc4F() | Color4B() | + | ccc4FEqual() | Color4F::equals() | + | ccWHITE | Color3B::WHITE | + | ccYELLOW | Color3B::YELLOW | + | ccBLUE | Color3B::BLUE | + | ccGREEN | Color3B::GREEN | + | ccRED | Color3B::RED | + | ccMAGENTA | Color3B::MAGENTA | + | ccBLACK | Color3B::BLACK | + | ccORANGE | Color3B::ORANGE | + | ccGRAY | Color3B::GRAY | + | kBlendFuncDisable | BlendFunc::BLEND_FUNC_DISABLE | ## Changes in the Lua bindings @@ -673,3 +675,4 @@ Through the funtions of the LuaBasicConversion file,they can be converted the Lu ## Known issues You can find all the known issues "here":http://www.cocos2d-x.org/projects/native/issues + From 2f4011ab179980c8a77436f134fbc483acd9d12f Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 6 Jan 2014 17:31:47 -0800 Subject: [PATCH 287/428] minor fixes with the information --- docs/RELEASE_NOTES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 6c0acc8777..918d190721 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -51,9 +51,9 @@ # Misc Information -* Download: http://cdn.cocos2d-x.org/cocos2d-x-3.0alpha1.zip -* Full Changelog: https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.0alph1/CHANGELOG -* API Reference: http://www.cocos2d-x.org/reference/native-cpp/V3.0alpha1/index.html +* Download: http://cdn.cocos2d-x.org/cocos2d-x-3.0beta.zip +* Full Changelog: https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.0beta/CHANGELOG +* API Reference: http://www.cocos2d-x.org/reference/native-cpp/V3.0beta/index.html # Requirements From 8cfc6fcafba9ed1ceb956b60f53985cfebdccca5 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Tue, 7 Jan 2014 09:47:46 +0800 Subject: [PATCH 288/428] Remove useless samples --- cocos/gui/UIText.cpp | 3 + .../UIGridViewTest/UIGridViewTest.cpp | 215 ----------- .../UIGridViewTest/UIGridViewTest.h | 56 --- .../UIPickerViewTest/UIPickerViewTest.cpp | 264 ------------- .../UIPickerViewTest/UIPickerViewTest.h | 62 --- .../UIPotentiometerTest.cpp | 80 ---- .../UIPotentiometerTest/UIPotentiometerTest.h | 45 --- .../UIProgressTimerTest.cpp | 362 ------------------ .../UIProgressTimerTest/UIProgressTimerTest.h | 93 ----- .../UISwitchTest/UISwitchTest.cpp | 254 ------------ .../UISwitchTest/UISwitchTest.h | 69 ---- 11 files changed, 3 insertions(+), 1500 deletions(-) delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIGridViewTest/UIGridViewTest.cpp delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIGridViewTest/UIGridViewTest.h delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPickerViewTest/UIPickerViewTest.cpp delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPickerViewTest/UIPickerViewTest.h delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPotentiometerTest/UIPotentiometerTest.cpp delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPotentiometerTest/UIPotentiometerTest.h delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIProgressTimerTest/UIProgressTimerTest.cpp delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIProgressTimerTest/UIProgressTimerTest.h delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISwitchTest/UISwitchTest.cpp delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISwitchTest/UISwitchTest.h diff --git a/cocos/gui/UIText.cpp b/cocos/gui/UIText.cpp index a6f22997bf..c4513e77c8 100644 --- a/cocos/gui/UIText.cpp +++ b/cocos/gui/UIText.cpp @@ -267,6 +267,9 @@ void Text::copySpecialProperties(Widget *widget) setFontSize(label->_labelRenderer->getFontSize()); setText(label->getStringValue()); setTouchScaleChangeEnabled(label->_touchScaleChangeEnabled); + setTextHorizontalAlignment(label->_labelRenderer->getHorizontalAlignment()); + setTextVerticalAlignment(label->_labelRenderer->getVerticalAlignment()); + setTextAreaSize(label->_labelRenderer->getDimensions()); } } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIGridViewTest/UIGridViewTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIGridViewTest/UIGridViewTest.cpp deleted file mode 100644 index d43ea27233..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIGridViewTest/UIGridViewTest.cpp +++ /dev/null @@ -1,215 +0,0 @@ - - -#include "UIGridViewTest.h" - - -// UIGridViewTest_Mode_Column - -UIGridViewTest_Mode_Column::UIGridViewTest_Mode_Column() -{ -} - -UIGridViewTest_Mode_Column::~UIGridViewTest_Mode_Column() -{ -} - -bool UIGridViewTest_Mode_Column::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add a label in which the scrollview alert will be displayed - _displayValueLabel = gui::Label::create(); - _displayValueLabel->setText("Move by vertical direction"); - _displayValueLabel->setFontName("Marker Felt"); - _displayValueLabel->setFontSize(32); - _displayValueLabel->setAnchorPoint(Point(0.5f, -1)); - _displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5)); - _uiLayer->addChild(_displayValueLabel); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Layout is in use with GridView bases on column mode"); - alert->setFontName("Marker Felt"); - alert->setFontSize(20); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5)); - _uiLayer->addChild(alert); - - Layout* root = static_cast(_uiLayer->getChildByTag(81)); - - Layout* background = dynamic_cast(root->getChildByName("background_Panel")); - - // Create the grid view with grid layout mode column - GridView* gridView = GridView::create(); - gridView->setLayoutType(LAYOUT_GRID_MODE_COLUMN); - gridView->setScrollEnabled(true); - gridView->setDirection(SCROLLVIEW_DIR_VERTICAL); - gridView->setBounceEnabled(true); - gridView->setTouchEnabled(true); - gridView->setSize(Size(280, 150)); - Size backgroundSize = background->getSize(); - gridView->setPosition(Point((widgetSize.width - backgroundSize.width) / 2.0f + - (backgroundSize.width - gridView->getSize().width) / 2.0f, - (widgetSize.height - backgroundSize.height) / 2.0f + - (backgroundSize.height - gridView->getSize().height) / 2.0f)); - gridView->addEventListenerScrollView(this, scrollvieweventselector(UIGridViewTest_Mode_Column::selectedChildEvent)); - _uiLayer->addChild(gridView); - - - // create items - int count = 19; - for (int i = 0; i < count; ++i) - { - Button* button = Button::create(); - button->setTouchEnabled(true); - button->loadTextures("cocosgui/button.png", "cocosgui/buttonHighlighted.png", ""); - button->setScale9Enabled(true); - AffineTransform transform = AffineTransformMakeIdentity(); - transform = AffineTransformScale(transform, 3.0f, 1.3f); - button->setSize(SizeApplyAffineTransform(button->getContentSize(), transform)); - button->setTitleText(String::createWithFormat("grid_%d", i)->getCString()); - - Layout* item = Layout::create(); - item->setTouchEnabled(true); - item->setSize(button->getSize()); - button->setPosition(Point(item->getSize().width / 2.0f, item->getSize().height / 2.0f)); - item->addChild(button); - - gridView->addChild(item); - } - - // set grid view row and column - Widget* item = static_cast(gridView->getChildren().at(0)); - int rowCount = gridView->getSize().height / item->getSize().height; - int columnCount = gridView->getSize().width / item->getSize().width; - gridView->setGridLayoutRowAndColumnCount(rowCount, columnCount); - - return true; - } - - return false; -} - -void UIGridViewTest_Mode_Column::selectedChildEvent(Object *pSender, ScrollviewEventType type) -{ - switch (type) - { - case SCROLLVIEW_EVENT_SELECT_CHILD: - { - GridView* gridView = static_cast(pSender); - CCLOG("select child index = %d", gridView->getSelectedChildIndex()); - } - break; - - default: - break; - } -} - - -// UIGridViewTest_Mode_Row - -UIGridViewTest_Mode_Row::UIGridViewTest_Mode_Row() -{ -} - -UIGridViewTest_Mode_Row::~UIGridViewTest_Mode_Row() -{ -} - -bool UIGridViewTest_Mode_Row::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add a label in which the scrollview alert will be displayed - _displayValueLabel = gui::Label::create(); - _displayValueLabel->setText("Move by horizontal direction"); - _displayValueLabel->setFontName("Marker Felt"); - _displayValueLabel->setFontSize(32); - _displayValueLabel->setAnchorPoint(Point(0.5f, -1)); - _displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5)); - _uiLayer->addChild(_displayValueLabel); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Layout is in use with GridView bases on row mode"); - alert->setFontName("Marker Felt"); - alert->setFontSize(20); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5)); - _uiLayer->addChild(alert); - - Layout* root = static_cast(_uiLayer->getChildByTag(81)); - - Layout* background = dynamic_cast(root->getChildByName("background_Panel")); - - // Create the scroll grid with grid layout mode row - GridView* gridView = GridView::create(); - gridView->setLayoutType(LAYOUT_GRID_MODE_ROW); - gridView->setScrollEnabled(true); - gridView->setDirection(SCROLLVIEW_DIR_HORIZONTAL); - gridView->setBounceEnabled(true); - gridView->setTouchEnabled(true); - gridView->setSize(Size(280, 150)); - Size backgroundSize = background->getSize(); - gridView->setPosition(Point((widgetSize.width - backgroundSize.width) / 2.0f + - (backgroundSize.width - gridView->getSize().width) / 2.0f, - (widgetSize.height - backgroundSize.height) / 2.0f + - (backgroundSize.height - gridView->getSize().height) / 2.0f)); - gridView->addEventListenerScrollView(this, scrollvieweventselector(UIGridViewTest_Mode_Row::selectedChildEvent)); - _uiLayer->addChild(gridView); - - - // create items - int count = 19; - for (int i = 0; i < count; ++i) - { - Button* button = Button::create(); - button->setTouchEnabled(true); - button->loadTextures("cocosgui/button.png", "cocosgui/buttonHighlighted.png", ""); - button->setScale9Enabled(true); - AffineTransform transform = AffineTransformMakeIdentity(); - transform = AffineTransformScale(transform, 3.0f, 1.3f); - button->setSize(SizeApplyAffineTransform(button->getContentSize(), transform)); - button->setTitleText(String::createWithFormat("grid_%d", i)->getCString()); - - Layout* item = Layout::create(); - item->setTouchEnabled(true); - item->setSize(button->getSize()); - button->setPosition(Point(item->getSize().width / 2.0f, item->getSize().height / 2.0f)); - item->addChild(button); - - gridView->addChild(item); - } - - // set grid view row and column - Widget* item = static_cast(gridView->getChildren().at(0)); - int rowCount = gridView->getSize().height / item->getSize().height; - int columnCount = gridView->getSize().width / item->getSize().width; - gridView->setGridLayoutRowAndColumnCount(rowCount, columnCount); - - return true; - } - - return false; -} - -void UIGridViewTest_Mode_Row::selectedChildEvent(Object *pSender, ScrollviewEventType type) -{ - switch (type) - { - case SCROLLVIEW_EVENT_SELECT_CHILD: - { - GridView* gridView = static_cast(pSender); - CCLOG("select child index = %d", gridView->getSelectedChildIndex()); - } - break; - - default: - break; - } -} diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIGridViewTest/UIGridViewTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIGridViewTest/UIGridViewTest.h deleted file mode 100644 index 4b16afba30..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIGridViewTest/UIGridViewTest.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __TestCpp__UIGridViewTest__ -#define __TestCpp__UIGridViewTest__ - -#include "../UIScene.h" - -class UIGridViewTest_Mode_Column : public UIScene -{ -public: - UIGridViewTest_Mode_Column(); - ~UIGridViewTest_Mode_Column(); - bool init(); - void selectedChildEvent(Object* pSender, ScrollviewEventType type); - -protected: - UI_SCENE_CREATE_FUNC(UIGridViewTest_Mode_Column) - gui::Label* _displayValueLabel; -}; - -class UIGridViewTest_Mode_Row : public UIScene -{ -public: - UIGridViewTest_Mode_Row(); - ~UIGridViewTest_Mode_Row(); - bool init(); - void selectedChildEvent(Object* pSender, ScrollviewEventType type); - -protected: - UI_SCENE_CREATE_FUNC(UIGridViewTest_Mode_Row) - gui::Label* _displayValueLabel; -}; - -#endif /* defined(__TestCpp__UIGridViewTest__) */ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPickerViewTest/UIPickerViewTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPickerViewTest/UIPickerViewTest.cpp deleted file mode 100644 index 53ec3758f2..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPickerViewTest/UIPickerViewTest.cpp +++ /dev/null @@ -1,264 +0,0 @@ - - -#include "UIPickerViewTest.h" - -// UIPickerViewTest_Vertical - -UIPickerViewTest_Vertical::UIPickerViewTest_Vertical() -{ - -} - -UIPickerViewTest_Vertical::~UIPickerViewTest_Vertical() -{ - CC_SAFE_RELEASE(m_array); -} - -bool UIPickerViewTest_Vertical::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - m_pDisplayValueLabel = gui::Label::create(); - m_pDisplayValueLabel->setText("Move by vertical direction"); - m_pDisplayValueLabel->setFontName("Marker Felt"); - m_pDisplayValueLabel->setFontSize(32); - m_pDisplayValueLabel->setAnchorPoint(Point(0.5f, -1)); - m_pDisplayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + m_pDisplayValueLabel->getContentSize().height * 1.5)); - _uiLayer->addChild(m_pDisplayValueLabel); - - - gui::Label* alert = gui::Label::create(); - alert->setText("PickerView vertical"); - alert->setFontName("Marker Felt"); - alert->setFontSize(30); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075)); - _uiLayer->addChild(alert); - - Layout* root = static_cast(_uiLayer->getChildByTag(81)); - - Layout* background = dynamic_cast(root->getChildByName("background_Panel")); - Size backgroundSize = background->getContentSize(); - - - // create picker view data - m_array = __Array::create(); - CC_SAFE_RETAIN(m_array); - for (int i = 0; i < 20; ++i) - { - String* ccstr = String::createWithFormat("pickerview_%d", i); - m_array->addObject(ccstr); - } - - - // Create the picker view - PickerView* pickerView = PickerView::create(); - // set picker view direction - pickerView->setDirection(SCROLLVIEW_DIR_VERTICAL); - pickerView->setTouchEnabled(true); - pickerView->setBounceEnabled(true); - pickerView->setBackGroundImage("cocosgui/yellow_edit.png"); - pickerView->setBackGroundImageScale9Enabled(true); - pickerView->setSize(Size(240, 150)); - pickerView->setPosition(Point((widgetSize.width - backgroundSize.width) / 2 + - (backgroundSize.width - pickerView->getSize().width) / 2, - (widgetSize.height - backgroundSize.height) / 2 + - (backgroundSize.height - pickerView->getSize().height) / 2)); - pickerView->addEventListenerScrollView(this, scrollvieweventselector(UIPickerViewTest_Vertical::selectedItemEvent)); - pickerView->addEventListenerPickerView(this, pickervieweventselector(UIPickerViewTest_Vertical::pickItemEvent)); - _uiLayer->addChild(pickerView); - - int count = m_array->count(); - pickerView->setItemCountInContainerWithOddNumber(count / 5); - - for (int i = 0; i < count; ++i) - { - Button* button = Button::create(); - button->loadTextures("cocosgui/orange_edit.png", "cocosgui/orange_edit.png", ""); - button->setScale9Enabled(true); - button->setSize(Size(100, - pickerView->getSize().height / pickerView->getItemCountInContainerWithOddNumber())); - button->setTitleText(static_cast(m_array->getObjectAtIndex(i))->getCString()); - - pickerView->addChild(button); - } - - // create picker render of picker view - Button* button_0 = static_cast(pickerView->getChildren().at(0)); - pickerView->loadPickerTexture("cocosgui/green_edit.png"); - Scale9Sprite* pickerRender = pickerView->getPickerRender(); - pickerRender->setOpacity(pickerView->getOpacity() / 3); - pickerRender->setPreferredSize(Size(pickerView->getSize().width, button_0->getSize().height)); - - return true; - } - - return false; -} - -void UIPickerViewTest_Vertical::selectedItemEvent(Object *pSender, ScrollviewEventType type) -{ - switch (type) - { - case SCROLLVIEW_EVENT_SELECT_CHILD: - { - PickerView* pickerView = static_cast(pSender); - CCLOG("select child index = %d", pickerView->getSelectedChildIndex()); - } - break; - - default: - break; - } -} - -void UIPickerViewTest_Vertical::pickItemEvent(Object *pSender, PickerViewEventType type) -{ - switch (type) - { - case PICKERVIEW_EVENT_PICK_ITEM: - { - PickerView* pickerView = static_cast(pSender); - CCLOG("picker view pick index = %d", pickerView->getPickIndex()); - } - break; - - default: - break; - } -} - -// UIPickerViewTest_Horizontal - -UIPickerViewTest_Horizontal::UIPickerViewTest_Horizontal() -{ - -} - -UIPickerViewTest_Horizontal::~UIPickerViewTest_Horizontal() -{ - CC_SAFE_RELEASE(m_array); -} - -bool UIPickerViewTest_Horizontal::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - m_pDisplayValueLabel = gui::Label::create(); - m_pDisplayValueLabel->setText("Move by horizontal direction"); - m_pDisplayValueLabel->setFontName("Marker Felt"); - m_pDisplayValueLabel->setFontSize(32); - m_pDisplayValueLabel->setAnchorPoint(Point(0.5f, -1)); - m_pDisplayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + m_pDisplayValueLabel->getContentSize().height * 1.5)); - _uiLayer->addChild(m_pDisplayValueLabel); - - - gui::Label* alert = gui::Label::create(); - alert->setText("PickerView horizontal"); - alert->setFontName("Marker Felt"); - alert->setFontSize(30); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075)); - _uiLayer->addChild(alert); - - Layout* root = static_cast(_uiLayer->getChildByTag(81)); - - Layout* background = dynamic_cast(root->getChildByName("background_Panel")); - Size backgroundSize = background->getContentSize(); - - - // create picker view data - m_array = __Array::create(); - CC_SAFE_RETAIN(m_array); - for (int i = 0; i < 20; ++i) - { - String* ccstr = String::createWithFormat("PCKER%d", i); - m_array->addObject(ccstr); - } - const char* title_0 = static_cast(m_array->getObjectAtIndex(0))->getCString(); - - - // Create the picker view - PickerView* pickerView = PickerView::create(); - // set picker view direction - pickerView->setDirection(SCROLLVIEW_DIR_HORIZONTAL); - pickerView->setTouchEnabled(true); - pickerView->setBounceEnabled(true); - pickerView->setBackGroundImage("cocosgui/yellow_edit.png"); - pickerView->setBackGroundImageScale9Enabled(true); - pickerView->setSize(Size(240, 150)); - pickerView->setPosition(Point((widgetSize.width - backgroundSize.width) / 2 + - (backgroundSize.width - pickerView->getSize().width) / 2, - (widgetSize.height - backgroundSize.height) / 2 + - (backgroundSize.height - pickerView->getSize().height) / 2)); - pickerView->addEventListenerScrollView(this, scrollvieweventselector(UIPickerViewTest_Horizontal::selectedItemEvent)); - pickerView->addEventListenerPickerView(this, pickervieweventselector(UIPickerViewTest_Horizontal::pickItemEvent)); - _uiLayer->addChild(pickerView); - - int count = m_array->count(); - pickerView->setItemCountInContainerWithOddNumber(count / 4); - - for (int i = 0; i < count; ++i) - { - Button* button = Button::create(); - button->loadTextures("cocosgui/orange_edit.png", "cocosgui/orange_edit.png", ""); - button->setScale9Enabled(true); - button->setSize(Size(pickerView->getSize().width / pickerView->getItemCountInContainerWithOddNumber(), - 120)); - button->setTitleText(static_cast(m_array->getObjectAtIndex(i))->getCString()); - button->setTitleDimension(Size(button->getTitleFontSize(), - button->getTitleFontSize() * (strlen(title_0) * 2))); - button->setTitleHorizontalAlignment(TextHAlignment::CENTER); - button->setTitleVerticalAlignment(TextVAlignment::CENTER); - - pickerView->addChild(button); - } - - // create picker render of picker view - Button* button_0 = static_cast(pickerView->getChildren().at(0)); - pickerView->loadPickerTexture("cocosgui/green_edit.png"); - Scale9Sprite* pickerRender = pickerView->getPickerRender(); - pickerRender->setOpacity(pickerView->getOpacity() / 3); - pickerRender->setPreferredSize(Size(button_0->getSize().width, pickerView->getSize().height)); - - return true; - } - - return false; -} - -void UIPickerViewTest_Horizontal::selectedItemEvent(Object *pSender, ScrollviewEventType type) -{ - switch (type) - { - case SCROLLVIEW_EVENT_SELECT_CHILD: - { - PickerView* pickerView = static_cast(pSender); - CCLOG("select child index = %d", pickerView->getSelectedChildIndex()); - } - break; - - default: - break; - } -} - -void UIPickerViewTest_Horizontal::pickItemEvent(Object *pSender, PickerViewEventType type) -{ - switch (type) - { - case PICKERVIEW_EVENT_PICK_ITEM: - { - PickerView* pickerView = static_cast(pSender); - CCLOG("picker view pick index = %d", pickerView->getPickIndex()); - } - break; - - default: - break; - } -} diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPickerViewTest/UIPickerViewTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPickerViewTest/UIPickerViewTest.h deleted file mode 100644 index 10c47aed5d..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPickerViewTest/UIPickerViewTest.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __TestCpp__UIPickViewTest__ -#define __TestCpp__UIPickViewTest__ - -#include "../UIScene.h" - -class UIPickerViewTest_Vertical : public UIScene -{ -public: - UIPickerViewTest_Vertical(); - ~UIPickerViewTest_Vertical(); - bool init(); - void selectedItemEvent(Object* pSender, ScrollviewEventType type); - void pickItemEvent(Object* pSender, PickerViewEventType type); - -protected: - UI_SCENE_CREATE_FUNC(UIPickerViewTest_Vertical) - gui::Label* m_pDisplayValueLabel; - - __Array* m_array; -}; - -class UIPickerViewTest_Horizontal : public UIScene -{ -public: - UIPickerViewTest_Horizontal(); - ~UIPickerViewTest_Horizontal(); - bool init(); - void selectedItemEvent(Object* pSender, ScrollviewEventType type); - void pickItemEvent(Object* pSender, PickerViewEventType type); - -protected: - UI_SCENE_CREATE_FUNC(UIPickerViewTest_Horizontal) - gui::Label* m_pDisplayValueLabel; - - __Array* m_array; -}; - -#endif /* defined(__TestCpp__UIPickViewTest__) */ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPotentiometerTest/UIPotentiometerTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPotentiometerTest/UIPotentiometerTest.cpp deleted file mode 100644 index b94b81e613..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPotentiometerTest/UIPotentiometerTest.cpp +++ /dev/null @@ -1,80 +0,0 @@ - - -#include "UIPotentiometerTest.h" - -// UIPotentiometerTest -UIPotentiometerTest::UIPotentiometerTest() -: _displayValueLabel(NULL) -{ -} - -UIPotentiometerTest::~UIPotentiometerTest() -{ -} - -bool UIPotentiometerTest::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add a label in which the button events will be displayed - _displayValueLabel = gui::Label::create(); - _displayValueLabel->setText("No Event"); - _displayValueLabel->setFontName("Marker Felt"); - _displayValueLabel->setFontSize(32); - _displayValueLabel->setAnchorPoint(Point(0.5f, -1)); - _displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height / 3)); - _uiLayer->addChild(_displayValueLabel); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Potentiometer"); - alert->setFontName("Marker Felt"); - alert->setFontSize(30); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2)); - _uiLayer->addChild(alert); - - // Create the potentiometer - Potentiometer *potentiometer = Potentiometer::create(); - potentiometer->setTouchEnabled(true); - potentiometer->loadTexture("cocosgui/potentiometerTrack.png", "cocosgui/potentiometerProgress.png", "cocosgui/potentiometerButton.png"); - potentiometer->setPosition(Point(widgetSize.width / 2 - potentiometer->getSize().width, widgetSize.height / 2)); - potentiometer->addEventListenerPotentiometer(this, potentiometervaluechangedselector(UIPotentiometerTest::valueChangedEvent)); - - _uiLayer->addChild(potentiometer); - - - // Create the potentiometer with allow min and max value - Potentiometer *potentiometerAllow = Potentiometer::create(); - potentiometerAllow->setTouchEnabled(true); - potentiometerAllow->loadTexture("cocosgui/potentiometerTrack.png", "cocosgui/potentiometerProgress.png", "cocosgui/potentiometerButton.png"); - potentiometerAllow->setPosition(Point(widgetSize.width / 2 + potentiometerAllow->getSize().width, widgetSize.height / 2)); - potentiometerAllow->addEventListenerPotentiometer(this, potentiometervaluechangedselector(UIPotentiometerTest::valueChangedEvent)); - - potentiometerAllow->setMinimumAllowValue(0.3); - potentiometerAllow->setMaximumAllowValue(0.7); - potentiometerAllow->setValue(0.3); - - _uiLayer->addChild(potentiometerAllow); - - return true; - } - return false; -} - -void UIPotentiometerTest::valueChangedEvent(Object *pSender, PotentiometerEventType type) -{ - Potentiometer* potentiometer = static_cast(pSender); - - switch (type) - { - case POTENTIOMETER_EVENT_VALUECHANGED: - _displayValueLabel->setText(CCString::createWithFormat("%.02f", potentiometer->getValue())->getCString()); - break; - - default: - break; - } -} diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPotentiometerTest/UIPotentiometerTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPotentiometerTest/UIPotentiometerTest.h deleted file mode 100644 index c4f7b329d2..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPotentiometerTest/UIPotentiometerTest.h +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __TestCpp__UIPotentiometerTest__ -#define __TestCpp__UIPotentiometerTest__ - -#include "../UIScene.h" - -class UIPotentiometerTest : public UIScene -{ -public: - UIPotentiometerTest(); - ~UIPotentiometerTest(); - bool init(); - void valueChangedEvent(Object* pSender, PotentiometerEventType type); - - -protected: - UI_SCENE_CREATE_FUNC(UIPotentiometerTest) - gui::Label* _displayValueLabel; -}; - - -#endif /* defined(__TestCpp__UIPotentiometerTest__) */ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIProgressTimerTest/UIProgressTimerTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIProgressTimerTest/UIProgressTimerTest.cpp deleted file mode 100644 index 9ec70b7f0b..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIProgressTimerTest/UIProgressTimerTest.cpp +++ /dev/null @@ -1,362 +0,0 @@ - - -#include "UIProgressTimerTest.h" - -// UIProgressTimerTest_Radial -bool UIProgressTimerTest_Radial::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Progress Timer Radial"); - alert->setFontName("Marker Felt"); - alert->setFontSize(30); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); - _uiLayer->addChild(alert); - - // Create the progress timer - ProgressTo* to1 = ProgressTo::create(2.0f, 100.0f); - ProgressTo* to2 = ProgressTo::create(2.0f, 100.0f); - - gui::ProgressTimer* left = gui::ProgressTimer::create(); - left->loadTexture("cocosgui/potentiometerProgress.png"); - left->setPosition(Point(widgetSize.width / 2.0f - left->getSize().width * 0.75f, widgetSize.height / 2.0f + left->getSize().height / 6.0f)); - left->setType(cocos2d::ProgressTimer::Type::RADIAL); - left->getVirtualRenderer()->runAction(RepeatForever::create(to1)); - _uiLayer->addChild(left); - - gui::ProgressTimer* right = gui::ProgressTimer::create(); - right->loadTexture("cocosgui/potentiometerProgress.png"); - right->setPosition(Point(widgetSize.width / 2.0f + right->getSize().width * 0.75f, widgetSize.height / 2.0f + right->getSize().height / 6.0f)); - right->setType(cocos2d::ProgressTimer::Type::RADIAL); - // Makes the ridial CCW - right->setReverseProgress(true); - right->getVirtualRenderer()->runAction(RepeatForever::create(to2)); - _uiLayer->addChild(right); - - return true; - } - return false; -} - -// UIProgressTimerTest_Horizontal -bool UIProgressTimerTest_Horizontal::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Progress Timer Horizontal"); - alert->setFontName("Marker Felt"); - alert->setFontSize(26); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.125f)); - _uiLayer->addChild(alert); - - // Create the progress timer - ProgressTo* to1 = ProgressTo::create(2.0f, 100.0f); - ProgressTo* to2 = ProgressTo::create(2.0f, 100.0f); - - gui::ProgressTimer* left = gui::ProgressTimer::create(); - left->loadTexture("cocosgui/potentiometerProgress.png"); - left->setPosition(Point(widgetSize.width / 2.0f - left->getSize().width * 0.75f, widgetSize.height / 2.0f + left->getSize().height / 6.0f)); - left->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the left since the midpoint is 0 for the x - left->setMidPoint(Point(0, 0)); - // Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change - left->setBarChangeRate(Point(1, 0)); - left->getVirtualRenderer()->runAction(RepeatForever::create(to1)); - _uiLayer->addChild(left); - - gui::ProgressTimer* right = gui::ProgressTimer::create(); - right->loadTexture("cocosgui/potentiometerProgress.png"); - right->setPosition(Point(widgetSize.width / 2.0f + right->getSize().width * 0.75f, widgetSize.height / 2.0f + right->getSize().height / 6.0f)); - right->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the left since the midpoint is 1 for the x - right->setMidPoint(Point(1, 0)); - // Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change - right->setBarChangeRate(Point(1, 0)); - right->getVirtualRenderer()->runAction(RepeatForever::create(to2)); - _uiLayer->addChild(right); - - return true; - } - return false; -} - -// UIProgressTimerTest_Vertical -bool UIProgressTimerTest_Vertical::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Progress Timer Vertical"); - alert->setFontName("Marker Felt"); - alert->setFontSize(26); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.125f)); - _uiLayer->addChild(alert); - - // Create the progress timer - ProgressTo* to1 = ProgressTo::create(2.0f, 100.0f); - ProgressTo* to2 = ProgressTo::create(2.0f, 100.0f); - - gui::ProgressTimer* left = gui::ProgressTimer::create(); - left->loadTexture("cocosgui/potentiometerProgress.png"); - left->setPosition(Point(widgetSize.width / 2.0f - left->getSize().width * 0.75f, widgetSize.height / 2.0f + left->getSize().height / 6.0f)); - left->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the bottom since the midpoint is 0 for the y - left->setMidPoint(Point(0, 0)); - // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - left->setBarChangeRate(Point(0, 1)); - left->getVirtualRenderer()->runAction(RepeatForever::create(to1)); - _uiLayer->addChild(left); - - gui::ProgressTimer* right = gui::ProgressTimer::create(); - right->loadTexture("cocosgui/potentiometerProgress.png"); - right->setPosition(Point(widgetSize.width / 2.0f + right->getSize().width * 0.75f, widgetSize.height / 2.0f + right->getSize().height / 6.0f)); - right->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the bottom since the midpoint is 0 for the y - right->setMidPoint(Point(0, 1)); - // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - right->setBarChangeRate(Point(0, 1)); - right->getVirtualRenderer()->runAction(RepeatForever::create(to2)); - _uiLayer->addChild(right); - - return true; - } - return false; -} - -// UIProgressTimerTest_RadialMidpointChanged -bool UIProgressTimerTest_RadialMidpointChanged::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Progress Timer Radial Midpoint Changed"); - alert->setFontName("Marker Felt"); - alert->setFontSize(17); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.325f)); - _uiLayer->addChild(alert); - - // Create the progress timer - ProgressTo* action = ProgressTo::create(2.0f, 100.0f); - - gui::ProgressTimer* left = gui::ProgressTimer::create(); - left->loadTexture("cocosgui/potentiometerProgress.png"); - left->setPosition(Point(widgetSize.width / 2.0f - left->getSize().width * 0.75f, widgetSize.height / 2.0f + left->getSize().height / 6.0f)); - left->setType(cocos2d::ProgressTimer::Type::RADIAL); - left->setMidPoint(Point(0.25f, 0.75f)); - left->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)action->clone())); - _uiLayer->addChild(left); - - gui::ProgressTimer* right = gui::ProgressTimer::create(); - right->loadTexture("cocosgui/potentiometerProgress.png"); - right->setPosition(Point(widgetSize.width / 2.0f + right->getSize().width * 0.75f, widgetSize.height / 2.0f + right->getSize().height / 6.0f)); - right->setType(cocos2d::ProgressTimer::Type::RADIAL); - right->setMidPoint(Point(0.75f, 0.25f)); - right->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)action->clone())); - _uiLayer->addChild(right); - - return true; - } - return false; -} - -// UIProgressTimerTest_BarVarious -bool UIProgressTimerTest_BarVarious::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Progress Timer Bar Various"); - alert->setFontName("Marker Felt"); - alert->setFontSize(26); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.125f)); - _uiLayer->addChild(alert); - - // Create the progress timer - ProgressTo* to = ProgressTo::create(2.0f, 100.0f); - - gui::ProgressTimer* left = gui::ProgressTimer::create(); - left->loadTexture("cocosgui/potentiometerProgress.png"); - left->setPosition(Point(widgetSize.width / 2.0f - left->getSize().width * 1.1, widgetSize.height / 2.0f + left->getSize().height / 6.0f)); - left->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the bottom since the midpoint is 0 for the y - left->setMidPoint(Point(0.5f, 0.5f)); - // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - left->setBarChangeRate(Point(1, 0)); - left->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)to->clone())); - _uiLayer->addChild(left); - - gui::ProgressTimer* middle = gui::ProgressTimer::create(); - middle->loadTexture("cocosgui/potentiometerProgress.png"); - middle->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + middle->getSize().height / 6.0f)); - middle->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the bottom since the midpoint is 0 for the y - middle->setMidPoint(Point(0.5f, 0.5f)); - // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - middle->setBarChangeRate(Point(1, 1)); - middle->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)to->clone())); - _uiLayer->addChild(middle); - - gui::ProgressTimer* right = gui::ProgressTimer::create(); - right->loadTexture("cocosgui/potentiometerProgress.png"); - right->setPosition(Point(widgetSize.width / 2.0f + right->getSize().width * 1.1, widgetSize.height / 2.0f + right->getSize().height / 6.0f)); - right->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the bottom since the midpoint is 0 for the y - right->setMidPoint(Point(0.5f, 0.5f)); - // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - right->setBarChangeRate(Point(0, 1)); - right->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)to->clone())); - _uiLayer->addChild(right); - - return true; - } - return false; -} - -// UIProgressTimerTest_BarTintAndFade -bool UIProgressTimerTest_BarTintAndFade::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Progress Timer Bar Tint and Fade"); - alert->setFontName("Marker Felt"); - alert->setFontSize(20); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.725f)); - _uiLayer->addChild(alert); - - // Create the progress timer - ProgressTo* to = ProgressTo::create(6, 100.0f); - Action* tint = Sequence::create(TintTo::create(1, 255, 0, 0), - TintTo::create(1, 0, 255, 0), - TintTo::create(1, 0, 0, 255), - NULL); - Action* fade = Sequence::create(FadeTo::create(1.0f, 0), - FadeTo::create(1.0f, 255), - NULL); - - gui::ProgressTimer* left = gui::ProgressTimer::create(); - left->loadTexture("cocosgui/potentiometerProgress.png"); - left->setPosition(Point(widgetSize.width / 2.0f - left->getSize().width * 1.1, widgetSize.height / 2.0f + left->getSize().height / 6.0f)); - left->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the bottom since the midpoint is 0 for the y - left->setMidPoint(Point(0.5f, 0.5f)); - // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - left->setBarChangeRate(Point(1, 0)); - left->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)to->clone())); - left->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)tint->clone())); - _uiLayer->addChild(left); - - gui::ProgressTimer* middle = gui::ProgressTimer::create(); - middle->loadTexture("cocosgui/potentiometerProgress.png"); - middle->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + middle->getSize().height / 6.0f)); - middle->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the bottom since the midpoint is 0 for the y - middle->setMidPoint(Point(0.5f, 0.5f)); - // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - middle->setBarChangeRate(Point(1, 1)); - middle->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)to->clone())); - middle->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)fade->clone())); - _uiLayer->addChild(middle); - - gui::ProgressTimer* right = gui::ProgressTimer::create(); - right->loadTexture("cocosgui/potentiometerProgress.png"); - right->setPosition(Point(widgetSize.width / 2.0f + right->getSize().width * 1.1, widgetSize.height / 2.0f + right->getSize().height / 6.0f)); - right->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the bottom since the midpoint is 0 for the y - right->setMidPoint(Point(0.5f, 0.5f)); - // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - right->setBarChangeRate(Point(0, 1)); - right->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)to->clone())); - right->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)tint->clone())); - right->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)fade->clone())); - _uiLayer->addChild(right); - - return true; - } - return false; -} - -// UIProgressTimerTest_WithSpriteFrame -bool UIProgressTimerTest_WithSpriteFrame::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Progress Timer with SpriteFrame"); - alert->setFontName("Marker Felt"); - alert->setFontSize(20); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.725f)); - _uiLayer->addChild(alert); - - // Create the progress timer - ProgressTo* to = ProgressTo::create(6, 100.0f); - - SpriteFrameCache::getInstance()->addSpriteFramesWithFile("zwoptex/grossini.plist"); - - gui::ProgressTimer* left = gui::ProgressTimer::create(); - left->loadTexture("grossini_dance_01.png", UI_TEX_TYPE_PLIST); - left->setPosition(Point(widgetSize.width / 2.0f - left->getSize().width * 2.0f, widgetSize.height / 2.0f + left->getSize().height / 6.0f)); - left->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the bottom since the midpoint is 0 for the y - left->setMidPoint(Point(0.5f, 0.5f)); - // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - left->setBarChangeRate(Point(1, 0)); - left->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)to->clone())); - _uiLayer->addChild(left); - - gui::ProgressTimer* middle = gui::ProgressTimer::create(); - middle->loadTexture("grossini_dance_04.png", UI_TEX_TYPE_PLIST); - middle->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + middle->getSize().height / 6.0f)); - middle->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the bottom since the midpoint is 0 for the y - middle->setMidPoint(Point(0.5f, 0.5f)); - // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - middle->setBarChangeRate(Point(1, 1)); - middle->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)to->clone())); - _uiLayer->addChild(middle); - - gui::ProgressTimer* right = gui::ProgressTimer::create(); - right->loadTexture("grossini_dance_03.png", UI_TEX_TYPE_PLIST); - right->setPosition(Point(widgetSize.width / 2.0f + right->getSize().width * 2.0f, widgetSize.height / 2.0f + right->getSize().height / 6.0f)); - right->setType(cocos2d::ProgressTimer::Type::BAR); - // Setup for a bar starting from the bottom since the midpoint is 0 for the y - right->setMidPoint(Point(0.5f, 0.5f)); - // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - right->setBarChangeRate(Point(0, 1)); - right->getVirtualRenderer()->runAction(RepeatForever::create((ActionInterval *)to->clone())); - _uiLayer->addChild(right); - - return true; - } - return false; -} diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIProgressTimerTest/UIProgressTimerTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIProgressTimerTest/UIProgressTimerTest.h deleted file mode 100644 index b13d9796b1..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIProgressTimerTest/UIProgressTimerTest.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __TestCpp__UIProgressTimerTest__ -#define __TestCpp__UIProgressTimerTest__ - -#include "../UIScene.h" - -class UIProgressTimerTest_Radial : public UIScene -{ -public: - bool init(); - -protected: - UI_SCENE_CREATE_FUNC(UIProgressTimerTest_Radial) -}; - -class UIProgressTimerTest_Horizontal : public UIScene -{ -public: - bool init(); - -protected: - UI_SCENE_CREATE_FUNC(UIProgressTimerTest_Horizontal) -}; - -class UIProgressTimerTest_Vertical : public UIScene -{ -public: - bool init(); - -protected: - UI_SCENE_CREATE_FUNC(UIProgressTimerTest_Vertical) -}; - -class UIProgressTimerTest_RadialMidpointChanged : public UIScene -{ -public: - bool init(); - -protected: - UI_SCENE_CREATE_FUNC(UIProgressTimerTest_RadialMidpointChanged) -}; - -class UIProgressTimerTest_BarVarious : public UIScene -{ -public: - bool init(); - -protected: - UI_SCENE_CREATE_FUNC(UIProgressTimerTest_BarVarious) -}; - -class UIProgressTimerTest_BarTintAndFade : public UIScene -{ -public: - bool init(); - -protected: - UI_SCENE_CREATE_FUNC(UIProgressTimerTest_BarTintAndFade) -}; - -class UIProgressTimerTest_WithSpriteFrame : public UIScene -{ -public: - bool init(); - -protected: - UI_SCENE_CREATE_FUNC(UIProgressTimerTest_WithSpriteFrame) -}; - -#endif /* defined(__TestCpp__UIProgressTimerTest__) */ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISwitchTest/UISwitchTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISwitchTest/UISwitchTest.cpp deleted file mode 100644 index 6b5483486b..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISwitchTest/UISwitchTest.cpp +++ /dev/null @@ -1,254 +0,0 @@ - - -#include "UISwitchTest.h" - -// UISwitchTest_Horizontal -UISwitchTest_Horizontal::UISwitchTest_Horizontal() -{ -} - -UISwitchTest_Horizontal::~UISwitchTest_Horizontal() -{ -} - -bool UISwitchTest_Horizontal::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add a label in which the switch events will be displayed - _displayValueLabel = gui::Label::create(); - _displayValueLabel->setText("No Event"); - _displayValueLabel->setFontName("Marker Felt"); - _displayValueLabel->setFontSize(32); - _displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f)); - _displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - _uiLayer->addChild(_displayValueLabel); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Switch Horizontal"); - alert->setFontName("Marker Felt"); - alert->setFontSize(30); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); - _uiLayer->addChild(alert); - - // Create the switch - Switch* pSwitch = Switch::create(); - pSwitch->setTouchEnabled(true); - pSwitch->loadTextures("cocosgui/switch-mask.png", "cocosgui/switch-on.png", "cocosgui/switch-off.png", "cocosgui/switch-thumb.png"); - pSwitch->setOnTitleText("On"); - pSwitch->setOffTitleText("Off"); - pSwitch->setOnTitleFontName("Arial-BoldMT"); - pSwitch->setOnTitleFontSize(16); - pSwitch->setOffTitleFontName("Arial-BoldMT"); - pSwitch->setOffTitleFontSize(16); - Size switchSize = pSwitch->getSize(); - pSwitch->setPosition(Point((widgetSize.width - switchSize.width) / 2.0f, (widgetSize.height - switchSize.height) / 2.0f)); - pSwitch->addEventListenerSwitch(this, switchselector(UISwitchTest_Horizontal::switchEvent)); - _uiLayer->addChild(pSwitch); - - return true; - } - return false; -} - -void UISwitchTest_Horizontal::switchEvent(Object *pSender, SwitchEventType type) -{ - Switch* pSwitch = static_cast(pSender); - - if (pSwitch->isOn()) - { - _displayValueLabel->setText("On"); - } - else - { - _displayValueLabel->setText("Off"); - } - - switch (type) - { - case SWITCH_EVENT_ON: - - break; - - case SWITCH_EVENT_OFF: - - break; - - default: - break; - } -} - -// UISwitchTest_Vertical -UISwitchTest_Vertical::UISwitchTest_Vertical() -{ -} - -UISwitchTest_Vertical::~UISwitchTest_Vertical() -{ -} - -bool UISwitchTest_Vertical::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add a label in which the switch events will be displayed - _displayValueLabel = gui::Label::create(); - _displayValueLabel->setText("No Event"); - _displayValueLabel->setFontName("Marker Felt"); - _displayValueLabel->setFontSize(32); - _displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f)); - _displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - _uiLayer->addChild(_displayValueLabel); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Switch Vertical"); - alert->setFontName("Marker Felt"); - alert->setFontSize(30); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); - _uiLayer->addChild(alert); - - // Create the switch - Switch* pSwitch = Switch::create(); - pSwitch->setTouchEnabled(true); - pSwitch->loadTextures("cocosgui/switch-mask_v.png", "cocosgui/switch-on_v.png", "cocosgui/switch-off_v.png", "cocosgui/switch-thumb_v.png"); - pSwitch->setOnTitleText("On"); - pSwitch->setOffTitleText("Off"); - pSwitch->setOnTitleFontName("Arial-BoldMT"); - pSwitch->setOnTitleFontSize(16); - pSwitch->setOffTitleFontName("Arial-BoldMT"); - pSwitch->setOffTitleFontSize(16); - Size switchSize = pSwitch->getSize(); - pSwitch->setPosition(Point((widgetSize.width - switchSize.width) / 2.0f, (widgetSize.height - switchSize.height) / 2.0f)); - pSwitch->addEventListenerSwitch(this, switchselector(UISwitchTest_Horizontal::switchEvent)); - _uiLayer->addChild(pSwitch); - - pSwitch->setDirection(SWITCH_DIRECTION_VERTICAL); - - return true; - } - return false; -} - -void UISwitchTest_Vertical::switchEvent(Object *pSender, SwitchEventType type) -{ - Switch *pSwitch = static_cast(pSender); - - if (pSwitch->isOn()) - { - _displayValueLabel->setText("On"); - } - else - { - _displayValueLabel->setText("Off"); - } - - switch (type) - { - case SWITCH_EVENT_ON: - - break; - - case SWITCH_EVENT_OFF: - - break; - - default: - break; - } -} - -// UISwitchTest_VerticalAndTitleVertical -UISwitchTest_VerticalAndTitleVertical::UISwitchTest_VerticalAndTitleVertical() -{ -} - -UISwitchTest_VerticalAndTitleVertical::~UISwitchTest_VerticalAndTitleVertical() -{ -} - -bool UISwitchTest_VerticalAndTitleVertical::init() -{ - if (UIScene::init()) - { - Size widgetSize = _widget->getSize(); - - // Add a label in which the switch events will be displayed - _displayValueLabel = gui::Label::create(); - _displayValueLabel->setText("No Event"); - _displayValueLabel->setFontName("Marker Felt"); - _displayValueLabel->setFontSize(32); - _displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f)); - _displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); - _uiLayer->addChild(_displayValueLabel); - - // Add the alert - gui::Label* alert = gui::Label::create(); - alert->setText("Switch Vertical and Title Vertical"); - alert->setFontName("Marker Felt"); - alert->setFontSize(20); - alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.7)); - _uiLayer->addChild(alert); - - // Create the switch - Switch* pSwitch = Switch::create(); - pSwitch->setTouchEnabled(true); - pSwitch->loadTextures("cocosgui/switch-mask_v.png", "cocosgui/switch-on_v.png", "cocosgui/switch-off_v.png", "cocosgui/switch-thumb_v.png"); - pSwitch->setOnTitleText("On"); - pSwitch->setOffTitleText("Off"); - pSwitch->setOnTitleFontName("Arial-BoldMT"); - pSwitch->setOnTitleFontSize(16); - pSwitch->setOffTitleFontName("Arial-BoldMT"); - pSwitch->setOffTitleFontSize(16); - Size switchSize = pSwitch->getSize(); - pSwitch->setPosition(Point((widgetSize.width - switchSize.width) / 2.0f, (widgetSize.height - switchSize.height) / 2.0f)); - pSwitch->addEventListenerSwitch(this, switchselector(UISwitchTest_Horizontal::switchEvent)); - _uiLayer->addChild(pSwitch); - - - pSwitch->setDirection(SWITCH_DIRECTION_VERTICAL); - - // set unicode text with title vertical direction - pSwitch->setTitleDirection(SWITCH_TITLE_DIRECTION_VERTICAL); - - return true; - } - return false; -} - -void UISwitchTest_VerticalAndTitleVertical::switchEvent(Object *pSender, SwitchEventType type) -{ - Switch* pSwitch = static_cast(pSender); - - if (pSwitch->isOn()) - { - _displayValueLabel->setText("On"); - } - else - { - _displayValueLabel->setText("Off"); - } - - switch (type) - { - case SWITCH_EVENT_ON: - - break; - - case SWITCH_EVENT_OFF: - - break; - - default: - break; - } -} diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISwitchTest/UISwitchTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISwitchTest/UISwitchTest.h deleted file mode 100644 index ff5e40945e..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISwitchTest/UISwitchTest.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __TestCpp__UISwitchTest__ -#define __TestCpp__UISwitchTest__ - -#include "../UIScene.h" - -class UISwitchTest_Horizontal : public UIScene -{ -public: - UISwitchTest_Horizontal(); - ~UISwitchTest_Horizontal(); - bool init(); - void switchEvent(Object* pSender, SwitchEventType type); - -protected: - UI_SCENE_CREATE_FUNC(UISwitchTest_Horizontal) - gui::Label* _displayValueLabel; -}; - -class UISwitchTest_Vertical : public UIScene -{ -public: - UISwitchTest_Vertical(); - ~UISwitchTest_Vertical(); - bool init(); - void switchEvent(Object* pSender, SwitchEventType type); - -protected: - UI_SCENE_CREATE_FUNC(UISwitchTest_Vertical) - gui::Label* _displayValueLabel; -}; - -class UISwitchTest_VerticalAndTitleVertical : public UIScene -{ -public: - UISwitchTest_VerticalAndTitleVertical(); - ~UISwitchTest_VerticalAndTitleVertical(); - bool init(); - void switchEvent(Object* pSender, SwitchEventType type); - -protected: - UI_SCENE_CREATE_FUNC(UISwitchTest_VerticalAndTitleVertical) - gui::Label* _displayValueLabel; -}; - -#endif /* defined(__TestCpp__UISwitchTest__) */ From 01013195d32c097238b691fcbd38fc5d7700fac7 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Tue, 7 Jan 2014 10:08:58 +0800 Subject: [PATCH 289/428] Fix:Resolve the release lua test sample compile error --- .../lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id index 3ef3e93cf1..0bea2ca89c 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id @@ -1 +1 @@ -f0ef8eb2f398001c933c2608c1eb219db7deaebf \ No newline at end of file +f467e0cd21df4f08e391df89dd9cb6679a25ce92 \ No newline at end of file From 8e64ef6d6df274d53696892edc14ae43ebe15c55 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Tue, 7 Jan 2014 10:20:59 +0800 Subject: [PATCH 290/428] issue #3401: add physics lua auto generate to android.mk --- cocos/scripting/lua/bindings/Android.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos/scripting/lua/bindings/Android.mk b/cocos/scripting/lua/bindings/Android.mk index 018cc5b6fe..fa92938dd4 100644 --- a/cocos/scripting/lua/bindings/Android.mk +++ b/cocos/scripting/lua/bindings/Android.mk @@ -21,11 +21,13 @@ LOCAL_SRC_FILES := CCLuaBridge.cpp \ ../../auto-generated/lua-bindings/lua_cocos2dx_studio_auto.cpp \ ../../auto-generated/lua-bindings/lua_cocos2dx_gui_auto.cpp \ ../../auto-generated/lua-bindings/lua_cocos2dx_spine_auto.cpp \ + ../../auto-generated/lua-bindings/lua_cocos2dx_physics_auto.cpp \ lua_cocos2dx_manual.cpp \ lua_cocos2dx_extension_manual.cpp \ lua_cocos2dx_coco_studio_manual.cpp \ lua_cocos2dx_gui_manual.cpp \ lua_cocos2dx_spine_manual.cpp \ + lua_cocos2dx_physics_manual.cpp \ lua_cocos2dx_deprecated.cpp \ lua_xml_http_request.cpp \ platform/android/CCLuaJavaBridge.cpp \ From f897407470e2ab1865d6357c1a2dfafd839c1c60 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 7 Jan 2014 10:55:42 +0800 Subject: [PATCH 291/428] Updates JS-Tests submodule. --- samples/Javascript/Shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index d4c38884a6..1b9d0c8c43 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit d4c38884a6f975073f551390732f1daaf9d41b38 +Subproject commit 1b9d0c8c432617c696a71c3c099a88c5b8bd921d From f7c88a8134afcd11cc27aca3a402ce6bb386893e Mon Sep 17 00:00:00 2001 From: boyu0 Date: Tue, 7 Jan 2014 11:09:40 +0800 Subject: [PATCH 292/428] issue #3401: update cmake project set --- cocos/scripting/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos/scripting/CMakeLists.txt b/cocos/scripting/CMakeLists.txt index 11667106a8..28ff1a834d 100644 --- a/cocos/scripting/CMakeLists.txt +++ b/cocos/scripting/CMakeLists.txt @@ -4,6 +4,7 @@ set(LUABINDING_SRC auto-generated/lua-bindings/lua_cocos2dx_studio_auto.cpp auto-generated/lua-bindings/lua_cocos2dx_gui_auto.cpp auto-generated/lua-bindings/lua_cocos2dx_spine_auto.cpp + auto-generated/lua-bindings/lua_cocos2dx_physics_auto.cpp lua/bindings/tolua_fix.c lua/bindings/CCLuaBridge.cpp lua/bindings/CCLuaEngine.cpp @@ -19,6 +20,7 @@ set(LUABINDING_SRC lua/bindings/lua_cocos2dx_coco_studio_manual.cpp lua/bindings/lua_cocos2dx_gui_manual.cpp lua/bindings/lua_cocos2dx_spine_manual.cpp + lua/bindings/lua_cocos2dx_physics_manual.cpp lua/bindings/lua_cocos2dx_deprecated.cpp lua/bindings/lua_xml_http_request.cpp lua/bindings/LuaSkeletonAnimation.cpp From 64af0de64891eb17e34bc42dab86f1c576d44040 Mon Sep 17 00:00:00 2001 From: walzer Date: Tue, 7 Jan 2014 11:25:07 +0800 Subject: [PATCH 293/428] update copyrights for 2014, in cocos/2d/ folder --- cocos/2d/CCAction.cpp | 5 +- cocos/2d/CCAction.h | 5 +- cocos/2d/CCActionCamera.cpp | 3 +- cocos/2d/CCActionCamera.h | 6 ++- cocos/2d/CCActionCatmullRom.cpp | 7 +-- cocos/2d/CCActionCatmullRom.h | 6 +-- cocos/2d/CCActionEase.cpp | 5 +- cocos/2d/CCActionEase.h | 3 +- cocos/2d/CCActionGrid.cpp | 5 +- cocos/2d/CCActionGrid.h | 3 +- cocos/2d/CCActionGrid3D.cpp | 3 +- cocos/2d/CCActionGrid3D.h | 3 +- cocos/2d/CCActionInstant.cpp | 5 +- cocos/2d/CCActionInstant.h | 7 +-- cocos/2d/CCActionInterval.cpp | 5 +- cocos/2d/CCActionInterval.h | 5 +- cocos/2d/CCActionManager.cpp | 3 +- cocos/2d/CCActionManager.h | 3 +- cocos/2d/CCActionPageTurn3D.cpp | 3 +- cocos/2d/CCActionPageTurn3D.h | 5 +- cocos/2d/CCActionProgressTimer.cpp | 3 +- cocos/2d/CCActionProgressTimer.h | 5 +- cocos/2d/CCActionTiledGrid.cpp | 5 +- cocos/2d/CCActionTiledGrid.h | 3 +- cocos/2d/CCActionTween.cpp | 5 +- cocos/2d/CCActionTween.h | 5 +- cocos/2d/CCAnimation.cpp | 5 +- cocos/2d/CCAnimation.h | 3 +- cocos/2d/CCAnimationCache.cpp | 3 +- cocos/2d/CCAnimationCache.h | 3 +- cocos/2d/CCAtlasNode.cpp | 3 +- cocos/2d/CCAtlasNode.h | 3 +- cocos/2d/CCClippingNode.cpp | 8 +-- cocos/2d/CCClippingNode.h | 8 +-- cocos/2d/CCComponent.cpp | 2 +- cocos/2d/CCComponent.h | 2 +- cocos/2d/CCComponentContainer.cpp | 2 +- cocos/2d/CCComponentContainer.h | 2 +- cocos/2d/CCConfiguration.cpp | 3 +- cocos/2d/CCConfiguration.h | 3 +- cocos/2d/CCDeprecated.cpp | 3 +- cocos/2d/CCDeprecated.h | 3 +- cocos/2d/CCDirector.cpp | 3 +- cocos/2d/CCDirector.h | 7 +-- cocos/2d/CCDrawNode.cpp | 1 + cocos/2d/CCDrawNode.h | 1 + cocos/2d/CCDrawingPrimitives.cpp | 3 +- cocos/2d/CCDrawingPrimitives.h | 3 +- cocos/2d/CCEvent.cpp | 2 +- cocos/2d/CCEvent.h | 2 +- cocos/2d/CCEventAcceleration.cpp | 2 +- cocos/2d/CCEventAcceleration.h | 2 +- cocos/2d/CCEventCustom.cpp | 2 +- cocos/2d/CCEventCustom.h | 2 +- cocos/2d/CCEventDispatcher.cpp | 2 +- cocos/2d/CCEventDispatcher.h | 2 +- cocos/2d/CCEventKeyboard.cpp | 2 +- cocos/2d/CCEventKeyboard.h | 2 +- cocos/2d/CCEventListener.cpp | 2 +- cocos/2d/CCEventListener.h | 2 +- cocos/2d/CCEventListenerAcceleration.cpp | 2 +- cocos/2d/CCEventListenerAcceleration.h | 2 +- cocos/2d/CCEventListenerCustom.cpp | 2 +- cocos/2d/CCEventListenerCustom.h | 2 +- cocos/2d/CCEventListenerKeyboard.cpp | 2 +- cocos/2d/CCEventListenerKeyboard.h | 2 +- cocos/2d/CCEventListenerMouse.cpp | 2 +- cocos/2d/CCEventListenerMouse.h | 2 +- cocos/2d/CCEventListenerTouch.cpp | 2 +- cocos/2d/CCEventListenerTouch.h | 2 +- cocos/2d/CCEventMouse.cpp | 2 +- cocos/2d/CCEventMouse.h | 2 +- cocos/2d/CCEventTouch.cpp | 2 +- cocos/2d/CCEventTouch.h | 2 +- cocos/2d/CCEventType.h | 23 ++++++++ cocos/2d/CCFont.cpp | 1 + cocos/2d/CCFont.h | 1 + cocos/2d/CCFontAtlas.cpp | 3 +- cocos/2d/CCFontAtlas.h | 1 + cocos/2d/CCFontAtlasCache.cpp | 1 + cocos/2d/CCFontAtlasCache.h | 1 + cocos/2d/CCFontAtlasFactory.cpp | 3 +- cocos/2d/CCFontAtlasFactory.h | 1 + cocos/2d/CCFontDefinition.cpp | 1 + cocos/2d/CCFontDefinition.h | 1 + cocos/2d/CCFontFNT.cpp | 3 +- cocos/2d/CCFontFNT.h | 1 + cocos/2d/CCFontFreeType.cpp | 3 +- cocos/2d/CCFontFreeType.h | 1 + cocos/2d/CCGLBufferedNode.cpp | 3 +- cocos/2d/CCGLBufferedNode.h | 3 +- cocos/2d/CCGLProgram.cpp | 3 +- cocos/2d/CCGLProgram.h | 6 ++- cocos/2d/CCGrabber.cpp | 3 +- cocos/2d/CCGrabber.h | 3 +- cocos/2d/CCGrid.cpp | 5 +- cocos/2d/CCGrid.h | 3 +- cocos/2d/CCIMEDelegate.h | 1 + cocos/2d/CCIMEDispatcher.cpp | 5 +- cocos/2d/CCIMEDispatcher.h | 5 +- cocos/2d/CCLabel.cpp | 1 + cocos/2d/CCLabel.h | 3 +- cocos/2d/CCLabelAtlas.cpp | 3 +- cocos/2d/CCLabelAtlas.h | 5 +- cocos/2d/CCLabelBMFont.cpp | 3 +- cocos/2d/CCLabelBMFont.h | 3 +- cocos/2d/CCLabelTTF.cpp | 3 +- cocos/2d/CCLabelTTF.h | 5 +- cocos/2d/CCLabelTextFormatProtocol.h | 1 + cocos/2d/CCLabelTextFormatter.cpp | 1 + cocos/2d/CCLabelTextFormatter.h | 1 + cocos/2d/CCLayer.cpp | 5 +- cocos/2d/CCLayer.h | 3 +- cocos/2d/CCMenu.cpp | 3 +- cocos/2d/CCMenu.h | 3 +- cocos/2d/CCMenuItem.cpp | 3 +- cocos/2d/CCMenuItem.h | 3 +- cocos/2d/CCMotionStreak.cpp | 3 +- cocos/2d/CCMotionStreak.h | 5 +- cocos/2d/CCNode.cpp | 3 +- cocos/2d/CCNode.h | 7 +-- cocos/2d/CCNodeGrid.cpp | 2 +- cocos/2d/CCNodeGrid.h | 2 +- cocos/2d/CCNotificationCenter.cpp | 4 +- cocos/2d/CCNotificationCenter.h | 4 +- cocos/2d/CCParallaxNode.cpp | 3 +- cocos/2d/CCParallaxNode.h | 3 +- cocos/2d/CCParticleBatchNode.cpp | 7 +-- cocos/2d/CCParticleBatchNode.h | 7 +-- cocos/2d/CCParticleExamples.cpp | 3 +- cocos/2d/CCParticleExamples.h | 3 +- cocos/2d/CCParticleSystem.cpp | 3 +- cocos/2d/CCParticleSystem.h | 3 +- cocos/2d/CCParticleSystemQuad.cpp | 3 +- cocos/2d/CCParticleSystemQuad.h | 3 +- cocos/2d/CCProfiling.cpp | 3 +- cocos/2d/CCProfiling.h | 3 +- cocos/2d/CCProgressTimer.cpp | 3 +- cocos/2d/CCProgressTimer.h | 3 +- cocos/2d/CCProtocols.h | 3 +- cocos/2d/CCRenderTexture.cpp | 3 +- cocos/2d/CCRenderTexture.h | 3 +- cocos/2d/CCScene.cpp | 3 +- cocos/2d/CCScene.h | 3 +- cocos/2d/CCScheduler.cpp | 3 +- cocos/2d/CCScheduler.h | 3 +- cocos/2d/CCScriptSupport.cpp | 1 + cocos/2d/CCScriptSupport.h | 1 + cocos/2d/CCShaderCache.cpp | 3 +- cocos/2d/CCShaderCache.h | 3 +- cocos/2d/CCSprite.cpp | 3 +- cocos/2d/CCSprite.h | 3 +- cocos/2d/CCSpriteBatchNode.cpp | 3 +- cocos/2d/CCSpriteBatchNode.h | 5 +- cocos/2d/CCSpriteFrame.cpp | 3 +- cocos/2d/CCSpriteFrame.h | 3 +- cocos/2d/CCSpriteFrameCache.cpp | 3 +- cocos/2d/CCSpriteFrameCache.h | 3 +- cocos/2d/CCTMXLayer.cpp | 3 +- cocos/2d/CCTMXLayer.h | 3 +- cocos/2d/CCTMXObjectGroup.cpp | 3 +- cocos/2d/CCTMXObjectGroup.h | 3 +- cocos/2d/CCTMXTiledMap.cpp | 3 +- cocos/2d/CCTMXTiledMap.h | 3 +- cocos/2d/CCTMXXMLParser.cpp | 5 +- cocos/2d/CCTMXXMLParser.h | 3 +- cocos/2d/CCTextFieldTTF.cpp | 3 +- cocos/2d/CCTextFieldTTF.h | 3 +- cocos/2d/CCTextImage.cpp | 3 +- cocos/2d/CCTextImage.h | 1 + cocos/2d/CCTexture2D.cpp | 3 +- cocos/2d/CCTexture2D.h | 3 +- cocos/2d/CCTextureAtlas.cpp | 3 +- cocos/2d/CCTextureAtlas.h | 3 +- cocos/2d/CCTextureCache.cpp | 3 +- cocos/2d/CCTextureCache.h | 3 +- cocos/2d/CCTileMapAtlas.cpp | 3 +- cocos/2d/CCTileMapAtlas.h | 3 +- cocos/2d/CCTouch.cpp | 3 +- cocos/2d/CCTouch.h | 3 +- cocos/2d/CCTransition.cpp | 3 +- cocos/2d/CCTransition.h | 3 +- cocos/2d/CCTransitionPageTurn.cpp | 3 +- cocos/2d/CCTransitionPageTurn.h | 3 +- cocos/2d/CCTransitionProgress.cpp | 5 +- cocos/2d/CCTransitionProgress.h | 5 +- cocos/2d/CCUserDefault.cpp | 1 + cocos/2d/CCUserDefault.h | 1 + cocos/2d/CCUserDefault.mm | 3 +- cocos/2d/CCUserDefaultAndroid.cpp | 1 + cocos/2d/CCVertex.cpp | 1 + cocos/2d/CCVertex.h | 1 + cocos/2d/TGAlib.cpp | 3 +- cocos/2d/TGAlib.h | 3 +- cocos/2d/TransformUtils.cpp | 3 +- cocos/2d/TransformUtils.h | 3 +- cocos/2d/ZipUtils.cpp | 5 +- cocos/2d/ZipUtils.h | 3 +- cocos/2d/base64.cpp | 5 +- cocos/2d/base64.h | 5 +- cocos/2d/ccCArray.cpp | 3 +- cocos/2d/ccCArray.h | 3 +- cocos/2d/ccConfig.h | 3 +- cocos/2d/ccGLStateCache.cpp | 3 +- cocos/2d/ccGLStateCache.h | 7 +-- cocos/2d/ccMacros.h | 3 +- cocos/2d/ccShaders.cpp | 3 +- cocos/2d/ccShaders.h | 3 +- cocos/2d/ccTypes.cpp | 5 +- cocos/2d/ccTypes.h | 3 +- cocos/2d/ccUTF8.cpp | 5 +- cocos/2d/ccUTF8.h | 26 ++++++--- cocos/2d/ccUtils.cpp | 3 +- cocos/2d/ccUtils.h | 3 +- cocos/2d/cocos2d.cpp | 3 +- cocos/2d/cocos2d.h | 3 +- cocos/2d/platform/CCApplicationProtocol.h | 25 +++++++++ cocos/2d/platform/CCCommon.h | 3 +- cocos/2d/platform/CCDevice.h | 25 +++++++++ cocos/2d/platform/CCEGLViewProtocol.cpp | 25 +++++++++ cocos/2d/platform/CCEGLViewProtocol.h | 25 +++++++++ cocos/2d/platform/CCFileUtils.cpp | 1 + cocos/2d/platform/CCFileUtils.h | 1 + cocos/2d/platform/CCImage.h | 3 +- cocos/2d/platform/CCImageCommon_cpp.h | 3 +- cocos/2d/platform/CCSAXParser.cpp | 2 +- cocos/2d/platform/CCSAXParser.h | 2 +- cocos/2d/platform/CCThread.cpp | 3 +- cocos/2d/platform/CCThread.h | 3 +- cocos/2d/platform/android/CCApplication.cpp | 24 +++++++++ cocos/2d/platform/android/CCApplication.h | 24 +++++++++ cocos/2d/platform/android/CCCommon.cpp | 3 +- cocos/2d/platform/android/CCDevice.cpp | 24 +++++++++ cocos/2d/platform/android/CCEGLView.cpp | 3 +- cocos/2d/platform/android/CCEGLView.h | 3 +- .../platform/android/CCFileUtilsAndroid.cpp | 3 +- .../2d/platform/android/CCFileUtilsAndroid.h | 3 +- cocos/2d/platform/android/CCGL.h | 3 +- cocos/2d/platform/android/CCImage.cpp | 3 +- cocos/2d/platform/android/CCPlatformDefine.h | 25 +++++++++ cocos/2d/platform/android/CCStdC.h | 3 +- .../src/org/cocos2dx/lib/Cocos2dxBitmap.java | 3 +- .../cocos2dx/lib/Cocos2dxEditBoxDialog.java | 1 + .../org/cocos2dx/lib/Cocos2dxEditText.java | 3 +- .../src/org/cocos2dx/lib/Cocos2dxHelper.java | 3 +- .../cocos2dx/lib/Cocos2dxLocalStorage.java | 2 +- .../cocos2dx/lib/Cocos2dxLuaJavaBridge.java | 23 ++++++++ .../src/org/cocos2dx/lib/Cocos2dxMusic.java | 4 +- .../src/org/cocos2dx/lib/Cocos2dxSound.java | 3 +- .../org/cocos2dx/lib/Cocos2dxTypefaces.java | 3 +- cocos/2d/platform/android/jni/IMEJni.cpp | 3 +- cocos/2d/platform/android/jni/IMEJni.h | 3 +- .../Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp | 25 +++++++++ .../Java_org_cocos2dx_lib_Cocos2dxBitmap.h | 1 + .../Java_org_cocos2dx_lib_Cocos2dxHelper.cpp | 24 +++++++++ .../Java_org_cocos2dx_lib_Cocos2dxHelper.h | 3 +- cocos/2d/platform/android/jni/JniHelper.cpp | 3 +- cocos/2d/platform/android/jni/JniHelper.h | 3 +- cocos/2d/platform/android/nativeactivity.cpp | 23 ++++++++ cocos/2d/platform/android/nativeactivity.h | 23 ++++++++ cocos/2d/platform/apple/CCFileUtilsApple.h | 4 +- cocos/2d/platform/apple/CCFileUtilsApple.mm | 1 + cocos/2d/platform/apple/CCLock.cpp | 3 +- cocos/2d/platform/apple/CCLock.h | 3 +- cocos/2d/platform/apple/CCThread.mm | 3 +- cocos/2d/platform/ios/CCApplication.h | 3 +- cocos/2d/platform/ios/CCApplication.mm | 3 +- cocos/2d/platform/ios/CCCommon.mm | 3 +- cocos/2d/platform/ios/CCDevice.mm | 24 +++++++++ cocos/2d/platform/ios/CCDirectorCaller.h | 11 ++-- cocos/2d/platform/ios/CCDirectorCaller.mm | 11 ++-- cocos/2d/platform/ios/CCEGLView.h | 37 ++++++------- cocos/2d/platform/ios/CCEGLView.mm | 37 ++++++------- cocos/2d/platform/ios/CCES2Renderer.h | 53 +++++++++---------- cocos/2d/platform/ios/CCES2Renderer.m | 53 +++++++++---------- cocos/2d/platform/ios/CCESRenderer.h | 53 +++++++++---------- cocos/2d/platform/ios/CCGL.h | 3 +- cocos/2d/platform/ios/CCImage.mm | 3 +- cocos/2d/platform/ios/CCPlatformDefine.h | 24 +++++++++ cocos/2d/platform/ios/CCStdC.h | 3 +- .../ios/Simulation/AccelerometerSimulation.h | 33 +++++++++--- .../ios/Simulation/AccelerometerSimulation.m | 32 ++++++++--- cocos/2d/platform/linux/CCApplication.cpp | 31 ++++++++--- cocos/2d/platform/linux/CCApplication.h | 30 ++++++++--- cocos/2d/platform/linux/CCCommon.cpp | 3 +- cocos/2d/platform/linux/CCDevice.cpp | 24 +++++++++ cocos/2d/platform/linux/CCEGLView.cpp | 30 ++++++++--- cocos/2d/platform/linux/CCEGLView.h | 30 ++++++++--- cocos/2d/platform/linux/CCFileUtilsLinux.cpp | 30 ++++++++--- cocos/2d/platform/linux/CCFileUtilsLinux.h | 45 ++++++++-------- cocos/2d/platform/linux/CCImage.cpp | 24 +++++++++ cocos/2d/platform/linux/CCPlatformDefine.h | 24 +++++++++ cocos/2d/platform/linux/CCStdC.cpp | 3 +- cocos/2d/platform/linux/CCStdC.h | 3 +- cocos/2d/platform/mac/CCApplication.h | 3 +- cocos/2d/platform/mac/CCApplication.mm | 45 ++++++++-------- cocos/2d/platform/mac/CCCommon.mm | 37 ++++++------- cocos/2d/platform/mac/CCDevice.mm | 24 +++++++++ cocos/2d/platform/mac/CCDirectorCaller.h | 45 ++++++++-------- cocos/2d/platform/mac/CCDirectorCaller.mm | 45 ++++++++-------- cocos/2d/platform/mac/CCEGLView.h | 45 ++++++++-------- cocos/2d/platform/mac/CCEGLView.mm | 45 ++++++++-------- cocos/2d/platform/mac/CCEventDispatcherMac.h | 50 ++++++++--------- cocos/2d/platform/mac/CCEventDispatcherMac.mm | 50 ++++++++--------- cocos/2d/platform/mac/CCGL.h | 3 +- cocos/2d/platform/mac/CCImage.mm | 3 +- cocos/2d/platform/mac/CCPlatformDefine.h | 25 +++++++++ cocos/2d/platform/mac/CCStdC.h | 3 +- cocos/2d/platform/mac/CCWindow.h | 3 +- cocos/2d/platform/mac/CCWindow.m | 3 +- cocos/2d/platform/mac/EAGLView.h | 3 +- cocos/2d/platform/mac/EAGLView.mm | 3 +- cocos/2d/platform/win32/CCApplication.cpp | 24 +++++++++ cocos/2d/platform/win32/CCApplication.h | 24 +++++++++ cocos/2d/platform/win32/CCCommon.cpp | 3 +- cocos/2d/platform/win32/CCDevice.cpp | 24 +++++++++ cocos/2d/platform/win32/CCEGLView.cpp | 3 +- cocos/2d/platform/win32/CCEGLView.h | 3 +- cocos/2d/platform/win32/CCFileUtilsWin32.cpp | 3 +- cocos/2d/platform/win32/CCFileUtilsWin32.h | 45 ++++++++-------- cocos/2d/platform/win32/CCGL.h | 3 +- cocos/2d/platform/win32/CCImage.cpp | 3 +- cocos/2d/platform/win32/CCPlatformDefine.h | 24 +++++++++ cocos/2d/platform/win32/CCStdC.cpp | 3 +- cocos/2d/platform/win32/CCStdC.h | 3 +- cocos/2d/renderer/CCCustomCommand.cpp | 2 +- cocos/2d/renderer/CCCustomCommand.h | 2 +- cocos/2d/renderer/CCFrustum.cpp | 2 +- cocos/2d/renderer/CCFrustum.h | 2 +- cocos/2d/renderer/CCGroupCommand.cpp | 2 +- cocos/2d/renderer/CCGroupCommand.h | 2 +- cocos/2d/renderer/CCMaterialManager.cpp | 2 +- cocos/2d/renderer/CCMaterialManager.h | 2 +- cocos/2d/renderer/CCQuadCommand.cpp | 2 +- cocos/2d/renderer/CCQuadCommand.h | 2 +- cocos/2d/renderer/CCRenderCommand.cpp | 2 +- cocos/2d/renderer/CCRenderCommand.h | 2 +- cocos/2d/renderer/CCRenderCommandPool.h | 2 +- cocos/2d/renderer/CCRenderMaterial.cpp | 2 +- cocos/2d/renderer/CCRenderMaterial.h | 2 +- cocos/2d/renderer/CCRenderer.cpp | 2 +- cocos/2d/renderer/CCRenderer.h | 2 +- 342 files changed, 1710 insertions(+), 715 deletions(-) diff --git a/cocos/2d/CCAction.cpp b/cocos/2d/CCAction.cpp index 3556b6e413..0ae3428605 100644 --- a/cocos/2d/CCAction.cpp +++ b/cocos/2d/CCAction.cpp @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. - +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCAction.h b/cocos/2d/CCAction.h index 1d76c43b17..dc5926fb0c 100644 --- a/cocos/2d/CCAction.h +++ b/cocos/2d/CCAction.h @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. - +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCActionCamera.cpp b/cocos/2d/CCActionCamera.cpp index 0d8ef23606..c044bdd21a 100644 --- a/cocos/2d/CCActionCamera.cpp +++ b/cocos/2d/CCActionCamera.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2013 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionCamera.h b/cocos/2d/CCActionCamera.h index c4cab0c0a1..c5515dfcff 100644 --- a/cocos/2d/CCActionCamera.h +++ b/cocos/2d/CCActionCamera.h @@ -1,7 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada - +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCActionCatmullRom.cpp b/cocos/2d/CCActionCatmullRom.cpp index db7e8e011a..1dcb626c73 100644 --- a/cocos/2d/CCActionCatmullRom.cpp +++ b/cocos/2d/CCActionCatmullRom.cpp @@ -1,11 +1,8 @@ /* - * Copyright (c) 2010-2012 cocos2d-x.org - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * * Copyright (c) 2008 Radu Gruian - * * Copyright (c) 2011 Vit Valentin - * + * Copyright (c) 2012 cocos2d-x.org + * Copyright (c) 2013-2014 Chukong Technologies Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/cocos/2d/CCActionCatmullRom.h b/cocos/2d/CCActionCatmullRom.h index 0c47a4137f..6ecad0c6af 100644 --- a/cocos/2d/CCActionCatmullRom.h +++ b/cocos/2d/CCActionCatmullRom.h @@ -1,10 +1,8 @@ /* - * Copyright (c) 2012 cocos2d-x.org - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * * Copyright (c) 2008 Radu Gruian - * * Copyright (c) 2011 Vit Valentin + * Copyright (c) 2012 cocos2d-x.org + * Copyright (c) 2013-2014 Chukong Technologies Inc. * * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCActionEase.cpp b/cocos/2d/CCActionEase.cpp index 8c7d4e38e0..2aec96013b 100644 --- a/cocos/2d/CCActionEase.cpp +++ b/cocos/2d/CCActionEase.cpp @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2009 Jason Booth +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. -http://www.cocos2d-x.org + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/cocos/2d/CCActionEase.h b/cocos/2d/CCActionEase.h index efe0c9600c..17f55abf57 100644 --- a/cocos/2d/CCActionEase.h +++ b/cocos/2d/CCActionEase.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2009 Jason Booth +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionGrid.cpp b/cocos/2d/CCActionGrid.cpp index edd96ae0da..c1aa872d06 100644 --- a/cocos/2d/CCActionGrid.cpp +++ b/cocos/2d/CCActionGrid.cpp @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2009 On-Core Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2009 On-Core - +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCActionGrid.h b/cocos/2d/CCActionGrid.h index b3981b42a8..25344eefd4 100644 --- a/cocos/2d/CCActionGrid.h +++ b/cocos/2d/CCActionGrid.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 On-Core +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionGrid3D.cpp b/cocos/2d/CCActionGrid3D.cpp index 2f88cd6684..9cc6194e5d 100644 --- a/cocos/2d/CCActionGrid3D.cpp +++ b/cocos/2d/CCActionGrid3D.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 On-Core +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionGrid3D.h b/cocos/2d/CCActionGrid3D.h index fbc82f4819..52311b6674 100644 --- a/cocos/2d/CCActionGrid3D.h +++ b/cocos/2d/CCActionGrid3D.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 On-Core +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionInstant.cpp b/cocos/2d/CCActionInstant.cpp index 92e5a5dfdf..f0280d1380 100644 --- a/cocos/2d/CCActionInstant.cpp +++ b/cocos/2d/CCActionInstant.cpp @@ -1,7 +1,8 @@ /**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011 Zynga Inc. + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2011 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionInstant.h b/cocos/2d/CCActionInstant.h index f518899374..11fce3aaae 100644 --- a/cocos/2d/CCActionInstant.h +++ b/cocos/2d/CCActionInstant.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2008-2010 Ricardo Quesada -Copyright (c) 2011 Zynga Inc. + Copyright (c) 2008-2010 Ricardo Quesada + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2011 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionInterval.cpp b/cocos/2d/CCActionInterval.cpp index 7d4a1e0bbb..a8a48f4081 100644 --- a/cocos/2d/CCActionInterval.cpp +++ b/cocos/2d/CCActionInterval.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada -Copyright (c) 2011 Zynga Inc. +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionInterval.h b/cocos/2d/CCActionInterval.h index 8fcfcda025..e88331d309 100644 --- a/cocos/2d/CCActionInterval.h +++ b/cocos/2d/CCActionInterval.h @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2011 Zynga Inc. Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2008-2011 Ricardo Quesada -Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionManager.cpp b/cocos/2d/CCActionManager.cpp index 56841d7f71..3865280806 100644 --- a/cocos/2d/CCActionManager.cpp +++ b/cocos/2d/CCActionManager.cpp @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2009 Valentin Milea +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionManager.h b/cocos/2d/CCActionManager.h index 406fadaeb9..0a096f1421 100644 --- a/cocos/2d/CCActionManager.h +++ b/cocos/2d/CCActionManager.h @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2009 Valentin Milea +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionPageTurn3D.cpp b/cocos/2d/CCActionPageTurn3D.cpp index 1da881614d..f6691c77d1 100644 --- a/cocos/2d/CCActionPageTurn3D.cpp +++ b/cocos/2d/CCActionPageTurn3D.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/ +Copyright (c) 2010-2012 cocos2d-x.org +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionPageTurn3D.h b/cocos/2d/CCActionPageTurn3D.h index 24b8863b3f..92bf724653 100644 --- a/cocos/2d/CCActionPageTurn3D.h +++ b/cocos/2d/CCActionPageTurn3D.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/ - +Copyright (c) 2010-2012 cocos2d-x.org +CopyRight (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCActionProgressTimer.cpp b/cocos/2d/CCActionProgressTimer.cpp index e5fa319875..46d3cca5e8 100644 --- a/cocos/2d/CCActionProgressTimer.cpp +++ b/cocos/2d/CCActionProgressTimer.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (C) 2010 Lam Pham +Copyright (c) 2010-2012 cocos2d-x.org +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionProgressTimer.h b/cocos/2d/CCActionProgressTimer.h index bdb8ab03f9..9314d3b8db 100644 --- a/cocos/2d/CCActionProgressTimer.h +++ b/cocos/2d/CCActionProgressTimer.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (C) 2010 Lam Pham - +Copyright (c) 2010-2012 cocos2d-x.org +CopyRight (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCActionTiledGrid.cpp b/cocos/2d/CCActionTiledGrid.cpp index 973634ace8..87b227b058 100644 --- a/cocos/2d/CCActionTiledGrid.cpp +++ b/cocos/2d/CCActionTiledGrid.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010£­2011 cocos2d-x.org -Copyright (c) 2009 On-Core +Copyright (c) 2009 On-Core +Copyright (c) 2010-2012 cocos2d-x.org +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionTiledGrid.h b/cocos/2d/CCActionTiledGrid.h index a12e65fb4e..35ab948faa 100644 --- a/cocos/2d/CCActionTiledGrid.h +++ b/cocos/2d/CCActionTiledGrid.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 On-Core +Copyright (c) 2010-2012 cocos2d-x.org +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCActionTween.cpp b/cocos/2d/CCActionTween.cpp index a54f562713..46a4836d68 100644 --- a/cocos/2d/CCActionTween.cpp +++ b/cocos/2d/CCActionTween.cpp @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2009 lhunath (Maarten Billemont) Copyright (c) 2010-2012 cocos2d-x.org -Copyright 2009 lhunath (Maarten Billemont) - +CopyRight (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCActionTween.h b/cocos/2d/CCActionTween.h index b5c1553f31..e4681a9037 100644 --- a/cocos/2d/CCActionTween.h +++ b/cocos/2d/CCActionTween.h @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2009 lhunath (Maarten Billemont) Copyright (c) 2010-2012 cocos2d-x.org -Copyright 2009 lhunath (Maarten Billemont) - +CopyRight (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCAnimation.cpp b/cocos/2d/CCAnimation.cpp index e79db07267..20c965a648 100644 --- a/cocos/2d/CCAnimation.cpp +++ b/cocos/2d/CCAnimation.cpp @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. - +CopyRight (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCAnimation.h b/cocos/2d/CCAnimation.h index 9dddeb6fcc..04f0fa1997 100644 --- a/cocos/2d/CCAnimation.h +++ b/cocos/2d/CCAnimation.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCAnimationCache.cpp b/cocos/2d/CCAnimationCache.cpp index 59d9144252..c8ae75fe8a 100644 --- a/cocos/2d/CCAnimationCache.cpp +++ b/cocos/2d/CCAnimationCache.cpp @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2010 Ricardo Quesada Copyright (c) 2011 Zynga Inc. +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCAnimationCache.h b/cocos/2d/CCAnimationCache.h index 6e60201882..925c2d9557 100644 --- a/cocos/2d/CCAnimationCache.h +++ b/cocos/2d/CCAnimationCache.h @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2010 Ricardo Quesada Copyright (c) 2011 Zynga Inc. +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCAtlasNode.cpp b/cocos/2d/CCAtlasNode.cpp index fc29683d90..5e88b70832 100644 --- a/cocos/2d/CCAtlasNode.cpp +++ b/cocos/2d/CCAtlasNode.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCAtlasNode.h b/cocos/2d/CCAtlasNode.h index 71d013a907..065ae77353 100644 --- a/cocos/2d/CCAtlasNode.h +++ b/cocos/2d/CCAtlasNode.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index c2936fb4ce..cdaf6a3df5 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -1,9 +1,9 @@ /* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * cocos2d-x: http://www.cocos2d-x.org + * Copyright (c) 2012 Pierre-David Bélanger + * Copyright (c) 2012 cocos2d-x.org + * Copyright (c) 2013-2014 Chukong Technologies Inc. * - * Copyright (c) 2012 Pierre-David Bélanger - * Copyright (c) 2012 cocos2d-x.org + * cocos2d-x: http://www.cocos2d-x.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/cocos/2d/CCClippingNode.h b/cocos/2d/CCClippingNode.h index c18379f722..5f9e0caa12 100644 --- a/cocos/2d/CCClippingNode.h +++ b/cocos/2d/CCClippingNode.h @@ -1,9 +1,9 @@ /* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * cocos2d-x: http://www.cocos2d-x.org + * Copyright (c) 2012 Pierre-David Bélanger + * Copyright (c) 2012 cocos2d-x.org + * Copyright (c) 2013-2014 Chukong Technologies Inc. * - * Copyright (c) 2012 Pierre-David Bélanger - * Copyright (c) 2012 cocos2d-x.org + * http://www.cocos2d-x.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/cocos/2d/CCComponent.cpp b/cocos/2d/CCComponent.cpp index 0d3deb1f47..1d5c83a8c7 100644 --- a/cocos/2d/CCComponent.cpp +++ b/cocos/2d/CCComponent.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCComponent.h b/cocos/2d/CCComponent.h index 617cbe8750..4d5625d71f 100644 --- a/cocos/2d/CCComponent.h +++ b/cocos/2d/CCComponent.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCComponentContainer.cpp b/cocos/2d/CCComponentContainer.cpp index 905bebbe27..9cd093deeb 100644 --- a/cocos/2d/CCComponentContainer.cpp +++ b/cocos/2d/CCComponentContainer.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCComponentContainer.h b/cocos/2d/CCComponentContainer.h index d895693a86..2e02a830e6 100644 --- a/cocos/2d/CCComponentContainer.h +++ b/cocos/2d/CCComponentContainer.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCConfiguration.cpp b/cocos/2d/CCConfiguration.cpp index 07ff02933d..47a079d415 100644 --- a/cocos/2d/CCConfiguration.cpp +++ b/cocos/2d/CCConfiguration.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCConfiguration.h b/cocos/2d/CCConfiguration.h index 90387d5c38..f2a7e1052c 100644 --- a/cocos/2d/CCConfiguration.h +++ b/cocos/2d/CCConfiguration.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCDeprecated.cpp b/cocos/2d/CCDeprecated.cpp index e26d0c964d..1c4aeffef4 100644 --- a/cocos/2d/CCDeprecated.cpp +++ b/cocos/2d/CCDeprecated.cpp @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCDeprecated.h b/cocos/2d/CCDeprecated.h index c894f7988c..05c1d618ee 100644 --- a/cocos/2d/CCDeprecated.h +++ b/cocos/2d/CCDeprecated.h @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index 95c6788426..277859644d 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2013 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2013 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCDirector.h b/cocos/2d/CCDirector.h index b8d73b02a1..10f46bb539 100644 --- a/cocos/2d/CCDirector.h +++ b/cocos/2d/CCDirector.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2008-2010 Ricardo Quesada -Copyright (c) 2011 Zynga Inc. + Copyright (c) 2008-2010 Ricardo Quesada + Copyright (c) 2010-2013 cocos2d-x.org + Copyright (c) 2011 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 1580d0af23..42e568cb7a 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -1,5 +1,6 @@ /* Copyright (c) 2012 Scott Lembcke and Howling Moon Software * Copyright (c) 2012 cocos2d-x.org + * Copyright (c) 2013-2014 Chukong Technologies Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index a5dbcfe76b..6563c3ebfa 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -1,5 +1,6 @@ /* Copyright (c) 2012 Scott Lembcke and Howling Moon Software * Copyright (c) 2012 cocos2d-x.org + * Copyright (c) 2013-2014 Chukong Technologies Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/cocos/2d/CCDrawingPrimitives.cpp b/cocos/2d/CCDrawingPrimitives.cpp index 16903cebe8..9a8dcfbd89 100644 --- a/cocos/2d/CCDrawingPrimitives.cpp +++ b/cocos/2d/CCDrawingPrimitives.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2013 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCDrawingPrimitives.h b/cocos/2d/CCDrawingPrimitives.h index c46c88a0ad..219cc1b7e7 100644 --- a/cocos/2d/CCDrawingPrimitives.h +++ b/cocos/2d/CCDrawingPrimitives.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2013 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEvent.cpp b/cocos/2d/CCEvent.cpp index c74beef87e..66855586b0 100644 --- a/cocos/2d/CCEvent.cpp +++ b/cocos/2d/CCEvent.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEvent.h b/cocos/2d/CCEvent.h index b067ff3ce3..c1ec2416c0 100644 --- a/cocos/2d/CCEvent.h +++ b/cocos/2d/CCEvent.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventAcceleration.cpp b/cocos/2d/CCEventAcceleration.cpp index 1a8a075d88..cb3001a369 100644 --- a/cocos/2d/CCEventAcceleration.cpp +++ b/cocos/2d/CCEventAcceleration.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventAcceleration.h b/cocos/2d/CCEventAcceleration.h index 1480ee6b0c..ce380edc45 100644 --- a/cocos/2d/CCEventAcceleration.h +++ b/cocos/2d/CCEventAcceleration.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventCustom.cpp b/cocos/2d/CCEventCustom.cpp index 65e9d4c2f5..09b5c5048a 100644 --- a/cocos/2d/CCEventCustom.cpp +++ b/cocos/2d/CCEventCustom.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventCustom.h b/cocos/2d/CCEventCustom.h index 4a7d750940..c967069151 100644 --- a/cocos/2d/CCEventCustom.h +++ b/cocos/2d/CCEventCustom.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventDispatcher.cpp b/cocos/2d/CCEventDispatcher.cpp index 517697e2a9..609b67c3cd 100644 --- a/cocos/2d/CCEventDispatcher.cpp +++ b/cocos/2d/CCEventDispatcher.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventDispatcher.h b/cocos/2d/CCEventDispatcher.h index 1bd015b27b..cb62e4711b 100644 --- a/cocos/2d/CCEventDispatcher.h +++ b/cocos/2d/CCEventDispatcher.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventKeyboard.cpp b/cocos/2d/CCEventKeyboard.cpp index 83bf0a8d0a..2051e09cbc 100644 --- a/cocos/2d/CCEventKeyboard.cpp +++ b/cocos/2d/CCEventKeyboard.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventKeyboard.h b/cocos/2d/CCEventKeyboard.h index e0533e62fd..942e5738d6 100644 --- a/cocos/2d/CCEventKeyboard.h +++ b/cocos/2d/CCEventKeyboard.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListener.cpp b/cocos/2d/CCEventListener.cpp index b4f9fdd499..3ed1e8b730 100644 --- a/cocos/2d/CCEventListener.cpp +++ b/cocos/2d/CCEventListener.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListener.h b/cocos/2d/CCEventListener.h index ea44c83559..cf380dd50d 100644 --- a/cocos/2d/CCEventListener.h +++ b/cocos/2d/CCEventListener.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListenerAcceleration.cpp b/cocos/2d/CCEventListenerAcceleration.cpp index d4192e2a83..72defaa6e0 100644 --- a/cocos/2d/CCEventListenerAcceleration.cpp +++ b/cocos/2d/CCEventListenerAcceleration.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListenerAcceleration.h b/cocos/2d/CCEventListenerAcceleration.h index afe7fb5bba..2f290b8fb8 100644 --- a/cocos/2d/CCEventListenerAcceleration.h +++ b/cocos/2d/CCEventListenerAcceleration.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListenerCustom.cpp b/cocos/2d/CCEventListenerCustom.cpp index eda8ba36fa..aeebcd5fd4 100644 --- a/cocos/2d/CCEventListenerCustom.cpp +++ b/cocos/2d/CCEventListenerCustom.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListenerCustom.h b/cocos/2d/CCEventListenerCustom.h index 8a7fe162e1..20c4f3497e 100644 --- a/cocos/2d/CCEventListenerCustom.h +++ b/cocos/2d/CCEventListenerCustom.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListenerKeyboard.cpp b/cocos/2d/CCEventListenerKeyboard.cpp index ff31aa2ace..b5131c0c3b 100644 --- a/cocos/2d/CCEventListenerKeyboard.cpp +++ b/cocos/2d/CCEventListenerKeyboard.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListenerKeyboard.h b/cocos/2d/CCEventListenerKeyboard.h index a8b181da66..a30f517658 100644 --- a/cocos/2d/CCEventListenerKeyboard.h +++ b/cocos/2d/CCEventListenerKeyboard.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListenerMouse.cpp b/cocos/2d/CCEventListenerMouse.cpp index 63ebebd501..7dfd8d4c95 100644 --- a/cocos/2d/CCEventListenerMouse.cpp +++ b/cocos/2d/CCEventListenerMouse.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListenerMouse.h b/cocos/2d/CCEventListenerMouse.h index a9fa326b8b..8ca58db437 100644 --- a/cocos/2d/CCEventListenerMouse.h +++ b/cocos/2d/CCEventListenerMouse.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListenerTouch.cpp b/cocos/2d/CCEventListenerTouch.cpp index c453d5f84c..a9b423c5d8 100644 --- a/cocos/2d/CCEventListenerTouch.cpp +++ b/cocos/2d/CCEventListenerTouch.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventListenerTouch.h b/cocos/2d/CCEventListenerTouch.h index 5f1ddd2845..7577bbc180 100644 --- a/cocos/2d/CCEventListenerTouch.h +++ b/cocos/2d/CCEventListenerTouch.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventMouse.cpp b/cocos/2d/CCEventMouse.cpp index f9d6fcd7a8..a787c79758 100644 --- a/cocos/2d/CCEventMouse.cpp +++ b/cocos/2d/CCEventMouse.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventMouse.h b/cocos/2d/CCEventMouse.h index ee563a7abc..8da29b84fb 100644 --- a/cocos/2d/CCEventMouse.h +++ b/cocos/2d/CCEventMouse.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventTouch.cpp b/cocos/2d/CCEventTouch.cpp index 9cfa0edd8d..f380d412ad 100644 --- a/cocos/2d/CCEventTouch.cpp +++ b/cocos/2d/CCEventTouch.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventTouch.h b/cocos/2d/CCEventTouch.h index 3bc18f55ca..9a8037d494 100644 --- a/cocos/2d/CCEventTouch.h +++ b/cocos/2d/CCEventTouch.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCEventType.h b/cocos/2d/CCEventType.h index 46cb1a1985..bc3b8a6194 100644 --- a/cocos/2d/CCEventType.h +++ b/cocos/2d/CCEventType.h @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef __CCEVENT_TYPE_H__ #define __CCEVENT_TYPE_H__ diff --git a/cocos/2d/CCFont.cpp b/cocos/2d/CCFont.cpp index 471346a5ad..dc363cfe02 100644 --- a/cocos/2d/CCFont.cpp +++ b/cocos/2d/CCFont.cpp @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCFont.h b/cocos/2d/CCFont.h index dfd5dd7ecc..440da0808b 100644 --- a/cocos/2d/CCFont.h +++ b/cocos/2d/CCFont.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index a4dcb8fd19..4d35ce980d 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. - + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCFontAtlas.h b/cocos/2d/CCFontAtlas.h index 044b0cdb5e..0a2d6f215b 100644 --- a/cocos/2d/CCFontAtlas.h +++ b/cocos/2d/CCFontAtlas.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp index 69eebc083a..ccea76b254 100644 --- a/cocos/2d/CCFontAtlasCache.cpp +++ b/cocos/2d/CCFontAtlasCache.cpp @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCFontAtlasCache.h b/cocos/2d/CCFontAtlasCache.h index acbbb28ca9..bdc7dd24d1 100644 --- a/cocos/2d/CCFontAtlasCache.h +++ b/cocos/2d/CCFontAtlasCache.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCFontAtlasFactory.cpp b/cocos/2d/CCFontAtlasFactory.cpp index 8e532af2c5..c9d3ebbb3b 100644 --- a/cocos/2d/CCFontAtlasFactory.cpp +++ b/cocos/2d/CCFontAtlasFactory.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. - + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCFontAtlasFactory.h b/cocos/2d/CCFontAtlasFactory.h index b03806dccd..2a10cc8d63 100644 --- a/cocos/2d/CCFontAtlasFactory.h +++ b/cocos/2d/CCFontAtlasFactory.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCFontDefinition.cpp b/cocos/2d/CCFontDefinition.cpp index d8414dc64d..c0d8af5051 100644 --- a/cocos/2d/CCFontDefinition.cpp +++ b/cocos/2d/CCFontDefinition.cpp @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCFontDefinition.h b/cocos/2d/CCFontDefinition.h index 1f9504920c..5bec2bb098 100644 --- a/cocos/2d/CCFontDefinition.h +++ b/cocos/2d/CCFontDefinition.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCFontFNT.cpp b/cocos/2d/CCFontFNT.cpp index 7ea6609f5c..93fd5c2410 100644 --- a/cocos/2d/CCFontFNT.cpp +++ b/cocos/2d/CCFontFNT.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. - + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCFontFNT.h b/cocos/2d/CCFontFNT.h index e9c4327672..eec0bd761c 100644 --- a/cocos/2d/CCFontFNT.h +++ b/cocos/2d/CCFontFNT.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 77a64bcfd9..60b5a11954 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. - +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCFontFreeType.h b/cocos/2d/CCFontFreeType.h index 7ff7596c20..bd86c5effc 100644 --- a/cocos/2d/CCFontFreeType.h +++ b/cocos/2d/CCFontFreeType.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCGLBufferedNode.cpp b/cocos/2d/CCGLBufferedNode.cpp index 0f97908370..ec3484fcde 100644 --- a/cocos/2d/CCGLBufferedNode.cpp +++ b/cocos/2d/CCGLBufferedNode.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. - +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCGLBufferedNode.h b/cocos/2d/CCGLBufferedNode.h index 10bf825462..4cc28a4721 100644 --- a/cocos/2d/CCGLBufferedNode.h +++ b/cocos/2d/CCGLBufferedNode.h @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. - +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCGLProgram.cpp b/cocos/2d/CCGLProgram.cpp index 0d9441cde3..e26adcd792 100644 --- a/cocos/2d/CCGLProgram.cpp +++ b/cocos/2d/CCGLProgram.cpp @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright 2012 cocos2d-x.org Copyright 2011 Jeff Lamarche Copyright 2012 Goffredo Marocchi Copyright 2012 Ricardo Quesada +Copyright 2012 cocos2d-x.org +Copyright 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCGLProgram.h b/cocos/2d/CCGLProgram.h index 84aaa113fa..eef956d687 100644 --- a/cocos/2d/CCGLProgram.h +++ b/cocos/2d/CCGLProgram.h @@ -1,9 +1,11 @@ /**************************************************************************** -Copyright 2012 cocos2d-x.org Copyright 2011 Jeff Lamarche Copyright 2012 Goffredo Marocchi Copyright 2012 Ricardo Quesada - +Copyright 2012 cocos2d-x.org +Copyright 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCGrabber.cpp b/cocos/2d/CCGrabber.cpp index 4486e58712..0475cca87b 100644 --- a/cocos/2d/CCGrabber.cpp +++ b/cocos/2d/CCGrabber.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 On-Core +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (C) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCGrabber.h b/cocos/2d/CCGrabber.h index 022e68ed0d..d3bdf1a07b 100644 --- a/cocos/2d/CCGrabber.h +++ b/cocos/2d/CCGrabber.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 On-Core +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (C) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCGrid.cpp b/cocos/2d/CCGrid.cpp index 06da510aed..53a86e8046 100644 --- a/cocos/2d/CCGrid.cpp +++ b/cocos/2d/CCGrid.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 On-Core - +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (C) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCGrid.h b/cocos/2d/CCGrid.h index 63e49547d8..8111190818 100644 --- a/cocos/2d/CCGrid.h +++ b/cocos/2d/CCGrid.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 On-Core +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (C) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCIMEDelegate.h b/cocos/2d/CCIMEDelegate.h index 053359abfc..d232236ceb 100644 --- a/cocos/2d/CCIMEDelegate.h +++ b/cocos/2d/CCIMEDelegate.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010 cocos2d-x.org +Copyright (C) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCIMEDispatcher.cpp b/cocos/2d/CCIMEDispatcher.cpp index 7bc493c988..c58f3d7d5e 100644 --- a/cocos/2d/CCIMEDispatcher.cpp +++ b/cocos/2d/CCIMEDispatcher.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - +Copyright (c) 2010 cocos2d-x.org +Copyright (C) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCIMEDispatcher.h b/cocos/2d/CCIMEDispatcher.h index ea551a4d3e..0f71c2fab6 100644 --- a/cocos/2d/CCIMEDispatcher.h +++ b/cocos/2d/CCIMEDispatcher.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - +Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index d0e203bbf4..00b3875877 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index aa33f8b72c..ea7462ab50 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. - + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index 63511eec7d..ddbf4df8f2 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCLabelAtlas.h b/cocos/2d/CCLabelAtlas.h index 743100cdbe..a55abf1c36 100644 --- a/cocos/2d/CCLabelAtlas.h +++ b/cocos/2d/CCLabelAtlas.h @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. - +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCLabelBMFont.cpp b/cocos/2d/CCLabelBMFont.cpp index d3008ba72a..539c5dab6a 100644 --- a/cocos/2d/CCLabelBMFont.cpp +++ b/cocos/2d/CCLabelBMFont.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCLabelBMFont.h b/cocos/2d/CCLabelBMFont.h index 58fb570f2b..5edda128e1 100644 --- a/cocos/2d/CCLabelBMFont.h +++ b/cocos/2d/CCLabelBMFont.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCLabelTTF.cpp b/cocos/2d/CCLabelTTF.cpp index 52fd5ebbd4..74483aa8c1 100644 --- a/cocos/2d/CCLabelTTF.cpp +++ b/cocos/2d/CCLabelTTF.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCLabelTTF.h b/cocos/2d/CCLabelTTF.h index c9d4f9de26..aa612adb17 100644 --- a/cocos/2d/CCLabelTTF.h +++ b/cocos/2d/CCLabelTTF.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada - +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCLabelTextFormatProtocol.h b/cocos/2d/CCLabelTextFormatProtocol.h index 179849e033..bf72775a51 100644 --- a/cocos/2d/CCLabelTextFormatProtocol.h +++ b/cocos/2d/CCLabelTextFormatProtocol.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp index 7c95dc8b13..956c5c3bb1 100644 --- a/cocos/2d/CCLabelTextFormatter.cpp +++ b/cocos/2d/CCLabelTextFormatter.cpp @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCLabelTextFormatter.h b/cocos/2d/CCLabelTextFormatter.h index f8569aca40..f6a7ecdec9 100644 --- a/cocos/2d/CCLabelTextFormatter.h +++ b/cocos/2d/CCLabelTextFormatter.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index 488dbc3d1a..177476c6f0 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. - +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCLayer.h b/cocos/2d/CCLayer.h index adc938909e..c75f704a35 100644 --- a/cocos/2d/CCLayer.h +++ b/cocos/2d/CCLayer.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCMenu.cpp b/cocos/2d/CCMenu.cpp index c6d2b787eb..c6cb20c5c1 100644 --- a/cocos/2d/CCMenu.cpp +++ b/cocos/2d/CCMenu.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCMenu.h b/cocos/2d/CCMenu.h index 2d3467d5b8..8d6cd5f4e9 100644 --- a/cocos/2d/CCMenu.h +++ b/cocos/2d/CCMenu.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCMenuItem.cpp b/cocos/2d/CCMenuItem.cpp index 7ec1097ee1..d097e1d30a 100644 --- a/cocos/2d/CCMenuItem.cpp +++ b/cocos/2d/CCMenuItem.cpp @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2008-2011 Ricardo Quesada Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCMenuItem.h b/cocos/2d/CCMenuItem.h index d44dd60d97..9e19b4488e 100644 --- a/cocos/2d/CCMenuItem.h +++ b/cocos/2d/CCMenuItem.h @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2008-2011 Ricardo Quesada Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCMotionStreak.cpp b/cocos/2d/CCMotionStreak.cpp index a358399bf5..4e248b7ea1 100644 --- a/cocos/2d/CCMotionStreak.cpp +++ b/cocos/2d/CCMotionStreak.cpp @@ -1,6 +1,7 @@ /**************************************************************************** +Copyright (c) 2011 ForzeField Studios S.L. Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 ForzeField Studios S.L. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCMotionStreak.h b/cocos/2d/CCMotionStreak.h index 33ef3217d1..09daacf5f6 100644 --- a/cocos/2d/CCMotionStreak.h +++ b/cocos/2d/CCMotionStreak.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 ForzeField Studios S.L. +Copyright (c) 2011 ForzeField Studios S.L. +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index d992a6e821..6e38937d19 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2009 Valentin Milea +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 46cac36cdb..09da015dd6 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -1,8 +1,9 @@ /**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2009 Valentin Milea - Copyright (c) 2011 Zynga Inc. +Copyright (c) 2009 Valentin Milea +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCNodeGrid.cpp b/cocos/2d/CCNodeGrid.cpp index ddf5e69590..90d5647a57 100644 --- a/cocos/2d/CCNodeGrid.cpp +++ b/cocos/2d/CCNodeGrid.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCNodeGrid.h b/cocos/2d/CCNodeGrid.h index c73ef07a76..b46a3fab72 100644 --- a/cocos/2d/CCNodeGrid.h +++ b/cocos/2d/CCNodeGrid.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCNotificationCenter.cpp b/cocos/2d/CCNotificationCenter.cpp index 081d699ea1..98452f82cd 100644 --- a/cocos/2d/CCNotificationCenter.cpp +++ b/cocos/2d/CCNotificationCenter.cpp @@ -1,6 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Erawppa +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCNotificationCenter.h b/cocos/2d/CCNotificationCenter.h index 8a1b8694ae..de75060feb 100644 --- a/cocos/2d/CCNotificationCenter.h +++ b/cocos/2d/CCNotificationCenter.h @@ -1,6 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Erawppa +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCParallaxNode.cpp b/cocos/2d/CCParallaxNode.cpp index 608a60964b..a2e165ce85 100644 --- a/cocos/2d/CCParallaxNode.cpp +++ b/cocos/2d/CCParallaxNode.cpp @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCParallaxNode.h b/cocos/2d/CCParallaxNode.h index 723b467985..827c5074e3 100644 --- a/cocos/2d/CCParallaxNode.h +++ b/cocos/2d/CCParallaxNode.h @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index e58f919b92..5b78d1256f 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -1,9 +1,10 @@ /* - * Copyright (c) 2010-2012 cocos2d-x.org * Copyright (C) 2009 Matt Oswald * Copyright (c) 2009-2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * Copyright (c) 2011 Marco Tillemans + * Copyright (c) 2010-2012 cocos2d-x.org + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2011 Marco Tillemans + * Copyright (c) 2013-2014 Chukong Technologies Inc. * * http://www.cocos2d-x.org * diff --git a/cocos/2d/CCParticleBatchNode.h b/cocos/2d/CCParticleBatchNode.h index 41fb9e5d40..d4fd276603 100644 --- a/cocos/2d/CCParticleBatchNode.h +++ b/cocos/2d/CCParticleBatchNode.h @@ -1,9 +1,10 @@ /* - * Copyright (c) 2010-2012 cocos2d-x.org * Copyright (C) 2009 Matt Oswald * Copyright (c) 2009-2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * Copyright (c) 2011 Marco Tillemans + * Copyright (c) 2010-2012 cocos2d-x.org + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2011 Marco Tillemans + * Copyright (c) 2013-2014 Chukong Technologies Inc. * * http://www.cocos2d-x.org * diff --git a/cocos/2d/CCParticleExamples.cpp b/cocos/2d/CCParticleExamples.cpp index 6f7a307db3..dafe9d09ec 100644 --- a/cocos/2d/CCParticleExamples.cpp +++ b/cocos/2d/CCParticleExamples.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCParticleExamples.h b/cocos/2d/CCParticleExamples.h index 325bcd59f9..4d72dfe11c 100644 --- a/cocos/2d/CCParticleExamples.h +++ b/cocos/2d/CCParticleExamples.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index f7855ad799..1b7d904a40 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCParticleSystem.h b/cocos/2d/CCParticleSystem.h index c09dc527a6..32c362ecf3 100644 --- a/cocos/2d/CCParticleSystem.h +++ b/cocos/2d/CCParticleSystem.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index bf589d85b9..579db6c024 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2009 Leonardo KasperaviÄius +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCParticleSystemQuad.h b/cocos/2d/CCParticleSystemQuad.h index 9901655313..42c338b304 100644 --- a/cocos/2d/CCParticleSystemQuad.h +++ b/cocos/2d/CCParticleSystemQuad.h @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2009 Leonardo KasperaviÄius +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCProfiling.cpp b/cocos/2d/CCProfiling.cpp index c7d9c606e5..3f6979a951 100644 --- a/cocos/2d/CCProfiling.cpp +++ b/cocos/2d/CCProfiling.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2010 Stuart Carnie +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCProfiling.h b/cocos/2d/CCProfiling.h index 8c122c8679..97f1a7c92d 100644 --- a/cocos/2d/CCProfiling.h +++ b/cocos/2d/CCProfiling.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2010 Stuart Carnie +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp index ee783e0e82..d608211acd 100644 --- a/cocos/2d/CCProgressTimer.cpp +++ b/cocos/2d/CCProgressTimer.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2010 Lam Pham +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc http://www.cocos2d-x.org diff --git a/cocos/2d/CCProgressTimer.h b/cocos/2d/CCProgressTimer.h index 5ed9308e81..de70a502dc 100644 --- a/cocos/2d/CCProgressTimer.h +++ b/cocos/2d/CCProgressTimer.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2010 Lam Pham +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCProtocols.h b/cocos/2d/CCProtocols.h index 54282b36f7..0e93f8328c 100644 --- a/cocos/2d/CCProtocols.h +++ b/cocos/2d/CCProtocols.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 46d7662e02..efaad582ef 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 Jason Booth +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCRenderTexture.h b/cocos/2d/CCRenderTexture.h index 58b38787a5..0d25d91002 100644 --- a/cocos/2d/CCRenderTexture.h +++ b/cocos/2d/CCRenderTexture.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 Jason Booth +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCScene.cpp b/cocos/2d/CCScene.cpp index 2dcf75283c..a03a1b0fbc 100644 --- a/cocos/2d/CCScene.cpp +++ b/cocos/2d/CCScene.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCScene.h b/cocos/2d/CCScene.h index 21576a87a7..a99912b3f9 100644 --- a/cocos/2d/CCScene.h +++ b/cocos/2d/CCScene.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCScheduler.cpp b/cocos/2d/CCScheduler.cpp index 28353ec368..2495fd930e 100644 --- a/cocos/2d/CCScheduler.cpp +++ b/cocos/2d/CCScheduler.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCScheduler.h b/cocos/2d/CCScheduler.h index 3146729205..21ed5abd6d 100644 --- a/cocos/2d/CCScheduler.h +++ b/cocos/2d/CCScheduler.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCScriptSupport.cpp b/cocos/2d/CCScriptSupport.cpp index 0668b9ff6b..4857638889 100644 --- a/cocos/2d/CCScriptSupport.cpp +++ b/cocos/2d/CCScriptSupport.cpp @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCScriptSupport.h b/cocos/2d/CCScriptSupport.h index c67e5350bc..631df08d08 100644 --- a/cocos/2d/CCScriptSupport.h +++ b/cocos/2d/CCScriptSupport.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCShaderCache.cpp b/cocos/2d/CCShaderCache.cpp index c727294e30..d22a899093 100644 --- a/cocos/2d/CCShaderCache.cpp +++ b/cocos/2d/CCShaderCache.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCShaderCache.h b/cocos/2d/CCShaderCache.h index ee65bc33b9..98f08dcc33 100644 --- a/cocos/2d/CCShaderCache.h +++ b/cocos/2d/CCShaderCache.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 0e1f7c10aa..271f1e8db9 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index e9e3f06cff..0a937a64e1 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index a2f9f79682..3ef2e183e9 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2009 Matt Oswald +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCSpriteBatchNode.h b/cocos/2d/CCSpriteBatchNode.h index 28c7b382aa..fc140aa391 100644 --- a/cocos/2d/CCSpriteBatchNode.h +++ b/cocos/2d/CCSpriteBatchNode.h @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009-2010 Ricardo Quesada -Copyright (C) 2009 Matt Oswald +Copyright (c) 2009 Matt Oswald +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCSpriteFrame.cpp b/cocos/2d/CCSpriteFrame.cpp index 63dce33227..611318b43e 100644 --- a/cocos/2d/CCSpriteFrame.cpp +++ b/cocos/2d/CCSpriteFrame.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2011 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCSpriteFrame.h b/cocos/2d/CCSpriteFrame.h index 7c403c33ef..05c96d7e2a 100644 --- a/cocos/2d/CCSpriteFrame.h +++ b/cocos/2d/CCSpriteFrame.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2011 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index c607da7194..a2b289ced6 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -1,9 +1,10 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2009 Jason Booth Copyright (c) 2009 Robert J Payne +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h index d9fff83c08..df346c76bd 100644 --- a/cocos/2d/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -1,9 +1,10 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2009 Jason Booth Copyright (c) 2009 Robert J Payne +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp index 9bc07202d1..53aec1b035 100644 --- a/cocos/2d/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h index 576e9e55e4..eb9b9eab75 100644 --- a/cocos/2d/CCTMXLayer.h +++ b/cocos/2d/CCTMXLayer.h @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTMXObjectGroup.cpp b/cocos/2d/CCTMXObjectGroup.cpp index 3cc08a0473..344185fc60 100644 --- a/cocos/2d/CCTMXObjectGroup.cpp +++ b/cocos/2d/CCTMXObjectGroup.cpp @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2010 Neophit Copyright (c) 2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTMXObjectGroup.h b/cocos/2d/CCTMXObjectGroup.h index 2064b6bd67..85f0f59272 100644 --- a/cocos/2d/CCTMXObjectGroup.h +++ b/cocos/2d/CCTMXObjectGroup.h @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2010 Neophit Copyright (c) 2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 5cd4bba307..33a4b77519 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTMXTiledMap.h b/cocos/2d/CCTMXTiledMap.h index 77530cf5d3..01074dd671 100644 --- a/cocos/2d/CCTMXTiledMap.h +++ b/cocos/2d/CCTMXTiledMap.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index 0ff3060340..2aac324dad 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -1,8 +1,9 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 МакÑим ÐкÑенов +Copyright (c) 2011 МакÑим ÐкÑенов Copyright (c) 2009-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index 68a520a157..621a197734 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp index 34240535ca..b00a69bbdb 100644 --- a/cocos/2d/CCTextFieldTTF.cpp +++ b/cocos/2d/CCTextFieldTTF.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTextFieldTTF.h b/cocos/2d/CCTextFieldTTF.h index 5c011b18cc..b1a69ba6b2 100644 --- a/cocos/2d/CCTextFieldTTF.h +++ b/cocos/2d/CCTextFieldTTF.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTextImage.cpp b/cocos/2d/CCTextImage.cpp index 97ab7dd8a0..d47ab768d0 100644 --- a/cocos/2d/CCTextImage.cpp +++ b/cocos/2d/CCTextImage.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. - + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/CCTextImage.h b/cocos/2d/CCTextImage.h index 3cfda7e18d..1c0da97201 100644 --- a/cocos/2d/CCTextImage.h +++ b/cocos/2d/CCTextImage.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2013 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTexture2D.cpp b/cocos/2d/CCTexture2D.cpp index 09539152a7..120ffe83d5 100644 --- a/cocos/2d/CCTexture2D.cpp +++ b/cocos/2d/CCTexture2D.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008 Apple Inc. All Rights Reserved. +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTexture2D.h b/cocos/2d/CCTexture2D.h index efd9b99abc..a2e259867e 100644 --- a/cocos/2d/CCTexture2D.h +++ b/cocos/2d/CCTexture2D.h @@ -1,6 +1,7 @@ /**************************************************************************** +Copyright (c) 2008 Apple Inc. All Rights Reserved. Copyright (c) 2010-2012 cocos2d-x.org -Copyright (C) 2008 Apple Inc. All Rights Reserved. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTextureAtlas.cpp b/cocos/2d/CCTextureAtlas.cpp index 83dce8b3c1..8a9818d8fc 100644 --- a/cocos/2d/CCTextureAtlas.cpp +++ b/cocos/2d/CCTextureAtlas.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTextureAtlas.h b/cocos/2d/CCTextureAtlas.h index 09cc0769f5..ba9c0047ff 100644 --- a/cocos/2d/CCTextureAtlas.h +++ b/cocos/2d/CCTextureAtlas.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp index ecfb1c75fb..c3526f0b46 100644 --- a/cocos/2d/CCTextureCache.cpp +++ b/cocos/2d/CCTextureCache.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTextureCache.h b/cocos/2d/CCTextureCache.h index 5b5c9ac95e..800f910352 100644 --- a/cocos/2d/CCTextureCache.h +++ b/cocos/2d/CCTextureCache.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTileMapAtlas.cpp b/cocos/2d/CCTileMapAtlas.cpp index 0956677088..17dd396116 100644 --- a/cocos/2d/CCTileMapAtlas.cpp +++ b/cocos/2d/CCTileMapAtlas.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTileMapAtlas.h b/cocos/2d/CCTileMapAtlas.h index 169be3fc88..79b561026f 100644 --- a/cocos/2d/CCTileMapAtlas.h +++ b/cocos/2d/CCTileMapAtlas.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTouch.cpp b/cocos/2d/CCTouch.cpp index c7743d7e75..20629b3ef5 100644 --- a/cocos/2d/CCTouch.cpp +++ b/cocos/2d/CCTouch.cpp @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTouch.h b/cocos/2d/CCTouch.h index 1ed19d3112..e27ac187d3 100644 --- a/cocos/2d/CCTouch.h +++ b/cocos/2d/CCTouch.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTransition.cpp b/cocos/2d/CCTransition.cpp index 4213232139..ed22b68651 100644 --- a/cocos/2d/CCTransition.cpp +++ b/cocos/2d/CCTransition.cpp @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTransition.h b/cocos/2d/CCTransition.h index 136dafe568..471f2f1d7b 100644 --- a/cocos/2d/CCTransition.h +++ b/cocos/2d/CCTransition.h @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTransitionPageTurn.cpp b/cocos/2d/CCTransitionPageTurn.cpp index a4bc2fbe15..7ade9878a4 100644 --- a/cocos/2d/CCTransitionPageTurn.cpp +++ b/cocos/2d/CCTransitionPageTurn.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/ +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTransitionPageTurn.h b/cocos/2d/CCTransitionPageTurn.h index f21598c8f2..f422ef0b82 100644 --- a/cocos/2d/CCTransitionPageTurn.h +++ b/cocos/2d/CCTransitionPageTurn.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/ +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTransitionProgress.cpp b/cocos/2d/CCTransitionProgress.cpp index 7e9d3bbc10..5735f1bb40 100644 --- a/cocos/2d/CCTransitionProgress.cpp +++ b/cocos/2d/CCTransitionProgress.cpp @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2009 Lam Pham Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2009 Lam Pham -Copyright (c) 2012 Ricardo Quesada +Copyright (c) 2012 Ricardo Quesada +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCTransitionProgress.h b/cocos/2d/CCTransitionProgress.h index 46685b339c..cf02cb408b 100644 --- a/cocos/2d/CCTransitionProgress.h +++ b/cocos/2d/CCTransitionProgress.h @@ -1,7 +1,8 @@ /**************************************************************************** +Copyright (c) 2009 Lam Pham Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2009 Lam Pham -Copyright (c) 2012 Ricardo Quesada +Copyright (c) 2012 Ricardo Quesada +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCUserDefault.cpp b/cocos/2d/CCUserDefault.cpp index 90e721e436..536d4c1584 100644 --- a/cocos/2d/CCUserDefault.cpp +++ b/cocos/2d/CCUserDefault.cpp @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCUserDefault.h b/cocos/2d/CCUserDefault.h index b38e705e7e..82bd6ef565 100644 --- a/cocos/2d/CCUserDefault.h +++ b/cocos/2d/CCUserDefault.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCUserDefault.mm b/cocos/2d/CCUserDefault.mm index 6193113a85..5d68077ea1 100644 --- a/cocos/2d/CCUserDefault.mm +++ b/cocos/2d/CCUserDefault.mm @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCUserDefaultAndroid.cpp b/cocos/2d/CCUserDefaultAndroid.cpp index af82d29364..639aa0e702 100644 --- a/cocos/2d/CCUserDefaultAndroid.cpp +++ b/cocos/2d/CCUserDefaultAndroid.cpp @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCVertex.cpp b/cocos/2d/CCVertex.cpp index 300b50473b..7086b4b23b 100644 --- a/cocos/2d/CCVertex.cpp +++ b/cocos/2d/CCVertex.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 ForzeField Studios S.L + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/CCVertex.h b/cocos/2d/CCVertex.h index b7abd7b110..bcf2d4a0d3 100644 --- a/cocos/2d/CCVertex.h +++ b/cocos/2d/CCVertex.h @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 ForzeField Studios S.L + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/TGAlib.cpp b/cocos/2d/TGAlib.cpp index 271ec91106..d37529efb3 100644 --- a/cocos/2d/TGAlib.cpp +++ b/cocos/2d/TGAlib.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/TGAlib.h b/cocos/2d/TGAlib.h index 8388d734e7..987826dd8f 100644 --- a/cocos/2d/TGAlib.h +++ b/cocos/2d/TGAlib.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/TransformUtils.cpp b/cocos/2d/TransformUtils.cpp index 85dbfc86e5..ab3d8ff09b 100644 --- a/cocos/2d/TransformUtils.cpp +++ b/cocos/2d/TransformUtils.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 Valentin Milea +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/TransformUtils.h b/cocos/2d/TransformUtils.h index 1684a66cb0..83072d7ccb 100644 --- a/cocos/2d/TransformUtils.h +++ b/cocos/2d/TransformUtils.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2009 Valentin Milea +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ZipUtils.cpp b/cocos/2d/ZipUtils.cpp index 6f0a4de462..79c0fac4dd 100644 --- a/cocos/2d/ZipUtils.cpp +++ b/cocos/2d/ZipUtils.cpp @@ -1,6 +1,7 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/ZipUtils.h b/cocos/2d/ZipUtils.h index cbe4400c8e..3611679248 100644 --- a/cocos/2d/ZipUtils.h +++ b/cocos/2d/ZipUtils.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/base64.cpp b/cocos/2d/base64.cpp index 4ef50c659b..04b6a8350d 100644 --- a/cocos/2d/base64.cpp +++ b/cocos/2d/base64.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/base64.h b/cocos/2d/base64.h index fd95485d9e..67149d78ed 100644 --- a/cocos/2d/base64.h +++ b/cocos/2d/base64.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/ccCArray.cpp b/cocos/2d/ccCArray.cpp index d9ea0ac11d..9c43756ffd 100644 --- a/cocos/2d/ccCArray.cpp +++ b/cocos/2d/ccCArray.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2007 Scott Lembcke +Copyright (c) 2010-2012 cocos2d-x.org +CopyRight (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ccCArray.h b/cocos/2d/ccCArray.h index 08228ad0fe..f069301098 100644 --- a/cocos/2d/ccCArray.h +++ b/cocos/2d/ccCArray.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2007 Scott Lembcke +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ccConfig.h b/cocos/2d/ccConfig.h index e411a8d658..cdaceb80a0 100644 --- a/cocos/2d/ccConfig.h +++ b/cocos/2d/ccConfig.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ccGLStateCache.cpp b/cocos/2d/ccGLStateCache.cpp index d1cc2d1d7e..97599289d1 100644 --- a/cocos/2d/ccGLStateCache.cpp +++ b/cocos/2d/ccGLStateCache.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (C) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ccGLStateCache.h b/cocos/2d/ccGLStateCache.h index 32bf5584be..a33f8ba59d 100644 --- a/cocos/2d/ccGLStateCache.h +++ b/cocos/2d/ccGLStateCache.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 Ricardo Quesada -Copyright (c) 2011 Zynga Inc. + Copyright (c) 2011 Ricardo Quesada + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2011 Zynga Inc. + Copyright (C) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ccMacros.h b/cocos/2d/ccMacros.h index 6332ae6078..8196fbac0c 100644 --- a/cocos/2d/ccMacros.h +++ b/cocos/2d/ccMacros.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ccShaders.cpp b/cocos/2d/ccShaders.cpp index 95d04a4995..38d22e1c44 100644 --- a/cocos/2d/ccShaders.cpp +++ b/cocos/2d/ccShaders.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ccShaders.h b/cocos/2d/ccShaders.h index e086fef68d..97fc404b95 100644 --- a/cocos/2d/ccShaders.h +++ b/cocos/2d/ccShaders.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ccTypes.cpp b/cocos/2d/ccTypes.cpp index da1430110d..b0bfefc710 100644 --- a/cocos/2d/ccTypes.cpp +++ b/cocos/2d/ccTypes.cpp @@ -1,5 +1,8 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ccTypes.h b/cocos/2d/ccTypes.h index 7083a34d6e..98219eaddf 100644 --- a/cocos/2d/ccTypes.h +++ b/cocos/2d/ccTypes.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ccUTF8.cpp b/cocos/2d/ccUTF8.cpp index ba639eef37..ceb240d2e6 100644 --- a/cocos/2d/ccUTF8.cpp +++ b/cocos/2d/ccUTF8.cpp @@ -3,8 +3,9 @@ * * gutf8.c - Operations on UTF-8 strings. * - * Copyright (C) 1999 Tom Tromey - * Copyright (C) 2000 Red Hat, Inc. + * Copyright (C) 1999 Tom Tromey + * Copyright (C) 2000 Red Hat, Inc. + * Copyright (c) 2013-2014 Chukong Technologies Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/cocos/2d/ccUTF8.h b/cocos/2d/ccUTF8.h index 86bf8b3e65..352a4db41a 100644 --- a/cocos/2d/ccUTF8.h +++ b/cocos/2d/ccUTF8.h @@ -1,9 +1,23 @@ -// -// ccUTF8.h -// cocos2dx -// -// Created by James Chen on 2/27/13. -// +/* + * Copyright (C) 1999 Tom Tromey + * Copyright (C) 2000 Red Hat, Inc. + * Copyright (c) 2013-2014 Chukong Technologies Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ #ifndef __cocos2dx__ccUTF8__ #define __cocos2dx__ccUTF8__ diff --git a/cocos/2d/ccUtils.cpp b/cocos/2d/ccUtils.cpp index e9d6eedf4a..3201054332 100644 --- a/cocos/2d/ccUtils.cpp +++ b/cocos/2d/ccUtils.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/ccUtils.h b/cocos/2d/ccUtils.h index 3379db33bf..a30cc72288 100644 --- a/cocos/2d/ccUtils.h +++ b/cocos/2d/ccUtils.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/cocos2d.cpp b/cocos/2d/cocos2d.cpp index d3eb4f8ce9..99adc6518c 100644 --- a/cocos/2d/cocos2d.cpp +++ b/cocos/2d/cocos2d.cpp @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/cocos2d.h b/cocos/2d/cocos2d.h index fceec68f6a..3476f536a5 100644 --- a/cocos/2d/cocos2d.h +++ b/cocos/2d/cocos2d.h @@ -1,7 +1,8 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/CCApplicationProtocol.h b/cocos/2d/platform/CCApplicationProtocol.h index bd88cc0646..9042c649d0 100644 --- a/cocos/2d/platform/CCApplicationProtocol.h +++ b/cocos/2d/platform/CCApplicationProtocol.h @@ -1,3 +1,28 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + #ifndef __CC_APPLICATION_PROTOCOL_H__ #define __CC_APPLICATION_PROTOCOL_H__ diff --git a/cocos/2d/platform/CCCommon.h b/cocos/2d/platform/CCCommon.h index 75dc85e90d..eb4f6fa9cb 100644 --- a/cocos/2d/platform/CCCommon.h +++ b/cocos/2d/platform/CCCommon.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/CCDevice.h b/cocos/2d/platform/CCDevice.h index 65d5a3f3b7..0bea8f2000 100644 --- a/cocos/2d/platform/CCDevice.h +++ b/cocos/2d/platform/CCDevice.h @@ -1,3 +1,28 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + #ifndef __CCDEVICE_H__ #define __CCDEVICE_H__ diff --git a/cocos/2d/platform/CCEGLViewProtocol.cpp b/cocos/2d/platform/CCEGLViewProtocol.cpp index b99e1cfe65..f494ddf44d 100644 --- a/cocos/2d/platform/CCEGLViewProtocol.cpp +++ b/cocos/2d/platform/CCEGLViewProtocol.cpp @@ -1,3 +1,28 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + #include "CCEGLViewProtocol.h" #include "CCTouch.h" #include "CCDirector.h" diff --git a/cocos/2d/platform/CCEGLViewProtocol.h b/cocos/2d/platform/CCEGLViewProtocol.h index 6b74f58962..45bea52eed 100644 --- a/cocos/2d/platform/CCEGLViewProtocol.h +++ b/cocos/2d/platform/CCEGLViewProtocol.h @@ -1,3 +1,28 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + #ifndef __CCEGLVIEWPROTOCOL_H__ #define __CCEGLVIEWPROTOCOL_H__ diff --git a/cocos/2d/platform/CCFileUtils.cpp b/cocos/2d/platform/CCFileUtils.cpp index 01ae6064e0..3404675922 100644 --- a/cocos/2d/platform/CCFileUtils.cpp +++ b/cocos/2d/platform/CCFileUtils.cpp @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/CCFileUtils.h b/cocos/2d/platform/CCFileUtils.h index 03cbb3a2a1..0a29d6efe5 100644 --- a/cocos/2d/platform/CCFileUtils.h +++ b/cocos/2d/platform/CCFileUtils.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/CCImage.h b/cocos/2d/platform/CCImage.h index c89bcd3412..03de5e6eba 100644 --- a/cocos/2d/platform/CCImage.h +++ b/cocos/2d/platform/CCImage.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/CCImageCommon_cpp.h b/cocos/2d/platform/CCImageCommon_cpp.h index 64cef42ea1..6c5c7a2d96 100644 --- a/cocos/2d/platform/CCImageCommon_cpp.h +++ b/cocos/2d/platform/CCImageCommon_cpp.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/CCSAXParser.cpp b/cocos/2d/platform/CCSAXParser.cpp index 0c5282bfe1..75dd1c0415 100644 --- a/cocos/2d/platform/CCSAXParser.cpp +++ b/cocos/2d/platform/CCSAXParser.cpp @@ -1,6 +1,6 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org http://cocos2d-x.org Copyright (c) 2010 МакÑим ÐкÑенов + Copyright (c) 2010 cocos2d-x.org Copyright (c) 2013 Martell Malone Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/platform/CCSAXParser.h b/cocos/2d/platform/CCSAXParser.h index 63665f4ec7..230572e306 100644 --- a/cocos/2d/platform/CCSAXParser.h +++ b/cocos/2d/platform/CCSAXParser.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org http://cocos2d-x.org + Copyright (c) 2010 cocos2d-x.org Copyright (c) 2010 МакÑим ÐкÑенов Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/2d/platform/CCThread.cpp b/cocos/2d/platform/CCThread.cpp index 0a33d2ddf6..b3e9e96c39 100644 --- a/cocos/2d/platform/CCThread.cpp +++ b/cocos/2d/platform/CCThread.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/CCThread.h b/cocos/2d/platform/CCThread.h index 7596d29c02..6f5ae244f0 100644 --- a/cocos/2d/platform/CCThread.h +++ b/cocos/2d/platform/CCThread.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/CCApplication.cpp b/cocos/2d/platform/android/CCApplication.cpp index 07c5814b3e..3c5b3191b3 100644 --- a/cocos/2d/platform/android/CCApplication.cpp +++ b/cocos/2d/platform/android/CCApplication.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "jni/JniHelper.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" #include "CCApplication.h" diff --git a/cocos/2d/platform/android/CCApplication.h b/cocos/2d/platform/android/CCApplication.h index d9b7d00f34..d3054c29d8 100644 --- a/cocos/2d/platform/android/CCApplication.h +++ b/cocos/2d/platform/android/CCApplication.h @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CC_APPLICATION_ANDROID_H__ #define __CC_APPLICATION_ANDROID_H__ diff --git a/cocos/2d/platform/android/CCCommon.cpp b/cocos/2d/platform/android/CCCommon.cpp index 277db4b14d..a24c002463 100644 --- a/cocos/2d/platform/android/CCCommon.cpp +++ b/cocos/2d/platform/android/CCCommon.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/CCDevice.cpp b/cocos/2d/platform/android/CCDevice.cpp index 2915cf6994..41c4aa1e9d 100644 --- a/cocos/2d/platform/android/CCDevice.cpp +++ b/cocos/2d/platform/android/CCDevice.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "platform/CCDevice.h" #include "jni/DPIJni.h" #include "nativeactivity.h" diff --git a/cocos/2d/platform/android/CCEGLView.cpp b/cocos/2d/platform/android/CCEGLView.cpp index c22babd3c1..e7da477e4e 100644 --- a/cocos/2d/platform/android/CCEGLView.cpp +++ b/cocos/2d/platform/android/CCEGLView.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/CCEGLView.h b/cocos/2d/platform/android/CCEGLView.h index cab0754d3e..dabb0a968d 100644 --- a/cocos/2d/platform/android/CCEGLView.h +++ b/cocos/2d/platform/android/CCEGLView.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/CCFileUtilsAndroid.cpp b/cocos/2d/platform/android/CCFileUtilsAndroid.cpp index 061cd9b789..45f4876323 100644 --- a/cocos/2d/platform/android/CCFileUtilsAndroid.cpp +++ b/cocos/2d/platform/android/CCFileUtilsAndroid.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/CCFileUtilsAndroid.h b/cocos/2d/platform/android/CCFileUtilsAndroid.h index f7819ab8ab..2def6e2566 100644 --- a/cocos/2d/platform/android/CCFileUtilsAndroid.h +++ b/cocos/2d/platform/android/CCFileUtilsAndroid.h @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/CCGL.h b/cocos/2d/platform/android/CCGL.h index 3c3160a694..6c9a2468e0 100644 --- a/cocos/2d/platform/android/CCGL.h +++ b/cocos/2d/platform/android/CCGL.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/CCImage.cpp b/cocos/2d/platform/android/CCImage.cpp index 3a9dcc2f06..60ce678cd4 100644 --- a/cocos/2d/platform/android/CCImage.cpp +++ b/cocos/2d/platform/android/CCImage.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/CCPlatformDefine.h b/cocos/2d/platform/android/CCPlatformDefine.h index 0780791326..8d146ebc14 100644 --- a/cocos/2d/platform/android/CCPlatformDefine.h +++ b/cocos/2d/platform/android/CCPlatformDefine.h @@ -1,3 +1,28 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ diff --git a/cocos/2d/platform/android/CCStdC.h b/cocos/2d/platform/android/CCStdC.h index 475142b51a..804abebceb 100644 --- a/cocos/2d/platform/android/CCStdC.h +++ b/cocos/2d/platform/android/CCStdC.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java index ef0ba4074e..578f7120c2 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010-2011 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java index 0b1a8a32d7..afebee4260 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java index fabc7e2b31..8c2fe378be 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2012 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java index b809b9d5c3..e1566df16d 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010-2013 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java index 99c9126400..d6dd3dd135 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java index 2dee611b29..80bfb15295 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java @@ -1,3 +1,26 @@ +/**************************************************************************** +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ package org.cocos2dx.lib; diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java index 2346389982..41793e24a9 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010-2011 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -21,6 +22,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + package org.cocos2dx.lib; import java.io.FileInputStream; diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java index 3bac47f621..9b8239da79 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010-2011 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java index b7495fba90..27451abb68 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010-2011 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/jni/IMEJni.cpp b/cocos/2d/platform/android/jni/IMEJni.cpp index 5cc75a8fcd..892b003739 100644 --- a/cocos/2d/platform/android/jni/IMEJni.cpp +++ b/cocos/2d/platform/android/jni/IMEJni.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2011-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/jni/IMEJni.h b/cocos/2d/platform/android/jni/IMEJni.h index 2d3dd62d87..d28850aa1d 100644 --- a/cocos/2d/platform/android/jni/IMEJni.h +++ b/cocos/2d/platform/android/jni/IMEJni.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2011-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp index 0e8f28a580..bdd9ee815f 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp +++ b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp @@ -1,3 +1,28 @@ +/**************************************************************************** +Copyright (c) 2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + #include "JniHelper.h" #include #include "CCDirector.h" diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h index 06e8474a1e..d26b861879 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h +++ b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp index bf353aca3f..3d69827626 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp +++ b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include #include #include diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h index 3d2ebf7cc5..4d3587a73e 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h +++ b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/jni/JniHelper.cpp b/cocos/2d/platform/android/jni/JniHelper.cpp index 9555643d7a..992e4ec2b8 100644 --- a/cocos/2d/platform/android/jni/JniHelper.cpp +++ b/cocos/2d/platform/android/jni/JniHelper.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/jni/JniHelper.h b/cocos/2d/platform/android/jni/JniHelper.h index 20955acf7e..3f57a85336 100644 --- a/cocos/2d/platform/android/jni/JniHelper.h +++ b/cocos/2d/platform/android/jni/JniHelper.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010-2011 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/android/nativeactivity.cpp b/cocos/2d/platform/android/nativeactivity.cpp index 8f6e7ce3e1..0e68cf0eb4 100644 --- a/cocos/2d/platform/android/nativeactivity.cpp +++ b/cocos/2d/platform/android/nativeactivity.cpp @@ -1,3 +1,26 @@ +/**************************************************************************** +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "nativeactivity.h" #include diff --git a/cocos/2d/platform/android/nativeactivity.h b/cocos/2d/platform/android/nativeactivity.h index 677fff3adf..bc7517f3cb 100644 --- a/cocos/2d/platform/android/nativeactivity.h +++ b/cocos/2d/platform/android/nativeactivity.h @@ -1,3 +1,26 @@ +/**************************************************************************** +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __COCOSNATIVEACTIVITY_H__ #define __COCOSNATIVEACTIVITY_H__ diff --git a/cocos/2d/platform/apple/CCFileUtilsApple.h b/cocos/2d/platform/apple/CCFileUtilsApple.h index 6903d42100..c11278d185 100644 --- a/cocos/2d/platform/apple/CCFileUtilsApple.h +++ b/cocos/2d/platform/apple/CCFileUtilsApple.h @@ -1,5 +1,7 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2011 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/apple/CCFileUtilsApple.mm b/cocos/2d/platform/apple/CCFileUtilsApple.mm index e1c20aba40..9c9443e0f7 100644 --- a/cocos/2d/platform/apple/CCFileUtilsApple.mm +++ b/cocos/2d/platform/apple/CCFileUtilsApple.mm @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/apple/CCLock.cpp b/cocos/2d/platform/apple/CCLock.cpp index 312cd377bd..0a6f29bfe5 100644 --- a/cocos/2d/platform/apple/CCLock.cpp +++ b/cocos/2d/platform/apple/CCLock.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/apple/CCLock.h b/cocos/2d/platform/apple/CCLock.h index 71d67e4371..db573603bb 100644 --- a/cocos/2d/platform/apple/CCLock.h +++ b/cocos/2d/platform/apple/CCLock.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/apple/CCThread.mm b/cocos/2d/platform/apple/CCThread.mm index 1d060c5028..a69398d013 100644 --- a/cocos/2d/platform/apple/CCThread.mm +++ b/cocos/2d/platform/apple/CCThread.mm @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/ios/CCApplication.h b/cocos/2d/platform/ios/CCApplication.h index a281a4f554..843a5d5b99 100644 --- a/cocos/2d/platform/ios/CCApplication.h +++ b/cocos/2d/platform/ios/CCApplication.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/ios/CCApplication.mm b/cocos/2d/platform/ios/CCApplication.mm index c09a0aa8a9..14b07975ca 100644 --- a/cocos/2d/platform/ios/CCApplication.mm +++ b/cocos/2d/platform/ios/CCApplication.mm @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/ios/CCCommon.mm b/cocos/2d/platform/ios/CCCommon.mm index 42b0dbfba8..0afbb57e73 100644 --- a/cocos/2d/platform/ios/CCCommon.mm +++ b/cocos/2d/platform/ios/CCCommon.mm @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/ios/CCDevice.mm b/cocos/2d/platform/ios/CCDevice.mm index e8610db653..a80efef136 100644 --- a/cocos/2d/platform/ios/CCDevice.mm +++ b/cocos/2d/platform/ios/CCDevice.mm @@ -1,3 +1,27 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #include "CCDevice.h" #include "ccTypes.h" #include "CCEventDispatcher.h" diff --git a/cocos/2d/platform/ios/CCDirectorCaller.h b/cocos/2d/platform/ios/CCDirectorCaller.h index f9a6ca330d..f3b4ee4c92 100644 --- a/cocos/2d/platform/ios/CCDirectorCaller.h +++ b/cocos/2d/platform/ios/CCDirectorCaller.h @@ -1,18 +1,19 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org - + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/cocos/2d/platform/ios/CCDirectorCaller.mm b/cocos/2d/platform/ios/CCDirectorCaller.mm index 092db285b3..957c8acff9 100644 --- a/cocos/2d/platform/ios/CCDirectorCaller.mm +++ b/cocos/2d/platform/ios/CCDirectorCaller.mm @@ -1,18 +1,19 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org - + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/cocos/2d/platform/ios/CCEGLView.h b/cocos/2d/platform/ios/CCEGLView.h index ef3b8ec1d0..3dce046feb 100644 --- a/cocos/2d/platform/ios/CCEGLView.h +++ b/cocos/2d/platform/ios/CCEGLView.h @@ -1,26 +1,27 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. -http://www.cocos2d-x.org + http://www.cocos2d-x.org -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef __CC_EGLVIEW_IPHONE_H__ #define __CC_EGLVIEW_IPHONE_H__ diff --git a/cocos/2d/platform/ios/CCEGLView.mm b/cocos/2d/platform/ios/CCEGLView.mm index 950c43fb2e..399b365e56 100644 --- a/cocos/2d/platform/ios/CCEGLView.mm +++ b/cocos/2d/platform/ios/CCEGLView.mm @@ -1,26 +1,27 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. -http://www.cocos2d-x.org + http://www.cocos2d-x.org -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #include "EAGLView.h" #include "CCDirectorCaller.h" #include "CCEGLView.h" diff --git a/cocos/2d/platform/ios/CCES2Renderer.h b/cocos/2d/platform/ios/CCES2Renderer.h index 755b694a69..1c25466fe4 100644 --- a/cocos/2d/platform/ios/CCES2Renderer.h +++ b/cocos/2d/platform/ios/CCES2Renderer.h @@ -1,30 +1,29 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * - * File autogenerated with Xcode. Adapted for cocos2d needs. - */ +/**************************************************************************** + Copyright (c) 2010 Ricardo Quesada + Copyright (c) 2010-2012 cocos2d-x.org + Corpyight (c) 2011 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. diff --git a/cocos/2d/platform/ios/CCES2Renderer.m b/cocos/2d/platform/ios/CCES2Renderer.m index 52b6d2a01d..3f3a226e82 100644 --- a/cocos/2d/platform/ios/CCES2Renderer.m +++ b/cocos/2d/platform/ios/CCES2Renderer.m @@ -1,30 +1,29 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2011 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * - * File autogenerated with Xcode. Adapted for cocos2d needs. - */ +/**************************************************************************** + Copyright (c) 2010 Ricardo Quesada + Copyright (c) 2010-2012 cocos2d-x.org + Corpyight (c) 2011 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. diff --git a/cocos/2d/platform/ios/CCESRenderer.h b/cocos/2d/platform/ios/CCESRenderer.h index 944be4926a..e35ea686e1 100644 --- a/cocos/2d/platform/ios/CCESRenderer.h +++ b/cocos/2d/platform/ios/CCESRenderer.h @@ -1,30 +1,29 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * - * File autogenerated with Xcode. Adapted for cocos2d needs. - */ +/**************************************************************************** + Copyright (c) 2010 Ricardo Quesada + Copyright (c) 2010-2012 cocos2d-x.org + Corpyight (c) 2011 Zynga Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. diff --git a/cocos/2d/platform/ios/CCGL.h b/cocos/2d/platform/ios/CCGL.h index 2dc082d729..6104a7fcfd 100644 --- a/cocos/2d/platform/ios/CCGL.h +++ b/cocos/2d/platform/ios/CCGL.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/ios/CCImage.mm b/cocos/2d/platform/ios/CCImage.mm index a2cc87dbec..5ad55ce594 100644 --- a/cocos/2d/platform/ios/CCImage.mm +++ b/cocos/2d/platform/ios/CCImage.mm @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/ios/CCPlatformDefine.h b/cocos/2d/platform/ios/CCPlatformDefine.h index 789ea77e08..02f7c89eba 100644 --- a/cocos/2d/platform/ios/CCPlatformDefine.h +++ b/cocos/2d/platform/ios/CCPlatformDefine.h @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ diff --git a/cocos/2d/platform/ios/CCStdC.h b/cocos/2d/platform/ios/CCStdC.h index 475142b51a..804abebceb 100644 --- a/cocos/2d/platform/ios/CCStdC.h +++ b/cocos/2d/platform/ios/CCStdC.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h index 504b101094..972843302c 100644 --- a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h +++ b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h @@ -1,11 +1,28 @@ -/* - * AccelerometerSimulation.h - * AccelerometerGraph - * - * Created by Otto Chrons on 9/26/08. - * Copyright 2008 Seastringo Oy. All rights reserved. - * - */ +/**************************************************************************** +Copyright (c) 2008 Otto Chrons at Seastringo Oy. +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #import // when compiling to ARM (iPhone device), hide everything and use system defaults diff --git a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m index bcf53d67dd..0a93a263e9 100644 --- a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m +++ b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m @@ -1,10 +1,28 @@ -// -// AccelerometerSimulation.m -// AccelerometerGraph -// -// Created by Otto Chrons on 9/26/08. -// Copyright 2008 Seastringo Oy. All rights reserved. -// +/**************************************************************************** +Copyright (c) 2008 Otto Chrons at Seastringo Oy. +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #import "AccelerometerSimulation.h" diff --git a/cocos/2d/platform/linux/CCApplication.cpp b/cocos/2d/platform/linux/CCApplication.cpp index 0534b83208..f2efa5b7de 100644 --- a/cocos/2d/platform/linux/CCApplication.cpp +++ b/cocos/2d/platform/linux/CCApplication.cpp @@ -1,9 +1,28 @@ -/* - * Aplication_linux.cpp - * - * Created on: Aug 8, 2011 - * Author: laschweinski - */ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + #include "CCApplication.h" #include #include diff --git a/cocos/2d/platform/linux/CCApplication.h b/cocos/2d/platform/linux/CCApplication.h index 6627a8a94c..8c5c51ae60 100644 --- a/cocos/2d/platform/linux/CCApplication.h +++ b/cocos/2d/platform/linux/CCApplication.h @@ -1,9 +1,27 @@ -/* - * Aplication.h - * - * Created on: Aug 8, 2011 - * Author: laschweinski - */ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef CCAPLICATION_H_ #define CCAPLICATION_H_ diff --git a/cocos/2d/platform/linux/CCCommon.cpp b/cocos/2d/platform/linux/CCCommon.cpp index 880d626540..4b94bcd8e0 100644 --- a/cocos/2d/platform/linux/CCCommon.cpp +++ b/cocos/2d/platform/linux/CCCommon.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/linux/CCDevice.cpp b/cocos/2d/platform/linux/CCDevice.cpp index 3b3c962413..44457cdb6e 100644 --- a/cocos/2d/platform/linux/CCDevice.cpp +++ b/cocos/2d/platform/linux/CCDevice.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "platform/CCDevice.h" #include #include diff --git a/cocos/2d/platform/linux/CCEGLView.cpp b/cocos/2d/platform/linux/CCEGLView.cpp index 360e96f101..2cab145265 100644 --- a/cocos/2d/platform/linux/CCEGLView.cpp +++ b/cocos/2d/platform/linux/CCEGLView.cpp @@ -1,9 +1,27 @@ -/* - * EGLViewlinux.cpp - * - * Created on: Aug 8, 2011 - * Author: laschweinski - */ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "CCEGLView.h" #include "CCGL.h" diff --git a/cocos/2d/platform/linux/CCEGLView.h b/cocos/2d/platform/linux/CCEGLView.h index ed4fc18245..ca7949f1fb 100644 --- a/cocos/2d/platform/linux/CCEGLView.h +++ b/cocos/2d/platform/linux/CCEGLView.h @@ -1,9 +1,27 @@ -/* - * EGLView.h - * - * Created on: Aug 8, 2011 - * Author: laschweinski - */ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef EGLVIEW_H_ #define EGLVIEW_H_ diff --git a/cocos/2d/platform/linux/CCFileUtilsLinux.cpp b/cocos/2d/platform/linux/CCFileUtilsLinux.cpp index dc3fb5b513..2d86c1ec87 100644 --- a/cocos/2d/platform/linux/CCFileUtilsLinux.cpp +++ b/cocos/2d/platform/linux/CCFileUtilsLinux.cpp @@ -1,9 +1,27 @@ -/* - * FileUtilsLinux.cpp - * - * Created on: Aug 9, 2011 - * Author: laschweinski - */ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "CCFileUtilsLinux.h" #include "platform/CCCommon.h" #include "ccMacros.h" diff --git a/cocos/2d/platform/linux/CCFileUtilsLinux.h b/cocos/2d/platform/linux/CCFileUtilsLinux.h index 366f8d08f5..20742b02f3 100644 --- a/cocos/2d/platform/linux/CCFileUtilsLinux.h +++ b/cocos/2d/platform/linux/CCFileUtilsLinux.h @@ -1,26 +1,27 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CC_FILEUTILS_LINUX_H__ #define __CC_FILEUTILS_LINUX_H__ diff --git a/cocos/2d/platform/linux/CCImage.cpp b/cocos/2d/platform/linux/CCImage.cpp index 551595c709..45602638b5 100644 --- a/cocos/2d/platform/linux/CCImage.cpp +++ b/cocos/2d/platform/linux/CCImage.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include #include diff --git a/cocos/2d/platform/linux/CCPlatformDefine.h b/cocos/2d/platform/linux/CCPlatformDefine.h index d427303599..5d2a56ff31 100644 --- a/cocos/2d/platform/linux/CCPlatformDefine.h +++ b/cocos/2d/platform/linux/CCPlatformDefine.h @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ diff --git a/cocos/2d/platform/linux/CCStdC.cpp b/cocos/2d/platform/linux/CCStdC.cpp index f0d0f8c01b..9f47e9e17a 100644 --- a/cocos/2d/platform/linux/CCStdC.cpp +++ b/cocos/2d/platform/linux/CCStdC.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/linux/CCStdC.h b/cocos/2d/platform/linux/CCStdC.h index 7fd6339bef..5f3e24e8c0 100644 --- a/cocos/2d/platform/linux/CCStdC.h +++ b/cocos/2d/platform/linux/CCStdC.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/mac/CCApplication.h b/cocos/2d/platform/mac/CCApplication.h index ed57cd4f0f..5a4c5bd8a5 100644 --- a/cocos/2d/platform/mac/CCApplication.h +++ b/cocos/2d/platform/mac/CCApplication.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/mac/CCApplication.mm b/cocos/2d/platform/mac/CCApplication.mm index 970b0e3566..0ece7367f4 100644 --- a/cocos/2d/platform/mac/CCApplication.mm +++ b/cocos/2d/platform/mac/CCApplication.mm @@ -1,26 +1,27 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #import "CCApplication.h" #import diff --git a/cocos/2d/platform/mac/CCCommon.mm b/cocos/2d/platform/mac/CCCommon.mm index a9b15874b1..3e6cb32295 100644 --- a/cocos/2d/platform/mac/CCCommon.mm +++ b/cocos/2d/platform/mac/CCCommon.mm @@ -1,26 +1,27 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. - http://www.cocos2d-x.org +http://www.cocos2d-x.org - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include #include "platform/CCCommon.h" diff --git a/cocos/2d/platform/mac/CCDevice.mm b/cocos/2d/platform/mac/CCDevice.mm index 0d3964e690..4814ee8768 100644 --- a/cocos/2d/platform/mac/CCDevice.mm +++ b/cocos/2d/platform/mac/CCDevice.mm @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "platform/CCDevice.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/mac/CCDirectorCaller.h b/cocos/2d/platform/mac/CCDirectorCaller.h index 4d80b6e8b5..87117073cb 100644 --- a/cocos/2d/platform/mac/CCDirectorCaller.h +++ b/cocos/2d/platform/mac/CCDirectorCaller.h @@ -1,26 +1,27 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #import #import diff --git a/cocos/2d/platform/mac/CCDirectorCaller.mm b/cocos/2d/platform/mac/CCDirectorCaller.mm index af4645a7aa..f371dae133 100644 --- a/cocos/2d/platform/mac/CCDirectorCaller.mm +++ b/cocos/2d/platform/mac/CCDirectorCaller.mm @@ -1,26 +1,27 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #import #import "CCDirectorCaller.h" #import "CCDirector.h" diff --git a/cocos/2d/platform/mac/CCEGLView.h b/cocos/2d/platform/mac/CCEGLView.h index d58d70dc4b..6b7495f5d0 100644 --- a/cocos/2d/platform/mac/CCEGLView.h +++ b/cocos/2d/platform/mac/CCEGLView.h @@ -1,26 +1,27 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CC_EGLVIEW_MAC_H__ #define __CC_EGLVIEW_MAC_H__ diff --git a/cocos/2d/platform/mac/CCEGLView.mm b/cocos/2d/platform/mac/CCEGLView.mm index 335b513634..920212e5f5 100644 --- a/cocos/2d/platform/mac/CCEGLView.mm +++ b/cocos/2d/platform/mac/CCEGLView.mm @@ -1,26 +1,27 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "CCEGLView.h" diff --git a/cocos/2d/platform/mac/CCEventDispatcherMac.h b/cocos/2d/platform/mac/CCEventDispatcherMac.h index 5bf0389792..df47784455 100644 --- a/cocos/2d/platform/mac/CCEventDispatcherMac.h +++ b/cocos/2d/platform/mac/CCEventDispatcherMac.h @@ -1,27 +1,29 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ +/**************************************************************************** +Copyright (c) 2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ // Only compile this code on Mac. These files should not be included on your iOS project. // But in case they are included, it won't be compiled. diff --git a/cocos/2d/platform/mac/CCEventDispatcherMac.mm b/cocos/2d/platform/mac/CCEventDispatcherMac.mm index 6629ae6470..691383d36a 100644 --- a/cocos/2d/platform/mac/CCEventDispatcherMac.mm +++ b/cocos/2d/platform/mac/CCEventDispatcherMac.mm @@ -1,27 +1,29 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ +/**************************************************************************** +Copyright (c) 2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ // Only compile this code on Mac. These files should not be included on your iOS project. // But in case they are included, it won't be compiled. diff --git a/cocos/2d/platform/mac/CCGL.h b/cocos/2d/platform/mac/CCGL.h index fde4eaa434..cfdb173068 100644 --- a/cocos/2d/platform/mac/CCGL.h +++ b/cocos/2d/platform/mac/CCGL.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/mac/CCImage.mm b/cocos/2d/platform/mac/CCImage.mm index ddb5b1137c..fea424d8a6 100644 --- a/cocos/2d/platform/mac/CCImage.mm +++ b/cocos/2d/platform/mac/CCImage.mm @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/mac/CCPlatformDefine.h b/cocos/2d/platform/mac/CCPlatformDefine.h index 67a7d0ea3d..ca87ebf069 100644 --- a/cocos/2d/platform/mac/CCPlatformDefine.h +++ b/cocos/2d/platform/mac/CCPlatformDefine.h @@ -1,3 +1,28 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ diff --git a/cocos/2d/platform/mac/CCStdC.h b/cocos/2d/platform/mac/CCStdC.h index 475142b51a..804abebceb 100644 --- a/cocos/2d/platform/mac/CCStdC.h +++ b/cocos/2d/platform/mac/CCStdC.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/mac/CCWindow.h b/cocos/2d/platform/mac/CCWindow.h index 8e24b8a858..78ac008922 100644 --- a/cocos/2d/platform/mac/CCWindow.h +++ b/cocos/2d/platform/mac/CCWindow.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/mac/CCWindow.m b/cocos/2d/platform/mac/CCWindow.m index 29e4a2d309..97d442d29a 100644 --- a/cocos/2d/platform/mac/CCWindow.m +++ b/cocos/2d/platform/mac/CCWindow.m @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/mac/EAGLView.h b/cocos/2d/platform/mac/EAGLView.h index 0be91c9b09..8c8ecd477f 100644 --- a/cocos/2d/platform/mac/EAGLView.h +++ b/cocos/2d/platform/mac/EAGLView.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/mac/EAGLView.mm b/cocos/2d/platform/mac/EAGLView.mm index 8276f8e02c..68573ba99f 100644 --- a/cocos/2d/platform/mac/EAGLView.mm +++ b/cocos/2d/platform/mac/EAGLView.mm @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/win32/CCApplication.cpp b/cocos/2d/platform/win32/CCApplication.cpp index a29e842143..85fe2a4a4e 100644 --- a/cocos/2d/platform/win32/CCApplication.cpp +++ b/cocos/2d/platform/win32/CCApplication.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "CCApplication.h" #include "CCEGLView.h" #include "CCDirector.h" diff --git a/cocos/2d/platform/win32/CCApplication.h b/cocos/2d/platform/win32/CCApplication.h index 94a85d1007..bd392a4f8c 100644 --- a/cocos/2d/platform/win32/CCApplication.h +++ b/cocos/2d/platform/win32/CCApplication.h @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CC_APPLICATION_WIN32_H__ #define __CC_APPLICATION_WIN32_H__ diff --git a/cocos/2d/platform/win32/CCCommon.cpp b/cocos/2d/platform/win32/CCCommon.cpp index 2a66aaf49e..58651989de 100644 --- a/cocos/2d/platform/win32/CCCommon.cpp +++ b/cocos/2d/platform/win32/CCCommon.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/win32/CCDevice.cpp b/cocos/2d/platform/win32/CCDevice.cpp index 163ad9a241..e934679bdc 100644 --- a/cocos/2d/platform/win32/CCDevice.cpp +++ b/cocos/2d/platform/win32/CCDevice.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "platform/CCDevice.h" #include "CCStdC.h" diff --git a/cocos/2d/platform/win32/CCEGLView.cpp b/cocos/2d/platform/win32/CCEGLView.cpp index e83eb289f2..953dede055 100644 --- a/cocos/2d/platform/win32/CCEGLView.cpp +++ b/cocos/2d/platform/win32/CCEGLView.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/win32/CCEGLView.h b/cocos/2d/platform/win32/CCEGLView.h index 59432e27ba..17f9e4de06 100644 --- a/cocos/2d/platform/win32/CCEGLView.h +++ b/cocos/2d/platform/win32/CCEGLView.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/win32/CCFileUtilsWin32.cpp b/cocos/2d/platform/win32/CCFileUtilsWin32.cpp index 0572b95591..8f70d1ba88 100644 --- a/cocos/2d/platform/win32/CCFileUtilsWin32.cpp +++ b/cocos/2d/platform/win32/CCFileUtilsWin32.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/win32/CCFileUtilsWin32.h b/cocos/2d/platform/win32/CCFileUtilsWin32.h index bfbdd5c725..d11d148f07 100644 --- a/cocos/2d/platform/win32/CCFileUtilsWin32.h +++ b/cocos/2d/platform/win32/CCFileUtilsWin32.h @@ -1,26 +1,27 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CC_FILEUTILS_WIN32_H__ #define __CC_FILEUTILS_WIN32_H__ diff --git a/cocos/2d/platform/win32/CCGL.h b/cocos/2d/platform/win32/CCGL.h index f87eac0851..4d2d0f9002 100644 --- a/cocos/2d/platform/win32/CCGL.h +++ b/cocos/2d/platform/win32/CCGL.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/win32/CCImage.cpp b/cocos/2d/platform/win32/CCImage.cpp index dd6d64742a..8cc3f508e5 100644 --- a/cocos/2d/platform/win32/CCImage.cpp +++ b/cocos/2d/platform/win32/CCImage.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/win32/CCPlatformDefine.h b/cocos/2d/platform/win32/CCPlatformDefine.h index 80447f0c73..964544860a 100644 --- a/cocos/2d/platform/win32/CCPlatformDefine.h +++ b/cocos/2d/platform/win32/CCPlatformDefine.h @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ diff --git a/cocos/2d/platform/win32/CCStdC.cpp b/cocos/2d/platform/win32/CCStdC.cpp index 8368194f76..15862bc0ad 100644 --- a/cocos/2d/platform/win32/CCStdC.cpp +++ b/cocos/2d/platform/win32/CCStdC.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/platform/win32/CCStdC.h b/cocos/2d/platform/win32/CCStdC.h index 027c8bf3cb..02c7a96fd2 100644 --- a/cocos/2d/platform/win32/CCStdC.h +++ b/cocos/2d/platform/win32/CCStdC.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCCustomCommand.cpp b/cocos/2d/renderer/CCCustomCommand.cpp index b23c51723b..790bd13e69 100644 --- a/cocos/2d/renderer/CCCustomCommand.cpp +++ b/cocos/2d/renderer/CCCustomCommand.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCCustomCommand.h b/cocos/2d/renderer/CCCustomCommand.h index a837255594..7ff4c3e3ca 100644 --- a/cocos/2d/renderer/CCCustomCommand.h +++ b/cocos/2d/renderer/CCCustomCommand.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCFrustum.cpp b/cocos/2d/renderer/CCFrustum.cpp index 4e1468fe58..b03c9771ee 100644 --- a/cocos/2d/renderer/CCFrustum.cpp +++ b/cocos/2d/renderer/CCFrustum.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCFrustum.h b/cocos/2d/renderer/CCFrustum.h index 41f8b254ee..88772fda59 100644 --- a/cocos/2d/renderer/CCFrustum.h +++ b/cocos/2d/renderer/CCFrustum.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCGroupCommand.cpp b/cocos/2d/renderer/CCGroupCommand.cpp index 12fddd3105..8bd6f85888 100644 --- a/cocos/2d/renderer/CCGroupCommand.cpp +++ b/cocos/2d/renderer/CCGroupCommand.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCGroupCommand.h b/cocos/2d/renderer/CCGroupCommand.h index 7e2ed1abb7..7a6b6e511c 100644 --- a/cocos/2d/renderer/CCGroupCommand.h +++ b/cocos/2d/renderer/CCGroupCommand.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCMaterialManager.cpp b/cocos/2d/renderer/CCMaterialManager.cpp index 9f4e7c898c..04db21ec76 100644 --- a/cocos/2d/renderer/CCMaterialManager.cpp +++ b/cocos/2d/renderer/CCMaterialManager.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCMaterialManager.h b/cocos/2d/renderer/CCMaterialManager.h index c6033ccadf..53330855a5 100644 --- a/cocos/2d/renderer/CCMaterialManager.h +++ b/cocos/2d/renderer/CCMaterialManager.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCQuadCommand.cpp b/cocos/2d/renderer/CCQuadCommand.cpp index ff63200f4d..9466a82a2a 100644 --- a/cocos/2d/renderer/CCQuadCommand.cpp +++ b/cocos/2d/renderer/CCQuadCommand.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCQuadCommand.h b/cocos/2d/renderer/CCQuadCommand.h index 441bb842fe..411dc4913b 100644 --- a/cocos/2d/renderer/CCQuadCommand.h +++ b/cocos/2d/renderer/CCQuadCommand.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCRenderCommand.cpp b/cocos/2d/renderer/CCRenderCommand.cpp index 0933f2dcd7..71fee4edb0 100644 --- a/cocos/2d/renderer/CCRenderCommand.cpp +++ b/cocos/2d/renderer/CCRenderCommand.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCRenderCommand.h b/cocos/2d/renderer/CCRenderCommand.h index 35d5ac4fe8..930ed1ecde 100644 --- a/cocos/2d/renderer/CCRenderCommand.h +++ b/cocos/2d/renderer/CCRenderCommand.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCRenderCommandPool.h b/cocos/2d/renderer/CCRenderCommandPool.h index 0f7f721f46..21415039f1 100644 --- a/cocos/2d/renderer/CCRenderCommandPool.h +++ b/cocos/2d/renderer/CCRenderCommandPool.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCRenderMaterial.cpp b/cocos/2d/renderer/CCRenderMaterial.cpp index da32ca0357..4b85023d49 100644 --- a/cocos/2d/renderer/CCRenderMaterial.cpp +++ b/cocos/2d/renderer/CCRenderMaterial.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCRenderMaterial.h b/cocos/2d/renderer/CCRenderMaterial.h index 796818e096..9a51225ba0 100644 --- a/cocos/2d/renderer/CCRenderMaterial.h +++ b/cocos/2d/renderer/CCRenderMaterial.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCRenderer.cpp b/cocos/2d/renderer/CCRenderer.cpp index 4b31b03650..1d3b8cd2b4 100644 --- a/cocos/2d/renderer/CCRenderer.cpp +++ b/cocos/2d/renderer/CCRenderer.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/2d/renderer/CCRenderer.h b/cocos/2d/renderer/CCRenderer.h index f6b317d917..e732547130 100644 --- a/cocos/2d/renderer/CCRenderer.h +++ b/cocos/2d/renderer/CCRenderer.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org From 641255e3ef073aafadeda4a32eb5254eb244f614 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 7 Jan 2014 03:25:39 +0000 Subject: [PATCH 294/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index f3d5f69b7b..db7c5b9d77 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit f3d5f69b7b088e348e1a6a58734b949c381f9a78 +Subproject commit db7c5b9d77a023a25b5124fa8adbff5663a4193c From c965131a08031a7b2b53cd9b0f378d757c480e55 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 19:33:28 -0800 Subject: [PATCH 295/428] Uses relative path for kazmath/CMakeLists.txt and physics/CMakeLists.txt. --- cocos/math/kazmath/CMakeLists.txt | 24 ++++++++++++------------ cocos/physics/CMakeLists.txt | 20 ++++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cocos/math/kazmath/CMakeLists.txt b/cocos/math/kazmath/CMakeLists.txt index 208b4a97c2..ae7ea4b3d7 100644 --- a/cocos/math/kazmath/CMakeLists.txt +++ b/cocos/math/kazmath/CMakeLists.txt @@ -1,17 +1,17 @@ SET(KAZMATH_SOURCES - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/mat4.c - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/mat3.c - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/plane.c - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/vec4.c - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/quaternion.c - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/vec2.c - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/vec3.c - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/utility.c - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/aabb.c - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/ray2.c - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/GL/mat4stack.c - ${CMAKE_SOURCE_DIR}/cocos/math/kazmath/src/GL/matrix.c + mat4.c + mat3.c + plane.c + vec4.c + quaternion.c + vec2.c + vec3.c + utility.c + aabb.c + ray2.c + GL/mat4stack.c + GL/matrix.c ) ADD_SUBDIRECTORY(src) diff --git a/cocos/physics/CMakeLists.txt b/cocos/physics/CMakeLists.txt index ef81f5ec6b..2810dcb5f4 100644 --- a/cocos/physics/CMakeLists.txt +++ b/cocos/physics/CMakeLists.txt @@ -1,13 +1,13 @@ set(COCOS_PHYSICS_SRC - ${CMAKE_SOURCE_DIR}/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp - ${CMAKE_SOURCE_DIR}/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp - ${CMAKE_SOURCE_DIR}/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp - ${CMAKE_SOURCE_DIR}/cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp - ${CMAKE_SOURCE_DIR}/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp - ${CMAKE_SOURCE_DIR}/cocos/physics/CCPhysicsBody.cpp - ${CMAKE_SOURCE_DIR}/cocos/physics/CCPhysicsContact.cpp - ${CMAKE_SOURCE_DIR}/cocos/physics/CCPhysicsShape.cpp - ${CMAKE_SOURCE_DIR}/cocos/physics/CCPhysicsJoint.cpp - ${CMAKE_SOURCE_DIR}/cocos/physics/CCPhysicsWorld.cpp + ../physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp + ../physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp + ../physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp + ../physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp + ../physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp + ../physics/CCPhysicsBody.cpp + ../physics/CCPhysicsContact.cpp + ../physics/CCPhysicsShape.cpp + ../physics/CCPhysicsJoint.cpp + ../physics/CCPhysicsWorld.cpp ) From 9183a69873d97d2f5d8397ac3f8ec152e0ac3759 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 19:34:48 -0800 Subject: [PATCH 296/428] Simplifies linux template, build.sh is not needed now. --- template/multi-platform-cpp/CMakeLists.txt | 72 ++++++++++++------- template/multi-platform-lua/CMakeLists.txt | 83 ++++++++++++++-------- 2 files changed, 100 insertions(+), 55 deletions(-) diff --git a/template/multi-platform-cpp/CMakeLists.txt b/template/multi-platform-cpp/CMakeLists.txt index 7b64f8b7cc..4376f2f9c8 100644 --- a/template/multi-platform-cpp/CMakeLists.txt +++ b/template/multi-platform-cpp/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.6) -set(APP_NAME HelloCpp) +set(APP_NAME MyGame) project (${APP_NAME}) include(cocos2d/build/BuildHelpers.CMakeLists.txt) @@ -76,7 +76,6 @@ include_directories( link_directories( /usr/local/lib - ${COCOS2D_ROOT}/lib ${COCOS2D_ROOT}/external/jpeg/prebuilt/linux/${ARCH_DIR} ${COCOS2D_ROOT}/external/tiff/prebuilt/linux/${ARCH_DIR} ${COCOS2D_ROOT}/external/webp/prebuilt/linux/${ARCH_DIR} @@ -85,6 +84,50 @@ link_directories( ${COCOS2D_ROOT}/external/linux-specific/fmod/prebuilt/${ARCH_DIR} ) +# kazmath +add_subdirectory(${COCOS2D_ROOT}/cocos/math/kazmath) + +# chipmunk library +add_subdirectory(${COCOS2D_ROOT}/external/chipmunk/src) + +# box2d library +add_subdirectory(${COCOS2D_ROOT}/external/Box2D) + +# unzip library +add_subdirectory(${COCOS2D_ROOT}/external/unzip) + +# tinyxml2 library +add_subdirectory(${COCOS2D_ROOT}/external/tinyxml2) + +# audio +add_subdirectory(${COCOS2D_ROOT}/cocos/audio) + +# cocos base library +add_subdirectory(${COCOS2D_ROOT}/cocos/base) + +# cocos 2d library +add_subdirectory(${COCOS2D_ROOT}/cocos/2d) + +# gui +add_subdirectory(${COCOS2D_ROOT}/cocos/gui) + +# network +add_subdirectory(${COCOS2D_ROOT}/cocos/network) + +# extensions +add_subdirectory(${COCOS2D_ROOT}/extensions) + +## Editor Support + +# spine +add_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/spine) + +# cocosbuilder +add_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/cocosbuilder) + +# cocostudio +add_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/cocostudio) + # add the executable add_executable(${APP_NAME} ${GAME_SRC} @@ -99,37 +142,12 @@ endif() target_link_libraries(${APP_NAME} gui network - curl - ldap - lber - idn - rtmp spine cocostudio cocosbuilder extensions - box2d audio - ${FMOD_LIB} cocos2d - cocosbase - chipmunk - tinyxml2 - kazmath - unzip - jpeg - webp - tiff - freetype - fontconfig - png - pthread - glfw - GLEW - GL - X11 - rt - z ) set(APP_BIN_DIR "${CMAKE_SOURCE_DIR}/bin") diff --git a/template/multi-platform-lua/CMakeLists.txt b/template/multi-platform-lua/CMakeLists.txt index 57076b1fdc..c14a3d0fe9 100644 --- a/template/multi-platform-lua/CMakeLists.txt +++ b/template/multi-platform-lua/CMakeLists.txt @@ -79,7 +79,6 @@ include_directories( link_directories( /usr/local/lib - ${COCOS2D_ROOT}/lib ${COCOS2D_ROOT}/external/jpeg/prebuilt/linux/${ARCH_DIR} ${COCOS2D_ROOT}/external/tiff/prebuilt/linux/${ARCH_DIR} ${COCOS2D_ROOT}/external/webp/prebuilt/linux/${ARCH_DIR} @@ -88,6 +87,60 @@ link_directories( ${COCOS2D_ROOT}/external/linux-specific/fmod/prebuilt/${ARCH_DIR} ) +# kazmath +add_subdirectory(${COCOS2D_ROOT}/cocos/math/kazmath) + +# chipmunk library +add_subdirectory(${COCOS2D_ROOT}/external/chipmunk/src) + +# box2d library +add_subdirectory(${COCOS2D_ROOT}/external/Box2D) + +# unzip library +add_subdirectory(${COCOS2D_ROOT}/external/unzip) + +# tinyxml2 library +add_subdirectory(${COCOS2D_ROOT}/external/tinyxml2) + +# audio +add_subdirectory(${COCOS2D_ROOT}/cocos/audio) + +# cocos base library +add_subdirectory(${COCOS2D_ROOT}/cocos/base) + +# cocos 2d library +add_subdirectory(${COCOS2D_ROOT}/cocos/2d) + +# gui +add_subdirectory(${COCOS2D_ROOT}/cocos/gui) + +# network +add_subdirectory(${COCOS2D_ROOT}/cocos/network) + +# extensions +add_subdirectory(${COCOS2D_ROOT}/extensions) + +## Editor Support + +# spine +add_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/spine) + +# cocosbuilder +add_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/cocosbuilder) + +# cocostudio +add_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/cocostudio) + +## Scripting +# lua +add_subdirectory(${COCOS2D_ROOT}/external/lua/lua) + +# tolua +add_subdirectory(${COCOS2D_ROOT}/external/lua/tolua) + +# luabinding +add_subdirectory(${COCOS2D_ROOT}/cocos/scripting) + # add the executable add_executable(${APP_NAME} ${GAME_SRC} @@ -101,41 +154,14 @@ endif() target_link_libraries(${APP_NAME} luabinding - tolua - lua gui network - curl - ldap - lber - idn - rtmp spine cocostudio cocosbuilder extensions - box2d audio - ${FMOD_LIB} cocos2d - cocosbase - chipmunk - tinyxml2 - kazmath - unzip - jpeg - webp - tiff - freetype - fontconfig - png - pthread - glfw - GLEW - GL - X11 - rt - z ) set(APP_BIN_DIR "${CMAKE_SOURCE_DIR}/bin") @@ -146,5 +172,6 @@ set_target_properties(${APP_NAME} PROPERTIES pre_build(${APP_NAME} COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua/script ${APP_BIN_DIR}/Resources ) From 2512c15cb9e2da3b9289cd2dc379a95777fa1a06 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 19:35:33 -0800 Subject: [PATCH 297/428] Renames title names for cpp and lua templates. --- template/multi-platform-cpp/proj.linux/main.cpp | 2 +- template/multi-platform-lua/proj.linux/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/template/multi-platform-cpp/proj.linux/main.cpp b/template/multi-platform-cpp/proj.linux/main.cpp index fe87d9a1cd..78a0c780cb 100644 --- a/template/multi-platform-cpp/proj.linux/main.cpp +++ b/template/multi-platform-cpp/proj.linux/main.cpp @@ -14,6 +14,6 @@ int main(int argc, char **argv) // create the application instance AppDelegate app; EGLView eglView; - eglView.init("TestCPP",900,640); + eglView.init("Cocos2d-x Game",900,640); return Application::getInstance()->run(); } diff --git a/template/multi-platform-lua/proj.linux/main.cpp b/template/multi-platform-lua/proj.linux/main.cpp index fe87d9a1cd..5e5565893c 100644 --- a/template/multi-platform-lua/proj.linux/main.cpp +++ b/template/multi-platform-lua/proj.linux/main.cpp @@ -14,6 +14,6 @@ int main(int argc, char **argv) // create the application instance AppDelegate app; EGLView eglView; - eglView.init("TestCPP",900,640); + eglView.init("Cocos2d-x Game Using LUA",900,640); return Application::getInstance()->run(); } From 23012352ce37dbb5e70c3c2ffe14ba9e53370d68 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 19:36:13 -0800 Subject: [PATCH 298/428] Deletes unused Makefile for linux. --- samples/Cpp/HelloCpp/proj.linux/.cproject | 389 ------------------ samples/Cpp/HelloCpp/proj.linux/.project | 93 ----- samples/Cpp/HelloCpp/proj.linux/Makefile | 25 -- samples/Cpp/SimpleGame/proj.linux/Makefile | 26 -- samples/Cpp/TestCpp/proj.linux/.cproject | 429 -------------------- samples/Cpp/TestCpp/proj.linux/.project | 142 ------- samples/Cpp/TestCpp/proj.linux/Makefile | 174 -------- samples/Lua/HelloLua/proj.linux/.cproject | 436 -------------------- samples/Lua/HelloLua/proj.linux/.project | 54 --- samples/Lua/HelloLua/proj.linux/Makefile | 22 - samples/Lua/TestLua/proj.linux/.cproject | 446 --------------------- samples/Lua/TestLua/proj.linux/.project | 56 --- samples/Lua/TestLua/proj.linux/Makefile | 31 -- 13 files changed, 2323 deletions(-) delete mode 100644 samples/Cpp/HelloCpp/proj.linux/.cproject delete mode 100644 samples/Cpp/HelloCpp/proj.linux/.project delete mode 100644 samples/Cpp/HelloCpp/proj.linux/Makefile delete mode 100644 samples/Cpp/SimpleGame/proj.linux/Makefile delete mode 100644 samples/Cpp/TestCpp/proj.linux/.cproject delete mode 100644 samples/Cpp/TestCpp/proj.linux/.project delete mode 100644 samples/Cpp/TestCpp/proj.linux/Makefile delete mode 100644 samples/Lua/HelloLua/proj.linux/.cproject delete mode 100644 samples/Lua/HelloLua/proj.linux/.project delete mode 100644 samples/Lua/HelloLua/proj.linux/Makefile delete mode 100644 samples/Lua/TestLua/proj.linux/.cproject delete mode 100644 samples/Lua/TestLua/proj.linux/.project delete mode 100644 samples/Lua/TestLua/proj.linux/Makefile diff --git a/samples/Cpp/HelloCpp/proj.linux/.cproject b/samples/Cpp/HelloCpp/proj.linux/.cproject deleted file mode 100644 index fc14f996d1..0000000000 --- a/samples/Cpp/HelloCpp/proj.linux/.cproject +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/HelloCpp/proj.linux/.project b/samples/Cpp/HelloCpp/proj.linux/.project deleted file mode 100644 index e53a1e70a7..0000000000 --- a/samples/Cpp/HelloCpp/proj.linux/.project +++ /dev/null @@ -1,93 +0,0 @@ - - - HelloCpp - - - libcocos2d - libCocosDenshion - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/HelloCocos2dx/Debug} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - PARENT-1-PROJECT_LOC/Classes - - - - diff --git a/samples/Cpp/HelloCpp/proj.linux/Makefile b/samples/Cpp/HelloCpp/proj.linux/Makefile deleted file mode 100644 index 0548290a52..0000000000 --- a/samples/Cpp/HelloCpp/proj.linux/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -EXECUTABLE = HelloCpp - -INCLUDES = -I.. -I../Classes - -SOURCES = main.cpp \ - ../Classes/AppDelegate.cpp \ - ../Classes/HelloWorldScene.cpp - -COCOS_ROOT = ../../../.. -include $(COCOS_ROOT)/cocos/2d/cocos2dx.mk - -SHAREDLIBS += -lcocos2d -COCOS_LIBS = $(LIB_DIR)/libcocos2d.so - -$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/samples/Cpp/SimpleGame/proj.linux/Makefile b/samples/Cpp/SimpleGame/proj.linux/Makefile deleted file mode 100644 index 9204555b28..0000000000 --- a/samples/Cpp/SimpleGame/proj.linux/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -EXECUTABLE = SimpleGame - -INCLUDES = -I.. -I../Classes - -SOURCES = main.cpp \ - ../Classes/AppDelegate.cpp \ - ../Classes/HelloWorldScene.cpp \ - ../Classes/GameOverScene.cpp - -COCOS_ROOT = ../../../.. -include $(COCOS_ROOT)/cocos/2d/cocos2dx.mk - -SHAREDLIBS += -lcocos2d -lcocosdenshion -INCLUDES += -I$(COCOS_ROOT)/cocos/audio/include - -$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/samples/Cpp/TestCpp/proj.linux/.cproject b/samples/Cpp/TestCpp/proj.linux/.cproject deleted file mode 100644 index 66a12db761..0000000000 --- a/samples/Cpp/TestCpp/proj.linux/.cproject +++ /dev/null @@ -1,429 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/TestCpp/proj.linux/.project b/samples/Cpp/TestCpp/proj.linux/.project deleted file mode 100644 index 41bd136722..0000000000 --- a/samples/Cpp/TestCpp/proj.linux/.project +++ /dev/null @@ -1,142 +0,0 @@ - - - TestCpp - - - libBox2D - libChipmunk - libcocos2d - libCocosDenshion - libextension - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/TestCpp/Debug} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - PARENT-1-PROJECT_LOC/Classes - - - extensions - 2 - PARENT-4-PROJECT_LOC/extensions - - - - - 1373359140703 - - 22 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-WebSocket* - - - - 1345105423456 - extensions - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-true-false-proj.win32 - - - - 1345106176896 - Classes/ExtensionsTest - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-true-false-EditBoxTest - - - - 1345105383081 - extensions/GUI - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-true-false-CCEditBox - - - - diff --git a/samples/Cpp/TestCpp/proj.linux/Makefile b/samples/Cpp/TestCpp/proj.linux/Makefile deleted file mode 100644 index da31571fb0..0000000000 --- a/samples/Cpp/TestCpp/proj.linux/Makefile +++ /dev/null @@ -1,174 +0,0 @@ -EXECUTABLE = TestCpp - -DEFINES += -DCC_KEYBOARD_SUPPORT - -INCLUDES = -I../../../../external \ - -I../../../../cocos/editor-support \ - -I../../../../cocos \ - -I../Classes - -SOURCES = ../Classes/AccelerometerTest/AccelerometerTest.cpp \ - ../Classes/ActionManagerTest/ActionManagerTest.cpp \ - ../Classes/ActionsEaseTest/ActionsEaseTest.cpp \ - ../Classes/ActionsProgressTest/ActionsProgressTest.cpp \ - ../Classes/ActionsTest/ActionsTest.cpp \ - ../Classes/Box2DTest/Box2dTest.cpp \ - ../Classes/Box2DTestBed/Box2dView.cpp \ - ../Classes/Box2DTestBed/GLES-Render.cpp \ - ../Classes/Box2DTestBed/Test.cpp \ - ../Classes/Box2DTestBed/TestEntries.cpp \ - ../Classes/BugsTest/Bug-1159.cpp \ - ../Classes/BugsTest/Bug-1174.cpp \ - ../Classes/BugsTest/Bug-350.cpp \ - ../Classes/BugsTest/Bug-422.cpp \ - ../Classes/BugsTest/Bug-458/Bug-458.cpp \ - ../Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ - ../Classes/BugsTest/Bug-624.cpp \ - ../Classes/BugsTest/Bug-886.cpp \ - ../Classes/BugsTest/Bug-899.cpp \ - ../Classes/BugsTest/Bug-914.cpp \ - ../Classes/BugsTest/BugsTest.cpp \ - ../Classes/ChipmunkTest/ChipmunkTest.cpp \ - ../Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \ - ../Classes/ClippingNodeTest/ClippingNodeTest.cpp \ - ../Classes/CocosDenshionTest/CocosDenshionTest.cpp \ - ../Classes/CurlTest/CurlTest.cpp \ - ../Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \ - ../Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ - ../Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ - ../Classes/EffectsTest/EffectsTest.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \ - ../Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \ - ../Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ - ../Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ - ../Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ - ../Classes/ExtensionsTest/ExtensionsTest.cpp \ - ../Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ - ../Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ - ../Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ - ../Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ - ../Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ - ../Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ - ../Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ - ../Classes/FontTest/FontTest.cpp \ - ../Classes/IntervalTest/IntervalTest.cpp \ - ../Classes/KeyboardTest/KeyboardTest.cpp \ - ../Classes/InputTest/MouseTest.cpp \ - ../Classes/KeypadTest/KeypadTest.cpp \ - ../Classes/LabelTest/LabelTest.cpp \ - ../Classes/LabelTest/LabelTestNew.cpp \ - ../Classes/LayerTest/LayerTest.cpp \ - ../Classes/MenuTest/MenuTest.cpp \ - ../Classes/MotionStreakTest/MotionStreakTest.cpp \ - ../Classes/MutiTouchTest/MutiTouchTest.cpp \ - ../Classes/NodeTest/NodeTest.cpp \ - ../Classes/ParallaxTest/ParallaxTest.cpp \ - ../Classes/ParticleTest/ParticleTest.cpp \ - ../Classes/PerformanceTest/PerformanceAllocTest.cpp \ - ../Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \ - ../Classes/PerformanceTest/PerformanceParticleTest.cpp \ - ../Classes/PerformanceTest/PerformanceSpriteTest.cpp \ - ../Classes/PerformanceTest/PerformanceTest.cpp \ - ../Classes/PerformanceTest/PerformanceTextureTest.cpp \ - ../Classes/PerformanceTest/PerformanceTouchesTest.cpp \ - ../Classes/PhysicsTest/PhysicsTest.cpp \ - ../Classes/RenderTextureTest/RenderTextureTest.cpp \ - ../Classes/RotateWorldTest/RotateWorldTest.cpp \ - ../Classes/SceneTest/SceneTest.cpp \ - ../Classes/SchedulerTest/SchedulerTest.cpp \ - ../Classes/ShaderTest/ShaderTest.cpp \ - ../Classes/ShaderTest/ShaderTest2.cpp \ - ../Classes/SpriteTest/SpriteTest.cpp \ - ../Classes/TextInputTest/TextInputTest.cpp \ - ../Classes/Texture2dTest/Texture2dTest.cpp \ - ../Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \ - ../Classes/TextureCacheTest/TextureCacheTest.cpp \ - ../Classes/TileMapTest/TileMapTest.cpp \ - ../Classes/TouchesTest/Ball.cpp \ - ../Classes/TouchesTest/Paddle.cpp \ - ../Classes/TouchesTest/TouchesTest.cpp \ - ../Classes/TransitionsTest/TransitionsTest.cpp \ - ../Classes/UserDefaultTest/UserDefaultTest.cpp \ - ../Classes/ZwoptexTest/ZwoptexTest.cpp \ - ../Classes/FileUtilsTest/FileUtilsTest.cpp \ - ../Classes/SpineTest/SpineTest.cpp \ - ../Classes/DataVisitorTest/DataVisitorTest.cpp \ - ../Classes/ConfigurationTest/ConfigurationTest.cpp \ - ../Classes/controller.cpp \ - ../Classes/testBasic.cpp \ - ../Classes/AppDelegate.cpp \ - ../Classes/BaseTest.cpp \ - ../Classes/VisibleRect.cpp \ - main.cpp - -SHAREDLIBS = -lcocos2d -lcocosdenshion -lcurl -lpng -COCOS_LIBS = $(LIB_DIR)/libcocos2d.so $(LIB_DIR)/libcocosdenshion.so - - -include ../../../../cocos/2d/cocos2dx.mk - -STATICLIBS += \ - $(STATICLIBS_DIR)/curl/prebuilt/linux/$(POSTFIX)/libcurl.a \ - $(LIB_DIR)/libextension.a \ - $(LIB_DIR)/libbox2d.a \ - $(LIB_DIR)/libchipmunk.a \ - $(LIB_DIR)/libgui.a \ - $(LIB_DIR)/libcocosbuilder.a \ - $(LIB_DIR)/libspine.a \ - $(LIB_DIR)/libcocostudio.a \ - $(LIB_DIR)/libnetwork.a - -####### Build rules -$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS) - -####### Compile -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.c $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CC)$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ diff --git a/samples/Lua/HelloLua/proj.linux/.cproject b/samples/Lua/HelloLua/proj.linux/.cproject deleted file mode 100644 index 05f6db5b1d..0000000000 --- a/samples/Lua/HelloLua/proj.linux/.cproject +++ /dev/null @@ -1,436 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Lua/HelloLua/proj.linux/.project b/samples/Lua/HelloLua/proj.linux/.project deleted file mode 100644 index 8d606ff4a1..0000000000 --- a/samples/Lua/HelloLua/proj.linux/.project +++ /dev/null @@ -1,54 +0,0 @@ - - - HelloLua - - - libcocos2d - libCocosDenshion - libextension - liblua - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - PARENT-1-PROJECT_LOC/Classes - - - cocos2dx_support - 2 - PARENT-4-PROJECT_LOC/scripting/lua/cocos2dx_support - - - - - 1373360284806 - - 22 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-Lua_web_socket.* - - - - diff --git a/samples/Lua/HelloLua/proj.linux/Makefile b/samples/Lua/HelloLua/proj.linux/Makefile deleted file mode 100644 index 6a0ddf230c..0000000000 --- a/samples/Lua/HelloLua/proj.linux/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -EXECUTABLE = HelloLua - -COCOS_ROOT = ../../../.. -INCLUDES = -I../Classes \ - -I$(COCOS_ROOT)/audio/include \ - -I$(COCOS_ROOT)/cocos/scripting/lua/bindings \ - -I$(COCOS_ROOT)/external/lua/lua - -SOURCES = main.cpp ../Classes/AppDelegate.cpp - -SHAREDLIBS += -lcocos2d -lcocosdenshion -llua -lextension - -include $(COCOS_ROOT)/cocos/2d/cocos2dx.mk - -$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - cp -n ../../../../cocos/scripting/lua/script/* ../../../../samples/Lua/HelloLua/Resources - $(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ diff --git a/samples/Lua/TestLua/proj.linux/.cproject b/samples/Lua/TestLua/proj.linux/.cproject deleted file mode 100644 index 8dab88e511..0000000000 --- a/samples/Lua/TestLua/proj.linux/.cproject +++ /dev/null @@ -1,446 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Lua/TestLua/proj.linux/.project b/samples/Lua/TestLua/proj.linux/.project deleted file mode 100644 index a7e8a57215..0000000000 --- a/samples/Lua/TestLua/proj.linux/.project +++ /dev/null @@ -1,56 +0,0 @@ - - - TestLua - - - libBox2D - libChipmunk - libcocos2d - libCocosDenshion - libextension - liblua - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - PARENT-1-PROJECT_LOC/Classes - - - cocos2dx_support - 2 - PARENT-4-PROJECT_LOC/scripting/lua/cocos2dx_support - - - - - 1373360472191 - - 22 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-Lua_web_socket.* - - - - diff --git a/samples/Lua/TestLua/proj.linux/Makefile b/samples/Lua/TestLua/proj.linux/Makefile deleted file mode 100644 index 8e9246c6ee..0000000000 --- a/samples/Lua/TestLua/proj.linux/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -EXECUTABLE = TestLua - -COCOS_ROOT = ../../../.. -INCLUDES = -I../Classes \ - -I$(COCOS_ROOT)/audio/include \ - -I$(COCOS_ROOT)/cocos/scripting/lua/bindings \ - -I$(COCOS_ROOT)/external/lua/lua \ - -I$(COCOS_ROOT)/external/lua/tolua \ - -I$(COCOS_ROOT)/extensions - -SOURCES = main.cpp \ -../Classes/AppDelegate.cpp \ -../Classes/lua_assetsmanager_test_sample.cpp - -SHAREDLIBS += -lcocos2d -lcocosdenshion -llua - -include $(COCOS_ROOT)/cocos/2d/cocos2dx.mk - -$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - cp -R -n ../../../../samples/Cpp/TestCpp/Resources ../../../../samples/Lua/TestLua - cp -n ../../../../cocos/scripting/lua/script/* ../../../../samples/Lua/TestLua/Resources - $(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS) - -$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ - -$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) - @mkdir -p $(@D) - $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ From 6c6da4cf77e59a0675010aabc3326304e89778bc Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 7 Jan 2014 11:39:55 +0800 Subject: [PATCH 299/428] fix label fnt bug for wrong shader --- cocos/2d/CCLabel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index d0e203bbf4..cd7356bc0c 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -145,7 +145,8 @@ bool Label::init() setLabelEffect(LabelEffect::NORMAL,Color3B::BLACK); else if(_useA8Shader) setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_A8_COLOR)); - + else + setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR)); return ret; } From 2f7c41bd28cddecfd14fb41daffa27f5c00265c1 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 19:42:51 -0800 Subject: [PATCH 300/428] [travis] builds linux template now. --- tools/travis-scripts/run-script.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/travis-scripts/run-script.sh b/tools/travis-scripts/run-script.sh index 84cec56874..0ade7a31c7 100755 --- a/tools/travis-scripts/run-script.sh +++ b/tools/travis-scripts/run-script.sh @@ -76,6 +76,23 @@ elif [ "$PLATFORM"x = "linux"x ]; then cd linux-build cmake ../.. make -j10 + cd .. + # build template + echo "Building template projects for linux ..." + cd tools/project-creator + ./create_project.py -n MyGameCpp -k com.MyCompany.AwesomeGameCpp -l cpp -p $HOME + ./create_project.py -n MyGameLua -k com.MyCompany.AwesomeGameLua -l lua -p $HOME + cd $HOME/MyGameCpp + mkdir build + cd build + cmake .. + make -j10 + + cd $HOME/MyGameLua + mkdir build + cd build + cmake .. + make -j10 elif [ "$PLATFORM"x = "emscripten"x ]; then # Generate binding glue codes From d4c1aa92d5c443b224c330f426a2debe2c289490 Mon Sep 17 00:00:00 2001 From: walzer Date: Tue, 7 Jan 2014 11:47:11 +0800 Subject: [PATCH 301/428] add copyrights for 2014, in folders other then 2d. --- cocos/audio/android/ccdandroidUtils.cpp | 24 ++++++++++ cocos/audio/android/ccdandroidUtils.h | 24 ++++++++++ cocos/audio/android/cddSimpleAudioEngine.cpp | 3 +- .../jni/cddandroidAndroidJavaEngine.cpp | 25 +++++++++++ .../android/jni/cddandroidAndroidJavaEngine.h | 24 ++++++++++ cocos/audio/android/opensl/OpenSLEngine.cpp | 24 ++++++++++ cocos/audio/android/opensl/OpenSLEngine.h | 24 ++++++++++ .../opensl/SimpleAudioEngineOpenSL.cpp | 24 ++++++++++ .../android/opensl/SimpleAudioEngineOpenSL.h | 24 ++++++++++ .../android/opensl/cddandroidOpenSLEngine.cpp | 24 ++++++++++ .../android/opensl/cddandroidOpenSLEngine.h | 24 ++++++++++ cocos/audio/include/Export.h | 24 ++++++++++ cocos/audio/include/SimpleAudioEngine.h | 3 +- cocos/audio/linux/AudioPlayer.h | 30 ++++++++++--- cocos/audio/linux/FmodAudioPlayer.cpp | 30 ++++++++++--- cocos/audio/linux/FmodAudioPlayer.h | 30 ++++++++++--- cocos/audio/linux/SimpleAudioEngineFMOD.cpp | 24 ++++++++++ .../audio/openal/SimpleAudioEngineOpenAL.cpp | 3 +- cocos/audio/win32/SimpleAudioEngine.cpp | 24 ++++++++++ cocos/base/CCAffineTransform.cpp | 3 +- cocos/base/CCAffineTransform.h | 3 +- cocos/base/CCArray.cpp | 5 ++- cocos/base/CCArray.h | 5 ++- cocos/base/CCAutoreleasePool.cpp | 3 +- cocos/base/CCAutoreleasePool.h | 3 +- cocos/base/CCBool.h | 3 +- cocos/base/CCConsole.cpp | 2 +- cocos/base/CCConsole.h | 2 +- cocos/base/CCData.cpp | 3 +- cocos/base/CCData.h | 3 +- cocos/base/CCDataVisitor.cpp | 2 +- cocos/base/CCDataVisitor.h | 2 +- cocos/base/CCDictionary.cpp | 5 ++- cocos/base/CCDictionary.h | 3 +- cocos/base/CCDouble.h | 2 +- cocos/base/CCFloat.h | 2 +- cocos/base/CCGeometry.cpp | 3 +- cocos/base/CCGeometry.h | 3 +- cocos/base/CCInteger.h | 2 +- cocos/base/CCMap.h | 2 +- cocos/base/CCNS.cpp | 3 +- cocos/base/CCNS.h | 3 +- cocos/base/CCObject.cpp | 3 +- cocos/base/CCObject.h | 3 +- cocos/base/CCPlatformConfig.h | 3 +- cocos/base/CCPlatformMacros.h | 3 +- cocos/base/CCSet.cpp | 3 +- cocos/base/CCSet.h | 1 + cocos/base/CCString.cpp | 3 +- cocos/base/CCString.h | 3 +- cocos/base/CCValue.cpp | 2 +- cocos/base/CCValue.h | 2 +- cocos/base/CCVector.h | 3 +- cocos/base/atitc.cpp | 2 +- cocos/base/atitc.h | 2 +- cocos/base/s3tc.cpp | 2 +- cocos/base/s3tc.h | 2 +- .../cocostudio/CCActionEaseEx.cpp | 2 +- .../cocostudio/CCActionEaseEx.h | 2 +- .../cocostudio/CCActionFrame.cpp | 2 +- .../editor-support/cocostudio/CCActionFrame.h | 2 +- .../cocostudio/CCActionFrameEasing.cpp | 2 +- .../cocostudio/CCActionFrameEasing.h | 2 +- .../cocostudio/CCActionManagerEx.cpp | 2 +- .../cocostudio/CCActionManagerEx.h | 2 +- .../cocostudio/CCActionNode.cpp | 2 +- .../editor-support/cocostudio/CCActionNode.h | 2 +- .../cocostudio/CCActionObject.cpp | 2 +- .../cocostudio/CCActionObject.h | 2 +- .../editor-support/cocostudio/CCArmature.cpp | 2 +- cocos/editor-support/cocostudio/CCArmature.h | 2 +- .../cocostudio/CCArmatureAnimation.cpp | 2 +- .../cocostudio/CCArmatureAnimation.h | 2 +- .../cocostudio/CCArmatureDataManager.cpp | 2 +- .../cocostudio/CCArmatureDataManager.h | 2 +- .../cocostudio/CCArmatureDefine.cpp | 2 +- .../cocostudio/CCArmatureDefine.h | 2 +- .../editor-support/cocostudio/CCBatchNode.cpp | 2 +- cocos/editor-support/cocostudio/CCBatchNode.h | 2 +- cocos/editor-support/cocostudio/CCBone.cpp | 2 +- cocos/editor-support/cocostudio/CCBone.h | 2 +- .../cocostudio/CCColliderDetector.cpp | 2 +- .../cocostudio/CCColliderDetector.h | 2 +- .../cocostudio/CCComAttribute.cpp | 2 +- .../cocostudio/CCComAttribute.h | 2 +- .../editor-support/cocostudio/CCComAudio.cpp | 2 +- cocos/editor-support/cocostudio/CCComAudio.h | 2 +- cocos/editor-support/cocostudio/CCComBase.h | 2 +- .../cocostudio/CCComController.cpp | 2 +- .../cocostudio/CCComController.h | 2 +- .../editor-support/cocostudio/CCComRender.cpp | 2 +- cocos/editor-support/cocostudio/CCComRender.h | 2 +- .../cocostudio/CCDataReaderHelper.cpp | 2 +- .../cocostudio/CCDataReaderHelper.h | 2 +- cocos/editor-support/cocostudio/CCDatas.cpp | 2 +- cocos/editor-support/cocostudio/CCDatas.h | 2 +- .../cocostudio/CCDecorativeDisplay.cpp | 2 +- .../cocostudio/CCDecorativeDisplay.h | 2 +- .../cocostudio/CCDisplayFactory.cpp | 2 +- .../cocostudio/CCDisplayFactory.h | 2 +- .../cocostudio/CCDisplayManager.cpp | 2 +- .../cocostudio/CCDisplayManager.h | 2 +- .../cocostudio/CCInputDelegate.cpp | 2 +- .../cocostudio/CCInputDelegate.h | 2 +- .../cocostudio/CCProcessBase.cpp | 2 +- .../editor-support/cocostudio/CCProcessBase.h | 3 +- .../cocostudio/CCSGUIReader.cpp | 44 +++++++++---------- .../editor-support/cocostudio/CCSGUIReader.h | 44 +++++++++---------- .../cocostudio/CCSSceneReader.cpp | 44 +++++++++---------- .../cocostudio/CCSSceneReader.h | 44 +++++++++---------- cocos/editor-support/cocostudio/CCSkin.cpp | 2 +- cocos/editor-support/cocostudio/CCSkin.h | 2 +- .../cocostudio/CCSpriteFrameCacheHelper.cpp | 2 +- .../cocostudio/CCSpriteFrameCacheHelper.h | 2 +- .../cocostudio/CCTransformHelp.cpp | 2 +- .../cocostudio/CCTransformHelp.h | 2 +- cocos/editor-support/cocostudio/CCTween.cpp | 2 +- cocos/editor-support/cocostudio/CCTween.h | 2 +- .../cocostudio/CCTweenFunction.cpp | 2 +- .../cocostudio/CCTweenFunction.h | 2 +- .../editor-support/cocostudio/CCUtilMath.cpp | 2 +- cocos/editor-support/cocostudio/CCUtilMath.h | 2 +- cocos/editor-support/cocostudio/CocoStudio.h | 44 +++++++++---------- .../cocostudio/DictionaryHelper.cpp | 44 +++++++++---------- .../cocostudio/DictionaryHelper.h | 44 +++++++++---------- .../cocostudio/ObjectFactory.cpp | 2 +- .../editor-support/cocostudio/ObjectFactory.h | 2 +- .../editor-support/cocostudio/TriggerBase.cpp | 2 +- cocos/editor-support/cocostudio/TriggerBase.h | 2 +- .../editor-support/cocostudio/TriggerMng.cpp | 2 +- cocos/editor-support/cocostudio/TriggerMng.h | 3 +- .../editor-support/cocostudio/TriggerObj.cpp | 4 +- cocos/editor-support/cocostudio/TriggerObj.h | 2 +- cocos/gui/CocosGUI.cpp | 44 +++++++++---------- cocos/gui/CocosGUI.h | 44 +++++++++---------- cocos/gui/UIButton.cpp | 44 +++++++++---------- cocos/gui/UIButton.h | 44 +++++++++---------- cocos/gui/UICheckBox.cpp | 44 +++++++++---------- cocos/gui/UICheckBox.h | 44 +++++++++---------- cocos/gui/UIHelper.cpp | 44 +++++++++---------- cocos/gui/UIHelper.h | 44 +++++++++---------- cocos/gui/UIImageView.cpp | 44 +++++++++---------- cocos/gui/UIImageView.h | 44 +++++++++---------- cocos/gui/UILayout.cpp | 44 +++++++++---------- cocos/gui/UILayout.h | 44 +++++++++---------- cocos/gui/UILayoutDefine.cpp | 44 +++++++++---------- cocos/gui/UILayoutDefine.h | 44 +++++++++---------- cocos/gui/UILayoutParameter.cpp | 44 +++++++++---------- cocos/gui/UILayoutParameter.h | 44 +++++++++---------- cocos/gui/UIListView.cpp | 44 +++++++++---------- cocos/gui/UIListView.h | 44 +++++++++---------- cocos/gui/UILoadingBar.cpp | 44 +++++++++---------- cocos/gui/UILoadingBar.h | 44 +++++++++---------- cocos/gui/UIPageView.cpp | 44 +++++++++---------- cocos/gui/UIPageView.h | 44 +++++++++---------- cocos/gui/UIScrollInterface.h | 44 +++++++++---------- cocos/gui/UIScrollView.cpp | 44 +++++++++---------- cocos/gui/UIScrollView.h | 44 +++++++++---------- cocos/gui/UISlider.cpp | 44 +++++++++---------- cocos/gui/UISlider.h | 44 +++++++++---------- cocos/gui/UIText.cpp | 44 +++++++++---------- cocos/gui/UIText.h | 44 +++++++++---------- cocos/gui/UITextAtlas.cpp | 44 +++++++++---------- cocos/gui/UITextAtlas.h | 44 +++++++++---------- cocos/gui/UITextBMFont.cpp | 44 +++++++++---------- cocos/gui/UITextBMFont.h | 44 +++++++++---------- cocos/gui/UITextField.cpp | 44 +++++++++---------- cocos/gui/UITextField.h | 44 +++++++++---------- cocos/gui/UIWidget.cpp | 44 +++++++++---------- cocos/gui/UIWidget.h | 44 +++++++++---------- cocos/network/HttpClient.cpp | 5 ++- cocos/network/HttpClient.h | 5 ++- cocos/network/HttpRequest.h | 1 + cocos/network/HttpResponse.h | 1 + cocos/network/SocketIO.cpp | 4 +- cocos/network/SocketIO.h | 2 +- cocos/network/WebSocket.cpp | 4 +- cocos/network/WebSocket.h | 4 +- cocos/physics/CCPhysicsBody.cpp | 2 +- cocos/physics/CCPhysicsBody.h | 2 +- cocos/physics/CCPhysicsContact.cpp | 2 +- cocos/physics/CCPhysicsContact.h | 2 +- cocos/physics/CCPhysicsJoint.cpp | 2 +- cocos/physics/CCPhysicsJoint.h | 2 +- cocos/physics/CCPhysicsShape.cpp | 2 +- cocos/physics/CCPhysicsShape.h | 2 +- cocos/physics/CCPhysicsWorld.cpp | 2 +- cocos/physics/CCPhysicsWorld.h | 2 +- cocos/scripting/lua/bindings/CCLuaBridge.cpp | 2 +- cocos/scripting/lua/bindings/CCLuaBridge.h | 2 +- cocos/scripting/lua/bindings/CCLuaEngine.cpp | 3 +- cocos/scripting/lua/bindings/CCLuaEngine.h | 3 +- cocos/scripting/lua/bindings/CCLuaStack.cpp | 3 +- cocos/scripting/lua/bindings/CCLuaStack.h | 3 +- cocos/scripting/lua/bindings/CCLuaValue.cpp | 3 +- cocos/scripting/lua/bindings/CCLuaValue.h | 3 +- .../lua/bindings/Cocos2dxLuaLoader.cpp | 3 +- .../lua/bindings/Cocos2dxLuaLoader.h | 3 +- .../lua/bindings/LuaBasicConversions.cpp | 2 +- .../lua/bindings/LuaBasicConversions.h | 23 ++++++++++ .../lua/bindings/LuaOpengl.cpp.REMOVED.git-id | 2 +- cocos/scripting/lua/bindings/LuaOpengl.h | 23 ++++++++++ .../lua/bindings/LuaScriptHandlerMgr.cpp | 23 ++++++++++ .../lua/bindings/LuaScriptHandlerMgr.h | 23 ++++++++++ .../lua/bindings/LuaSkeletonAnimation.cpp | 30 ++++++++++--- .../lua/bindings/LuaSkeletonAnimation.h | 30 ++++++++++--- .../scripting/lua/bindings/Lua_web_socket.cpp | 23 ++++++++++ cocos/scripting/lua/bindings/Lua_web_socket.h | 23 ++++++++++ .../lua_cocos2dx_coco_studio_manual.cpp | 23 ++++++++++ .../lua_cocos2dx_coco_studio_manual.hpp | 23 ++++++++++ .../lua/bindings/lua_cocos2dx_deprecated.cpp | 23 ++++++++++ .../lua/bindings/lua_cocos2dx_deprecated.h | 23 ++++++++++ .../lua_cocos2dx_extension_manual.cpp | 23 ++++++++++ .../bindings/lua_cocos2dx_extension_manual.h | 23 ++++++++++ .../lua/bindings/lua_cocos2dx_gui_manual.cpp | 23 ++++++++++ .../lua/bindings/lua_cocos2dx_gui_manual.hpp | 23 ++++++++++ .../lua_cocos2dx_manual.cpp.REMOVED.git-id | 2 +- .../lua/bindings/lua_cocos2dx_manual.hpp | 23 ++++++++++ .../bindings/lua_cocos2dx_spine_manual.cpp | 23 ++++++++++ .../bindings/lua_cocos2dx_spine_manual.hpp | 23 ++++++++++ .../lua/bindings/lua_xml_http_request.cpp | 24 +++++++++- .../lua/bindings/lua_xml_http_request.h | 23 ++++++++++ .../local-storage/LocalStorageAndroid.cpp | 8 ++-- 223 files changed, 2028 insertions(+), 1152 deletions(-) diff --git a/cocos/audio/android/ccdandroidUtils.cpp b/cocos/audio/android/ccdandroidUtils.cpp index edb0bf4540..b6bba2c6fe 100644 --- a/cocos/audio/android/ccdandroidUtils.cpp +++ b/cocos/audio/android/ccdandroidUtils.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "ccdandroidUtils.h" #include "cocos2d.h" diff --git a/cocos/audio/android/ccdandroidUtils.h b/cocos/audio/android/ccdandroidUtils.h index b5a8270ac8..e5f6791ef1 100644 --- a/cocos/audio/android/ccdandroidUtils.h +++ b/cocos/audio/android/ccdandroidUtils.h @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CCDANDROIDUTILS_H__ #define __CCDANDROIDUTILS_H__ diff --git a/cocos/audio/android/cddSimpleAudioEngine.cpp b/cocos/audio/android/cddSimpleAudioEngine.cpp index 5eff566a3a..4d1849df41 100644 --- a/cocos/audio/android/cddSimpleAudioEngine.cpp +++ b/cocos/audio/android/cddSimpleAudioEngine.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp b/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp index a1e351d2f3..6978a8d26c 100644 --- a/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp +++ b/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp @@ -1,3 +1,28 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + #include "cddandroidAndroidJavaEngine.h" #include "platform/android/jni/JniHelper.h" #include "ccdandroidUtils.h" diff --git a/cocos/audio/android/jni/cddandroidAndroidJavaEngine.h b/cocos/audio/android/jni/cddandroidAndroidJavaEngine.h index 451f9c148c..a6bb400ea4 100644 --- a/cocos/audio/android/jni/cddandroidAndroidJavaEngine.h +++ b/cocos/audio/android/jni/cddandroidAndroidJavaEngine.h @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CDDANDRIODANDROIDJAVAENGINE_H__ #define __CDDANDRIODANDROIDJAVAENGINE_H__ diff --git a/cocos/audio/android/opensl/OpenSLEngine.cpp b/cocos/audio/android/opensl/OpenSLEngine.cpp index e2c1943b7c..f3f7423273 100644 --- a/cocos/audio/android/opensl/OpenSLEngine.cpp +++ b/cocos/audio/android/opensl/OpenSLEngine.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "OpenSLEngine.h" #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,"OPENSL_ENGINE.CPP", __VA_ARGS__) diff --git a/cocos/audio/android/opensl/OpenSLEngine.h b/cocos/audio/android/opensl/OpenSLEngine.h index 3f6132bf0e..d0296bde06 100644 --- a/cocos/audio/android/opensl/OpenSLEngine.h +++ b/cocos/audio/android/opensl/OpenSLEngine.h @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef _OPENSL_ENGINE_H_ #define _OPENSL_ENGINE_H_ diff --git a/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.cpp b/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.cpp index 47a89f6abb..a5b7326c91 100644 --- a/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.cpp +++ b/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "SimpleAudioEngineOpenSL.h" #include #include diff --git a/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.h b/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.h index 8f5059e9d7..4b0d190843 100644 --- a/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.h +++ b/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.h @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef _SIMPLE_AUDIO_ENGINE_OPENSL_H_ #define _SIMPLE_AUDIO_ENGINE_OPENSL_H_ diff --git a/cocos/audio/android/opensl/cddandroidOpenSLEngine.cpp b/cocos/audio/android/opensl/cddandroidOpenSLEngine.cpp index 4f45ad9698..37b8ca3a1b 100644 --- a/cocos/audio/android/opensl/cddandroidOpenSLEngine.cpp +++ b/cocos/audio/android/opensl/cddandroidOpenSLEngine.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "cddandroidOpenSLEngine.h" namespace CocosDenshion { diff --git a/cocos/audio/android/opensl/cddandroidOpenSLEngine.h b/cocos/audio/android/opensl/cddandroidOpenSLEngine.h index 9355cf59a0..594d503ad3 100644 --- a/cocos/audio/android/opensl/cddandroidOpenSLEngine.h +++ b/cocos/audio/android/opensl/cddandroidOpenSLEngine.h @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CDDANDROIDOPENSLENGINE_H__ #define __CDDANDROIDOPENSLENGINE_H__ diff --git a/cocos/audio/include/Export.h b/cocos/audio/include/Export.h index 30096064c4..86ca3b7845 100644 --- a/cocos/audio/include/Export.h +++ b/cocos/audio/include/Export.h @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __EXPORT_COMMON__ #define __EXPORT_COMMON__ diff --git a/cocos/audio/include/SimpleAudioEngine.h b/cocos/audio/include/SimpleAudioEngine.h index 29e2f2c05f..8eda5ddeb6 100644 --- a/cocos/audio/include/SimpleAudioEngine.h +++ b/cocos/audio/include/SimpleAudioEngine.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2010 Steve Oldmeadow +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/audio/linux/AudioPlayer.h b/cocos/audio/linux/AudioPlayer.h index 074b230c0f..28aafdce16 100644 --- a/cocos/audio/linux/AudioPlayer.h +++ b/cocos/audio/linux/AudioPlayer.h @@ -1,9 +1,27 @@ -/* - * AudioPlayer.h - * - * Created on: Aug 18, 2011 - * Author: laschweinski - */ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef AUDIOPLAYER_H_ #define AUDIOPLAYER_H_ diff --git a/cocos/audio/linux/FmodAudioPlayer.cpp b/cocos/audio/linux/FmodAudioPlayer.cpp index ef4f5bb9d2..ffe27136a5 100644 --- a/cocos/audio/linux/FmodAudioPlayer.cpp +++ b/cocos/audio/linux/FmodAudioPlayer.cpp @@ -1,9 +1,27 @@ -/* - * FmodAudioPlayer.cpp - * - * Created on: Aug 18, 2011 - * Author: laschweinski - */ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "FmodAudioPlayer.h" #include diff --git a/cocos/audio/linux/FmodAudioPlayer.h b/cocos/audio/linux/FmodAudioPlayer.h index 4af2265425..887d67ea8a 100644 --- a/cocos/audio/linux/FmodAudioPlayer.h +++ b/cocos/audio/linux/FmodAudioPlayer.h @@ -1,9 +1,27 @@ -/* - * FmodAudioPlayer.h - * - * Created on: Aug 18, 2011 - * Author: laschweinski - */ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef FMODAUDIOPLAYER_H_ #define FMODAUDIOPLAYER_H_ diff --git a/cocos/audio/linux/SimpleAudioEngineFMOD.cpp b/cocos/audio/linux/SimpleAudioEngineFMOD.cpp index 931ccdc994..ace87437ff 100644 --- a/cocos/audio/linux/SimpleAudioEngineFMOD.cpp +++ b/cocos/audio/linux/SimpleAudioEngineFMOD.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2011 Laschweinski +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef OPENAL #include "SimpleAudioEngine.h" diff --git a/cocos/audio/openal/SimpleAudioEngineOpenAL.cpp b/cocos/audio/openal/SimpleAudioEngineOpenAL.cpp index 01ba4e6e79..fafa8f89a8 100644 --- a/cocos/audio/openal/SimpleAudioEngineOpenAL.cpp +++ b/cocos/audio/openal/SimpleAudioEngineOpenAL.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/audio/win32/SimpleAudioEngine.cpp b/cocos/audio/win32/SimpleAudioEngine.cpp index 06245b8d5b..fed1de067f 100644 --- a/cocos/audio/win32/SimpleAudioEngine.cpp +++ b/cocos/audio/win32/SimpleAudioEngine.cpp @@ -1,3 +1,27 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "SimpleAudioEngine.h" #include diff --git a/cocos/base/CCAffineTransform.cpp b/cocos/base/CCAffineTransform.cpp index ff81b275d1..7d72528285 100644 --- a/cocos/base/CCAffineTransform.cpp +++ b/cocos/base/CCAffineTransform.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCAffineTransform.h b/cocos/base/CCAffineTransform.h index c3034bbf50..7e6445a8e8 100644 --- a/cocos/base/CCAffineTransform.h +++ b/cocos/base/CCAffineTransform.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCArray.cpp b/cocos/base/CCArray.cpp index 8e827878a5..eecd15fe63 100644 --- a/cocos/base/CCArray.cpp +++ b/cocos/base/CCArray.cpp @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCArray.h b/cocos/base/CCArray.h index 8b40329a26..0ceedadff9 100644 --- a/cocos/base/CCArray.h +++ b/cocos/base/CCArray.h @@ -1,6 +1,7 @@ /**************************************************************************** -Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCAutoreleasePool.cpp b/cocos/base/CCAutoreleasePool.cpp index 1dd5d403de..5e551ec3aa 100644 --- a/cocos/base/CCAutoreleasePool.cpp +++ b/cocos/base/CCAutoreleasePool.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCAutoreleasePool.h b/cocos/base/CCAutoreleasePool.h index 67930173e2..d6ee35349b 100644 --- a/cocos/base/CCAutoreleasePool.h +++ b/cocos/base/CCAutoreleasePool.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCBool.h b/cocos/base/CCBool.h index c07c7a1e9a..216d9b5656 100644 --- a/cocos/base/CCBool.h +++ b/cocos/base/CCBool.h @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index e2440a49f7..3e37a11396 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCConsole.h b/cocos/base/CCConsole.h index d401991525..34a1409b40 100644 --- a/cocos/base/CCConsole.h +++ b/cocos/base/CCConsole.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCData.cpp b/cocos/base/CCData.cpp index 77674c853d..0e3fcd4c26 100644 --- a/cocos/base/CCData.cpp +++ b/cocos/base/CCData.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org - + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/base/CCData.h b/cocos/base/CCData.h index 7ba7431c94..ad259bc723 100644 --- a/cocos/base/CCData.h +++ b/cocos/base/CCData.h @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org - + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/base/CCDataVisitor.cpp b/cocos/base/CCDataVisitor.cpp index 27ead8fbb3..b149321649 100644 --- a/cocos/base/CCDataVisitor.cpp +++ b/cocos/base/CCDataVisitor.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCDataVisitor.h b/cocos/base/CCDataVisitor.h index dda87ffc36..96f004987f 100644 --- a/cocos/base/CCDataVisitor.h +++ b/cocos/base/CCDataVisitor.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCDictionary.cpp b/cocos/base/CCDictionary.cpp index ea1d76ba28..5be01c5c29 100644 --- a/cocos/base/CCDictionary.cpp +++ b/cocos/base/CCDictionary.cpp @@ -1,6 +1,7 @@ /**************************************************************************** - Copyright (c) 2012 - 2013 cocos2d-x.org - + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/cocos/base/CCDictionary.h b/cocos/base/CCDictionary.h index ef20d76e05..6be84d7e2d 100644 --- a/cocos/base/CCDictionary.h +++ b/cocos/base/CCDictionary.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2012 - 2013 cocos2d-x.org +Copyright (c) 2012 cocos2d-x.org + opyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCDouble.h b/cocos/base/CCDouble.h index 6ef8ae28c8..0b01eb10e5 100644 --- a/cocos/base/CCDouble.h +++ b/cocos/base/CCDouble.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCFloat.h b/cocos/base/CCFloat.h index 6591638cd2..1c2c5e3e74 100644 --- a/cocos/base/CCFloat.h +++ b/cocos/base/CCFloat.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCGeometry.cpp b/cocos/base/CCGeometry.cpp index fe5086cba9..4be119ff6b 100644 --- a/cocos/base/CCGeometry.cpp +++ b/cocos/base/CCGeometry.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCGeometry.h b/cocos/base/CCGeometry.h index f1a080fdc5..4f43ddda4b 100644 --- a/cocos/base/CCGeometry.h +++ b/cocos/base/CCGeometry.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCInteger.h b/cocos/base/CCInteger.h index 56b6468dd4..f7a7b953ee 100644 --- a/cocos/base/CCInteger.h +++ b/cocos/base/CCInteger.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCMap.h b/cocos/base/CCMap.h index 4b6e22ad4e..450b39bc2e 100644 --- a/cocos/base/CCMap.h +++ b/cocos/base/CCMap.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2012 - 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCNS.cpp b/cocos/base/CCNS.cpp index d9732d03ea..11b92516c5 100644 --- a/cocos/base/CCNS.cpp +++ b/cocos/base/CCNS.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCNS.h b/cocos/base/CCNS.h index c078e45225..663df74076 100644 --- a/cocos/base/CCNS.h +++ b/cocos/base/CCNS.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCObject.cpp b/cocos/base/CCObject.cpp index 75d01c5937..09dc4399f6 100644 --- a/cocos/base/CCObject.cpp +++ b/cocos/base/CCObject.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCObject.h b/cocos/base/CCObject.h index dc1a6adfd2..28bb7da247 100644 --- a/cocos/base/CCObject.h +++ b/cocos/base/CCObject.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCPlatformConfig.h b/cocos/base/CCPlatformConfig.h index 3a74498d1a..7d171b8d8b 100644 --- a/cocos/base/CCPlatformConfig.h +++ b/cocos/base/CCPlatformConfig.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCPlatformMacros.h b/cocos/base/CCPlatformMacros.h index 7fbfa542c8..426d898420 100644 --- a/cocos/base/CCPlatformMacros.h +++ b/cocos/base/CCPlatformMacros.h @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCSet.cpp b/cocos/base/CCSet.cpp index b3e565c6f4..baca990f36 100644 --- a/cocos/base/CCSet.cpp +++ b/cocos/base/CCSet.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCSet.h b/cocos/base/CCSet.h index 89ef7d0ac4..266946df6b 100644 --- a/cocos/base/CCSet.h +++ b/cocos/base/CCSet.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCString.cpp b/cocos/base/CCString.cpp index 8714861da4..a6dfcf1e0d 100644 --- a/cocos/base/CCString.cpp +++ b/cocos/base/CCString.cpp @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCString.h b/cocos/base/CCString.h index a3f4fd94ba..2b9778d559 100644 --- a/cocos/base/CCString.h +++ b/cocos/base/CCString.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCValue.cpp b/cocos/base/CCValue.cpp index b94454eb3f..6aabf25c6e 100644 --- a/cocos/base/CCValue.cpp +++ b/cocos/base/CCValue.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCValue.h b/cocos/base/CCValue.h index f4bd0ab59a..c710a64cb7 100644 --- a/cocos/base/CCValue.h +++ b/cocos/base/CCValue.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index 073dc7651c..128f5951b3 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com -Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/atitc.cpp b/cocos/base/atitc.cpp index e93cb801b2..d098b084bf 100644 --- a/cocos/base/atitc.cpp +++ b/cocos/base/atitc.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/atitc.h b/cocos/base/atitc.h index 72bfd32a8c..1f1ad7a8ef 100644 --- a/cocos/base/atitc.h +++ b/cocos/base/atitc.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/s3tc.cpp b/cocos/base/s3tc.cpp index 2995849603..067c00aa11 100644 --- a/cocos/base/s3tc.cpp +++ b/cocos/base/s3tc.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/base/s3tc.h b/cocos/base/s3tc.h index a3cf233257..e6573d9849 100644 --- a/cocos/base/s3tc.h +++ b/cocos/base/s3tc.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionEaseEx.cpp b/cocos/editor-support/cocostudio/CCActionEaseEx.cpp index 5a823242fe..c5d11eb1e1 100644 --- a/cocos/editor-support/cocostudio/CCActionEaseEx.cpp +++ b/cocos/editor-support/cocostudio/CCActionEaseEx.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionEaseEx.h b/cocos/editor-support/cocostudio/CCActionEaseEx.h index e56923870c..0350d4d590 100644 --- a/cocos/editor-support/cocostudio/CCActionEaseEx.h +++ b/cocos/editor-support/cocostudio/CCActionEaseEx.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionFrame.cpp b/cocos/editor-support/cocostudio/CCActionFrame.cpp index 1a67511c9a..b35bb272f7 100644 --- a/cocos/editor-support/cocostudio/CCActionFrame.cpp +++ b/cocos/editor-support/cocostudio/CCActionFrame.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionFrame.h b/cocos/editor-support/cocostudio/CCActionFrame.h index 031990aeb4..5b152f4eb3 100644 --- a/cocos/editor-support/cocostudio/CCActionFrame.h +++ b/cocos/editor-support/cocostudio/CCActionFrame.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionFrameEasing.cpp b/cocos/editor-support/cocostudio/CCActionFrameEasing.cpp index 25067811b1..b4a6fe9940 100644 --- a/cocos/editor-support/cocostudio/CCActionFrameEasing.cpp +++ b/cocos/editor-support/cocostudio/CCActionFrameEasing.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionFrameEasing.h b/cocos/editor-support/cocostudio/CCActionFrameEasing.h index b067949a76..65c9ad3a05 100644 --- a/cocos/editor-support/cocostudio/CCActionFrameEasing.h +++ b/cocos/editor-support/cocostudio/CCActionFrameEasing.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp index 30fc24841f..e0bfad1a31 100644 --- a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionManagerEx.h b/cocos/editor-support/cocostudio/CCActionManagerEx.h index 281acd13fe..e24c48d436 100644 --- a/cocos/editor-support/cocostudio/CCActionManagerEx.h +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionNode.cpp b/cocos/editor-support/cocostudio/CCActionNode.cpp index 3a174e7f47..b5482ff223 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/CCActionNode.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionNode.h b/cocos/editor-support/cocostudio/CCActionNode.h index ba7ef8c828..42e4d0e4ee 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.h +++ b/cocos/editor-support/cocostudio/CCActionNode.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionObject.cpp b/cocos/editor-support/cocostudio/CCActionObject.cpp index 8ccafdf0b6..eeba39d121 100644 --- a/cocos/editor-support/cocostudio/CCActionObject.cpp +++ b/cocos/editor-support/cocostudio/CCActionObject.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCActionObject.h b/cocos/editor-support/cocostudio/CCActionObject.h index 086a947f0c..8d33a2017f 100644 --- a/cocos/editor-support/cocostudio/CCActionObject.h +++ b/cocos/editor-support/cocostudio/CCActionObject.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index 684b98eeb9..33d230df97 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCArmature.h b/cocos/editor-support/cocostudio/CCArmature.h index f601c057f7..e63e77d87e 100644 --- a/cocos/editor-support/cocostudio/CCArmature.h +++ b/cocos/editor-support/cocostudio/CCArmature.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp index 90549e3042..755f7c3c9f 100644 --- a/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCArmatureAnimation.h b/cocos/editor-support/cocostudio/CCArmatureAnimation.h index f135501cb1..cd08bdeefc 100644 --- a/cocos/editor-support/cocostudio/CCArmatureAnimation.h +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp b/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp index 8ff4b503c3..0848ab6226 100644 --- a/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCArmatureDataManager.h b/cocos/editor-support/cocostudio/CCArmatureDataManager.h index 5ca512a19a..f621a6c6bf 100644 --- a/cocos/editor-support/cocostudio/CCArmatureDataManager.h +++ b/cocos/editor-support/cocostudio/CCArmatureDataManager.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCArmatureDefine.cpp b/cocos/editor-support/cocostudio/CCArmatureDefine.cpp index 3873a918ba..987711eb70 100644 --- a/cocos/editor-support/cocostudio/CCArmatureDefine.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureDefine.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCArmatureDefine.h b/cocos/editor-support/cocostudio/CCArmatureDefine.h index e2c8894cf8..934b7bc43d 100644 --- a/cocos/editor-support/cocostudio/CCArmatureDefine.h +++ b/cocos/editor-support/cocostudio/CCArmatureDefine.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCBatchNode.cpp b/cocos/editor-support/cocostudio/CCBatchNode.cpp index 449aee1bb5..45dcade7d6 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/CCBatchNode.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCBatchNode.h b/cocos/editor-support/cocostudio/CCBatchNode.h index feff9c868d..1de8a963a2 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.h +++ b/cocos/editor-support/cocostudio/CCBatchNode.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCBone.cpp b/cocos/editor-support/cocostudio/CCBone.cpp index ecf13a5bf8..4bd7883a43 100644 --- a/cocos/editor-support/cocostudio/CCBone.cpp +++ b/cocos/editor-support/cocostudio/CCBone.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCBone.h b/cocos/editor-support/cocostudio/CCBone.h index a5afb8641f..db153a1da5 100644 --- a/cocos/editor-support/cocostudio/CCBone.h +++ b/cocos/editor-support/cocostudio/CCBone.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCColliderDetector.cpp b/cocos/editor-support/cocostudio/CCColliderDetector.cpp index 69883544b3..838b2a97be 100644 --- a/cocos/editor-support/cocostudio/CCColliderDetector.cpp +++ b/cocos/editor-support/cocostudio/CCColliderDetector.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCColliderDetector.h b/cocos/editor-support/cocostudio/CCColliderDetector.h index f7c4e73d2a..9619ed4f29 100644 --- a/cocos/editor-support/cocostudio/CCColliderDetector.h +++ b/cocos/editor-support/cocostudio/CCColliderDetector.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp index b583952182..b2fe13fbfd 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCComAttribute.h b/cocos/editor-support/cocostudio/CCComAttribute.h index 6d432389b9..3919d6ca56 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.h +++ b/cocos/editor-support/cocostudio/CCComAttribute.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCComAudio.cpp b/cocos/editor-support/cocostudio/CCComAudio.cpp index c513b8d861..e232d07569 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.cpp +++ b/cocos/editor-support/cocostudio/CCComAudio.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCComAudio.h b/cocos/editor-support/cocostudio/CCComAudio.h index a80ca17604..4bbb97bb47 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.h +++ b/cocos/editor-support/cocostudio/CCComAudio.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCComBase.h b/cocos/editor-support/cocostudio/CCComBase.h index 82c4bd11a8..59dfccbe7f 100644 --- a/cocos/editor-support/cocostudio/CCComBase.h +++ b/cocos/editor-support/cocostudio/CCComBase.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCComController.cpp b/cocos/editor-support/cocostudio/CCComController.cpp index 1d22237c05..0cba200351 100644 --- a/cocos/editor-support/cocostudio/CCComController.cpp +++ b/cocos/editor-support/cocostudio/CCComController.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCComController.h b/cocos/editor-support/cocostudio/CCComController.h index 0c77861e56..d68b25559c 100644 --- a/cocos/editor-support/cocostudio/CCComController.h +++ b/cocos/editor-support/cocostudio/CCComController.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp index 5ca698556b..e143e44fdf 100644 --- a/cocos/editor-support/cocostudio/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCComRender.h b/cocos/editor-support/cocostudio/CCComRender.h index 255aa12e30..b2b94f3305 100644 --- a/cocos/editor-support/cocostudio/CCComRender.h +++ b/cocos/editor-support/cocostudio/CCComRender.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp index e401172c7c..452f25d9b8 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.h b/cocos/editor-support/cocostudio/CCDataReaderHelper.h index 88804e7ddb..03ed25133b 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.h +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCDatas.cpp b/cocos/editor-support/cocostudio/CCDatas.cpp index 9fefedf1d1..17d2a60b9a 100644 --- a/cocos/editor-support/cocostudio/CCDatas.cpp +++ b/cocos/editor-support/cocostudio/CCDatas.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCDatas.h b/cocos/editor-support/cocostudio/CCDatas.h index 22eaabbc22..42ac9ae2f6 100644 --- a/cocos/editor-support/cocostudio/CCDatas.h +++ b/cocos/editor-support/cocostudio/CCDatas.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp b/cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp index 73efa5443c..1d4c899dea 100644 --- a/cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp +++ b/cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCDecorativeDisplay.h b/cocos/editor-support/cocostudio/CCDecorativeDisplay.h index eee97e9019..1d6dcbe979 100644 --- a/cocos/editor-support/cocostudio/CCDecorativeDisplay.h +++ b/cocos/editor-support/cocostudio/CCDecorativeDisplay.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCDisplayFactory.cpp b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp index a1e2df89d1..20f826cb2b 100644 --- a/cocos/editor-support/cocostudio/CCDisplayFactory.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCDisplayFactory.h b/cocos/editor-support/cocostudio/CCDisplayFactory.h index 3f6fdd3ff0..3c94dc8d3b 100644 --- a/cocos/editor-support/cocostudio/CCDisplayFactory.h +++ b/cocos/editor-support/cocostudio/CCDisplayFactory.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.cpp b/cocos/editor-support/cocostudio/CCDisplayManager.cpp index f05ccb1675..c2ce242a47 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayManager.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.h b/cocos/editor-support/cocostudio/CCDisplayManager.h index 6b3f188236..39b89e45af 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.h +++ b/cocos/editor-support/cocostudio/CCDisplayManager.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCInputDelegate.cpp b/cocos/editor-support/cocostudio/CCInputDelegate.cpp index 03ac5030a7..3f3d94745e 100644 --- a/cocos/editor-support/cocostudio/CCInputDelegate.cpp +++ b/cocos/editor-support/cocostudio/CCInputDelegate.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCInputDelegate.h b/cocos/editor-support/cocostudio/CCInputDelegate.h index 215fa0b21c..81cd4c9218 100644 --- a/cocos/editor-support/cocostudio/CCInputDelegate.h +++ b/cocos/editor-support/cocostudio/CCInputDelegate.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCProcessBase.cpp b/cocos/editor-support/cocostudio/CCProcessBase.cpp index b55585c047..137b804d58 100644 --- a/cocos/editor-support/cocostudio/CCProcessBase.cpp +++ b/cocos/editor-support/cocostudio/CCProcessBase.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCProcessBase.h b/cocos/editor-support/cocostudio/CCProcessBase.h index cb7db59a71..693a7ea2f8 100644 --- a/cocos/editor-support/cocostudio/CCProcessBase.h +++ b/cocos/editor-support/cocostudio/CCProcessBase.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - #ifndef __CCPROCESSBASE_H__ #define __CCPROCESSBASE_H__ diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index 3b3bd6e618..349bba5dfe 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "cocostudio/CCSGUIReader.h" #include "gui/CocosGUI.h" #include "cocostudio/CCActionManagerEx.h" diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.h b/cocos/editor-support/cocostudio/CCSGUIReader.h index f93a6c3d5c..e44e390a97 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.h +++ b/cocos/editor-support/cocostudio/CCSGUIReader.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CCSGUIREADER_H__ #define __CCSGUIREADER_H__ diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index 44bd667507..12b18604ff 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "cocostudio/CocoStudio.h" #include "gui/CocosGUI.h" diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.h b/cocos/editor-support/cocostudio/CCSSceneReader.h index 459062710f..6b72b82574 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/CCSSceneReader.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __CCSSCENEREADER_H__ #define __CCSSCENEREADER_H__ diff --git a/cocos/editor-support/cocostudio/CCSkin.cpp b/cocos/editor-support/cocostudio/CCSkin.cpp index 0f41b9f6f9..94ba291e2b 100644 --- a/cocos/editor-support/cocostudio/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/CCSkin.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCSkin.h b/cocos/editor-support/cocostudio/CCSkin.h index 42ba994189..e0f255e70d 100644 --- a/cocos/editor-support/cocostudio/CCSkin.h +++ b/cocos/editor-support/cocostudio/CCSkin.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp index fb1cf6065b..c5399ba479 100644 --- a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h index 89c20f6833..75797c1aa2 100644 --- a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCTransformHelp.cpp b/cocos/editor-support/cocostudio/CCTransformHelp.cpp index bc81478d17..6979285cff 100644 --- a/cocos/editor-support/cocostudio/CCTransformHelp.cpp +++ b/cocos/editor-support/cocostudio/CCTransformHelp.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCTransformHelp.h b/cocos/editor-support/cocostudio/CCTransformHelp.h index 57b57fad9c..3dedccbebe 100644 --- a/cocos/editor-support/cocostudio/CCTransformHelp.h +++ b/cocos/editor-support/cocostudio/CCTransformHelp.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCTween.cpp b/cocos/editor-support/cocostudio/CCTween.cpp index 282df8297e..8d4aaccf72 100644 --- a/cocos/editor-support/cocostudio/CCTween.cpp +++ b/cocos/editor-support/cocostudio/CCTween.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCTween.h b/cocos/editor-support/cocostudio/CCTween.h index 9a6357059f..8153d21e0d 100644 --- a/cocos/editor-support/cocostudio/CCTween.h +++ b/cocos/editor-support/cocostudio/CCTween.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCTweenFunction.cpp b/cocos/editor-support/cocostudio/CCTweenFunction.cpp index 808e314c7e..853a3f46e1 100644 --- a/cocos/editor-support/cocostudio/CCTweenFunction.cpp +++ b/cocos/editor-support/cocostudio/CCTweenFunction.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCTweenFunction.h b/cocos/editor-support/cocostudio/CCTweenFunction.h index d845636244..f5d5aac1eb 100644 --- a/cocos/editor-support/cocostudio/CCTweenFunction.h +++ b/cocos/editor-support/cocostudio/CCTweenFunction.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCUtilMath.cpp b/cocos/editor-support/cocostudio/CCUtilMath.cpp index 0714958857..ec78117792 100644 --- a/cocos/editor-support/cocostudio/CCUtilMath.cpp +++ b/cocos/editor-support/cocostudio/CCUtilMath.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CCUtilMath.h b/cocos/editor-support/cocostudio/CCUtilMath.h index 20541a8c80..b10690d620 100644 --- a/cocos/editor-support/cocostudio/CCUtilMath.h +++ b/cocos/editor-support/cocostudio/CCUtilMath.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/CocoStudio.h b/cocos/editor-support/cocostudio/CocoStudio.h index 7a1b07bc99..9f1875957d 100644 --- a/cocos/editor-support/cocostudio/CocoStudio.h +++ b/cocos/editor-support/cocostudio/CocoStudio.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __EDITOR_SUPPORT_COCOSTUDIO_H__ #define __EDITOR_SUPPORT_COCOSTUDIO_H__ diff --git a/cocos/editor-support/cocostudio/DictionaryHelper.cpp b/cocos/editor-support/cocostudio/DictionaryHelper.cpp index 9151f52123..0c46694e7b 100644 --- a/cocos/editor-support/cocostudio/DictionaryHelper.cpp +++ b/cocos/editor-support/cocostudio/DictionaryHelper.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "cocostudio/DictionaryHelper.h" diff --git a/cocos/editor-support/cocostudio/DictionaryHelper.h b/cocos/editor-support/cocostudio/DictionaryHelper.h index b8da590829..58f58455f5 100644 --- a/cocos/editor-support/cocostudio/DictionaryHelper.h +++ b/cocos/editor-support/cocostudio/DictionaryHelper.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __DICTIONARYHELPER_H__ #define __DICTIONARYHELPER_H__ diff --git a/cocos/editor-support/cocostudio/ObjectFactory.cpp b/cocos/editor-support/cocostudio/ObjectFactory.cpp index 268224b011..b74fee8859 100644 --- a/cocos/editor-support/cocostudio/ObjectFactory.cpp +++ b/cocos/editor-support/cocostudio/ObjectFactory.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/ObjectFactory.h b/cocos/editor-support/cocostudio/ObjectFactory.h index 26e2bd6447..94be620b56 100644 --- a/cocos/editor-support/cocostudio/ObjectFactory.h +++ b/cocos/editor-support/cocostudio/ObjectFactory.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/TriggerBase.cpp b/cocos/editor-support/cocostudio/TriggerBase.cpp index 59cff85905..9d7f424bcb 100644 --- a/cocos/editor-support/cocostudio/TriggerBase.cpp +++ b/cocos/editor-support/cocostudio/TriggerBase.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/TriggerBase.h b/cocos/editor-support/cocostudio/TriggerBase.h index 921f6e96d4..f90d8028b2 100644 --- a/cocos/editor-support/cocostudio/TriggerBase.h +++ b/cocos/editor-support/cocostudio/TriggerBase.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/TriggerMng.cpp b/cocos/editor-support/cocostudio/TriggerMng.cpp index ca9703736a..bc0d4580c2 100644 --- a/cocos/editor-support/cocostudio/TriggerMng.cpp +++ b/cocos/editor-support/cocostudio/TriggerMng.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/TriggerMng.h b/cocos/editor-support/cocostudio/TriggerMng.h index 46f50642e6..3f84d3810b 100644 --- a/cocos/editor-support/cocostudio/TriggerMng.h +++ b/cocos/editor-support/cocostudio/TriggerMng.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -21,7 +21,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - #ifndef __TRIGGERMNG_H__ #define __TRIGGERMNG_H__ diff --git a/cocos/editor-support/cocostudio/TriggerObj.cpp b/cocos/editor-support/cocostudio/TriggerObj.cpp index dd020c7b87..83d7bdcfbc 100644 --- a/cocos/editor-support/cocostudio/TriggerObj.cpp +++ b/cocos/editor-support/cocostudio/TriggerObj.cpp @@ -1,5 +1,5 @@ - /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +/**************************************************************************** +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/editor-support/cocostudio/TriggerObj.h b/cocos/editor-support/cocostudio/TriggerObj.h index 6586bbab7d..55d98ca504 100644 --- a/cocos/editor-support/cocostudio/TriggerObj.h +++ b/cocos/editor-support/cocostudio/TriggerObj.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/gui/CocosGUI.cpp b/cocos/gui/CocosGUI.cpp index 2612e72454..3aef3982eb 100644 --- a/cocos/gui/CocosGUI.cpp +++ b/cocos/gui/CocosGUI.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/CocosGUI.h" diff --git a/cocos/gui/CocosGUI.h b/cocos/gui/CocosGUI.h index dbd73c21ef..3f81214d5e 100644 --- a/cocos/gui/CocosGUI.h +++ b/cocos/gui/CocosGUI.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __COCOSGUI_H__ #define __COCOSGUI_H__ diff --git a/cocos/gui/UIButton.cpp b/cocos/gui/UIButton.cpp index c0d21dc2b3..5a6a2dc54f 100644 --- a/cocos/gui/UIButton.cpp +++ b/cocos/gui/UIButton.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UIButton.h" #include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" diff --git a/cocos/gui/UIButton.h b/cocos/gui/UIButton.h index 6e74ee2ac1..c2f7bf30a4 100644 --- a/cocos/gui/UIButton.h +++ b/cocos/gui/UIButton.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UIBUTTON_H__ #define __UIBUTTON_H__ diff --git a/cocos/gui/UICheckBox.cpp b/cocos/gui/UICheckBox.cpp index b255cfe49c..f37baf2b0b 100644 --- a/cocos/gui/UICheckBox.cpp +++ b/cocos/gui/UICheckBox.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UICheckBox.h" diff --git a/cocos/gui/UICheckBox.h b/cocos/gui/UICheckBox.h index 6796a3f710..c332c003a7 100644 --- a/cocos/gui/UICheckBox.h +++ b/cocos/gui/UICheckBox.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UICHECKBOX_H__ #define __UICHECKBOX_H__ diff --git a/cocos/gui/UIHelper.cpp b/cocos/gui/UIHelper.cpp index c8692d5a49..30371a7a08 100644 --- a/cocos/gui/UIHelper.cpp +++ b/cocos/gui/UIHelper.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "CocosGUI.h" diff --git a/cocos/gui/UIHelper.h b/cocos/gui/UIHelper.h index 723570d844..6021c06032 100644 --- a/cocos/gui/UIHelper.h +++ b/cocos/gui/UIHelper.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UIHELPER_H__ #define __UIHELPER_H__ diff --git a/cocos/gui/UIImageView.cpp b/cocos/gui/UIImageView.cpp index fd2a0640c5..a77dee73e0 100644 --- a/cocos/gui/UIImageView.cpp +++ b/cocos/gui/UIImageView.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UIImageView.h" #include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" diff --git a/cocos/gui/UIImageView.h b/cocos/gui/UIImageView.h index ba0f56594d..df373a67a9 100644 --- a/cocos/gui/UIImageView.h +++ b/cocos/gui/UIImageView.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UIIMAGEVIEW_H__ #define __UIIMAGEVIEW_H__ diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index 2cc1929ebd..2381edb45f 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UILayout.h" #include "gui/UIHelper.h" diff --git a/cocos/gui/UILayout.h b/cocos/gui/UILayout.h index 5b0d3bd202..2595cf125e 100644 --- a/cocos/gui/UILayout.h +++ b/cocos/gui/UILayout.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __LAYOUT_H__ #define __LAYOUT_H__ diff --git a/cocos/gui/UILayoutDefine.cpp b/cocos/gui/UILayoutDefine.cpp index e1de93008b..88de5a8fe8 100644 --- a/cocos/gui/UILayoutDefine.cpp +++ b/cocos/gui/UILayoutDefine.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "UILayoutDefine.h" NS_CC_BEGIN diff --git a/cocos/gui/UILayoutDefine.h b/cocos/gui/UILayoutDefine.h index 595071623d..1fee726968 100644 --- a/cocos/gui/UILayoutDefine.h +++ b/cocos/gui/UILayoutDefine.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UILAYOUTDEFINE_H__ #define __UILAYOUTDEFINE_H__ diff --git a/cocos/gui/UILayoutParameter.cpp b/cocos/gui/UILayoutParameter.cpp index 7941763909..d0a98f4d0d 100644 --- a/cocos/gui/UILayoutParameter.cpp +++ b/cocos/gui/UILayoutParameter.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UILayoutParameter.h" #include "gui/UILayout.h" diff --git a/cocos/gui/UILayoutParameter.h b/cocos/gui/UILayoutParameter.h index fa16172573..9065a16176 100644 --- a/cocos/gui/UILayoutParameter.h +++ b/cocos/gui/UILayoutParameter.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __LAYOUTPARMETER_H__ #define __LAYOUTPARMETER_H__ diff --git a/cocos/gui/UIListView.cpp b/cocos/gui/UIListView.cpp index cb44091cec..ba6a567aef 100644 --- a/cocos/gui/UIListView.cpp +++ b/cocos/gui/UIListView.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UIListView.h" #include "gui/UIHelper.h" diff --git a/cocos/gui/UIListView.h b/cocos/gui/UIListView.h index 059240f64b..2a6b2df848 100644 --- a/cocos/gui/UIListView.h +++ b/cocos/gui/UIListView.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UILISTVIEW_H__ diff --git a/cocos/gui/UILoadingBar.cpp b/cocos/gui/UILoadingBar.cpp index 38ca9a3764..b561c3fd7c 100644 --- a/cocos/gui/UILoadingBar.cpp +++ b/cocos/gui/UILoadingBar.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UILoadingBar.h" #include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" diff --git a/cocos/gui/UILoadingBar.h b/cocos/gui/UILoadingBar.h index 85a3854d04..b0305951d5 100644 --- a/cocos/gui/UILoadingBar.h +++ b/cocos/gui/UILoadingBar.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UILOADINGBAR_H__ #define __UILOADINGBAR_H__ diff --git a/cocos/gui/UIPageView.cpp b/cocos/gui/UIPageView.cpp index 5e11a88918..9e41a534ed 100644 --- a/cocos/gui/UIPageView.cpp +++ b/cocos/gui/UIPageView.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UIPageView.h" diff --git a/cocos/gui/UIPageView.h b/cocos/gui/UIPageView.h index 40eb1fdc62..3c98b39c46 100644 --- a/cocos/gui/UIPageView.h +++ b/cocos/gui/UIPageView.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UIPAGEVIEW_H__ #define __UIPAGEVIEW_H__ diff --git a/cocos/gui/UIScrollInterface.h b/cocos/gui/UIScrollInterface.h index 96b91e7267..14923fed9f 100644 --- a/cocos/gui/UIScrollInterface.h +++ b/cocos/gui/UIScrollInterface.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UISCROLLDELEGATE_H__ #define __UISCROLLDELEGATE_H__ diff --git a/cocos/gui/UIScrollView.cpp b/cocos/gui/UIScrollView.cpp index 7a5614faff..11bb00c622 100644 --- a/cocos/gui/UIScrollView.cpp +++ b/cocos/gui/UIScrollView.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UIScrollView.h" diff --git a/cocos/gui/UIScrollView.h b/cocos/gui/UIScrollView.h index 6075a02adf..56e0b27eaf 100644 --- a/cocos/gui/UIScrollView.h +++ b/cocos/gui/UIScrollView.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UISCROLLVIEW_H__ #define __UISCROLLVIEW_H__ diff --git a/cocos/gui/UISlider.cpp b/cocos/gui/UISlider.cpp index cad6f3d763..d138def5a3 100644 --- a/cocos/gui/UISlider.cpp +++ b/cocos/gui/UISlider.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UISlider.h" #include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" diff --git a/cocos/gui/UISlider.h b/cocos/gui/UISlider.h index f79b3e9efe..bc952ede15 100644 --- a/cocos/gui/UISlider.h +++ b/cocos/gui/UISlider.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UISLIDER_H__ #define __UISLIDER_H__ diff --git a/cocos/gui/UIText.cpp b/cocos/gui/UIText.cpp index a6f22997bf..f940dac6b0 100644 --- a/cocos/gui/UIText.cpp +++ b/cocos/gui/UIText.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UIText.h" diff --git a/cocos/gui/UIText.h b/cocos/gui/UIText.h index 1134d441aa..05ea37b9c1 100644 --- a/cocos/gui/UIText.h +++ b/cocos/gui/UIText.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UILABEL_H__ #define __UILABEL_H__ diff --git a/cocos/gui/UITextAtlas.cpp b/cocos/gui/UITextAtlas.cpp index 9e5444ab60..491ad1af80 100644 --- a/cocos/gui/UITextAtlas.cpp +++ b/cocos/gui/UITextAtlas.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UITextAtlas.h" diff --git a/cocos/gui/UITextAtlas.h b/cocos/gui/UITextAtlas.h index 5f3b0025ce..89f28a8b10 100644 --- a/cocos/gui/UITextAtlas.h +++ b/cocos/gui/UITextAtlas.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UILABELATLAS_H__ #define __UILABELATLAS_H__ diff --git a/cocos/gui/UITextBMFont.cpp b/cocos/gui/UITextBMFont.cpp index 846ed82876..a72bfc9458 100644 --- a/cocos/gui/UITextBMFont.cpp +++ b/cocos/gui/UITextBMFont.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UITextBMFont.h" diff --git a/cocos/gui/UITextBMFont.h b/cocos/gui/UITextBMFont.h index 18dceeb2f4..2a5f729623 100644 --- a/cocos/gui/UITextBMFont.h +++ b/cocos/gui/UITextBMFont.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UILABELBMFONT_H__ #define __UILABELBMFONT_H__ diff --git a/cocos/gui/UITextField.cpp b/cocos/gui/UITextField.cpp index 58cf592df7..c6e080fed3 100644 --- a/cocos/gui/UITextField.cpp +++ b/cocos/gui/UITextField.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UITextField.h" diff --git a/cocos/gui/UITextField.h b/cocos/gui/UITextField.h index 382f80e97a..1372696bcb 100644 --- a/cocos/gui/UITextField.h +++ b/cocos/gui/UITextField.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UITEXTFIELD_H__ #define __UITEXTFIELD_H__ diff --git a/cocos/gui/UIWidget.cpp b/cocos/gui/UIWidget.cpp index 6b68087843..f0a8c1dba9 100644 --- a/cocos/gui/UIWidget.cpp +++ b/cocos/gui/UIWidget.cpp @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #include "gui/UIWidget.h" #include "gui/UILayout.h" diff --git a/cocos/gui/UIWidget.h b/cocos/gui/UIWidget.h index 62b3f19279..c0d664d634 100644 --- a/cocos/gui/UIWidget.h +++ b/cocos/gui/UIWidget.h @@ -1,26 +1,26 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ #ifndef __UIWIDGET_H__ #define __UIWIDGET_H__ diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index 9773992df8..cc19b72524 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -1,6 +1,7 @@ /**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2012 greathqy + Copyright (c) 2012 greathqy + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/network/HttpClient.h b/cocos/network/HttpClient.h index 6a9bfd8974..74f498e942 100644 --- a/cocos/network/HttpClient.h +++ b/cocos/network/HttpClient.h @@ -1,6 +1,7 @@ /**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2012 greathqy + Copyright (c) 2012 greathqy + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/network/HttpRequest.h b/cocos/network/HttpRequest.h index 4aff1e2d10..50d660bca3 100644 --- a/cocos/network/HttpRequest.h +++ b/cocos/network/HttpRequest.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/network/HttpResponse.h b/cocos/network/HttpResponse.h index 25e7d43540..764ddde120 100644 --- a/cocos/network/HttpResponse.h +++ b/cocos/network/HttpResponse.h @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/network/SocketIO.cpp b/cocos/network/SocketIO.cpp index da25ff015c..c38ed4c70d 100644 --- a/cocos/network/SocketIO.cpp +++ b/cocos/network/SocketIO.cpp @@ -1,6 +1,6 @@ /**************************************************************************** - Copyright (c) 2010-2013 cocos2d-x.org - Copyright (c) 2013 Chris Hannon + Copyright (c) 2013 Chris Hannon + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/network/SocketIO.h b/cocos/network/SocketIO.h index 6759c1cac7..599a6c4cd0 100644 --- a/cocos/network/SocketIO.h +++ b/cocos/network/SocketIO.h @@ -1,6 +1,6 @@ /**************************************************************************** - Copyright (c) 2010-2013 cocos2d-x.org Copyright (c) 2013 Chris Hannon http://www.channon.us + Copyright (c) 2013-2014 Chukong Technologies Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 6f12bd79ef..3a77d75868 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -1,6 +1,6 @@ /**************************************************************************** - Copyright (c) 2010-2013 cocos2d-x.org - Copyright (c) 2013 James Chen + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/network/WebSocket.h b/cocos/network/WebSocket.h index a561900894..d9363bb666 100644 --- a/cocos/network/WebSocket.h +++ b/cocos/network/WebSocket.h @@ -1,6 +1,6 @@ /**************************************************************************** - Copyright (c) 2010-2013 cocos2d-x.org - Copyright (c) 2013 James Chen + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/physics/CCPhysicsBody.cpp b/cocos/physics/CCPhysicsBody.cpp index c626389290..240f9833ba 100644 --- a/cocos/physics/CCPhysicsBody.cpp +++ b/cocos/physics/CCPhysicsBody.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/physics/CCPhysicsBody.h b/cocos/physics/CCPhysicsBody.h index a843732ad9..52ba0f527d 100644 --- a/cocos/physics/CCPhysicsBody.h +++ b/cocos/physics/CCPhysicsBody.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/physics/CCPhysicsContact.cpp b/cocos/physics/CCPhysicsContact.cpp index c04b295f46..86e7cec08f 100644 --- a/cocos/physics/CCPhysicsContact.cpp +++ b/cocos/physics/CCPhysicsContact.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/physics/CCPhysicsContact.h b/cocos/physics/CCPhysicsContact.h index 552ab81e63..987e5daf47 100644 --- a/cocos/physics/CCPhysicsContact.h +++ b/cocos/physics/CCPhysicsContact.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/physics/CCPhysicsJoint.cpp b/cocos/physics/CCPhysicsJoint.cpp index 2d5cddd7ab..2509c5c7a6 100644 --- a/cocos/physics/CCPhysicsJoint.cpp +++ b/cocos/physics/CCPhysicsJoint.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/physics/CCPhysicsJoint.h b/cocos/physics/CCPhysicsJoint.h index b5e80e1c42..e2a2d5a9a9 100644 --- a/cocos/physics/CCPhysicsJoint.h +++ b/cocos/physics/CCPhysicsJoint.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/physics/CCPhysicsShape.cpp b/cocos/physics/CCPhysicsShape.cpp index 543bbf0333..c7b798c278 100644 --- a/cocos/physics/CCPhysicsShape.cpp +++ b/cocos/physics/CCPhysicsShape.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/physics/CCPhysicsShape.h b/cocos/physics/CCPhysicsShape.h index 1146b2d291..b1c4a4f50c 100644 --- a/cocos/physics/CCPhysicsShape.h +++ b/cocos/physics/CCPhysicsShape.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/physics/CCPhysicsWorld.cpp b/cocos/physics/CCPhysicsWorld.cpp index ebb12e4ec2..f57679c7e4 100644 --- a/cocos/physics/CCPhysicsWorld.cpp +++ b/cocos/physics/CCPhysicsWorld.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/physics/CCPhysicsWorld.h b/cocos/physics/CCPhysicsWorld.h index 6991071679..bca81f35b4 100644 --- a/cocos/physics/CCPhysicsWorld.h +++ b/cocos/physics/CCPhysicsWorld.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/CCLuaBridge.cpp b/cocos/scripting/lua/bindings/CCLuaBridge.cpp index c915636448..50aaca89e5 100644 --- a/cocos/scripting/lua/bindings/CCLuaBridge.cpp +++ b/cocos/scripting/lua/bindings/CCLuaBridge.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2011 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/CCLuaBridge.h b/cocos/scripting/lua/bindings/CCLuaBridge.h index e23f47b406..0b5ba061c5 100644 --- a/cocos/scripting/lua/bindings/CCLuaBridge.h +++ b/cocos/scripting/lua/bindings/CCLuaBridge.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2011 cocos2d-x.org + Copyright (c) 2013 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/CCLuaEngine.cpp b/cocos/scripting/lua/bindings/CCLuaEngine.cpp index 752fb3561a..a05fa8f54d 100644 --- a/cocos/scripting/lua/bindings/CCLuaEngine.cpp +++ b/cocos/scripting/lua/bindings/CCLuaEngine.cpp @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2011 cocos2d-x.org + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/CCLuaEngine.h b/cocos/scripting/lua/bindings/CCLuaEngine.h index fe076b9418..e3f4ff9bef 100644 --- a/cocos/scripting/lua/bindings/CCLuaEngine.h +++ b/cocos/scripting/lua/bindings/CCLuaEngine.h @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2011 cocos2d-x.org + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/CCLuaStack.cpp b/cocos/scripting/lua/bindings/CCLuaStack.cpp index b9d9a8db6d..9bdce3aab3 100644 --- a/cocos/scripting/lua/bindings/CCLuaStack.cpp +++ b/cocos/scripting/lua/bindings/CCLuaStack.cpp @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2011 cocos2d-x.org + Copyright (c) 2011-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/CCLuaStack.h b/cocos/scripting/lua/bindings/CCLuaStack.h index e48d7bb9d3..ed31c48b91 100644 --- a/cocos/scripting/lua/bindings/CCLuaStack.h +++ b/cocos/scripting/lua/bindings/CCLuaStack.h @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2011 cocos2d-x.org + Copyright (c) 2011-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/CCLuaValue.cpp b/cocos/scripting/lua/bindings/CCLuaValue.cpp index dcb80c527b..584f17a6a8 100644 --- a/cocos/scripting/lua/bindings/CCLuaValue.cpp +++ b/cocos/scripting/lua/bindings/CCLuaValue.cpp @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2011 cocos2d-x.org + Copyright (c) 2011-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/CCLuaValue.h b/cocos/scripting/lua/bindings/CCLuaValue.h index 08cdc2544f..eefc0c85c4 100644 --- a/cocos/scripting/lua/bindings/CCLuaValue.h +++ b/cocos/scripting/lua/bindings/CCLuaValue.h @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2011 cocos2d-x.org + Copyright (c) 2011-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp b/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp index 13c9c26e34..6409c99f61 100644 --- a/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp +++ b/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2011 cocos2d-x.org + Copyright (c) 2011-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.h b/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.h index 75db7d0fdc..e251bac27b 100644 --- a/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.h +++ b/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.h @@ -1,5 +1,6 @@ /**************************************************************************** -Copyright (c) 2011 cocos2d-x.org +Copyright (c) 2011-2012 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/LuaBasicConversions.cpp b/cocos/scripting/lua/bindings/LuaBasicConversions.cpp index 84c013968c..8906fd94e1 100644 --- a/cocos/scripting/lua/bindings/LuaBasicConversions.cpp +++ b/cocos/scripting/lua/bindings/LuaBasicConversions.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2011 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/scripting/lua/bindings/LuaBasicConversions.h b/cocos/scripting/lua/bindings/LuaBasicConversions.h index ed46e80a29..ad982839e9 100644 --- a/cocos/scripting/lua/bindings/LuaBasicConversions.h +++ b/cocos/scripting/lua/bindings/LuaBasicConversions.h @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef __COCOS2DX_SCRIPTING_LUA_COCOS2DXSUPPORT_LUABAISCCONVERSIONS_H__ #define __COCOS2DX_SCRIPTING_LUA_COCOS2DXSUPPORT_LUABAISCCONVERSIONS_H__ diff --git a/cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id index 3271e22a11..42910a1d92 100644 --- a/cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id +++ b/cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id @@ -1 +1 @@ -9104cc5ff14c7548ea6924a2785400db7526c1e1 \ No newline at end of file +bcec27eb626dbcf63b810cce7f0f48b2d02c2158 \ No newline at end of file diff --git a/cocos/scripting/lua/bindings/LuaOpengl.h b/cocos/scripting/lua/bindings/LuaOpengl.h index fa8f3780f6..d4691677ae 100644 --- a/cocos/scripting/lua/bindings/LuaOpengl.h +++ b/cocos/scripting/lua/bindings/LuaOpengl.h @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef __LUA_OPENGL_H__ #define __LUA_OPENGL_H__ diff --git a/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp index 6ed20bf4ba..81317d65d7 100644 --- a/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp +++ b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifdef __cplusplus extern "C" { #endif diff --git a/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h index 5079dca704..d1cb5d3a57 100644 --- a/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h +++ b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef __LUA_SCRIPT_HANDLER_MGR_H__ #define __LUA_SCRIPT_HANDLER_MGR_H__ diff --git a/cocos/scripting/lua/bindings/LuaSkeletonAnimation.cpp b/cocos/scripting/lua/bindings/LuaSkeletonAnimation.cpp index c06d633f68..92cc7699bd 100644 --- a/cocos/scripting/lua/bindings/LuaSkeletonAnimation.cpp +++ b/cocos/scripting/lua/bindings/LuaSkeletonAnimation.cpp @@ -1,9 +1,27 @@ -/* - * LuaSkeletonAnimation.cpp - * - * Created on: 2013?11?21? - * Author: edwardzhou - */ + /**************************************************************************** + Copyright (c) 2013 Edward Zhou + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #include "LuaSkeletonAnimation.h" #include "cocos2d.h" diff --git a/cocos/scripting/lua/bindings/LuaSkeletonAnimation.h b/cocos/scripting/lua/bindings/LuaSkeletonAnimation.h index b1f570be8f..7872ad7cbb 100644 --- a/cocos/scripting/lua/bindings/LuaSkeletonAnimation.h +++ b/cocos/scripting/lua/bindings/LuaSkeletonAnimation.h @@ -1,9 +1,27 @@ -/* - * LuaSkeletonAnimation.h - * - * Created on: 2013?11?21? - * Author: edwardzhou - */ + /**************************************************************************** + Copyright (c) 2013 Edward Zhou + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef LUASKELETONANIMATION_H_ #define LUASKELETONANIMATION_H_ diff --git a/cocos/scripting/lua/bindings/Lua_web_socket.cpp b/cocos/scripting/lua/bindings/Lua_web_socket.cpp index a541001ec8..8301c75d8f 100644 --- a/cocos/scripting/lua/bindings/Lua_web_socket.cpp +++ b/cocos/scripting/lua/bindings/Lua_web_socket.cpp @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) diff --git a/cocos/scripting/lua/bindings/Lua_web_socket.h b/cocos/scripting/lua/bindings/Lua_web_socket.h index 458705d779..5431209d12 100644 --- a/cocos/scripting/lua/bindings/Lua_web_socket.h +++ b/cocos/scripting/lua/bindings/Lua_web_socket.h @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef __LUA_WEB_SOCKET_H__ #define __LUA_WEB_SOCKET_H__ diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp index a72df5ca6b..5120f1d966 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #include "lua_cocos2dx_coco_studio_manual.hpp" #ifdef __cplusplus diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.hpp b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.hpp index f85d67cb8e..fcbdb8b7b1 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.hpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.hpp @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_COCO_STUDIO_MANUAL_H #define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_COCO_STUDIO_MANUAL_H diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp index bad4c5d654..0d6d053810 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #include "lua_cocos2dx_deprecated.h" #ifdef __cplusplus diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.h b/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.h index 62bea3bf27..7db6757ee2 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.h +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.h @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_LUA_COCOS2DX_DEPRECATED_H #define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_LUA_COCOS2DX_DEPRECATED_H diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp index 160037fbca..88b4693c01 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #include "lua_cocos2dx_extension_manual.h" #ifdef __cplusplus diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h index d369ee3659..1a76eaf316 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_LUA_COCOS2DX_EXTENSION_MANUAL_H #define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_LUA_COCOS2DX_EXTENSION_MANUAL_H diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp index d6827dfa0a..ec8a23ccd8 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #include "lua_cocos2dx_gui_manual.hpp" #ifdef __cplusplus diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.hpp b/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.hpp index b7a9c42033..d18581a291 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.hpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.hpp @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_GUI_MANUAL_H #define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_GUI_MANUAL_H diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id index 3ef3e93cf1..bdcf5be18e 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id @@ -1 +1 @@ -f0ef8eb2f398001c933c2608c1eb219db7deaebf \ No newline at end of file +8684eb059f027da79ca8c0c0e620cc9396be6451 \ No newline at end of file diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.hpp b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.hpp index 4e4a67eea9..d8dae90200 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.hpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.hpp @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_MANUAL_H #define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_MANUAL_H diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.cpp index 79480afcb3..593dd3f0a3 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.cpp @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #include "lua_cocos2dx_spine_manual.hpp" #ifdef __cplusplus diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.hpp b/cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.hpp index 75ce975ab9..85797a1a83 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.hpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.hpp @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_SPINE_MANUAL_H #define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_SPINE_MANUAL_H diff --git a/cocos/scripting/lua/bindings/lua_xml_http_request.cpp b/cocos/scripting/lua/bindings/lua_xml_http_request.cpp index 945b36a16a..9a7b124ee9 100644 --- a/cocos/scripting/lua/bindings/lua_xml_http_request.cpp +++ b/cocos/scripting/lua/bindings/lua_xml_http_request.cpp @@ -1,4 +1,26 @@ - +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #include "lua_xml_http_request.h" extern "C" diff --git a/cocos/scripting/lua/bindings/lua_xml_http_request.h b/cocos/scripting/lua/bindings/lua_xml_http_request.h index 227e576740..8d0ae45394 100644 --- a/cocos/scripting/lua/bindings/lua_xml_http_request.h +++ b/cocos/scripting/lua/bindings/lua_xml_http_request.h @@ -1,3 +1,26 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef __COCOS_SCRIPTING_LUA_BINDINGS_LUA_XML_HTTP_REQUEST_H__ #define __COCOS_SCRIPTING_LUA_BINDINGS_LUA_XML_HTTP_REQUEST_H__ diff --git a/cocos/storage/local-storage/LocalStorageAndroid.cpp b/cocos/storage/local-storage/LocalStorageAndroid.cpp index a678b17edd..93de8f5dc2 100644 --- a/cocos/storage/local-storage/LocalStorageAndroid.cpp +++ b/cocos/storage/local-storage/LocalStorageAndroid.cpp @@ -1,7 +1,7 @@ -/* - - Copyright (c) 2012 - Zynga Inc. +/*************************************************************************** + Copyright (c) 2012 Zynga Inc. Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologic Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -20,8 +20,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +***************************************************************************/ - */ /* Local Storage support for the JS Bindings for iOS. From 37b6ef99e3cad411509e28114d7d51abd9b98cc6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 20:04:30 -0800 Subject: [PATCH 302/428] Wrong dir fix for travis ci. --- tools/travis-scripts/run-script.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/travis-scripts/run-script.sh b/tools/travis-scripts/run-script.sh index 0ade7a31c7..aa9c47f5c6 100755 --- a/tools/travis-scripts/run-script.sh +++ b/tools/travis-scripts/run-script.sh @@ -76,10 +76,9 @@ elif [ "$PLATFORM"x = "linux"x ]; then cd linux-build cmake ../.. make -j10 - cd .. # build template echo "Building template projects for linux ..." - cd tools/project-creator + cd $COCOS2DX_ROOT/tools/project-creator ./create_project.py -n MyGameCpp -k com.MyCompany.AwesomeGameCpp -l cpp -p $HOME ./create_project.py -n MyGameLua -k com.MyCompany.AwesomeGameLua -l lua -p $HOME cd $HOME/MyGameCpp From e0b2d16a54f7fd0a2171404f4246dde8c8f02b53 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 7 Jan 2014 12:48:55 +0800 Subject: [PATCH 303/428] update changelog --- CHANGELOG | 51 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index fa443fca76..b41e9c125e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,14 +1,24 @@ cocos2d-x-3.0beta Jan.7 2014 [All] + [NEW] New label: shadow, outline, glow support + [NEW] AngelCode binary file format support for LabelBMFont + [NEW] New spine runtime support + [NEW] Add templated containers, such as `cocos2d::Map<>` and `cocos2d::Vector<>` + [NEW] TextureCache::addImageAsync() uses std::function<> as call back + [NEW] Namespace changed: network -> cocos2d::network, gui -> cocos2d::gui + [NEW] Added more CocoStudioSceneTest samples. + [NEW] Added UnitTest for Vector, Map, Value. + [NEW] AngelCode binary file format support for LabelBMFont. + [NEW] New renderer: Scene graph and Renderer are decoupled now. [NEW] Upgrated Box2D to 2.3.0 [NEW] SChedule::performFunctionInCocosThread() [NEW] Added tga format support again. + [NEW] Adds UnitTest for Template container and Value class [FIX] A Logic error in ControlUtils::RectUnion. [FIX] Bug fixes for Armature, use Vector, Map instead of Array, Dictionary. [FIX] Used c++11 range loop(highest performance) instead of other types of loop. [FIX] Removed most hungarian notations. [FIX] Merged NodeRGBA to Node. - [NEW] New renderer: Scene graph and Renderer are decoupled now. [FIX] Potential hash collision fix. [FIX] Updates spine runtime to the latest version. [FIX] Uses `const std::string&` instead of `const char*`. @@ -17,28 +27,49 @@ cocos2d-x-3.0beta Jan.7 2014 [FIX] GUI refactoring: Removes UI prefix, Widget is inherited from Node, uses new containers(Vector, Map). [FIX] String itself is also modified in `String::componentsSeparatedByString`. [FIX] Sprites with PhysicsBody move to a wrong position when game resume from background. - [FIX] Crash if connection breaks during download using AssetManager. - [NEW] AngelCode binary file format support for LabelBMFont. + [FIX] Crash if connection breaks during download using AssetManager. [FIX] OpenAL context isn't destroyed correctly on mac and ios. [FIX] Useless conversion in ScrollView::onTouchBegan. - [FIX] Two memory leak fixes in EventDispatcher::removeEventListener(s). - [NEW] TextureCache::addImageAsync() uses std::function<> as call back - [NEW] Namespace changed: network -> cocos2d::network, gui -> cocos2d::gui - [NEW] Added more CocoStudioSceneTest samples. - [NEW] Added UnitTest for Vector, Map, Value. + [FIX] Two memory leak fixes in EventDispatcher::removeEventListener(s). + [FIX] CCTMXMap doesn't support TMX files reference external TSX files + [FIX] Logical error in `CallFuncN::clone()` + [FIX] Child's opacity will not be changed when its parent's cascadeOpacityEnabled was set to true and opacity was changed + [FIX] Disallow copy and assign for Scene Graph + Actions objects + [FIX] XMLHttpRequest receives wrong binary array + [FIX] XMLHttpRequest.status needs to be assigned even when connection fails + [FIX] TextureCache::addImageAsync may load a image even it is loaded in GL thread + [FIX] EventCustom shouldn't use std::hash to generate unique ID, because the result is not unique + [FIX] CC_USE_PHYSICS is actually impossible to turn it off + [FIX] Crash if connection breaks during download using AssetManager + [FIX] Project_creator supports creating project at any folder and supports UI [Android] [NEW] build/android-build.sh: add supporting to generate .apk file - [FIX] XMLHttpRequest receives wrong binary array. [NEW] Bindings-generator supports to bind 'unsigned long'. + [FIX] XMLHttpRequest receives wrong binary array. [FIX] 'Test Frame Event' of TestJavascript/CocoStudioArmatureTest Crashes. [FIX] UserDefault::getDoubleForKey() doesn't pass default value to Java. +[iOS] + [FIX] Infinite loop in UserDefault's destructor [Windows] [NEW] CMake support for windows. [Bindings] - [FIX] Don't bind override functions for JSB and LuaBining since they aren't needed at all. + [NEW] Support CocoStudio v1.2 [NEW] Adds spine JS binding support. + [FIX] Don't bind override functions for JSB and LuaBining since they aren't needed at all. [FIX] The order of onEnter and onExit is wrong. [FIX] The setBlendFunc method of some classes wasn't exposed to LUA. + [FIX] Bindings-generator doesn't support 'unsigned long' + [FIX] Potential hash collision by using typeid(T).hash_code() in JSB and LuaBinding +[Lua binding] + [NEW] New label support + [NEW] Physcis integrated support + [NEW] EventDispatcher support + [FIX] CallFuncND + auto remove lua test case have no effect + [FIX] Lua gc will cause correcsponding c++ object been released + [FIX] Some lua manual binding functions don't remove unneeded element in the lua stack + [FIX] The setBlendFunc method of some classes wasn't exposed to LUA +[Javascript binding] + [FIX] `onEnter` event is triggered after children's `onEnter` event cocos2d-x-3.0alpha1 Nov.19 2013 [all platforms] From 2a3e24d5b5396292f51164a8552dd98b840244df Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 14:09:05 +0800 Subject: [PATCH 304/428] Updates README.md for running new project. --- README.md | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 92e6e9c9a3..5a83ee1934 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,7 @@ How to start a new game 1. Download the code from [cocos2d download site][4] 2. Enter `tools/project-creator` - -2. Run the `create-projects.py` script +3. Run the `create-projects.py` script Example: @@ -33,6 +32,36 @@ Example: $ ./project-creator.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame $ cd /home/mygame +### Build new project for android ### + + $ cd proj.android + $ ./build_native.py + +### Build new project for ios & osx ### + +* Enter *proj.ios_mac* folder, open *mygame.xcodeproj* +* Select ios or osx targets in scheme toolbar + +### Build new project for linux ### + +if you never run cocos2d-x on linux, you need to install all dependences by the +script in **cocos2d/build/install-deps-linux.sh** + + $ cd cocos2d/build + $ ./install-deps-linux.sh + $ ../.. + +Then + + $ mkdir build + $ cd build + $ cmake .. + $ make -j4 + +### Build new project for win32 ### + +* Enter *proj.win32*, open *mygame.sln* by vs2012 + Main features ------------- @@ -57,7 +86,7 @@ Main features * Motion Streak * Render To Texture * Touch/Accelerometer on mobile devices - * Touch/Mouse/Keyboard on desktop + * Touch/Mouse/Keyboard on desktop * Sound Engine support (CocosDenshion library) based on OpenAL * Integrated Slow motion/Fast forward * Fast and compressed textures: PVR compressed and uncompressed textures, ETC1 compressed textures, and more @@ -103,8 +132,8 @@ $ cmake .. $ make ``` - You may meet building errors when building libGLFW.so. It is because libGL.so directs to an error target, - you should make it to direct to a correct one. `install-deps-linux.sh` only has to be run onece. + You may meet building errors when building libGLFW.so. It is because libGL.so directs to an error target, + you should make it to direct to a correct one. `install-deps-linux.sh` only has to be run once. * For Windows From 1031dbcd75f6fd2480bf20e0c3ed551d20adc0df Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 14:41:30 +0800 Subject: [PATCH 305/428] Updates release note for EventDispatcher. --- docs/RELEASE_NOTES.md | 55 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 918d190721..5ea058d6c2 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -23,6 +23,7 @@ - [Improved LabelTTF / LabelBMFont](#improved-labelttf--labelbmfont) - [New EventDispatcher](#new-eventdispatcher) - [Adding Touch Event Listener](#adding-touch-event-listener) + - [Adding Mouse Event Listener](#adding-mouse-event-listener) - [Adding A Keyboard Event Listener](#adding-a-keyboard-event-listener) - [Adding An Acceleration Event Listener](#adding-an-acceleration-event-listener) - [Adding A Custom Event Listener](#adding-a-custom-event-listener) @@ -30,8 +31,10 @@ - [Setting Fixed Priority For A Listener](#setting-fixed-priority-for-a-listener) - [Removing Event Listener](#removing-event-listener) - [Removing A Specified Event Listener](#removing-a-specified-event-listener) - - [Removing All Listeners For An Event Type](#removing-all-listeners-for-an-event-type) + - [Removing Custom Event Listener](#removing-custom-listener) + - [Removing All Listeners For Specified Event Listener Type](#removing-all-listeners-for-an-event-type) - [Removing All Listeners](#removing-all-listeners) + - [Physics Integration](#physics-integration) - [PhysicsWorld](#physicsworld) - [PhysicsBody](#physicsbody) @@ -146,7 +149,7 @@ auto item = MenuItemLabel::create(label, CC_CALLBACK_1(MyClass::callback, this)) auto item = MenuItemLabel::create(label, std::bind(&MyClass::callback, this, std::placeholders::_1)); // in v3.0 you can use lambdas or any other "Function" object -auto item = MenuItemLabel::create(label, +auto item = MenuItemLabel::create(label, [&](Object *sender) { // do something. Item "sender" clicked }); @@ -304,7 +307,7 @@ void setTexParameters(const ccTexParams& texParams); _Feature added in v3.0-beta_ -The renderer functionality has been decoupled from the Scene graph / Node logic. A new object called `Renderer` is responsible for rendering the object. +The renderer functionality has been decoupled from the Scene graph / Node logic. A new object called `Renderer` is responsible for rendering the object. Auto-batching and auto-culling support has been added. @@ -323,14 +326,15 @@ All events like touch event, keyboard event, acceleration event and custom event ### Adding Touch Event Listener +For TouchOneByOne: ```c++ auto sprite = Sprite::create("file.png"); ... -auto listener = EventListenerTouch::create(Touch::DispatchMode::ONE_BY_ONE); +auto listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouch(true); -listener->onTouchBegan = [](Touch* touch, Event* event) { do_some_thing(); return true; }; -listener->onTouchMoved = [](Touch* touch, Event* event) { do_some_thing(); }; -listener->onTouchEnded = [](Touch* touch, Event* event) { do_some_thing(); }; +listener->onTouchBegan = [](Touch* touch, Event* event) { do_some_thing(); return true; }; +listener->onTouchMoved = [](Touch* touch, Event* event) { do_some_thing(); }; +listener->onTouchEnded = [](Touch* touch, Event* event) { do_some_thing(); }; listener->onTouchCancelled = [](Touch* touch, Event* event) { do_some_thing(); }; // The priority of the touch listener is based on the draw order of sprite EventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, sprite); @@ -338,6 +342,30 @@ EventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, EventDispatcher::getInstance()->addEventListenerWithFixedPriority(listener, 100); // 100 is a fixed value ``` +For TouchAllAtOnce +```c++ +auto sprite = Sprite::create("file.png"); +... +auto listener = EventListenerTouchAllAtOnce::create(); +listener->onTouchesBegan = [](const std::vector& touches, Event* event) { do_some_thing(); return true; }; +listener->onTouchesMoved = [](const std::vector& touches, Event* event) { do_some_thing(); }; +listener->onTouchesEnded = [](const std::vector& touches, Event* event) { do_some_thing(); }; +listener->onTouchesCancelled = [](const std::vector& touches, Event* event) { do_some_thing(); }; +// The priority of the touch listener is based on the draw order of sprite +EventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, sprite); +// Or the priority of the touch listener is a fixed value +EventDispatcher::getInstance()->addEventListenerWithFixedPriority(listener, 100); // 100 is a fixed value +``` + +### Adding Mouse Event Listener ### +```c++ +auto mouseListener = EventListenerMouse::create(); +mouseListener->onMouseScroll = [](Event* event) { EventMouse* e = static_cast(event); do_some_thing(); }; +mouseListener->onMouseUp = [](Event* event) { EventMouse* e = static_cast(event); do_some_thing(); }; +mouseListener->onMouseDown = [](Event* event) { EventMouse* e = static_cast(event); do_some_thing(); }; +dispatcher->addEventListenerWithSceneGraphPriority(mouseListener, this); +``` + ### Adding A Keyboard Event Listener ```c++ @@ -386,10 +414,16 @@ dispatcher->setPriority(fixedPriorityListener, 200); dispatcher->removeEventListener(listener); ``` -#### Removing All Listeners For An Event Type +#### Removing Custom Event Listener #### ```c++ -dispatcher->removeListenersForEventType("event_name"); +dispatcher->removeCustomEventListener("my_custom_event_listener_name"); +``` + +#### Removing All Listeners For An Event Listener Type + +```c++ +dispatcher->removeEventListeners(EventListener::Type::TOUCH_ONE_BY_ONE); ``` #### Removing All Listeners @@ -443,7 +477,7 @@ world->addJoint(joint); ### PhysicsContact -A `PhysicsContact` object is created automatically to describes a contact between two physical bodies in a `PhysicsWorld`. you can control the contact behavior from the physics contact event listener. +A `PhysicsContact` object is created automatically to describes a contact between two physical bodies in a `PhysicsWorld`. you can control the contact behavior from the physics contact event listener. Other classes contain the contact information: `PhysicsContactPreSolve`, `PhysicsContactPostSolve`. The event listener for physics: `EventListenerPhysicsContact`, `EventListenerPhysicsContactWithBodies`, `EventListenerPhysicsContactWithShapes`, `EventListenerPhysicsContactWithGroup`. ```c++ @@ -675,4 +709,3 @@ Through the funtions of the LuaBasicConversion file,they can be converted the Lu ## Known issues You can find all the known issues "here":http://www.cocos2d-x.org/projects/native/issues - From c1827c96587fa37151bf713c93d409430e5293e6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 14:50:26 +0800 Subject: [PATCH 306/428] Update RELEASE_NOTES.md --- docs/RELEASE_NOTES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 5ea058d6c2..4dcbdf9da3 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -23,7 +23,7 @@ - [Improved LabelTTF / LabelBMFont](#improved-labelttf--labelbmfont) - [New EventDispatcher](#new-eventdispatcher) - [Adding Touch Event Listener](#adding-touch-event-listener) - - [Adding Mouse Event Listener](#adding-mouse-event-listener) + - [Adding Mouse Event Listener](#adding-mouse-event-listener) - [Adding A Keyboard Event Listener](#adding-a-keyboard-event-listener) - [Adding An Acceleration Event Listener](#adding-an-acceleration-event-listener) - [Adding A Custom Event Listener](#adding-a-custom-event-listener) @@ -347,7 +347,7 @@ For TouchAllAtOnce auto sprite = Sprite::create("file.png"); ... auto listener = EventListenerTouchAllAtOnce::create(); -listener->onTouchesBegan = [](const std::vector& touches, Event* event) { do_some_thing(); return true; }; +listener->onTouchesBegan = [](const std::vector& touches, Event* event) { do_some_thing(); }; listener->onTouchesMoved = [](const std::vector& touches, Event* event) { do_some_thing(); }; listener->onTouchesEnded = [](const std::vector& touches, Event* event) { do_some_thing(); }; listener->onTouchesCancelled = [](const std::vector& touches, Event* event) { do_some_thing(); }; From b50b110287d3291d8b71de29bdab74e6d50b0394 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 14:53:39 +0800 Subject: [PATCH 307/428] Update RELEASE_NOTES.md --- docs/RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 4dcbdf9da3..5d97883d9d 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -31,7 +31,7 @@ - [Setting Fixed Priority For A Listener](#setting-fixed-priority-for-a-listener) - [Removing Event Listener](#removing-event-listener) - [Removing A Specified Event Listener](#removing-a-specified-event-listener) - - [Removing Custom Event Listener](#removing-custom-listener) + - [Removing Custom Event Listener](#removing-custom-listener) - [Removing All Listeners For Specified Event Listener Type](#removing-all-listeners-for-an-event-type) - [Removing All Listeners](#removing-all-listeners) From 9626a44f70a528e56e6aa75d652c3931b43393c5 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 15:00:15 +0800 Subject: [PATCH 308/428] Update RELEASE_NOTES.md --- docs/RELEASE_NOTES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 5d97883d9d..c9e5c61dcd 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -31,8 +31,8 @@ - [Setting Fixed Priority For A Listener](#setting-fixed-priority-for-a-listener) - [Removing Event Listener](#removing-event-listener) - [Removing A Specified Event Listener](#removing-a-specified-event-listener) - - [Removing Custom Event Listener](#removing-custom-listener) - - [Removing All Listeners For Specified Event Listener Type](#removing-all-listeners-for-an-event-type) + - [Removing Custom Event Listener](#removing-custom-event-listener) + - [Removing All Listeners For Specified Event Listener Type](#removing-all-listeners-for-specified-event-listener-type) - [Removing All Listeners](#removing-all-listeners) - [Physics Integration](#physics-integration) From aa2168f66f38fed991e0d8ac8c24d803d4fd54df Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 6 Jan 2014 23:41:01 -0800 Subject: [PATCH 309/428] RenderQuad with bigger size It uses 18 bits for texture id and 10 bits for shader id This is a temporal fix --- cocos/2d/renderer/CCQuadCommand.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/cocos/2d/renderer/CCQuadCommand.cpp b/cocos/2d/renderer/CCQuadCommand.cpp index 9466a82a2a..bbb7ba018c 100644 --- a/cocos/2d/renderer/CCQuadCommand.cpp +++ b/cocos/2d/renderer/CCQuadCommand.cpp @@ -119,9 +119,9 @@ int64_t QuadCommand::generateID() //Generate Material ID //TODO fix shader ID generation - CCASSERT(_shader->getProgram() < 64, "ShaderID is greater than 64"); + CCASSERT(_shader->getProgram() < pow(2,10), "ShaderID is greater than 2^10"); //TODO fix texture ID generation - CCASSERT(_textureID < 1024, "TextureID is greater than 1024"); + CCASSERT(_textureID < pow(2,18), "TextureID is greater than 2^18"); //TODO fix blend id generation int blendID = 0; @@ -146,9 +146,17 @@ int64_t QuadCommand::generateID() blendID = 4; } - _materialID = (int32_t)_shader->getProgram() << 28 - | (int32_t)blendID << 24 - | (int32_t)_textureID << 14; + //TODO Material ID should be part of the ID + // + // Temporal hack (later, these 32-bits should be packed in 24-bits + // + // +---------------------+-------------------+----------------------+ + // | Shader ID (10 bits) | Blend ID (4 bits) | Texture ID (18 bits) | + // +---------------------+-------------------+----------------------+ + + _materialID = (int32_t)_shader->getProgram() << 22 + | (int32_t)blendID << 18 + | (int32_t)_textureID << 0; //Generate RenderCommandID _id = (int64_t)_viewport << 61 From 5dadbce813604350479176d8bc02f4d2a8eae5f6 Mon Sep 17 00:00:00 2001 From: heliclei Date: Tue, 7 Jan 2014 15:41:18 +0800 Subject: [PATCH 310/428] fix symbol link create error --- tools/jenkins-scripts/ghprb.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index 360986f40a..6510e6fd58 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -73,7 +73,12 @@ def main(): #reset path to workspace root os.system("cd " + os.environ['WORKSPACE']); - + os.system("git checkout develop") + os.system("git branch -D pull" + str(pr_num)) + #clean workspace + print "git clean -xdf" + os.system("git clean -xdf") + #fetch pull request to local repo git_fetch_pr = "git fetch origin pull/" + str(pr_num) + "/head" os.system(git_fetch_pr) @@ -86,16 +91,22 @@ def main(): git_update_submodule = "git submodule update --init --force" os.system(git_update_submodule) + #make temp dir + print "current dir is" + os.environ['WORKSPACE'] + os.system("cd " + os.environ['WORKSPACE']); + os.mkdir("android_build_objs") #add symbol link PROJECTS=["Cpp/HelloCpp","Cpp/TestCpp","Cpp/SimpleGame","Cpp/AssetsManagerTest", "Javascript/TestJavascript","Javascript/CocosDragonJS","Javascript/CrystalCraze", "Javascript/MoonWarriors","Javascript/WatermelonWithMe","Lua/HelloLua","Lua/TestLua"] - if(platform.system == 'Darwin'): + print platform.system() + if(platform.system() == 'Darwin'): for item in PROJECTS: - os.System("ln -s "+os.environ['WORKSPACE']+"/android_build_objs " + os.environ['WORKSPACE']+"/samples/"+item+"/proj.android/obj") - elif(platform.system == 'Windows'): + cmd = "ln -s " + os.environ['WORKSPACE']+"/android_build_objs/ " + os.environ['WORKSPACE']+"/samples/"+item+"/proj.android/obj" + os.system(cmd) + elif(platform.system() == 'Windows'): for item in PROJECTS: - os.System("mklink /J "+os.environ['WORKSPACE']+os.sep+"samples"+os.sep +item+os.sep+"proj.android/obj " + os.environ['WORKSPACE']+os.sep+"android_build_objs") + os.system("mklink /J "+os.environ['WORKSPACE']+os.sep+"samples"+os.sep +item+os.sep+"proj.android/obj " + os.environ['WORKSPACE']+os.sep+"android_build_objs") #build #TODO: support android-mac build currently From 2a3481f20c5c994996eae81e215a7417375ee68b Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 23:44:36 -0800 Subject: [PATCH 311/428] Moves temp files to CURRENT_BINARY_DIR. --- cocos/2d/CMakeLists.txt | 4 ++-- cocos/audio/CMakeLists.txt | 4 ++-- cocos/base/CMakeLists.txt | 4 ++-- cocos/editor-support/cocosbuilder/CMakeLists.txt | 4 ++-- cocos/editor-support/cocostudio/CMakeLists.txt | 4 ++-- cocos/editor-support/spine/CMakeLists.txt | 4 ++-- cocos/gui/CMakeLists.txt | 4 ++-- cocos/math/kazmath/CMakeLists.txt | 4 ++-- cocos/network/CMakeLists.txt | 4 ++-- cocos/scripting/CMakeLists.txt | 4 ++-- extensions/CMakeLists.txt | 4 ++-- external/Box2D/CMakeLists.txt | 4 ++-- external/chipmunk/src/CMakeLists.txt | 4 ++-- external/lua/lua/CMakeLists.txt | 4 ++-- external/lua/tolua/CMakeLists.txt | 4 ++-- external/tinyxml2/CMakeLists.txt | 4 ++-- external/unzip/CMakeLists.txt | 4 ++-- samples/Cpp/HelloCpp/CMakeLists.txt | 2 +- samples/Cpp/TestCpp/CMakeLists.txt | 2 +- samples/Lua/HelloLua/CMakeLists.txt | 2 +- samples/Lua/TestLua/CMakeLists.txt | 2 +- 21 files changed, 38 insertions(+), 38 deletions(-) diff --git a/cocos/2d/CMakeLists.txt b/cocos/2d/CMakeLists.txt index 429647ca8a..88090ec7c5 100644 --- a/cocos/2d/CMakeLists.txt +++ b/cocos/2d/CMakeLists.txt @@ -224,7 +224,7 @@ target_link_libraries(cocos2d set_target_properties(cocos2d PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/cocos/audio/CMakeLists.txt b/cocos/audio/CMakeLists.txt index 9ad9e99b12..3a42929d02 100644 --- a/cocos/audio/CMakeLists.txt +++ b/cocos/audio/CMakeLists.txt @@ -42,7 +42,7 @@ target_link_libraries(audio set_target_properties(audio PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) endif() diff --git a/cocos/base/CMakeLists.txt b/cocos/base/CMakeLists.txt index 06d3e582c1..6077e77a4f 100644 --- a/cocos/base/CMakeLists.txt +++ b/cocos/base/CMakeLists.txt @@ -23,7 +23,7 @@ add_library(cocosbase STATIC set_target_properties(cocosbase PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/cocos/editor-support/cocosbuilder/CMakeLists.txt b/cocos/editor-support/cocosbuilder/CMakeLists.txt index 179f9eb387..6d41d29579 100644 --- a/cocos/editor-support/cocosbuilder/CMakeLists.txt +++ b/cocos/editor-support/cocosbuilder/CMakeLists.txt @@ -33,7 +33,7 @@ add_library(cocosbuilder STATIC set_target_properties(cocosbuilder PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/cocos/editor-support/cocostudio/CMakeLists.txt b/cocos/editor-support/cocostudio/CMakeLists.txt index 7db63eac1a..a6f86af9e5 100644 --- a/cocos/editor-support/cocostudio/CMakeLists.txt +++ b/cocos/editor-support/cocostudio/CMakeLists.txt @@ -51,7 +51,7 @@ target_link_libraries(cocostudio set_target_properties(cocostudio PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/cocos/editor-support/spine/CMakeLists.txt b/cocos/editor-support/spine/CMakeLists.txt index 613cdb9786..c3d96e8b61 100644 --- a/cocos/editor-support/spine/CMakeLists.txt +++ b/cocos/editor-support/spine/CMakeLists.txt @@ -42,7 +42,7 @@ add_library(spine STATIC set_target_properties(spine PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/cocos/gui/CMakeLists.txt b/cocos/gui/CMakeLists.txt index 5f28565527..c6a9905072 100644 --- a/cocos/gui/CMakeLists.txt +++ b/cocos/gui/CMakeLists.txt @@ -25,6 +25,6 @@ add_library(gui STATIC set_target_properties(gui PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/cocos/math/kazmath/CMakeLists.txt b/cocos/math/kazmath/CMakeLists.txt index ae7ea4b3d7..184bb1bc2d 100644 --- a/cocos/math/kazmath/CMakeLists.txt +++ b/cocos/math/kazmath/CMakeLists.txt @@ -18,6 +18,6 @@ ADD_SUBDIRECTORY(src) set_target_properties(kazmath PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/cocos/network/CMakeLists.txt b/cocos/network/CMakeLists.txt index f2deb9b365..217fe49409 100644 --- a/cocos/network/CMakeLists.txt +++ b/cocos/network/CMakeLists.txt @@ -17,7 +17,7 @@ target_link_libraries(network set_target_properties(network PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/cocos/scripting/CMakeLists.txt b/cocos/scripting/CMakeLists.txt index 11667106a8..b822cf76f8 100644 --- a/cocos/scripting/CMakeLists.txt +++ b/cocos/scripting/CMakeLists.txt @@ -48,6 +48,6 @@ target_link_libraries(luabinding set_target_properties(luabinding PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index f8083e1220..fbf971ce45 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -34,7 +34,7 @@ add_library(extensions STATIC set_target_properties(extensions PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/external/Box2D/CMakeLists.txt b/external/Box2D/CMakeLists.txt index 36a068b720..eff3db22eb 100644 --- a/external/Box2D/CMakeLists.txt +++ b/external/Box2D/CMakeLists.txt @@ -57,6 +57,6 @@ add_library(box2d STATIC set_target_properties(box2d PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/external/chipmunk/src/CMakeLists.txt b/external/chipmunk/src/CMakeLists.txt index a0d15b7b8a..45c855e838 100644 --- a/external/chipmunk/src/CMakeLists.txt +++ b/external/chipmunk/src/CMakeLists.txt @@ -44,7 +44,7 @@ endif(BUILD_SHARED OR INSTALL_STATIC) set_target_properties(chipmunk_static PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/external/lua/lua/CMakeLists.txt b/external/lua/lua/CMakeLists.txt index c63d80a7b2..81febeffb3 100644 --- a/external/lua/lua/CMakeLists.txt +++ b/external/lua/lua/CMakeLists.txt @@ -37,6 +37,6 @@ add_library(lua STATIC set_target_properties(lua PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/external/lua/tolua/CMakeLists.txt b/external/lua/tolua/CMakeLists.txt index b12e144e75..ccede5366b 100644 --- a/external/lua/tolua/CMakeLists.txt +++ b/external/lua/tolua/CMakeLists.txt @@ -17,6 +17,6 @@ add_library(tolua STATIC set_target_properties(tolua PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/external/tinyxml2/CMakeLists.txt b/external/tinyxml2/CMakeLists.txt index 6877779b2c..f2fd323735 100644 --- a/external/tinyxml2/CMakeLists.txt +++ b/external/tinyxml2/CMakeLists.txt @@ -8,7 +8,7 @@ add_library(tinyxml2 STATIC set_target_properties(tinyxml2 PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/external/unzip/CMakeLists.txt b/external/unzip/CMakeLists.txt index ae98584279..69bdd33b9b 100644 --- a/external/unzip/CMakeLists.txt +++ b/external/unzip/CMakeLists.txt @@ -9,7 +9,7 @@ add_library(unzip STATIC set_target_properties(unzip PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) diff --git a/samples/Cpp/HelloCpp/CMakeLists.txt b/samples/Cpp/HelloCpp/CMakeLists.txt index f5af51def4..861118b09b 100644 --- a/samples/Cpp/HelloCpp/CMakeLists.txt +++ b/samples/Cpp/HelloCpp/CMakeLists.txt @@ -61,7 +61,7 @@ if(WIN32 AND MSVC) set_target_properties(${APP_NAME} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") set_target_properties(${APP_NAME} PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS") else() - set(APP_BIN_DIR "${CMAKE_SOURCE_DIR}/bin/${APP_NAME}") + set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}") set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}") diff --git a/samples/Cpp/TestCpp/CMakeLists.txt b/samples/Cpp/TestCpp/CMakeLists.txt index e676cd9856..18543c6e2c 100644 --- a/samples/Cpp/TestCpp/CMakeLists.txt +++ b/samples/Cpp/TestCpp/CMakeLists.txt @@ -157,7 +157,7 @@ target_link_libraries(${APP_NAME} box2d ) -set(APP_BIN_DIR "${CMAKE_SOURCE_DIR}/bin/${APP_NAME}") +set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}") set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}") diff --git a/samples/Lua/HelloLua/CMakeLists.txt b/samples/Lua/HelloLua/CMakeLists.txt index e0d1f3a753..894fc66565 100644 --- a/samples/Lua/HelloLua/CMakeLists.txt +++ b/samples/Lua/HelloLua/CMakeLists.txt @@ -28,7 +28,7 @@ target_link_libraries(${APP_NAME} cocos2d ) -set(APP_BIN_DIR "${CMAKE_SOURCE_DIR}/bin/${APP_NAME}") +set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}") set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}") diff --git a/samples/Lua/TestLua/CMakeLists.txt b/samples/Lua/TestLua/CMakeLists.txt index 743f3eeb3f..bc9427168f 100644 --- a/samples/Lua/TestLua/CMakeLists.txt +++ b/samples/Lua/TestLua/CMakeLists.txt @@ -28,7 +28,7 @@ target_link_libraries(${APP_NAME} cocos2d ) -set(APP_BIN_DIR "${CMAKE_SOURCE_DIR}/bin/${APP_NAME}") +set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}") set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}") From f8e7f570f3c8eff480ebaaf40baad8a6a79be003 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 7 Jan 2014 07:54:58 +0000 Subject: [PATCH 312/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index db7c5b9d77..e20a9d8a7a 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit db7c5b9d77a023a25b5124fa8adbff5663a4193c +Subproject commit e20a9d8a7afa860d5dc2f414602a10b2060201e2 From 1be11f8a82d2125e49b3f776baba0f0d7339133b Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 6 Jan 2014 23:55:57 -0800 Subject: [PATCH 313/428] Uses CMAKE_BINARY_DIR instead of CMAKE_SOURCE_DIR for template. --- template/multi-platform-cpp/CMakeLists.txt | 2 +- template/multi-platform-lua/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/template/multi-platform-cpp/CMakeLists.txt b/template/multi-platform-cpp/CMakeLists.txt index 4376f2f9c8..b2bfd73699 100644 --- a/template/multi-platform-cpp/CMakeLists.txt +++ b/template/multi-platform-cpp/CMakeLists.txt @@ -150,7 +150,7 @@ target_link_libraries(${APP_NAME} cocos2d ) -set(APP_BIN_DIR "${CMAKE_SOURCE_DIR}/bin") +set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin") set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}") diff --git a/template/multi-platform-lua/CMakeLists.txt b/template/multi-platform-lua/CMakeLists.txt index c14a3d0fe9..ccf8e4b634 100644 --- a/template/multi-platform-lua/CMakeLists.txt +++ b/template/multi-platform-lua/CMakeLists.txt @@ -164,7 +164,7 @@ target_link_libraries(${APP_NAME} cocos2d ) -set(APP_BIN_DIR "${CMAKE_SOURCE_DIR}/bin") +set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin") set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}") From e1c21aa9cb7ab506d76f8a607dcda6b680a12a05 Mon Sep 17 00:00:00 2001 From: edwardzhou Date: Tue, 7 Jan 2014 16:22:18 +0800 Subject: [PATCH 314/428] rename UIHelper to Helper for consistency --- cocos/editor-support/cocostudio/CCActionNode.cpp | 2 +- cocos/gui/UIHelper.cpp | 8 ++++---- cocos/gui/UIHelper.h | 2 +- cocos/gui/UILayout.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCActionNode.cpp b/cocos/editor-support/cocostudio/CCActionNode.cpp index b5482ff223..b792c47e09 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/CCActionNode.cpp @@ -154,7 +154,7 @@ void ActionNode::initActionNodeFromRoot(Object* root) Widget* rootWidget = dynamic_cast(root); if (rootWidget != nullptr) { - Widget* widget = UIHelper::seekActionWidgetByActionTag(rootWidget, getActionTag()); + Widget* widget = Helper::seekActionWidgetByActionTag(rootWidget, getActionTag()); if (widget != nullptr) { setObject(widget); diff --git a/cocos/gui/UIHelper.cpp b/cocos/gui/UIHelper.cpp index 30371a7a08..f16a230e2c 100644 --- a/cocos/gui/UIHelper.cpp +++ b/cocos/gui/UIHelper.cpp @@ -28,7 +28,7 @@ NS_CC_BEGIN namespace gui { -Widget* UIHelper::seekWidgetByTag(Widget* root, int tag) +Widget* Helper::seekWidgetByTag(Widget* root, int tag) { if (!root) { @@ -52,7 +52,7 @@ Widget* UIHelper::seekWidgetByTag(Widget* root, int tag) return nullptr; } -Widget* UIHelper::seekWidgetByName(Widget* root, const char *name) +Widget* Helper::seekWidgetByName(Widget* root, const char *name) { if (!root) { @@ -75,7 +75,7 @@ Widget* UIHelper::seekWidgetByName(Widget* root, const char *name) return nullptr; } -Widget* UIHelper::seekWidgetByRelativeName(Widget *root, const char *name) +Widget* Helper::seekWidgetByRelativeName(Widget *root, const char *name) { if (!root) { @@ -95,7 +95,7 @@ Widget* UIHelper::seekWidgetByRelativeName(Widget *root, const char *name) } /*temp action*/ -Widget* UIHelper::seekActionWidgetByActionTag(Widget* root, int tag) +Widget* Helper::seekActionWidgetByActionTag(Widget* root, int tag) { if (!root) { diff --git a/cocos/gui/UIHelper.h b/cocos/gui/UIHelper.h index 6021c06032..fb0e0413a4 100644 --- a/cocos/gui/UIHelper.h +++ b/cocos/gui/UIHelper.h @@ -33,7 +33,7 @@ namespace gui { * @js NA * @lua NA */ -class UIHelper +class Helper { public: /** diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index 2381edb45f..c70f109a14 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -927,7 +927,7 @@ void Layout::doLayout() float finalPosY = 0.0f; if (relativeName && strcmp(relativeName, "")) { - relativeWidget = UIHelper::seekWidgetByRelativeName(this, relativeName); + relativeWidget = Helper::seekWidgetByRelativeName(this, relativeName); if (relativeWidget) { relativeWidgetLP = dynamic_cast(relativeWidget->getLayoutParameter(LAYOUT_PARAMETER_RELATIVE)); From 6bb4f9822ac4a5946a66bb86d8f474c0e8dfbed4 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 7 Jan 2014 16:23:58 +0800 Subject: [PATCH 315/428] ActionProgress has fade and tint effect --- cocos/2d/CCProgressTimer.cpp | 22 ++++++++++++++++++++++ cocos/2d/CCProgressTimer.h | 8 ++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp index d608211acd..7d135a9016 100644 --- a/cocos/2d/CCProgressTimer.cpp +++ b/cocos/2d/CCProgressTimer.cpp @@ -228,6 +228,28 @@ Point ProgressTimer::getMidpoint() const return _midpoint; } +void ProgressTimer::setColor(const Color3B &color) +{ + _sprite->setColor(color); + updateColor(); +} + +const Color3B& ProgressTimer::getColor() const +{ + return _sprite->getColor(); +} + +void ProgressTimer::setOpacity(GLubyte opacity) +{ + _sprite->setOpacity(opacity); + updateColor(); +} + +GLubyte ProgressTimer::getOpacity() const +{ + return _sprite->getOpacity(); +} + void ProgressTimer::setMidpoint(const Point& midPoint) { _midpoint = midPoint.getClampPoint(Point::ZERO, Point(1, 1)); diff --git a/cocos/2d/CCProgressTimer.h b/cocos/2d/CCProgressTimer.h index de70a502dc..78cbaa6513 100644 --- a/cocos/2d/CCProgressTimer.h +++ b/cocos/2d/CCProgressTimer.h @@ -111,8 +111,12 @@ public: inline Point getBarChangeRate() const { return _barChangeRate; } // Overrides - virtual void draw(void) override; - void setAnchorPoint(const Point& anchorPoint) override; + virtual void draw() override; + virtual void setAnchorPoint(const Point& anchorPoint) override; + virtual void setColor(const Color3B &color) override; + virtual const Color3B& getColor() const override; + virtual void setOpacity(GLubyte opacity) override; + virtual GLubyte getOpacity() const; protected: /** From 7b6bdf40f8e61ebd812f740b1ab0bcab85be396a Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 16:25:37 +0800 Subject: [PATCH 316/428] Updates README.md for linux build --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 5a83ee1934..ea9fa791ca 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,10 @@ Then $ cd build $ cmake .. $ make -j4 + +Run + + $ bin/mygame ### Build new project for win32 ### @@ -130,6 +134,14 @@ $ cd cocos2d-x/build $ ./install-deps-linux.sh $ cmake .. $ make +``` + +Run Samples + +``` +$ bin/hellocpp/hellocpp +or +$ bin/testlua/testlua ``` You may meet building errors when building libGLFW.so. It is because libGL.so directs to an error target, From 05f6fedd1eee3d45338b09e44f53db49ffd55ab5 Mon Sep 17 00:00:00 2001 From: heliclei Date: Tue, 7 Jan 2014 16:27:23 +0800 Subject: [PATCH 317/428] fix windows symbol link path error --- tools/jenkins-scripts/ghprb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index 6510e6fd58..c2c20c1939 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -106,7 +106,10 @@ def main(): os.system(cmd) elif(platform.system() == 'Windows'): for item in PROJECTS: - os.system("mklink /J "+os.environ['WORKSPACE']+os.sep+"samples"+os.sep +item+os.sep+"proj.android/obj " + os.environ['WORKSPACE']+os.sep+"android_build_objs") + p = item.replace("/", os.sep) + cmd = "mklink /J "+os.environ['WORKSPACE']+os.sep+"samples"+os.sep +p+os.sep+"proj.android"+os.sep+"obj " + os.environ['WORKSPACE']+os.sep+"android_build_objs" + print cmd + os.system(cmd) #build #TODO: support android-mac build currently From 1275d03c7772fcce8c496674c54872fcba84e5eb Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 7 Jan 2014 16:30:12 +0800 Subject: [PATCH 318/428] add override --- cocos/2d/CCProgressTimer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCProgressTimer.h b/cocos/2d/CCProgressTimer.h index 78cbaa6513..5ca74f5458 100644 --- a/cocos/2d/CCProgressTimer.h +++ b/cocos/2d/CCProgressTimer.h @@ -116,7 +116,7 @@ public: virtual void setColor(const Color3B &color) override; virtual const Color3B& getColor() const override; virtual void setOpacity(GLubyte opacity) override; - virtual GLubyte getOpacity() const; + virtual GLubyte getOpacity() const override; protected: /** From 11a5945bd35963d7b77fe4623200e832d90ccafa Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Tue, 7 Jan 2014 16:45:03 +0800 Subject: [PATCH 319/428] =?UTF-8?q?Fix:Resolve=20the=20android=20template?= =?UTF-8?q?=20projects=E2=80=99s=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/multi-platform-cpp/proj.android/AndroidManifest.xml | 2 +- .../src/org/cocos2dx/{hellocpp => cpp}/Cocos2dxActivity.java | 2 +- template/multi-platform-js/Classes/AppDelegate.cpp | 2 -- template/multi-platform-js/proj.android/AndroidManifest.xml | 2 +- template/multi-platform-js/proj.android/project.properties | 2 +- .../{hellojavascript => javascript}/Cocos2dxActivity.java | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) rename template/multi-platform-cpp/proj.android/src/org/cocos2dx/{hellocpp => cpp}/Cocos2dxActivity.java (96%) rename template/multi-platform-js/proj.android/src/org/cocos2dx/{hellojavascript => javascript}/Cocos2dxActivity.java (95%) diff --git a/template/multi-platform-cpp/proj.android/AndroidManifest.xml b/template/multi-platform-cpp/proj.android/AndroidManifest.xml index 2c44924d36..d2a87966cc 100644 --- a/template/multi-platform-cpp/proj.android/AndroidManifest.xml +++ b/template/multi-platform-cpp/proj.android/AndroidManifest.xml @@ -11,7 +11,7 @@ android:icon="@drawable/icon"> - addRegisterCallback(register_all_cocos2dx_extension); sc->addRegisterCallback(register_cocos2dx_js_extensions); sc->addRegisterCallback(register_all_cocos2dx_extension_manual); - sc->addRegisterCallback(register_all_cocos2dx_spine); sc->addRegisterCallback(jsb_register_chipmunk); sc->addRegisterCallback(JSB_register_opengl); sc->addRegisterCallback(jsb_register_system); diff --git a/template/multi-platform-js/proj.android/AndroidManifest.xml b/template/multi-platform-js/proj.android/AndroidManifest.xml index 82da03cf94..9b92bfa562 100644 --- a/template/multi-platform-js/proj.android/AndroidManifest.xml +++ b/template/multi-platform-js/proj.android/AndroidManifest.xml @@ -10,7 +10,7 @@ - Date: Tue, 7 Jan 2014 16:49:51 +0800 Subject: [PATCH 320/428] Fix:Update cocos_files.json file --- tools/project-creator/module/cocos_files.json.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/project-creator/module/cocos_files.json.REMOVED.git-id b/tools/project-creator/module/cocos_files.json.REMOVED.git-id index de718a692d..38b25afe6d 100644 --- a/tools/project-creator/module/cocos_files.json.REMOVED.git-id +++ b/tools/project-creator/module/cocos_files.json.REMOVED.git-id @@ -1 +1 @@ -83d4ef65b31281ef8759505d8f90b3172b99992b \ No newline at end of file +0a2d046187d7848172fadf6ee4a7e80897e6a75c \ No newline at end of file From 7e142d79f7ecb23c78fc1483426aff52f89abf2b Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 7 Jan 2014 09:05:07 +0000 Subject: [PATCH 321/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index e20a9d8a7a..56bc67d7c0 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit e20a9d8a7afa860d5dc2f414602a10b2060201e2 +Subproject commit 56bc67d7c048334e43e7747c35df8e61f27a19e3 From 3cab3e5df35d9bb39776d6699ab8ee4c13917181 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 7 Jan 2014 17:19:29 +0800 Subject: [PATCH 322/428] update bindings-generator submodule --- tools/bindings-generator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bindings-generator b/tools/bindings-generator index c842ccaa4b..71a0aa4bc7 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit c842ccaa4b31121ac5f7be99ca64cafeb8d422c5 +Subproject commit 71a0aa4bc70743ae2078f4a43217987751ff17ec From 5c217f70d16fd523ab40ea8316737bd5435d8f75 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 17:46:24 +0800 Subject: [PATCH 323/428] ScrollView uses new renderer now. --- extensions/GUI/CCScrollView/CCScrollView.cpp | 18 ++++++++++++++++-- extensions/GUI/CCScrollView/CCScrollView.h | 5 +++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 9d1981e4dc..f487f0b84a 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -485,10 +485,17 @@ void ScrollView::addChild(Node * child, int zOrder, int tag) } } +void ScrollView::beforeDraw() +{ + _beforeDrawCommand.init(0, _vertexZ); + _beforeDrawCommand.func = CC_CALLBACK_0(ScrollView::onBeforeDraw, this); + Director::getInstance()->getRenderer()->addCommand(&_beforeDrawCommand); +} + /** * clip this view so that outside of the visible bounds can be hidden. */ -void ScrollView::beforeDraw() +void ScrollView::onBeforeDraw() { if (_clippingToBounds) { @@ -513,11 +520,18 @@ void ScrollView::beforeDraw() } } +void ScrollView::afterDraw() +{ + _afterDrawCommand.init(0, _vertexZ); + _afterDrawCommand.func = CC_CALLBACK_0(ScrollView::onAfterDraw, this); + Director::getInstance()->getRenderer()->addCommand(&_afterDrawCommand); +} + /** * retract what's done in beforeDraw so that there's no side effect to * other nodes. */ -void ScrollView::afterDraw() +void ScrollView::onAfterDraw() { if (_clippingToBounds) { diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index bef479e49b..c77d74bc13 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -254,11 +254,13 @@ protected: * clip this view so that outside of the visible bounds can be hidden. */ void beforeDraw(); + void onBeforeDraw(); /** * retract what's done in beforeDraw so that there's no side effect to * other nodes. */ void afterDraw(); + void onAfterDraw(); /** * Zoom handling */ @@ -351,6 +353,9 @@ protected: /** Touch listener */ EventListenerTouchOneByOne* _touchListener; + + CustomCommand _beforeDrawCommand; + CustomCommand _afterDrawCommand; }; // end of GUI group From 6967caeff9d15b443cd77d7622756110bba5859d Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 7 Jan 2014 09:47:05 +0000 Subject: [PATCH 324/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 56bc67d7c0..33c8327fd2 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 56bc67d7c048334e43e7747c35df8e61f27a19e3 +Subproject commit 33c8327fd2a6a1e57b566bb53a4aefeabf396e85 From a6da007e4f50cb91952a0ab299923e0b585a49d3 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 18:01:22 +0800 Subject: [PATCH 325/428] Updates JS-Test submodule. --- samples/Javascript/Shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index 1b9d0c8c43..301c8e9f6b 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit 1b9d0c8c432617c696a71c3c099a88c5b8bd921d +Subproject commit 301c8e9f6ba2f9d9d6012f6581cb40eddcc3840a From 26efb4bf5cd75757584c41458ee970b90b5cf0a6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 18:26:31 +0800 Subject: [PATCH 326/428] =?UTF-8?q?long=20=E2=80=94>=20ssize=5Ft=20for=20s?= =?UTF-8?q?ome=20classes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cocostudio/CCArmatureAnimation.cpp | 2 +- .../cocostudio/CCArmatureAnimation.h | 2 +- cocos/gui/UIText.cpp | 2 +- cocos/gui/UIText.h | 2 +- extensions/GUI/CCScrollView/CCTableViewCell.cpp | 16 +++------------- extensions/GUI/CCScrollView/CCTableViewCell.h | 8 +++----- 6 files changed, 10 insertions(+), 22 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp index 755f7c3c9f..70296710f4 100644 --- a/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp @@ -328,7 +328,7 @@ void ArmatureAnimation::gotoAndPause(int frameIndex) pause(); } -long ArmatureAnimation::getMovementCount() const +ssize_t ArmatureAnimation::getMovementCount() const { return _animationData->getMovementCount(); } diff --git a/cocos/editor-support/cocostudio/CCArmatureAnimation.h b/cocos/editor-support/cocostudio/CCArmatureAnimation.h index cd08bdeefc..96a07950d8 100644 --- a/cocos/editor-support/cocostudio/CCArmatureAnimation.h +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.h @@ -170,7 +170,7 @@ public: /** * Get movement count */ - long getMovementCount() const; + ssize_t getMovementCount() const; void update(float dt); diff --git a/cocos/gui/UIText.cpp b/cocos/gui/UIText.cpp index a129f98ef5..1899d7439a 100644 --- a/cocos/gui/UIText.cpp +++ b/cocos/gui/UIText.cpp @@ -87,7 +87,7 @@ const std::string& Text::getStringValue() return _labelRenderer->getString(); } -size_t Text::getStringLength() +ssize_t Text::getStringLength() { return _labelRenderer->getString().size(); } diff --git a/cocos/gui/UIText.h b/cocos/gui/UIText.h index 05ea37b9c1..e41b01d321 100644 --- a/cocos/gui/UIText.h +++ b/cocos/gui/UIText.h @@ -72,7 +72,7 @@ public: * * @return string length. */ - size_t getStringLength(); + ssize_t getStringLength(); /** * Sets the font size of label. diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.cpp b/extensions/GUI/CCScrollView/CCTableViewCell.cpp index 9a015f4632..7df9c478fd 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.cpp +++ b/extensions/GUI/CCScrollView/CCTableViewCell.cpp @@ -33,24 +33,14 @@ void TableViewCell::reset() _idx = CC_INVALID_INDEX; } -void TableViewCell::setObjectID(long uIdx) -{ - _idx = uIdx; -} - -long TableViewCell::getObjectID() +ssize_t TableViewCell::getIdx() { return _idx; } -long TableViewCell::getIdx() +void TableViewCell::setIdx(ssize_t idx) { - return _idx; -} - -void TableViewCell::setIdx(long uIdx) -{ - _idx = uIdx; + _idx = idx; } NS_CC_EXT_END diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.h b/extensions/GUI/CCScrollView/CCTableViewCell.h index 96ab28d67d..fc496e0773 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.h +++ b/extensions/GUI/CCScrollView/CCTableViewCell.h @@ -41,17 +41,15 @@ public: /** * The index used internally by SWTableView and its subclasses */ - long getIdx(); - void setIdx(long uIdx); + ssize_t getIdx(); + void setIdx(ssize_t uIdx); /** * Cleans up any resources linked to this cell and resets idx property. */ void reset(); - void setObjectID(long uIdx); - long getObjectID(); private: - long _idx; + ssize_t _idx; }; NS_CC_EXT_END From 5391024399c5483be2c802dc02395a0b60461f47 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 18:27:04 +0800 Subject: [PATCH 327/428] Adds override keyword. --- .../jsb_cocos2dx_extension_manual.cpp | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.cpp b/cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.cpp index 6deed71add..e98e062ad6 100644 --- a/cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.cpp @@ -33,7 +33,7 @@ public: } } - virtual void scrollViewDidScroll(ScrollView* view) + virtual void scrollViewDidScroll(ScrollView* view) override { js_proxy_t * p = jsb_get_native_proxy(view); if (!p) return; @@ -42,7 +42,7 @@ public: ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "scrollViewDidScroll", 1, &arg, NULL); } - virtual void scrollViewDidZoom(ScrollView* view) + virtual void scrollViewDidZoom(ScrollView* view) override { js_proxy_t * p = jsb_get_native_proxy(view); if (!p) return; @@ -119,32 +119,32 @@ public: } } - virtual void scrollViewDidScroll(ScrollView* view) + virtual void scrollViewDidScroll(ScrollView* view) override { callJSDelegate(view, "scrollViewDidScroll"); } - virtual void scrollViewDidZoom(ScrollView* view) + virtual void scrollViewDidZoom(ScrollView* view) override { callJSDelegate(view, "scrollViewDidZoom"); } - virtual void tableCellTouched(TableView* table, TableViewCell* cell) + virtual void tableCellTouched(TableView* table, TableViewCell* cell) override { callJSDelegate(table, cell, "tableCellTouched"); } - virtual void tableCellHighlight(TableView* table, TableViewCell* cell) + virtual void tableCellHighlight(TableView* table, TableViewCell* cell) override { callJSDelegate(table, cell, "tableCellHighlight"); } - virtual void tableCellUnhighlight(TableView* table, TableViewCell* cell) + virtual void tableCellUnhighlight(TableView* table, TableViewCell* cell) override { callJSDelegate(table, cell, "tableCellUnhighlight"); } - virtual void tableCellWillRecycle(TableView* table, TableViewCell* cell) + virtual void tableCellWillRecycle(TableView* table, TableViewCell* cell) override { callJSDelegate(table, cell, "tableCellWillRecycle"); } @@ -248,7 +248,7 @@ public: } } - virtual Size tableCellSizeForIndex(TableView *table, ssize_t idx) + virtual Size tableCellSizeForIndex(TableView *table, ssize_t idx) override { jsval ret; bool ok = callJSDelegate(table, idx, "tableCellSizeForIndex", ret); @@ -268,7 +268,7 @@ public: } - virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx) + virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx) override { jsval ret; bool ok = callJSDelegate(table, idx, "tableCellAtIndex", ret); @@ -288,7 +288,7 @@ public: return NULL; } - virtual ssize_t numberOfCellsInTableView(TableView *table) + virtual ssize_t numberOfCellsInTableView(TableView *table) override { jsval ret; bool ok = callJSDelegate(table, "numberOfCellsInTableView", ret); @@ -508,7 +508,7 @@ public: } } - virtual void editBoxEditingDidBegin(EditBox* editBox) + virtual void editBoxEditingDidBegin(EditBox* editBox) override { js_proxy_t * p = jsb_get_native_proxy(editBox); if (!p) return; @@ -517,7 +517,7 @@ public: ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "editBoxEditingDidBegin", 1, &arg, NULL); } - virtual void editBoxEditingDidEnd(EditBox* editBox) + virtual void editBoxEditingDidEnd(EditBox* editBox) override { js_proxy_t * p = jsb_get_native_proxy(editBox); if (!p) return; @@ -526,7 +526,7 @@ public: ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "editBoxEditingDidEnd", 1, &arg, NULL); } - virtual void editBoxTextChanged(EditBox* editBox, const std::string& text) + virtual void editBoxTextChanged(EditBox* editBox, const std::string& text) override { js_proxy_t * p = jsb_get_native_proxy(editBox); if (!p) return; @@ -539,7 +539,7 @@ public: ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), "editBoxTextChanged", 2, dataVal, NULL); } - virtual void editBoxReturn(EditBox* editBox) + virtual void editBoxReturn(EditBox* editBox) override { js_proxy_t * p = jsb_get_native_proxy(editBox); if (!p) return; From ac3697db190dd050cf141a5dd0094053932f591d Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 18:28:46 +0800 Subject: [PATCH 328/428] fix for jsval_to_ssize and ssize_to_jsval, it only supports 32 bits now. Otherwise, (string).toFixed(0) will fails. Do we need 64 bit for JS? --- .../javascript/bindings/js_manual_conversions.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cocos/scripting/javascript/bindings/js_manual_conversions.cpp b/cocos/scripting/javascript/bindings/js_manual_conversions.cpp index 43bf044b8a..5a9bc016ba 100644 --- a/cocos/scripting/javascript/bindings/js_manual_conversions.cpp +++ b/cocos/scripting/javascript/bindings/js_manual_conversions.cpp @@ -1197,9 +1197,13 @@ JSBool jsval_to_ccvaluevector(JSContext* cx, jsval v, cocos2d::ValueVector* ret) return JS_TRUE; } -JSBool jsval_to_ssize( JSContext *cx, jsval vp, ssize_t* ret) +JSBool jsval_to_ssize( JSContext *cx, jsval vp, ssize_t* size) { - return jsval_to_long(cx, vp, reinterpret_cast(ret)); + JSBool ret = JS_FALSE; + int32_t sizeInt32 = 0; + ret = jsval_to_int32(cx, vp, &sizeInt32); + *size = sizeInt32; + return ret; } JSBool jsval_to_std_vector_string( JSContext *cx, jsval vp, std::vector* ret) @@ -2192,5 +2196,6 @@ jsval ccvaluevector_to_jsval(JSContext* cx, const cocos2d::ValueVector& v) jsval ssize_to_jsval(JSContext *cx, ssize_t v) { - return long_to_jsval(cx, v); + CCASSERT(v < INT_MAX, "The size should not bigger than 32 bit (int32_t)."); + return int32_to_jsval(cx, static_cast(v)); } From ba4833e07091d4e94713278884057461ae966947 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 7 Jan 2014 18:30:12 +0800 Subject: [PATCH 329/428] update liblua vs project for add miss file. --- cocos/scripting/lua/bindings/liblua.vcxproj | 5 +++++ .../scripting/lua/bindings/liblua.vcxproj.filters | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/cocos/scripting/lua/bindings/liblua.vcxproj b/cocos/scripting/lua/bindings/liblua.vcxproj index 9fc1c1c521..c7fcc70043 100644 --- a/cocos/scripting/lua/bindings/liblua.vcxproj +++ b/cocos/scripting/lua/bindings/liblua.vcxproj @@ -132,6 +132,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$ + @@ -149,6 +150,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$ + @@ -164,6 +166,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$ + @@ -181,6 +184,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$ + @@ -190,6 +194,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$ + diff --git a/cocos/scripting/lua/bindings/liblua.vcxproj.filters b/cocos/scripting/lua/bindings/liblua.vcxproj.filters index f90bdee1d7..57c0335ab0 100644 --- a/cocos/scripting/lua/bindings/liblua.vcxproj.filters +++ b/cocos/scripting/lua/bindings/liblua.vcxproj.filters @@ -105,6 +105,12 @@ cocos2dx_support + + cocos2dx_support + + + cocos2dx_support\generated + @@ -197,6 +203,12 @@ cocos2dx_support + + cocos2dx_support + + + cocos2dx_support\generated + @@ -211,5 +223,8 @@ cocos2dx_support\generated + + cocos2dx_support\generated + \ No newline at end of file From ab84228037e97c9194e602bcf2513efe26126b9a Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 7 Jan 2014 10:40:28 +0000 Subject: [PATCH 330/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 33c8327fd2..d8d1c134c3 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 33c8327fd2a6a1e57b566bb53a4aefeabf396e85 +Subproject commit d8d1c134c31e7f1b4e78af1d2c80597275f61e41 From bf8187fee2d9230587bea71169c10cfa986dcc48 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Tue, 7 Jan 2014 19:04:18 +0800 Subject: [PATCH 331/428] fixed UIAction play error. --- cocos/editor-support/cocostudio/CCActionNode.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCActionNode.cpp b/cocos/editor-support/cocostudio/CCActionNode.cpp index b792c47e09..b8dbd7162c 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/CCActionNode.cpp @@ -101,7 +101,7 @@ void ActionNode::initWithDictionary(const rapidjson::Value& dic,Object* root) actionFrame->setFrameIndex(frameInex); actionFrame->setScaleX(scaleX); actionFrame->setScaleY(scaleY); - auto cActionArray = _frameArray.at((int)kKeyframeMove); + auto cActionArray = _frameArray.at((int)kKeyframeScale); cActionArray->pushBack(actionFrame); } @@ -113,7 +113,7 @@ void ActionNode::initWithDictionary(const rapidjson::Value& dic,Object* root) actionFrame->autorelease(); actionFrame->setFrameIndex(frameInex); actionFrame->setRotation(rotation); - auto cActionArray = _frameArray.at((int)kKeyframeMove); + auto cActionArray = _frameArray.at((int)kKeyframeRotate); cActionArray->pushBack(actionFrame); } @@ -125,7 +125,7 @@ void ActionNode::initWithDictionary(const rapidjson::Value& dic,Object* root) actionFrame->autorelease(); actionFrame->setFrameIndex(frameInex); actionFrame->setOpacity(opacity); - auto cActionArray = _frameArray.at((int)kKeyframeMove); + auto cActionArray = _frameArray.at((int)kKeyframeTint); cActionArray->pushBack(actionFrame); } @@ -139,7 +139,7 @@ void ActionNode::initWithDictionary(const rapidjson::Value& dic,Object* root) actionFrame->autorelease(); actionFrame->setFrameIndex(frameInex); actionFrame->setColor(Color3B(colorR,colorG,colorB)); - auto cActionArray = _frameArray.at((int)kKeyframeMove); + auto cActionArray = _frameArray.at((int)kKeyframeFade); cActionArray->pushBack(actionFrame); } } From de5c86a184293b48ada5653b302314f4cb23f74a Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Tue, 7 Jan 2014 20:39:46 +0800 Subject: [PATCH 332/428] =?UTF-8?q?Fix:Replace=20the=20=E2=80=9CsetDisplay?= =?UTF-8?q?Frame=E2=80=9D=20function=20with=20the=20=E2=80=9CsetSpriteFram?= =?UTF-8?q?e=E2=80=9D=20=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestLua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/Lua/TestLua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua b/samples/Lua/TestLua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua index a84dbbf085..2b716a6b8a 100644 --- a/samples/Lua/TestLua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua @@ -74,8 +74,8 @@ local function ZwoptexGenericTest() local str1 = string.format("grossini_dance_%02d.png", spriteFrameIndex) local str2 = string.format("grossini_dance_generic_%02d.png", spriteFrameIndex) - sprite1:setDisplayFrame(cc.SpriteFrameCache:getInstance():getSpriteFrame(str1)) - sprite2:setDisplayFrame(cc.SpriteFrameCache:getInstance():getSpriteFrame(str2)) + sprite1:setSpriteFrame(cc.SpriteFrameCache:getInstance():getSpriteFrame(str1)) + sprite2:setSpriteFrame(cc.SpriteFrameCache:getInstance():getSpriteFrame(str2)) end sprite1:retain() From c7639319ee2bedf72533442b26611dc0fba22b90 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 20:53:44 +0800 Subject: [PATCH 333/428] Fix Armature::init() crashes --- cocos/editor-support/cocostudio/CCArmature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index 33d230df97..decc3cc0c2 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -101,7 +101,7 @@ Armature::~Armature(void) bool Armature::init() { - return init(nullptr); + return init(""); } From 7a52d2aad7ed9a5d53fb6eb16ceac39cedee28a9 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 20:54:34 +0800 Subject: [PATCH 334/428] Small fix in ArmatureScene.cpp/.h --- .../CocoStudioArmatureTest/ArmatureScene.cpp | 10 +++++----- .../CocoStudioArmatureTest/ArmatureScene.h | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index 35865b7813..1349970d67 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -1023,7 +1023,7 @@ void TestColliderDetector::update(float delta) // This code is just telling how to get the vertex. // For a more accurate collider detection, you need to implemente yourself. const Map& map = armature2->getBoneDic(); - for(auto element : map) + for(const auto& element : map) { Bone *bone = element.second; ColliderDetector *detector = bone->getColliderDetector(); @@ -1033,12 +1033,12 @@ void TestColliderDetector::update(float delta) const cocos2d::Vector& bodyList = detector->getColliderBodyList(); - for (auto object : bodyList) + for (const auto& object : bodyList) { ColliderBody *body = static_cast(object); const std::vector &vertexList = body->getCalculatedVertexList(); - float minx, miny, maxx, maxy = 0; + float minx = 0, miny = 0, maxx = 0, maxy = 0; int length = vertexList.size(); for (int i = 0; i& touches, Ev armature->runAction(Sequence::create(move, nullptr)); } -void TestArmatureNesting2::ChangeMountCallback(Object* pSender) +void TestArmatureNesting2::changeMountCallback(Object* pSender) { hero->stopAllActions(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h index 97e31ef697..c3b64debb9 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h @@ -336,15 +336,16 @@ public: class TestArmatureNesting2 : public ArmatureTestLayer { public: - virtual void onEnter(); - virtual void onExit(); + virtual void onEnter() override; + virtual void onExit() override; virtual std::string title() const override; virtual std::string subtitle() const override; void onTouchesEnded(const std::vector& touches, Event* event); - virtual void ChangeMountCallback(Object* pSender); + void changeMountCallback(Object* pSender); virtual cocostudio::Armature *createMount(const char *name, Point position); +private: Hero *hero; cocostudio::Armature *horse; From e25c4b5f4d9f3c7e5726d7ec3fa0f17f4a41ea88 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 20:55:07 +0800 Subject: [PATCH 335/428] [JSB] Armature should be able to be extended in JS. --- tools/tojs/cocos2dx_studio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tojs/cocos2dx_studio.ini b/tools/tojs/cocos2dx_studio.ini index 2f806a3257..64cd414f96 100644 --- a/tools/tojs/cocos2dx_studio.ini +++ b/tools/tojs/cocos2dx_studio.ini @@ -79,3 +79,4 @@ abstract_classes = ColliderDetector ColliderBody ArmatureDataManager ComAttribut # Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. script_control_cpp = no +classes_need_extend = Armature From 9387e516be90d479f427da2365ee92949029e338 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 21:19:51 +0800 Subject: [PATCH 336/428] =?UTF-8?q?[JSB]=20Fix=20for=20SpineTest=20didn?= =?UTF-8?q?=E2=80=99t=20show=20anything.=20Skeleton=20uses=20new=20rendere?= =?UTF-8?q?r.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/editor-support/spine/CCSkeleton.cpp | 10 +++++++++- cocos/editor-support/spine/CCSkeleton.h | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cocos/editor-support/spine/CCSkeleton.cpp b/cocos/editor-support/spine/CCSkeleton.cpp index 77e2243b7d..4c5422a21c 100644 --- a/cocos/editor-support/spine/CCSkeleton.cpp +++ b/cocos/editor-support/spine/CCSkeleton.cpp @@ -126,7 +126,15 @@ void Skeleton::update (float deltaTime) { spSkeleton_update(skeleton, deltaTime * timeScale); } -void Skeleton::draw () { +void Skeleton::draw() +{ + _customCommand.init(0, _vertexZ); + _customCommand.func = CC_CALLBACK_0(Skeleton::onDraw, this); + Director::getInstance()->getRenderer()->addCommand(&_customCommand); +} + +void Skeleton::onDraw () +{ CC_NODE_DRAW_SETUP(); GL::blendFunc(blendFunc.src, blendFunc.dst); diff --git a/cocos/editor-support/spine/CCSkeleton.h b/cocos/editor-support/spine/CCSkeleton.h index ab4270be0d..111da7bf0e 100644 --- a/cocos/editor-support/spine/CCSkeleton.h +++ b/cocos/editor-support/spine/CCSkeleton.h @@ -64,6 +64,7 @@ public: virtual void update (float deltaTime) override; virtual void draw() override; + void onDraw(); virtual cocos2d::Rect getBoundingBox () const override; // --- Convenience methods for common Skeleton_* functions. @@ -103,6 +104,8 @@ private: void initialize (); // Util function that setting blend-function by nextRenderedTexture's premultiplied flag void setFittedBlendingFunc(cocos2d::TextureAtlas * nextRenderedTexture); + + cocos2d::CustomCommand _customCommand; }; } From 6fd72db5133c29a273bc83b5026abedaaf876fe2 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 7 Jan 2014 13:28:43 +0000 Subject: [PATCH 337/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index d8d1c134c3..71f56b2e07 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit d8d1c134c31e7f1b4e78af1d2c80597275f61e41 +Subproject commit 71f56b2e07d08ca91e9a415d9217757e39989bb7 From 1d852788e217cd9d93cc6f30fade1f47df606d67 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 21:40:06 +0800 Subject: [PATCH 338/428] [Spine] Saves old transform matrix in Skeleton::draw, uses it in ::onDraw. --- cocos/editor-support/spine/CCSkeleton.cpp | 10 ++++++++++ cocos/editor-support/spine/CCSkeleton.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/cocos/editor-support/spine/CCSkeleton.cpp b/cocos/editor-support/spine/CCSkeleton.cpp index 4c5422a21c..9051679a98 100644 --- a/cocos/editor-support/spine/CCSkeleton.cpp +++ b/cocos/editor-support/spine/CCSkeleton.cpp @@ -128,6 +128,9 @@ void Skeleton::update (float deltaTime) { void Skeleton::draw() { + kmGLMatrixMode(KM_GL_MODELVIEW); + kmGLGetMatrix(KM_GL_MODELVIEW, &_oldTransMatrix); + _customCommand.init(0, _vertexZ); _customCommand.func = CC_CALLBACK_0(Skeleton::onDraw, this); Director::getInstance()->getRenderer()->addCommand(&_customCommand); @@ -135,6 +138,10 @@ void Skeleton::draw() void Skeleton::onDraw () { + kmGLMatrixMode(KM_GL_MODELVIEW); + kmGLPushMatrix(); + kmGLLoadMatrix(&_oldTransMatrix); + CC_NODE_DRAW_SETUP(); GL::blendFunc(blendFunc.src, blendFunc.dst); @@ -228,6 +235,9 @@ void Skeleton::onDraw () if (i == 0) DrawPrimitives::setDrawColor4B(0, 255, 0, 255); } } + + kmGLMatrixMode(KM_GL_MODELVIEW); + kmGLPopMatrix(); } TextureAtlas* Skeleton::getTextureAtlas (spRegionAttachment* regionAttachment) const { diff --git a/cocos/editor-support/spine/CCSkeleton.h b/cocos/editor-support/spine/CCSkeleton.h index 111da7bf0e..f1cffffea6 100644 --- a/cocos/editor-support/spine/CCSkeleton.h +++ b/cocos/editor-support/spine/CCSkeleton.h @@ -106,6 +106,8 @@ private: void setFittedBlendingFunc(cocos2d::TextureAtlas * nextRenderedTexture); cocos2d::CustomCommand _customCommand; + + kmMat4 _oldTransMatrix; }; } From b1d9d5e55e7e9ac930e701acda2c4ba4478484c0 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 7 Jan 2014 22:08:00 +0800 Subject: [PATCH 339/428] fix layerColor occlude sprite bug on android --- cocos/2d/CCGLProgram.cpp | 1 + cocos/2d/CCGLProgram.h | 1 + cocos/2d/CCLayer.cpp | 23 ++++++++++++++++++----- cocos/2d/CCLayer.h | 3 ++- cocos/2d/CCShaderCache.cpp | 20 ++++++++++++++++++++ 5 files changed, 42 insertions(+), 6 deletions(-) diff --git a/cocos/2d/CCGLProgram.cpp b/cocos/2d/CCGLProgram.cpp index 0d9441cde3..dbdd14f686 100644 --- a/cocos/2d/CCGLProgram.cpp +++ b/cocos/2d/CCGLProgram.cpp @@ -49,6 +49,7 @@ const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR = "ShaderPositionTextu const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP = "ShaderPositionTextureColor_noMVP"; const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST = "ShaderPositionTextureColorAlphaTest"; const char* GLProgram::SHADER_NAME_POSITION_COLOR = "ShaderPositionColor"; +const char* GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP = "ShaderPositionColor_noMVP"; const char* GLProgram::SHADER_NAME_POSITION_TEXTURE = "ShaderPositionTexture"; const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_U_COLOR = "ShaderPositionTexture_uColor"; const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_A8_COLOR = "ShaderPositionTextureA8Color"; diff --git a/cocos/2d/CCGLProgram.h b/cocos/2d/CCGLProgram.h index 84aaa113fa..24e6f47e7e 100644 --- a/cocos/2d/CCGLProgram.h +++ b/cocos/2d/CCGLProgram.h @@ -82,6 +82,7 @@ public: static const char* SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP; static const char* SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST; static const char* SHADER_NAME_POSITION_COLOR; + static const char* SHADER_NAME_POSITION_COLOR_NO_MVP; static const char* SHADER_NAME_POSITION_TEXTURE; static const char* SHADER_NAME_POSITION_TEXTURE_U_COLOR; static const char* SHADER_NAME_POSITION_TEXTURE_A8_COLOR; diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index 488dbc3d1a..1526a686a9 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -512,7 +512,7 @@ bool LayerColor::initWithColor(const Color4B& color, GLfloat w, GLfloat h) updateColor(); setContentSize(Size(w, h)); - setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_COLOR)); + setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP)); return true; } return false; @@ -567,6 +567,20 @@ void LayerColor::draw() _customCommand.init(0, _vertexZ); _customCommand.func = CC_CALLBACK_0(LayerColor::onDraw, this); Director::getInstance()->getRenderer()->addCommand(&_customCommand); + + kmMat4 p, mvp; + kmGLGetMatrix(KM_GL_PROJECTION, &p); + kmGLGetMatrix(KM_GL_MODELVIEW, &mvp); + kmMat4Multiply(&mvp, &p, &mvp); + + for(int i = 0; i < 4; ++i) + { + kmVec3 pos; + pos.x = _squareVertices[i].x; pos.y = _squareVertices[i].y; pos.z = _vertexZ; + kmVec3TransformCoord(&pos, &pos, &mvp); + _noMVPVertices[i] = Vertex3F(pos.x,pos.y,pos.z); + } + } void LayerColor::onDraw() @@ -574,18 +588,17 @@ void LayerColor::onDraw() CC_NODE_DRAW_SETUP(); GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_COLOR ); - // // Attributes // #ifdef EMSCRIPTEN - setGLBufferData(_squareVertices, 4 * sizeof(Vertex2F), 0); - glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0); + setGLBufferData(_noMVPVertices, 4 * sizeof(Vertex3F), 0); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, 0); setGLBufferData(_squareColors, 4 * sizeof(Color4F), 1); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, 0); #else - glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, _squareVertices); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _noMVPVertices); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, _squareColors); #endif // EMSCRIPTEN diff --git a/cocos/2d/CCLayer.h b/cocos/2d/CCLayer.h index adc938909e..afe72b1aa7 100644 --- a/cocos/2d/CCLayer.h +++ b/cocos/2d/CCLayer.h @@ -36,6 +36,7 @@ THE SOFTWARE. #include "CCEventKeyboard.h" #include "renderer/CCCustomCommand.h" +#include "renderer/CCQuadCommand.h" NS_CC_BEGIN @@ -298,7 +299,7 @@ protected: Vertex2F _squareVertices[4]; Color4F _squareColors[4]; CustomCommand _customCommand; - + Vertex3F _noMVPVertices[4]; private: CC_DISALLOW_COPY_AND_ASSIGN(LayerColor); diff --git a/cocos/2d/CCShaderCache.cpp b/cocos/2d/CCShaderCache.cpp index c727294e30..ae987a0060 100644 --- a/cocos/2d/CCShaderCache.cpp +++ b/cocos/2d/CCShaderCache.cpp @@ -36,6 +36,7 @@ enum { kShaderType_PositionTextureColor_noMVP, kShaderType_PositionTextureColorAlphaTest, kShaderType_PositionColor, + kShaderType_PositionColor_noMVP, kShaderType_PositionTexture, kShaderType_PositionTexture_uColor, kShaderType_PositionTextureA8Color, @@ -124,6 +125,13 @@ void ShaderCache::loadDefaultShaders() loadDefaultShader(p, kShaderType_PositionColor); _programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_COLOR, p) ); + // + // Position, Color shader no MVP + // + p = new GLProgram(); + loadDefaultShader(p, kShaderType_PositionColor_noMVP); + _programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP, p) ); + // // Position Texture shader // @@ -202,6 +210,12 @@ void ShaderCache::reloadDefaultShaders() p->reset(); loadDefaultShader(p, kShaderType_PositionColor); + // + // Position, Color shader no MVP + // + p = getProgram(GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP); + loadDefaultShader(p, kShaderType_PositionColor_noMVP); + // // Position Texture shader // @@ -288,6 +302,12 @@ void ShaderCache::loadDefaultShader(GLProgram *p, int type) p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION); p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR); + break; + case kShaderType_PositionColor_noMVP: + p->initWithVertexShaderByteArray(ccPositionTextureColor_noMVP_vert ,ccPositionColor_frag); + + p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION); + p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR); break; case kShaderType_PositionTexture: p->initWithVertexShaderByteArray(ccPositionTexture_vert ,ccPositionTexture_frag); From 4bb091067f2c2b130159f6313f619237a35b39d0 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 22:15:20 +0800 Subject: [PATCH 340/428] Adds empty constructor for TableView and TableViewCell. --- extensions/GUI/CCScrollView/CCTableView.cpp | 5 +++++ extensions/GUI/CCScrollView/CCTableView.h | 4 ++++ extensions/GUI/CCScrollView/CCTableViewCell.h | 2 ++ 3 files changed, 11 insertions(+) diff --git a/extensions/GUI/CCScrollView/CCTableView.cpp b/extensions/GUI/CCScrollView/CCTableView.cpp index 2d20838719..ff143f77d5 100644 --- a/extensions/GUI/CCScrollView/CCTableView.cpp +++ b/extensions/GUI/CCScrollView/CCTableView.cpp @@ -29,6 +29,10 @@ NS_CC_EXT_BEGIN +TableView* TableView::create() +{ + return TableView::create(nullptr, Size::ZERO); +} TableView* TableView::create(TableViewDataSource* dataSource, Size size) { @@ -51,6 +55,7 @@ bool TableView::initWithViewSize(Size size, Node* container/* = NULL*/) { if (ScrollView::initWithViewSize(size,container)) { + CC_SAFE_DELETE(_indices); _indices = new std::set(); _vordering = VerticalFillOrder::BOTTOM_UP; this->setDirection(Direction::VERTICAL); diff --git a/extensions/GUI/CCScrollView/CCTableView.h b/extensions/GUI/CCScrollView/CCTableView.h index 649fc19175..674e10df19 100644 --- a/extensions/GUI/CCScrollView/CCTableView.h +++ b/extensions/GUI/CCScrollView/CCTableView.h @@ -148,6 +148,10 @@ public: TOP_DOWN, BOTTOM_UP }; + + /** Empty contructor of TableView */ + static TableView* create(); + /** * An intialized table view object * diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.h b/extensions/GUI/CCScrollView/CCTableViewCell.h index fc496e0773..33438a0f96 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.h +++ b/extensions/GUI/CCScrollView/CCTableViewCell.h @@ -37,6 +37,8 @@ NS_CC_EXT_BEGIN class TableViewCell: public Node { public: + CREATE_FUNC(TableViewCell); + TableViewCell() {} /** * The index used internally by SWTableView and its subclasses From a61f9fce27627e1e0a488de77b7dfd22766ce4dd Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Tue, 7 Jan 2014 22:16:07 +0800 Subject: [PATCH 341/428] =?UTF-8?q?Fix:Resolve=20the=20pLengthSQ=E2=80=99s?= =?UTF-8?q?=20error=20in=20the=20Cocos2d.lua?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/scripting/lua/script/Cocos2d.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/lua/script/Cocos2d.lua b/cocos/scripting/lua/script/Cocos2d.lua index afcd5650f1..1628b920e6 100644 --- a/cocos/scripting/lua/script/Cocos2d.lua +++ b/cocos/scripting/lua/script/Cocos2d.lua @@ -143,7 +143,7 @@ function cc.pUnrotate(pt1, pt2) end --Calculates the square length of pt function cc.pLengthSQ(pt) - return cc.pDot(pt) + return cc.pDot(pt,pt) end --Calculates the square distance between pt1 and pt2 function cc.pDistanceSQ(pt1,pt2) From e93b56700092c7cd9ee8e4a40c307df5677e3d6a Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 22:16:24 +0800 Subject: [PATCH 342/428] ScrollView::intWithView supports be invoked several times. --- extensions/GUI/CCScrollView/CCScrollView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index f487f0b84a..05200d32cb 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -46,10 +46,10 @@ ScrollView::ScrollView() : _zoomScale(0.0f) , _minZoomScale(0.0f) , _maxZoomScale(0.0f) -, _delegate(NULL) +, _delegate(nullptr) , _direction(Direction::BOTH) , _dragging(false) -, _container(NULL) +, _container(nullptr) , _touchMoved(false) , _bounceable(false) , _clippingToBounds(false) @@ -104,8 +104,8 @@ bool ScrollView::initWithViewSize(Size size, Node *container/* = NULL*/) if (!this->_container) { _container = Layer::create(); - this->_container->ignoreAnchorPointForPosition(false); - this->_container->setAnchorPoint(Point(0.0f, 0.0f)); + _container->ignoreAnchorPointForPosition(false); + _container->setAnchorPoint(Point(0.0f, 0.0f)); } this->setViewSize(size); From b07acb6c126ade1243fd2c8b86c7753650031294 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 22:17:22 +0800 Subject: [PATCH 343/428] [JSB] Supports cc.ScrollView.extend, cc.TableView.extend, cc.TableViewCell. --- tools/tojs/cocos2dx_extension.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tojs/cocos2dx_extension.ini b/tools/tojs/cocos2dx_extension.ini index f91748cd66..9c131621f5 100644 --- a/tools/tojs/cocos2dx_extension.ini +++ b/tools/tojs/cocos2dx_extension.ini @@ -71,3 +71,4 @@ abstract_classes = # Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. script_control_cpp = no +classes_need_extend = ScrollView TableView TableViewCell From a650ddf88bad85bb09031e2e0af4755ed1b39f8f Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 7 Jan 2014 14:27:34 +0000 Subject: [PATCH 344/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 71f56b2e07..f387eb216f 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 71f56b2e07d08ca91e9a415d9217757e39989bb7 +Subproject commit f387eb216fd0849b8482203c76b5a8ce1b99471b From 65b5a7c0314e49d9aa28b00d6484eda36ae9c339 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 7 Jan 2014 22:39:14 +0800 Subject: [PATCH 345/428] If this.ctor was not found, output a log. --- cocos/scripting/javascript/script/jsb_cocos2d.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cocos/scripting/javascript/script/jsb_cocos2d.js b/cocos/scripting/javascript/script/jsb_cocos2d.js index d119c670f6..3237113d99 100644 --- a/cocos/scripting/javascript/script/jsb_cocos2d.js +++ b/cocos/scripting/javascript/script/jsb_cocos2d.js @@ -650,8 +650,12 @@ cc.Class.extend = function (prop) { // The dummy class constructor function Class() { // All construction is actually done in the init method - if (!initializing && this.ctor) - this.ctor.apply(this, arguments); + if (!initializing) { + if (!this.ctor) + cc.log("No ctor function found, please set `classes_need_extend` section at `ini` file as `tools/tojs/cocos2dx.ini`"); + else + this.ctor.apply(this, arguments); + } } // Populate our constructed prototype object From eb8f621ab090595abbc3a7af58b788f3b58b573c Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 8 Jan 2014 10:47:27 +0800 Subject: [PATCH 346/428] closed #3597: Uses !xxx.empty() instead of xxx.size() > 0. --- cocos/2d/CCParticleSystem.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index aeda75ac68..f34e692792 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -351,13 +351,13 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string& { string textureDir = textureName.substr(0, rPos + 1); - if (dirname.size()>0 && textureDir != dirname) + if (!dirname.empty() && textureDir != dirname) { textureName = textureName.substr(rPos+1); textureName = dirname + textureName; } } - else if ( dirname.size()>0 && textureName.empty() == false) + else if (!dirname.empty() && !textureName.empty()) { textureName = dirname + textureName; } @@ -369,7 +369,7 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string& // set not pop-up message box when load image failed bool notify = FileUtils::getInstance()->isPopupNotify(); FileUtils::getInstance()->setPopupNotify(false); - tex = Director::getInstance()->getTextureCache()->addImage(textureName.c_str()); + tex = Director::getInstance()->getTextureCache()->addImage(textureName); // reset the value of UIImage notify FileUtils::getInstance()->setPopupNotify(notify); } @@ -406,10 +406,12 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string& image->release(); } } - if (_configName.length()>0) + + if (!_configName.empty()) { - _yCoordFlipped = dictionary["yCoordFlipped"].asInt(); + _yCoordFlipped = dictionary["yCoordFlipped"].asInt(); } + CCASSERT( this->_texture != nullptr, "CCParticleSystem: error loading the texture"); } ret = true; From 3e7a21a367c743f8de640065d176bf2d92edfe3f Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 8 Jan 2014 10:51:34 +0800 Subject: [PATCH 347/428] Update AUTHORS [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 7b76f10faa..789a85cf74 100644 --- a/AUTHORS +++ b/AUTHORS @@ -402,6 +402,7 @@ Developers: Zecken (gelldur) Fixing a profiling compilation error in CCParticleBatchNode. Fixing linking errors for TestCPP with libcurl on linux. + Fixing a bug that crash was triggered if there is not `textureFileName`section in particle plist file. flamingo (flaming0) Null pointer check in order to prevent crashes. From df18e86d86d70577d6e1e626a9405942c9f6d1a9 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 8 Jan 2014 10:57:27 +0800 Subject: [PATCH 348/428] Updates CHANGELOG [ci skip] --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index b41e9c125e..303268968a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +cocos2d-x-3.0final ?.? ? +[All] + [FIX] Crash was triggered if there is not `textureFileName`section in particle plist file. cocos2d-x-3.0beta Jan.7 2014 [All] [NEW] New label: shadow, outline, glow support From f7a0e7da1aab95bb806c016fa7e7598923c39466 Mon Sep 17 00:00:00 2001 From: heliclei Date: Wed, 8 Jan 2014 16:21:11 +0800 Subject: [PATCH 349/428] add auto generate bindings --- tools/jenkins-scripts/gen_jsb.sh | 60 ++++++++++++++++++++++++++++++++ tools/jenkins-scripts/ghprb.py | 8 +++++ 2 files changed, 68 insertions(+) create mode 100755 tools/jenkins-scripts/gen_jsb.sh diff --git a/tools/jenkins-scripts/gen_jsb.sh b/tools/jenkins-scripts/gen_jsb.sh new file mode 100755 index 0000000000..4737256f53 --- /dev/null +++ b/tools/jenkins-scripts/gen_jsb.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +# Generate JS and Lua bindings for Cocos2D-X +# ... using Android NDK system headers +# ... and automatically update submodule references +# ... and push these changes to remote repos + +# Dependencies +# +# For bindings generator: +# (see ../../../tojs/genbindings.sh and ../../../tolua/genbindings.sh +# ... for the defaults used if the environment is not customized) +# +# * $PYTHON_BIN +# * $CLANG_ROOT +# * $NDK_ROOT +# +echo "[test]start generate js binding..." +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +COCOS2DX_ROOT="$DIR"/../.. +TOJS_ROOT=$COCOS2DX_ROOT/tools/tojs +TOLUA_ROOT=$COCOS2DX_ROOT/tools/tolua +GENERATED_WORKTREE="$COCOS2DX_ROOT"/cocos/scripting/auto-generated + + +# Exit on error +set -e + +generate_bindings_glue_codes() +{ + echo "Create auto-generated jsbinding glue codes." + pushd "$TOJS_ROOT" + ./genbindings.sh + popd + + echo "Create auto-generated luabinding glue codes." + pushd "$TOLUA_ROOT" + ./genbindings.sh + popd +} + +# Update submodule of auto-gen Binding repo. +pushd "$GENERATED_WORKTREE" + +echo "Delete all directories and files except '.git' and 'README.md'." +ls -a | grep -E -v ^\[.\]\{1,2\}$ | grep -E -v ^\.git$ | grep -E -v ^README\.md$ | xargs -I{} rm -rf {} +echo "Show files in ${GENERATED_WORKTREE} folder." +ls -a +popd + + + +# 1. Generate JS bindings +generate_bindings_glue_codes + +echo +echo Bindings generated successfully +echo + + diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index c2c20c1939..8a0821a3c6 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -79,6 +79,7 @@ def main(): print "git clean -xdf" os.system("git clean -xdf") + #fetch pull request to local repo git_fetch_pr = "git fetch origin pull/" + str(pr_num) + "/head" os.system(git_fetch_pr) @@ -91,6 +92,13 @@ def main(): git_update_submodule = "git submodule update --init --force" os.system(git_update_submodule) + # Generate binding glue codes + if(platform.system() == 'Darwin'): + print "[test]Generating bindings glue codes ..." + #cd $COCOS2DX_ROOT/tools/travis-scripts + os.system("chmod 777 tools/jenkins-scripts/gen_jsb.sh") + os.system("tools/jenkins-scripts/gen_jsb.sh") + #make temp dir print "current dir is" + os.environ['WORKSPACE'] os.system("cd " + os.environ['WORKSPACE']); From 13fab57ce234e7fbb63a8104bcce2365968aab75 Mon Sep 17 00:00:00 2001 From: heliclei Date: Wed, 8 Jan 2014 16:27:08 +0800 Subject: [PATCH 350/428] remove debug print --- tools/jenkins-scripts/ghprb.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index 8a0821a3c6..5fae589283 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -94,7 +94,6 @@ def main(): # Generate binding glue codes if(platform.system() == 'Darwin'): - print "[test]Generating bindings glue codes ..." #cd $COCOS2DX_ROOT/tools/travis-scripts os.system("chmod 777 tools/jenkins-scripts/gen_jsb.sh") os.system("tools/jenkins-scripts/gen_jsb.sh") From 6cbf69306c6c558350e2bb4bef6852c5ba0bba17 Mon Sep 17 00:00:00 2001 From: heliclei Date: Wed, 8 Jan 2014 16:51:37 +0800 Subject: [PATCH 351/428] remove unnessesary chmod and ls command --- tools/jenkins-scripts/gen_jsb.sh | 2 -- tools/jenkins-scripts/ghprb.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/tools/jenkins-scripts/gen_jsb.sh b/tools/jenkins-scripts/gen_jsb.sh index 4737256f53..1e8fc1b084 100755 --- a/tools/jenkins-scripts/gen_jsb.sh +++ b/tools/jenkins-scripts/gen_jsb.sh @@ -44,8 +44,6 @@ pushd "$GENERATED_WORKTREE" echo "Delete all directories and files except '.git' and 'README.md'." ls -a | grep -E -v ^\[.\]\{1,2\}$ | grep -E -v ^\.git$ | grep -E -v ^README\.md$ | xargs -I{} rm -rf {} -echo "Show files in ${GENERATED_WORKTREE} folder." -ls -a popd diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index 5fae589283..bbc86c68ec 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -94,8 +94,6 @@ def main(): # Generate binding glue codes if(platform.system() == 'Darwin'): - #cd $COCOS2DX_ROOT/tools/travis-scripts - os.system("chmod 777 tools/jenkins-scripts/gen_jsb.sh") os.system("tools/jenkins-scripts/gen_jsb.sh") #make temp dir From 954ee61022f1a231beb3f50d6f9b865fa90e8a43 Mon Sep 17 00:00:00 2001 From: WuHuan Date: Wed, 8 Jan 2014 16:58:36 +0800 Subject: [PATCH 352/428] testcpp mingw --- CMakeLists.txt | 14 +++++++------- cocos/2d/platform/win32/CCStdC.h | 1 + cocos/audio/CMakeLists.txt | 7 +++++++ cocos/base/CMakeLists.txt | 6 ++++++ cocos/network/CMakeLists.txt | 6 ++---- extensions/CMakeLists.txt | 13 +++++++++++++ .../GUI/CCControlExtension/CCControlUtils.cpp | 2 +- extensions/proj.win32/Win32InputBox.cpp | 4 ++++ samples/Cpp/TestCpp/CMakeLists.txt | 3 +++ 9 files changed, 44 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 086dd47286..a5486c2b41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,15 +38,15 @@ option(USE_CHIPMUNK "Use chipmunk for physics library" ON) option(USE_BOX2D "Use box2d for physics library" OFF) option(DEBUG_MODE "Debug or release?" ON) option(BUILD_LIBS_LUA "Build lua libraries" OFF) -option(BUILD_GUI "Build GUI library" OFF) -option(BUILD_NETWORK "Build network library" OFF) -option(BUILD_EXTENSIONS "Build extension library" OFF) -option(BUILD_EDITOR_SPINE "Build editor support for spine" OFF) -option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" OFF) -option(BUILD_EDITOR_COCOSBUILDER "Build editor support for cocosbuilder" OFF) +option(BUILD_GUI "Build GUI library" ON) +option(BUILD_NETWORK "Build network library" ON) +option(BUILD_EXTENSIONS "Build extension library" ON) +option(BUILD_EDITOR_SPINE "Build editor support for spine" ON) +option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" ON) +option(BUILD_EDITOR_COCOSBUILDER "Build editor support for cocosbuilder" ON) option(BUILD_HelloCpp "Only build HelloCpp sample" ON) -option(BUILD_TestCpp "Only build TestCpp sample" OFF) +option(BUILD_TestCpp "Only build TestCpp sample" ON) option(BUILD_HelloLua "Only build HelloLua sample" OFF) option(BUILD_TestLua "Only build TestLua sample" OFF) diff --git a/cocos/2d/platform/win32/CCStdC.h b/cocos/2d/platform/win32/CCStdC.h index 035ff90367..d8d8ddb17e 100644 --- a/cocos/2d/platform/win32/CCStdC.h +++ b/cocos/2d/platform/win32/CCStdC.h @@ -109,6 +109,7 @@ NS_CC_END #else #include + inline int vsnprintf_s(char *buffer, size_t sizeOfBuffer, size_t count, const char *format, va_list argptr) { return vsnprintf(buffer, sizeOfBuffer, format, argptr); diff --git a/cocos/audio/CMakeLists.txt b/cocos/audio/CMakeLists.txt index 9ad9e99b12..c2b45816aa 100644 --- a/cocos/audio/CMakeLists.txt +++ b/cocos/audio/CMakeLists.txt @@ -45,4 +45,11 @@ set_target_properties(audio ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" ) + +elseif(WIN32) + +target_link_libraries(audio + Winmm +) + endif() diff --git a/cocos/base/CMakeLists.txt b/cocos/base/CMakeLists.txt index 06d3e582c1..18b7b6bfe6 100644 --- a/cocos/base/CMakeLists.txt +++ b/cocos/base/CMakeLists.txt @@ -21,6 +21,12 @@ add_library(cocosbase STATIC ${COCOS_BASE_SRC} ) +if(WIN32) +target_link_libraries(cocosbase + Ws2_32 +) +endif() + set_target_properties(cocosbase PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib" diff --git a/cocos/network/CMakeLists.txt b/cocos/network/CMakeLists.txt index f2deb9b365..eb1fd9877e 100644 --- a/cocos/network/CMakeLists.txt +++ b/cocos/network/CMakeLists.txt @@ -1,6 +1,7 @@ set(NETWORK_SRC HttpClient.cpp SocketIO.cpp + WebSocket.cpp ) add_library(network STATIC @@ -9,10 +10,7 @@ add_library(network STATIC target_link_libraries(network curl - ldap - lber - idn - rtmp + websockets ) set_target_properties(network diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index f8083e1220..a6e438340b 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -24,12 +24,25 @@ set(EXTENSIONS_SRC physics-nodes/CCPhysicsSprite.cpp ) +if(WIN32) + ADD_DEFINITIONS(-DUNICODE -D_UNICODE) + + set(PLATFORM_EXTENSIONS_SRC + proj.win32/Win32InputBox.cpp + ) +elseif(APPLE) + +else() + +endif() + include_directories( .. ) add_library(extensions STATIC ${EXTENSIONS_SRC} + ${PLATFORM_EXTENSIONS_SRC} ) set_target_properties(extensions diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.cpp b/extensions/GUI/CCControlExtension/CCControlUtils.cpp index e660a29d8e..75d246796d 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.cpp +++ b/extensions/GUI/CCControlExtension/CCControlUtils.cpp @@ -92,7 +92,7 @@ RGBA ControlUtils::RGBfromHSV(HSV value) if (value.s <= 0.0) // < is bogus, just shuts up warnings { - if (isnan(value.h)) // value.h == NAN + if (std::isnan(value.h)) // value.h == NAN { out.r = value.v; out.g = value.v; diff --git a/extensions/proj.win32/Win32InputBox.cpp b/extensions/proj.win32/Win32InputBox.cpp index 8a0de6ffcb..220a932072 100644 --- a/extensions/proj.win32/Win32InputBox.cpp +++ b/extensions/proj.win32/Win32InputBox.cpp @@ -133,7 +133,11 @@ INT_PTR CWin32InputBox::InputBoxEx(WIN32INPUTBOX_PARAM *param) if (param->DlgTemplateName != 0) { HMODULE hModule = (HMODULE)param->hInstance; +#ifdef __MINGW32__ + HRSRC rcDlg = ::FindResource(hModule, (LPWSTR)(ULONG_PTR)(size_t)(param->DlgTemplateName), RT_DIALOG); +#else HRSRC rcDlg = ::FindResource(hModule, MAKEINTRESOURCE(param->DlgTemplateName), RT_DIALOG); +#endif if (rcDlg == NULL) return 0; diff --git a/samples/Cpp/TestCpp/CMakeLists.txt b/samples/Cpp/TestCpp/CMakeLists.txt index 91db89f44b..35964eb925 100644 --- a/samples/Cpp/TestCpp/CMakeLists.txt +++ b/samples/Cpp/TestCpp/CMakeLists.txt @@ -50,7 +50,10 @@ set(SAMPLE_SRC Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp Classes/ExtensionsTest/ExtensionsTest.cpp Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp + Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp + Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp + Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp From d18da426953bdffc8ef979d8f0c108769331d693 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Wed, 8 Jan 2014 23:42:54 +0800 Subject: [PATCH 353/428] fix addImageAsync bad judgment of generate image for the first ImageFile. --- cocos/2d/CCTextureCache.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cocos/2d/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp index c3526f0b46..73670fdf61 100644 --- a/cocos/2d/CCTextureCache.cpp +++ b/cocos/2d/CCTextureCache.cpp @@ -183,7 +183,9 @@ void TextureCache::loadImage() break; } _imageInfoMutex.unlock(); - if(infoSize > 0 && pos < infoSize) + if(infoSize == 0) + generateImage = true; + else if(pos < infoSize) generateImage = true; } From dccd1b40deb829c2890d43e9571dccb6d6416026 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 8 Jan 2014 16:28:18 -0800 Subject: [PATCH 354/428] Adds a new test that shows the problem with the Camera Apprently the bug is in QuadCommand, since if we use CustomCommand the camera works OK. --- .../Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp | 122 ++++++++++++++++++ .../Cpp/TestCpp/Classes/NodeTest/NodeTest.h | 18 +++ 2 files changed, 140 insertions(+) diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp index 77c7c907d7..5c2534dee0 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp @@ -25,6 +25,7 @@ static int sceneIdx = -1; static std::function createFunctions[] = { + CL(CameraTest2), CL(CameraCenterTest), CL(Test2), CL(Test4), @@ -827,6 +828,127 @@ std::string NodeNonOpaqueTest::subtitle() const return "Node rendered with GL_BLEND enabled"; } +//------------------------------------------------------------------ +// +// CameraTest2 +// +//------------------------------------------------------------------ + +class MySprite : public Sprite +{ +public: + static MySprite* create(const std::string &spritefilename) + { + auto sprite = new MySprite; + sprite->initWithFile(spritefilename); + sprite->autorelease(); + + auto shader = CCShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR); + sprite->setShaderProgram(shader); + return sprite; + } + virtual void draw() override; + void onDraw(); + +protected: + CustomCommand _customCommand; +}; + +void MySprite::draw() +{ + _customCommand.init(0, _vertexZ); + _customCommand.func = CC_CALLBACK_0(MySprite::onDraw, this); + Director::getInstance()->getRenderer()->addCommand(&_customCommand); +} + +void MySprite::onDraw() +{ + CC_NODE_DRAW_SETUP(); + + GL::blendFunc( _blendFunc.src, _blendFunc.dst ); + + GL::bindTexture2D( _texture->getName() ); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX ); + +#define kQuadSize sizeof(_quad.bl) + long offset = (long)&_quad; + + // vertex + int diff = offsetof( V3F_C4B_T2F, vertices); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff)); + + // texCoods + diff = offsetof( V3F_C4B_T2F, texCoords); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff)); + + // color + diff = offsetof( V3F_C4B_T2F, colors); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff)); + + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + CHECK_GL_ERROR_DEBUG(); + CC_INCREMENT_GL_DRAWS(1); +} +void CameraTest2::onEnter() +{ + TestCocosNodeDemo::onEnter(); + Director::getInstance()->setProjection(Director::Projection::_3D); + Director::getInstance()->setDepthTest(true); +} + +void CameraTest2::onExit() +{ + Director::getInstance()->setProjection(Director::Projection::_2D); + TestCocosNodeDemo::onExit(); +} + +CameraTest2::CameraTest2() +{ + auto s = Director::getInstance()->getWinSize(); + + _sprite1 = MySprite::create(s_back3); + addChild( _sprite1 ); + _sprite1->setPosition( Point(1*s.width/4, s.height/2) ); + _sprite1->setScale(0.5); + + _sprite2 = Sprite::create(s_back3); + addChild( _sprite2 ); + _sprite2->setPosition( Point(3*s.width/4, s.height/2) ); + _sprite2->setScale(0.5); + + scheduleUpdate(); +} + +std::string CameraTest2::title() const +{ + return "Camera Test 2"; +} + +std::string CameraTest2::subtitle() const +{ + return "Background image should be rotated in 3D"; +} + +void CameraTest2::update(float dt) +{ + kmVec3 eye, center, up; + + kmVec3Fill(&eye, 150, 0, 200); + kmVec3Fill(¢er, 0, 0, 0); + kmVec3Fill(&up, 0, 1, 0); + + + kmMat4 lookupMatrix; + kmMat4LookAt(&lookupMatrix, &eye, ¢er, &up); + + _sprite1->setAdditionalTransform(lookupMatrix); + _sprite2->setAdditionalTransform(lookupMatrix); +} + +/// +/// void CocosNodeTestScene::runThisTest() { auto layer = nextCocosNodeAction(); diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h index 3e6f8fa9ce..50959ced5a 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h @@ -148,6 +148,24 @@ protected: CameraCenterTest(); }; +class CameraTest2 : public TestCocosNodeDemo +{ +public: + CREATE_FUNC(CameraTest2); + virtual std::string title() const override; + virtual std::string subtitle() const override; + virtual void onEnter() override; + virtual void onExit() override; + +protected: + virtual void update(float dt) override; + CameraTest2(); + + Sprite *_sprite1; + Sprite *_sprite2; + +}; + class ConvertToNode : public TestCocosNodeDemo { public: From fe7d5cbdfbe77b2de63289776b3a1ec0857c4dc8 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Thu, 9 Jan 2014 09:46:17 +0800 Subject: [PATCH 355/428] update If Construct --- cocos/2d/CCTextureCache.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cocos/2d/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp index 73670fdf61..4af449c8bf 100644 --- a/cocos/2d/CCTextureCache.cpp +++ b/cocos/2d/CCTextureCache.cpp @@ -183,9 +183,7 @@ void TextureCache::loadImage() break; } _imageInfoMutex.unlock(); - if(infoSize == 0) - generateImage = true; - else if(pos < infoSize) + if(infoSize == 0 || pos < infoSize) generateImage = true; } From 3a235f1ffcf8c74e5cdfbc33a1f498d18ad4d61e Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Thu, 9 Jan 2014 09:50:02 +0800 Subject: [PATCH 356/428] amendment incorrect use of macro --- .../Classes/CocosDenshionTest/CocosDenshionTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp b/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp index 63959537d8..6ebcc144cc 100644 --- a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp +++ b/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp @@ -4,17 +4,17 @@ #include "extensions/GUI/CCControlExtension/CCControlSlider.h" // android effect only support ogg -#if (CC_TARGET_PLATFORM == CC_PLATFOR_ANDROID) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #define EFFECT_FILE "effect2.ogg" -#elif( CC_TARGET_PLATFORM == CC_PLATFOR_MARMALADE) +#elif( CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE) #define EFFECT_FILE "effect1.raw" #else #define EFFECT_FILE "effect1.wav" #endif // CC_PLATFOR_ANDROID -#if (CC_TARGET_PLATFORM == CC_PLATFOR_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #define MUSIC_FILE "music.mid" -#elif (CC_TARGET_PLATFORM == CC_PLATFOR_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFOR_LINUX ) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX ) #define MUSIC_FILE "background.ogg" #else #define MUSIC_FILE "background.mp3" From e3667a2894bb7163b478f1f41e9f6f42097cefc8 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Thu, 9 Jan 2014 09:58:27 +0800 Subject: [PATCH 357/428] Fixed bugs. --- cocos/gui/UIPageView.cpp | 7 ++++++- cocos/gui/UIPageView.h | 2 ++ cocos/gui/UIScrollView.cpp | 7 ++++++- cocos/gui/UIScrollView.h | 2 ++ cocos/gui/UITextField.cpp | 12 ++++-------- cocos/gui/UITextField.h | 4 ++-- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/cocos/gui/UIPageView.cpp b/cocos/gui/UIPageView.cpp index 9e41a534ed..2ad5a8c533 100644 --- a/cocos/gui/UIPageView.cpp +++ b/cocos/gui/UIPageView.cpp @@ -66,13 +66,18 @@ PageView* PageView::create() CC_SAFE_DELETE(widget); return nullptr; } + +void PageView::onEnter() +{ + Layout::onEnter(); + setUpdateEnabled(true); +} bool PageView::init() { if (Layout::init()) { setClippingEnabled(true); - setUpdateEnabled(true); setTouchEnabled(true); return true; } diff --git a/cocos/gui/UIPageView.h b/cocos/gui/UIPageView.h index 3c98b39c46..4b4a890199 100644 --- a/cocos/gui/UIPageView.h +++ b/cocos/gui/UIPageView.h @@ -159,6 +159,8 @@ public: */ virtual std::string getDescription() const override; + virtual void onEnter() override; + protected: virtual void addChild(Node * child) override; virtual void addChild(Node * child, int zOrder) override; diff --git a/cocos/gui/UIScrollView.cpp b/cocos/gui/UIScrollView.cpp index 11bb00c622..33dee12004 100644 --- a/cocos/gui/UIScrollView.cpp +++ b/cocos/gui/UIScrollView.cpp @@ -93,12 +93,17 @@ ScrollView* ScrollView::create() CC_SAFE_DELETE(widget); return nullptr; } + +void ScrollView::onEnter() +{ + Layout::onEnter(); + setUpdateEnabled(true); +} bool ScrollView::init() { if (Layout::init()) { - setUpdateEnabled(true); setTouchEnabled(true); setClippingEnabled(true); _innerContainer->setTouchEnabled(false); diff --git a/cocos/gui/UIScrollView.h b/cocos/gui/UIScrollView.h index 56e0b27eaf..9a0a9f889b 100644 --- a/cocos/gui/UIScrollView.h +++ b/cocos/gui/UIScrollView.h @@ -314,6 +314,8 @@ public: * Returns the "class name" of widget. */ virtual std::string getDescription() const override; + + virtual void onEnter() override; protected: virtual bool init() override; virtual void initRenderer() override; diff --git a/cocos/gui/UITextField.cpp b/cocos/gui/UITextField.cpp index c6e080fed3..95f5ccaea6 100644 --- a/cocos/gui/UITextField.cpp +++ b/cocos/gui/UITextField.cpp @@ -300,15 +300,11 @@ TextField* TextField::create() CC_SAFE_DELETE(widget); return nullptr; } - -bool TextField::init() + +void TextField::onEnter() { - if (Widget::init()) - { - setUpdateEnabled(true); - return true; - } - return false; + Widget::onEnter(); + setUpdateEnabled(true); } void TextField::initRenderer() diff --git a/cocos/gui/UITextField.h b/cocos/gui/UITextField.h index 1372696bcb..1f01103592 100644 --- a/cocos/gui/UITextField.h +++ b/cocos/gui/UITextField.h @@ -107,8 +107,6 @@ public: TextField(); virtual ~TextField(); static TextField* create(); - virtual bool init() override; - virtual void initRenderer() override; void setTouchSize(const Size &size); void setText(const std::string& text); void setPlaceHolder(const std::string& value); @@ -145,8 +143,10 @@ public: virtual const Size& getContentSize() const override; virtual Node* getVirtualRenderer() override; void attachWithIME(); + virtual void onEnter() override; protected: // event + virtual void initRenderer() override; void attachWithIMEEvent(); void detachWithIMEEvent(); void insertTextEvent(); From c43baaa2df0db1265fb375c9328acd85ff299e08 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 10:02:52 +0800 Subject: [PATCH 358/428] Update AUTHORS [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 789a85cf74..8956a45f36 100644 --- a/AUTHORS +++ b/AUTHORS @@ -657,6 +657,7 @@ Developers: xhcnb Device::setAccelerometerEnabled needs to be invoked before adding ACC listener. + Fixed a bug that it will get wrong custom properties when use different count custom properties in CocosBuilder. bopohaa Fixed a bug that Webp test crashes. From 33a7dba909469bb44f481d290f30ff493a3b3d23 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 10:51:40 +0800 Subject: [PATCH 359/428] Update AUTHORS [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 8956a45f36..7076e763f7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -705,6 +705,9 @@ Developers: daltomi Fixed a typo in Director class. Removed an unnecessary boolean flag in CCFontAtlasCache.cpp. + + v1ctor + ControlSlider supports setting selected thumb sprite. Retired Core Developers: WenSheng Yang From 8f12490df6767c7f66979fc1529f6b8d69c95553 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 10:52:19 +0800 Subject: [PATCH 360/428] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 303268968a..13af14aa8a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ cocos2d-x-3.0final ?.? ? [All] [FIX] Crash was triggered if there is not `textureFileName`section in particle plist file. + [FIX] ControlSlider doesn't support setting selected thumb sprite. cocos2d-x-3.0beta Jan.7 2014 [All] [NEW] New label: shadow, outline, glow support From 2b7aa2630806a1a8146c470f2c0c89933fd2d2ca Mon Sep 17 00:00:00 2001 From: heliclei Date: Thu, 9 Jan 2014 10:56:33 +0800 Subject: [PATCH 361/428] fix create job state --- tools/jenkins-scripts/create-job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/jenkins-scripts/create-job.py b/tools/jenkins-scripts/create-job.py index ef3e386368..1aac211cdf 100644 --- a/tools/jenkins-scripts/create-job.py +++ b/tools/jenkins-scripts/create-job.py @@ -19,7 +19,7 @@ r = requests.get(api_get_pr) pr = r.json() #forge a payload -payload = {"action":"open","number":"","pull_request":""} +payload = {"action":"opened","number":"","pull_request":""} payload['number']=pr_num payload['pull_request']=pr From e66468025d8716025ee908b45233f394398944a9 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 9 Jan 2014 02:59:53 +0000 Subject: [PATCH 362/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index f387eb216f..4b1726503c 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit f387eb216fd0849b8482203c76b5a8ce1b99471b +Subproject commit 4b1726503ce048967c58f6cca7573e86a150e29f From 630bd32192eb773124d9a64cc9d4bc18a151dfab Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 11:28:54 +0800 Subject: [PATCH 363/428] Update AUTHORS [ci skip] --- AUTHORS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 7076e763f7..695374eccc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -707,7 +707,8 @@ Developers: Removed an unnecessary boolean flag in CCFontAtlasCache.cpp. v1ctor - ControlSlider supports setting selected thumb sprite. + ControlSlider supports to set selected thumb sprite. + ControlButton supports to set scale ratio of touchdown state Retired Core Developers: WenSheng Yang From 29cbd2bcc896fbe197a00914439cc41d02e3fe17 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 11:29:36 +0800 Subject: [PATCH 364/428] Update CHANGELOG [ci skip] --- CHANGELOG | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 13af14aa8a..89df2ce901 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,8 @@ cocos2d-x-3.0final ?.? ? [All] [FIX] Crash was triggered if there is not `textureFileName`section in particle plist file. - [FIX] ControlSlider doesn't support setting selected thumb sprite. + [FIX] ControlSlider doesn't support to set selected thumb sprite. + [FIX] ControlButton doesn't support to set scale ratio of touchdown state. cocos2d-x-3.0beta Jan.7 2014 [All] [NEW] New label: shadow, outline, glow support From 746a360176d5c101a04d3fe68ace429dabe23bd1 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 9 Jan 2014 03:37:44 +0000 Subject: [PATCH 365/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 4b1726503c..8c348de59f 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 4b1726503ce048967c58f6cca7573e86a150e29f +Subproject commit 8c348de59f9a69b6662dddb3c455440313e67351 From 2d8fcb2c00342a6ec26d27ad180f0da754a63ad9 Mon Sep 17 00:00:00 2001 From: walzer Date: Thu, 9 Jan 2014 12:40:51 +0800 Subject: [PATCH 366/428] issue #3627, remove UICCLabelAtlas, add LabelAtlas::create() for GUI module --- cocos/2d/CCLabelAtlas.cpp | 15 ++++++++++++ cocos/2d/CCLabelAtlas.h | 5 +++- cocos/gui/UITextAtlas.cpp | 51 ++------------------------------------- cocos/gui/UITextAtlas.h | 28 ++------------------- 4 files changed, 23 insertions(+), 76 deletions(-) diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index ddbf4df8f2..99f7baba0a 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -43,6 +43,21 @@ NS_CC_BEGIN //CCLabelAtlas - Creation & Init +LabelAtlas* LabelAtlas::create() +{ + LabelAtlas* ret = new LabelAtlas(); + if (ret) + { + ret->autorelease(); + } + else + { + CC_SAFE_RELEASE_NULL(ret); + } + + return ret; +} + LabelAtlas* LabelAtlas::create(const std::string& string, const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap) { LabelAtlas *pRet = new LabelAtlas(); diff --git a/cocos/2d/CCLabelAtlas.h b/cocos/2d/CCLabelAtlas.h index a55abf1c36..f5419b3611 100644 --- a/cocos/2d/CCLabelAtlas.h +++ b/cocos/2d/CCLabelAtlas.h @@ -67,8 +67,11 @@ public: _string.clear(); } + /** creates an empty LabelAtlas, user need to call initWithString(...) later to make this object work properly **/ + static LabelAtlas* create(); + /** creates the LabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas */ - static LabelAtlas * create(const std::string& string, const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap); + static LabelAtlas* create(const std::string& string, const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap); /** creates the LabelAtlas with a string and a configuration file @since v2.0 diff --git a/cocos/gui/UITextAtlas.cpp b/cocos/gui/UITextAtlas.cpp index 491ad1af80..7d1eed08c2 100644 --- a/cocos/gui/UITextAtlas.cpp +++ b/cocos/gui/UITextAtlas.cpp @@ -30,52 +30,6 @@ namespace gui { static const int LABELATLAS_RENDERER_Z = (-1); - -UICCLabelAtlas::UICCLabelAtlas() -{ - -} - -UICCLabelAtlas::~UICCLabelAtlas() -{ - -} - -UICCLabelAtlas* UICCLabelAtlas::create() -{ - UICCLabelAtlas *pRet = new UICCLabelAtlas(); - if(pRet) - { - pRet->autorelease(); - return pRet; - } - CC_SAFE_DELETE(pRet); - - return nullptr; -} - -void UICCLabelAtlas::setProperty(const std::string& string, const std::string& charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap) -{ - initWithString(string, charMapFile, itemWidth, itemHeight, startCharMap); -} - -void UICCLabelAtlas::setProperty(const std::string& string, Texture2D *texture, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap) -{ - initWithString(string, texture, itemWidth, itemHeight, startCharMap); -} - -void UICCLabelAtlas::draw() -{ - if (!_textureAtlas) - { - return; - } - - AtlasNode::draw(); -} - - - TextAtlas::TextAtlas(): _labelAtlasRenderer(nullptr), _stringValue(""), @@ -84,7 +38,6 @@ _itemWidth(0), _itemHeight(0), _startCharMap("") { - } TextAtlas::~TextAtlas() @@ -106,7 +59,7 @@ TextAtlas* TextAtlas::create() void TextAtlas::initRenderer() { - _labelAtlasRenderer = UICCLabelAtlas::create(); + _labelAtlasRenderer = LabelAtlas::create(); Node::addChild(_labelAtlasRenderer, LABELATLAS_RENDERER_Z, -1); } @@ -117,7 +70,7 @@ void TextAtlas::setProperty(const std::string& stringValue, const std::string& c _itemWidth = itemWidth; _itemHeight = itemHeight; _startCharMap = startCharMap; - _labelAtlasRenderer->setProperty(stringValue, charMapFile, itemWidth, itemHeight, (int)(startCharMap[0])); + _labelAtlasRenderer->initWithString(stringValue, charMapFile, itemWidth, itemHeight, (int)(startCharMap[0])); updateAnchorPoint(); labelAtlasScaleChangedWithSize(); } diff --git a/cocos/gui/UITextAtlas.h b/cocos/gui/UITextAtlas.h index 89f28a8b10..cdd25c3b6f 100644 --- a/cocos/gui/UITextAtlas.h +++ b/cocos/gui/UITextAtlas.h @@ -30,32 +30,7 @@ THE SOFTWARE. NS_CC_BEGIN namespace gui { - -/** - * @js NA - * @lua NA - */ -class UICCLabelAtlas : public LabelAtlas -{ -public: - /** - * Default constructor - */ - UICCLabelAtlas(); - /** - * Default destructor - */ - virtual ~UICCLabelAtlas(); - - /** - * Allocates and initializes. - */ - static UICCLabelAtlas* create(); - void setProperty(const std::string& string, const std::string& charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); - void setProperty(const std::string& string, Texture2D *texture, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); - virtual void draw(void) override; -}; /** * @js NA * @lua NA @@ -108,7 +83,8 @@ protected: virtual Widget* createCloneInstance() override; virtual void copySpecialProperties(Widget* model) override; protected: - UICCLabelAtlas* _labelAtlasRenderer; + // UICCLabelAtlas* _labelAtlasRenderer; + LabelAtlas* _labelAtlasRenderer; std::string _stringValue; std::string _charMapFileName; int _itemWidth; From 7055340ace08d1e619689efda2a117844a553502 Mon Sep 17 00:00:00 2001 From: walzer Date: Thu, 9 Jan 2014 12:43:57 +0800 Subject: [PATCH 367/428] fixed #3627. There're no UICCLabelAtlas any more. --- cocos/gui/UITextAtlas.h | 1 - 1 file changed, 1 deletion(-) diff --git a/cocos/gui/UITextAtlas.h b/cocos/gui/UITextAtlas.h index cdd25c3b6f..99933fcb2e 100644 --- a/cocos/gui/UITextAtlas.h +++ b/cocos/gui/UITextAtlas.h @@ -83,7 +83,6 @@ protected: virtual Widget* createCloneInstance() override; virtual void copySpecialProperties(Widget* model) override; protected: - // UICCLabelAtlas* _labelAtlasRenderer; LabelAtlas* _labelAtlasRenderer; std::string _stringValue; std::string _charMapFileName; From 007a64e50ecc13deac60d44ca5cb241541120a51 Mon Sep 17 00:00:00 2001 From: heliclei Date: Thu, 9 Jan 2014 12:47:46 +0800 Subject: [PATCH 368/428] support [ci skip] command --- tools/jenkins-scripts/ghprb.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index bbc86c68ec..3f258e4401 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -38,9 +38,8 @@ def main(): action = payload['action'] print 'action: ' + action - - pr = payload['pull_request'] + url = pr['html_url'] print "url:" + url pr_desc = '

pr#' + str(pr_num) + ' is '+ action +'

' @@ -61,7 +60,18 @@ def main(): if((action != 'opened') and (action != 'synchronize')): print 'pull request #' + str(pr_num) + ' is '+action+', no build triggered' return(0) + + r = requests.get(pr['url']+"/commits") + commits = r.json() + last_commit = commits[len(commits)-1] + message = last_commit['commit']['message'] + pattern = re.compile("\[ci(\s+)skip\]", re.I) + result = pattern.search(message) + if result is not None: + print 'skip build for pull request #' + str(pr_num) + return(0) + data = {"state":"pending", "target_url":target_url} access_token = os.environ['GITHUB_ACCESS_TOKEN'] Headers = {"Authorization":"token " + access_token} From 2945322b97a799f604005cd94a961d7170e0f26e Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 9 Jan 2014 04:50:38 +0000 Subject: [PATCH 369/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 8c348de59f..4a690da567 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 8c348de59f9a69b6662dddb3c455440313e67351 +Subproject commit 4a690da5675369f036f3fc3dd553afaa1b10f1de From 480a9277daa2463c4ea6d64bdf34f1925a986a35 Mon Sep 17 00:00:00 2001 From: edwardzhou Date: Thu, 9 Jan 2014 13:29:56 +0800 Subject: [PATCH 370/428] fix WebSocket cannot send/receive more than 4096 bytes of data --- cocos/network/WebSocket.cpp | 154 +++++++++++++++++++++++++----------- cocos/network/WebSocket.h | 8 +- 2 files changed, 112 insertions(+), 50 deletions(-) diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 3a77d75868..3f81e5ba90 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -37,6 +37,8 @@ #include "libwebsockets.h" +#define WS_WRITE_BUFFER_SIZE 2048 + NS_CC_BEGIN namespace network { @@ -221,6 +223,9 @@ WebSocket::WebSocket() , _delegate(nullptr) , _SSLConnection(0) , _wsProtocols(nullptr) +, _pending_frame_data_len(0) +, _current_data_len(0) +, _current_data(NULL) { } @@ -497,12 +502,13 @@ int WebSocket::onSocketCallback(struct libwebsocket_context *ctx, case LWS_CALLBACK_CLIENT_WRITEABLE: { + std::lock_guard lk(_wsHelper->_subThreadWsMessageQueueMutex); std::list::iterator iter = _wsHelper->_subThreadWsMessageQueue->begin(); int bytesWrite = 0; - for (; iter != _wsHelper->_subThreadWsMessageQueue->end(); ++iter) + for (; iter != _wsHelper->_subThreadWsMessageQueue->end();) { WsMessage* subThreadMsg = *iter; @@ -511,44 +517,64 @@ int WebSocket::onSocketCallback(struct libwebsocket_context *ctx, { Data* data = (Data*)subThreadMsg->obj; - unsigned char* buf = new unsigned char[LWS_SEND_BUFFER_PRE_PADDING - + data->len + LWS_SEND_BUFFER_POST_PADDING]; + const size_t c_bufferSize = WS_WRITE_BUFFER_SIZE; + + size_t remaining = data->len - data->issued; + size_t n = std::min(remaining, c_bufferSize ); + CCLOG("[websocket:send] total: %d, sent: %d, remaining: %d, buffer size: %d", data->len, data->issued, remaining, n); + + unsigned char* buf = new unsigned char[LWS_SEND_BUFFER_PRE_PADDING + n + LWS_SEND_BUFFER_POST_PADDING]; + + memcpy((char*)&buf[LWS_SEND_BUFFER_PRE_PADDING], data->bytes + data->issued, n); - memset(&buf[LWS_SEND_BUFFER_PRE_PADDING], 0, data->len); - memcpy((char*)&buf[LWS_SEND_BUFFER_PRE_PADDING], data->bytes, data->len); + int writeProtocol; - enum libwebsocket_write_protocol writeProtocol; - - if (WS_MSG_TO_SUBTRHEAD_SENDING_STRING == subThreadMsg->what) - { - writeProtocol = LWS_WRITE_TEXT; + if (data->issued == 0) { + if (WS_MSG_TO_SUBTRHEAD_SENDING_STRING == subThreadMsg->what) + { + writeProtocol = LWS_WRITE_TEXT; + } + else + { + writeProtocol = LWS_WRITE_BINARY; + } + + // If we have more than 1 fragment + if (data->len > c_bufferSize) + writeProtocol |= LWS_WRITE_NO_FIN; + } else { + // we are in the middle of fragments + writeProtocol = LWS_WRITE_CONTINUATION; + // and if not in the last fragment + if (remaining != n) + writeProtocol |= LWS_WRITE_NO_FIN; } - else - { - writeProtocol = LWS_WRITE_BINARY; - } - - bytesWrite = libwebsocket_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING], data->len, writeProtocol); - + + bytesWrite = libwebsocket_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING], n, (libwebsocket_write_protocol)writeProtocol); + CCLOG("[websocket:send] bytesWrite => %d", bytesWrite); + + // Buffer overrun? if (bytesWrite < 0) { - CCLOGERROR("%s", "libwebsocket_write error..."); + break; } - if (bytesWrite < data->len) + // Do we have another fragments to send? + else if (remaining != n) { - CCLOGERROR("Partial write LWS_CALLBACK_CLIENT_WRITEABLE\n"); + data->issued += n; + break; + } + // Safely done! + else + { + CC_SAFE_DELETE_ARRAY(data->bytes); + CC_SAFE_DELETE(data); + CC_SAFE_DELETE_ARRAY(buf); + _wsHelper->_subThreadWsMessageQueue->erase(iter++); + CC_SAFE_DELETE(subThreadMsg); } - - CC_SAFE_DELETE_ARRAY(data->bytes); - CC_SAFE_DELETE(data); - CC_SAFE_DELETE_ARRAY(buf); } - - CC_SAFE_DELETE(subThreadMsg); } - - _wsHelper->_subThreadWsMessageQueue->clear(); - /* get notified as soon as we can write again */ @@ -577,32 +603,64 @@ int WebSocket::onSocketCallback(struct libwebsocket_context *ctx, { if (in && len > 0) { - WsMessage* msg = new WsMessage(); - msg->what = WS_MSG_TO_UITHREAD_MESSAGE; - - char* bytes = NULL; - Data* data = new Data(); - - if (lws_frame_is_binary(wsi)) + // Accumulate the data (increasing the buffer as we go) + if (_current_data_len == 0) { - - bytes = new char[len]; - data->isBinary = true; + _current_data = new char[len]; + memcpy (_current_data, in, len); + _current_data_len = len; } else { - bytes = new char[len+1]; - bytes[len] = '\0'; - data->isBinary = false; + char *new_data = new char [_current_data_len + len]; + memcpy (new_data, _current_data, _current_data_len); + memcpy (new_data + _current_data_len, in, len); + CC_SAFE_DELETE_ARRAY(_current_data); + _current_data = new_data; + _current_data_len = _current_data_len + len; } - memcpy(bytes, in, len); + _pending_frame_data_len = libwebsockets_remaining_packet_payload (wsi); + + if (_pending_frame_data_len > 0) + { + //CCLOG("%ld bytes of pending data to receive, consider increasing the libwebsocket rx_buffer_size value.", _pending_frame_data_len); + } - data->bytes = bytes; - data->len = len; - msg->obj = (void*)data; - - _wsHelper->sendMessageToUIThread(msg); + // If no more data pending, send it to the client thread + if (_pending_frame_data_len == 0) + { + WsMessage* msg = new WsMessage(); + msg->what = WS_MSG_TO_UITHREAD_MESSAGE; + + char* bytes = NULL; + Data* data = new Data(); + + if (lws_frame_is_binary(wsi)) + { + + bytes = new char[_current_data_len]; + data->isBinary = true; + } + else + { + bytes = new char[_current_data_len+1]; + bytes[_current_data_len] = '\0'; + data->isBinary = false; + } + + memcpy(bytes, _current_data, _current_data_len); + + data->bytes = bytes; + data->len = _current_data_len; + msg->obj = (void*)data; + + CC_SAFE_DELETE_ARRAY(_current_data); + _current_data = NULL; + _current_data_len = 0; + + _wsHelper->sendMessageToUIThread(msg); + } } } break; diff --git a/cocos/network/WebSocket.h b/cocos/network/WebSocket.h index d9363bb666..830d9fb2ee 100644 --- a/cocos/network/WebSocket.h +++ b/cocos/network/WebSocket.h @@ -62,9 +62,9 @@ public: */ struct Data { - Data():bytes(NULL), len(0), isBinary(false){} + Data():bytes(NULL), len(0), issued(0), isBinary(false){} char* bytes; - ssize_t len; + ssize_t len, issued; bool isBinary; }; @@ -153,6 +153,10 @@ private: unsigned int _port; std::string _path; + size_t _pending_frame_data_len; + unsigned int _current_data_len; + char *_current_data; + friend class WsThreadHelper; WsThreadHelper* _wsHelper; From d15874fdf72f3393fe8b639780cc90d6d92db962 Mon Sep 17 00:00:00 2001 From: walzer Date: Thu, 9 Jan 2014 14:16:26 +0800 Subject: [PATCH 371/428] fixed #3627, an extra benefit from adding LabelAtlas::create() is that we can hide its default constructor into protected. --- cocos/2d/CCDirector.cpp | 9 ++++++--- cocos/2d/CCLabelAtlas.h | 30 +++++++++++++++--------------- cocos/2d/CCMenuItem.cpp | 3 +-- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index 277859644d..428772a367 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -948,17 +948,20 @@ void Director::createStatsLabel() */ float factor = EGLView::getInstance()->getDesignResolutionSize().height / 320.0f; - _FPSLabel = new LabelAtlas; + _FPSLabel = LabelAtlas::create(); + _FPSLabel->retain(); _FPSLabel->setIgnoreContentScaleFactor(true); _FPSLabel->initWithString("00.0", texture, 12, 32 , '.'); _FPSLabel->setScale(factor); - _SPFLabel = new LabelAtlas; + _SPFLabel = LabelAtlas::create(); + _SPFLabel->retain(); _SPFLabel->setIgnoreContentScaleFactor(true); _SPFLabel->initWithString("0.000", texture, 12, 32, '.'); _SPFLabel->setScale(factor); - _drawsLabel = new LabelAtlas; + _drawsLabel = LabelAtlas::create(); + _drawsLabel->retain(); _drawsLabel->setIgnoreContentScaleFactor(true); _drawsLabel->initWithString("000", texture, 12, 32, '.'); _drawsLabel->setScale(factor); diff --git a/cocos/2d/CCLabelAtlas.h b/cocos/2d/CCLabelAtlas.h index f5419b3611..4eb25b67af 100644 --- a/cocos/2d/CCLabelAtlas.h +++ b/cocos/2d/CCLabelAtlas.h @@ -52,21 +52,6 @@ A more flexible class is LabelBMFont. It supports variable width characters and class CC_DLL LabelAtlas : public AtlasNode, public LabelProtocol { public: - /** - * @js ctor - */ - LabelAtlas() - :_string("") - {} - /** - * @js NA - * @lua NA - */ - virtual ~LabelAtlas() - { - _string.clear(); - } - /** creates an empty LabelAtlas, user need to call initWithString(...) later to make this object work properly **/ static LabelAtlas* create(); @@ -101,6 +86,21 @@ public: #endif protected: + /** + * @js ctor + */ + LabelAtlas() + :_string("") + {} + /** + * @js NA + * @lua NA + */ + virtual ~LabelAtlas() + { + _string.clear(); + } + // string to render std::string _string; // the first char in the charmap diff --git a/cocos/2d/CCMenuItem.cpp b/cocos/2d/CCMenuItem.cpp index d097e1d30a..f137404176 100644 --- a/cocos/2d/CCMenuItem.cpp +++ b/cocos/2d/CCMenuItem.cpp @@ -348,9 +348,8 @@ bool MenuItemAtlasFont::initWithString(const std::string& value, const std::stri bool MenuItemAtlasFont::initWithString(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, const ccMenuCallback& callback) { CCASSERT( value.size() != 0, "value length must be greater than 0"); - LabelAtlas *label = new LabelAtlas(); + LabelAtlas *label = LabelAtlas::create(); label->initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap); - label->autorelease(); if (MenuItemLabel::initWithLabel(label, callback)) { // do something ? From 8da48795609b9ac5a8f8bbbf9af8213a2dd8dfae Mon Sep 17 00:00:00 2001 From: walzer Date: Thu, 9 Jan 2014 14:21:43 +0800 Subject: [PATCH 372/428] issue #3627, remove lua/js doxygen mark from LabelAtals constructor & destructor. --- cocos/2d/CCLabelAtlas.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cocos/2d/CCLabelAtlas.h b/cocos/2d/CCLabelAtlas.h index 4eb25b67af..47064c14c7 100644 --- a/cocos/2d/CCLabelAtlas.h +++ b/cocos/2d/CCLabelAtlas.h @@ -86,16 +86,10 @@ public: #endif protected: - /** - * @js ctor - */ LabelAtlas() :_string("") {} - /** - * @js NA - * @lua NA - */ + virtual ~LabelAtlas() { _string.clear(); From 1ad14340bfd7c5e3269dff3b68c2c32036c412d2 Mon Sep 17 00:00:00 2001 From: walzer Date: Thu, 9 Jan 2014 14:26:34 +0800 Subject: [PATCH 373/428] issue #3627, remove Hungarian Notation in LabelAtlas --- cocos/2d/CCLabelAtlas.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index 99f7baba0a..200bec0641 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -60,13 +60,13 @@ LabelAtlas* LabelAtlas::create() LabelAtlas* LabelAtlas::create(const std::string& string, const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap) { - LabelAtlas *pRet = new LabelAtlas(); - if(pRet && pRet->initWithString(string, charMapFile, itemWidth, itemHeight, startCharMap)) + LabelAtlas* ret = new LabelAtlas(); + if(ret && ret->initWithString(string, charMapFile, itemWidth, itemHeight, startCharMap)) { - pRet->autorelease(); - return pRet; + ret->autorelease(); + return ret; } - CC_SAFE_DELETE(pRet); + CC_SAFE_DELETE(ret); return nullptr; } From 1b339a46352b0302c8dd799dce82e5cb5bd504c8 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Thu, 9 Jan 2014 14:50:29 +0800 Subject: [PATCH 374/428] Add Test Case: LayerColor should not occlude sprites and labels when depth test is true --- .../TestCpp/Classes/LayerTest/LayerTest.cpp | 25 +++++++++++++++++++ .../Cpp/TestCpp/Classes/LayerTest/LayerTest.h | 13 ++++++++++ 2 files changed, 38 insertions(+) diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp index 1c1ae1084a..0bbb8cc63a 100644 --- a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp +++ b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp @@ -25,6 +25,7 @@ static std::function createFunctions[] = { CL(LayerExtendedBlendOpacityTest), CL(LayerBug3162A), CL(LayerBug3162B), + CL(LayerColorOccludeBug), }; static int sceneIdx=-1; @@ -954,3 +955,27 @@ std::string LayerBug3162B::subtitle() const { return "u and m layer color is effected/diseffected with b layer"; } + +std::string LayerColorOccludeBug::title() const +{ + return "Layer Color Occlude Bug Test"; +} + +std::string LayerColorOccludeBug::subtitle() const +{ + return "Layer Color Should not occlude titles and any sprites"; +} + +void LayerColorOccludeBug::onEnter() +{ + LayerTest::onEnter(); + Director::getInstance()->setDepthTest(true); + _layer = LayerColor::create(Color4B(0, 80, 95, 255)); + addChild(_layer); +} + +void LayerColorOccludeBug::onExit() +{ + LayerTest::onExit(); + Director::getInstance()->setDepthTest(false); +} diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h index 61a8602200..61b4f6fc2c 100644 --- a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h +++ b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h @@ -202,6 +202,19 @@ private: LayerColor* _layer[3]; }; +class LayerColorOccludeBug : public LayerTest +{ +public: + CREATE_FUNC(LayerColorOccludeBug); + virtual void onEnter() override; + virtual void onExit() override; + virtual std::string title() const override; + virtual std::string subtitle() const override; + +private: + LayerColor* _layer; +}; + class LayerTestScene : public TestScene { public: From ce0b86e7fe41aebabcada91026560ef038af6e55 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 9 Jan 2014 06:56:48 +0000 Subject: [PATCH 375/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 4a690da567..17d3f11698 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 4a690da5675369f036f3fc3dd553afaa1b10f1de +Subproject commit 17d3f116985b86a820a648927ea1fc5cfe5951d3 From f8d369248b61152fff514be173ad3ebd16605dfd Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 15:18:06 +0800 Subject: [PATCH 376/428] closed #3605: Websocket doesn't support send/receive data which larger than 4096 bytes, renames member variables to follow cocos2d-x coding guide line. --- cocos/network/WebSocket.cpp | 60 ++++++++++++++++++------------------- cocos/network/WebSocket.h | 10 +++---- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 3f81e5ba90..5e17487567 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -46,7 +46,7 @@ namespace network { class WsMessage { public: - WsMessage() : what(0), obj(NULL){} + WsMessage() : what(0), obj(nullptr){} unsigned int what; // message type void* obj; }; @@ -114,7 +114,7 @@ public: // Implementation of WsThreadHelper WsThreadHelper::WsThreadHelper() : _subThreadInstance(nullptr) -, _ws(NULL) +, _ws(nullptr) , _needQuit(false) { _UIWsMessageQueue = new std::list(); @@ -183,7 +183,7 @@ void WsThreadHelper::joinSubThread() void WsThreadHelper::update(float dt) { - WsMessage *msg = NULL; + WsMessage *msg = nullptr; // Returns quickly if no message std::lock_guard lk(_UIWsMessageQueueMutex); @@ -223,9 +223,9 @@ WebSocket::WebSocket() , _delegate(nullptr) , _SSLConnection(0) , _wsProtocols(nullptr) -, _pending_frame_data_len(0) -, _current_data_len(0) -, _current_data(NULL) +, _pendingFrameDataLen(0) +, _currentDataLen(0) +, _currentData(nullptr) { } @@ -243,7 +243,7 @@ WebSocket::~WebSocket() bool WebSocket::init(const Delegate& delegate, const std::string& url, - const std::vector* protocols/* = NULL*/) + const std::vector* protocols/* = nullptr*/) { bool ret = false; bool useSSL = false; @@ -604,60 +604,60 @@ int WebSocket::onSocketCallback(struct libwebsocket_context *ctx, if (in && len > 0) { // Accumulate the data (increasing the buffer as we go) - if (_current_data_len == 0) + if (_currentDataLen == 0) { - _current_data = new char[len]; - memcpy (_current_data, in, len); - _current_data_len = len; + _currentData = new char[len]; + memcpy (_currentData, in, len); + _currentDataLen = len; } else { - char *new_data = new char [_current_data_len + len]; - memcpy (new_data, _current_data, _current_data_len); - memcpy (new_data + _current_data_len, in, len); - CC_SAFE_DELETE_ARRAY(_current_data); - _current_data = new_data; - _current_data_len = _current_data_len + len; + char *new_data = new char [_currentDataLen + len]; + memcpy (new_data, _currentData, _currentDataLen); + memcpy (new_data + _currentDataLen, in, len); + CC_SAFE_DELETE_ARRAY(_currentData); + _currentData = new_data; + _currentDataLen = _currentDataLen + len; } - _pending_frame_data_len = libwebsockets_remaining_packet_payload (wsi); + _pendingFrameDataLen = libwebsockets_remaining_packet_payload (wsi); - if (_pending_frame_data_len > 0) + if (_pendingFrameDataLen > 0) { - //CCLOG("%ld bytes of pending data to receive, consider increasing the libwebsocket rx_buffer_size value.", _pending_frame_data_len); + //CCLOG("%ld bytes of pending data to receive, consider increasing the libwebsocket rx_buffer_size value.", _pendingFrameDataLen); } // If no more data pending, send it to the client thread - if (_pending_frame_data_len == 0) + if (_pendingFrameDataLen == 0) { WsMessage* msg = new WsMessage(); msg->what = WS_MSG_TO_UITHREAD_MESSAGE; - char* bytes = NULL; + char* bytes = nullptr; Data* data = new Data(); if (lws_frame_is_binary(wsi)) { - bytes = new char[_current_data_len]; + bytes = new char[_currentDataLen]; data->isBinary = true; } else { - bytes = new char[_current_data_len+1]; - bytes[_current_data_len] = '\0'; + bytes = new char[_currentDataLen+1]; + bytes[_currentDataLen] = '\0'; data->isBinary = false; } - memcpy(bytes, _current_data, _current_data_len); + memcpy(bytes, _currentData, _currentDataLen); data->bytes = bytes; - data->len = _current_data_len; + data->len = _currentDataLen; msg->obj = (void*)data; - CC_SAFE_DELETE_ARRAY(_current_data); - _current_data = NULL; - _current_data_len = 0; + CC_SAFE_DELETE_ARRAY(_currentData); + _currentData = nullptr; + _currentDataLen = 0; _wsHelper->sendMessageToUIThread(msg); } diff --git a/cocos/network/WebSocket.h b/cocos/network/WebSocket.h index 830d9fb2ee..738abf2c2f 100644 --- a/cocos/network/WebSocket.h +++ b/cocos/network/WebSocket.h @@ -62,7 +62,7 @@ public: */ struct Data { - Data():bytes(NULL), len(0), issued(0), isBinary(false){} + Data():bytes(nullptr), len(0), issued(0), isBinary(false){} char* bytes; ssize_t len, issued; bool isBinary; @@ -112,7 +112,7 @@ public: */ bool init(const Delegate& delegate, const std::string& url, - const std::vector* protocols = NULL); + const std::vector* protocols = nullptr); /** * @brief Sends string data to websocket server. @@ -153,9 +153,9 @@ private: unsigned int _port; std::string _path; - size_t _pending_frame_data_len; - unsigned int _current_data_len; - char *_current_data; + size_t _pendingFrameDataLen; + unsigned int _currentDataLen; + char *_currentData; friend class WsThreadHelper; WsThreadHelper* _wsHelper; From e063755596531755527f214a5d9c5a0ea5d14fa3 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Thu, 9 Jan 2014 15:26:05 +0800 Subject: [PATCH 377/428] fix Image crashes in mac when load tag file --- cocos/2d/platform/CCImageCommon_cpp.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cocos/2d/platform/CCImageCommon_cpp.h b/cocos/2d/platform/CCImageCommon_cpp.h index 6c5c7a2d96..fa331d313f 100644 --- a/cocos/2d/platform/CCImageCommon_cpp.h +++ b/cocos/2d/platform/CCImageCommon_cpp.h @@ -391,10 +391,7 @@ Image::Image() Image::~Image() { - if (_data != nullptr) - { - free(_data); - } + CC_SAFE_FREE(_data); } bool Image::initWithImageFile(const std::string& path) @@ -1539,7 +1536,7 @@ bool Image::initWithTGAData(tImageTGA* tgaData) }while(false); - if (!ret) + if (ret) { const unsigned char tgaSuffix[] = ".tga"; for(int i = 0; i < 4; ++i) @@ -1556,6 +1553,7 @@ bool Image::initWithTGAData(tImageTGA* tgaData) if (tgaData->imageData != nullptr) { free(tgaData->imageData); + _data = nullptr; } } From b8528351c4ed3a127dbbbb4e59ae855a79eadb02 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 15:26:24 +0800 Subject: [PATCH 378/428] Update AUTHORS [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 695374eccc..2eb0817f4c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -519,6 +519,7 @@ Developers: Correcting the type detecting order for Lua CCBProxy::getNodeTypeName. Casting variables to their own type, and print warning info if no corresponding lua callback function instead of crash. fix of WebSocket url parse error for 'ws://domain.com/websocket' pattern. + Fixed a bug that Websocket doesn't support send/receive data which larger than 4096 bytes. musikov Fixing a bug that missing precision when getting strokeColor and fontFillColor From 43a9c84cc2a598af31c39c4d83c86cf18d6a9434 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 15:26:54 +0800 Subject: [PATCH 379/428] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 89df2ce901..505c7e208b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ cocos2d-x-3.0final ?.? ? [FIX] Crash was triggered if there is not `textureFileName`section in particle plist file. [FIX] ControlSlider doesn't support to set selected thumb sprite. [FIX] ControlButton doesn't support to set scale ratio of touchdown state. + [FIX] Websocket doesn't support send/receive data which larger than 4096 bytes. cocos2d-x-3.0beta Jan.7 2014 [All] [NEW] New label: shadow, outline, glow support From 19f0e5546470d97ae060d1f80c013ba49deca16c Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Thu, 9 Jan 2014 15:43:18 +0800 Subject: [PATCH 380/428] fixed bug of layout --- cocos/gui/UILayout.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index c70f109a14..fcdb4fb621 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -490,6 +490,7 @@ const Rect& Layout::getClippingRect() void Layout::onSizeChanged() { Widget::onSizeChanged(); + setContentSize(_size); setStencilClippingSize(_size); _doLayoutDirty = true; if (_backGroundImage) From ccda90cab5d6ff482d5244a4e3f284f79267cbd7 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Thu, 9 Jan 2014 15:52:04 +0800 Subject: [PATCH 381/428] fix compiling error in CCControlSlider.cpp on vs. --- extensions/GUI/CCControlExtension/CCControlSlider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index 6dbd30f512..ace6ef2cec 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -109,7 +109,7 @@ bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressS Sprite* selectedThumbSprite = Sprite::createWithTexture(thumbSprite->getTexture(), thumbSprite->getTextureRect()); selectedThumbSprite->setColor(Color3B::GRAY); - this->initWithSprites(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite); + return this->initWithSprites(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite); } bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite, From e34ef0d38fb67fd38cae826a2fae75cd35dc963e Mon Sep 17 00:00:00 2001 From: boyu0 Date: Thu, 9 Jan 2014 16:33:31 +0800 Subject: [PATCH 382/428] change initialization _data from 0 to nullptr. --- cocos/2d/platform/CCImageCommon_cpp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/platform/CCImageCommon_cpp.h b/cocos/2d/platform/CCImageCommon_cpp.h index fa331d313f..40eeca0ae7 100644 --- a/cocos/2d/platform/CCImageCommon_cpp.h +++ b/cocos/2d/platform/CCImageCommon_cpp.h @@ -376,7 +376,7 @@ namespace ////////////////////////////////////////////////////////////////////////// Image::Image() -: _data(0) +: _data(nullptr) , _dataLen(0) , _width(0) , _height(0) From f523c1c2fdc9686e820bdb484a3ae2aeb4bedca7 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 17:12:58 +0800 Subject: [PATCH 383/428] Update AUTHORS [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 2eb0817f4c..f5895c2f29 100644 --- a/AUTHORS +++ b/AUTHORS @@ -356,6 +356,7 @@ Developers: ThePickleMan Adding 'rotationIsDir' property to ParticleSystem. + DrawNode supports to draw triangle, quad bezier, cubic bezier. Jianghua (jxhgzs) Adding an additional transform for CCNode. From ffdfcfbefbd95bbea4ace11256de2f0b0ddb370b Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 17:13:34 +0800 Subject: [PATCH 384/428] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 505c7e208b..420e678c08 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ cocos2d-x-3.0final ?.? ? [FIX] ControlSlider doesn't support to set selected thumb sprite. [FIX] ControlButton doesn't support to set scale ratio of touchdown state. [FIX] Websocket doesn't support send/receive data which larger than 4096 bytes. + [NEW] DrawNode supports to draw triangle, quad bezier, cubic bezier. cocos2d-x-3.0beta Jan.7 2014 [All] [NEW] New label: shadow, outline, glow support From f14bbd59c95cb3df06b7a4c30b553433856b978b Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 17:16:09 +0800 Subject: [PATCH 385/428] Adding clang build for travis ci. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 1e67e468bf..d46929bd03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ env: matrix: - GEN_JSB=YES - PLATFORM=linux DEBUG=1 + - PLATFORM=linux DEBUG=1 CLANG=1 # Since switching to C++11 only the ARM version of the nactive client # port currently builds. TODO(sbc): Re-enable all architectures. # Disabled travis-ci build for native client port since it doesn't support std::thread, std::mutex. From c60681c556cac9093ed6ca9e3efe752e4c75c9cf Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 9 Jan 2014 09:17:11 +0000 Subject: [PATCH 386/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 17d3f11698..f7835c1364 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 17d3f116985b86a820a648927ea1fc5cfe5951d3 +Subproject commit f7835c13644591879f5a995074ccc8faf70c355e From 2cbe502113bd8f972c1811062eb4e651b5fc74a9 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 9 Jan 2014 17:23:22 +0800 Subject: [PATCH 387/428] issue #3643:Lua websocket can't receive more than 64 bytes of data --- .../scripting/lua/bindings/Lua_web_socket.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/cocos/scripting/lua/bindings/Lua_web_socket.cpp b/cocos/scripting/lua/bindings/Lua_web_socket.cpp index 8301c75d8f..4d3b8ae715 100644 --- a/cocos/scripting/lua/bindings/Lua_web_socket.cpp +++ b/cocos/scripting/lua/bindings/Lua_web_socket.cpp @@ -102,18 +102,22 @@ void LuaWebSocket::onMessage(WebSocket* ws, const WebSocket::Data& data) LuaWebSocket* luaWs = dynamic_cast(ws); if (NULL != luaWs) { if (data.isBinary) { - int nHandler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE); - if (0 != nHandler) { - SendBinaryMessageToLua(nHandler, (const unsigned char*)data.bytes, data.len); + int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE); + if (0 != handler) { + SendBinaryMessageToLua(handler, (const unsigned char*)data.bytes, data.len); } } else{ - int nHandler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE); - if (0 != nHandler) { - CommonScriptData commonData(nHandler,data.bytes); - ScriptEvent event(kCommonEvent,(void*)&commonData); - ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE); + if (0 != handler) + { + LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); + if (nullptr != stack) + { + stack->pushString(data.bytes,data.len); + stack->executeFunctionByHandler(handler, 1); + } } } } From c0195015c3aa82cadfdf267dac0b4eddc1cd978c Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 17:26:33 +0800 Subject: [PATCH 388/428] updates CC and CCX env variables --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d46929bd03..bf21d1dcef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ env: matrix: - GEN_JSB=YES - PLATFORM=linux DEBUG=1 - - PLATFORM=linux DEBUG=1 CLANG=1 + - PLATFORM=linux DEBUG=1 CC=/usr/bin/clang CXX=/usr/bin/clang++ # Since switching to C++11 only the ARM version of the nactive client # port currently builds. TODO(sbc): Re-enable all architectures. # Disabled travis-ci build for native client port since it doesn't support std::thread, std::mutex. From 4b4dc160309ac083c6ef89f1406bd3c6c05b354e Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 17:48:08 +0800 Subject: [PATCH 389/428] Exports CC and CXX for gcc and clang. --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bf21d1dcef..762cbcbf06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ language: cpp env: matrix: - GEN_JSB=YES - - PLATFORM=linux DEBUG=1 - - PLATFORM=linux DEBUG=1 CC=/usr/bin/clang CXX=/usr/bin/clang++ + - PLATFORM=linux DEBUG=1 CC_COMPILER=gcc CXX_COMPILER=g++ + - PLATFORM=linux DEBUG=1 CC_COMPILER=clang CXX_COMPILER=clang++ # Since switching to C++11 only the ARM version of the nactive client # port currently builds. TODO(sbc): Re-enable all architectures. # Disabled travis-ci build for native client port since it doesn't support std::thread, std::mutex. @@ -24,6 +24,8 @@ env: 9lV+vgJQDRcFe7dKwtC86vk10EU7Ym2bhVmhMxi/AlmJXgavjmPVdizRT7rh X2Ry/Nb6hGRkH3WS0T3D/KG1+e7lP/TMB9bvo6/locLJ2A6Z1YI= script: +- export CC=$CC_COMPILER +- export CXX=$CXX_COMPILER - tools/travis-scripts/run-script.sh before_install: - tools/travis-scripts/before-install.sh From 4dbb0ee1e878da1d1da986455f601355c936f2e2 Mon Sep 17 00:00:00 2001 From: WuHuan Date: Thu, 9 Jan 2014 17:48:37 +0800 Subject: [PATCH 390/428] mingw console --- cocos/base/CCConsole.cpp | 4 +--- samples/Cpp/TestCpp/CMakeLists.txt | 12 +++++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index f876b4ad48..6eb9256a67 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -102,9 +102,7 @@ static const char* inet_ntop(int af, const void* src, char* dst, int cnt) srcaddr.sin_family = af; if (WSAAddressToString((struct sockaddr*) &srcaddr, sizeof(struct sockaddr_in), 0, dst, (LPDWORD) &cnt) != 0) { - DWORD rv = WSAGetLastError(); - printf("WSAAddressToString() : %d\n",rv); - return NULL; + return nullptr; } return dst; } diff --git a/samples/Cpp/TestCpp/CMakeLists.txt b/samples/Cpp/TestCpp/CMakeLists.txt index 2c3fc4033e..155ad7a2ae 100644 --- a/samples/Cpp/TestCpp/CMakeLists.txt +++ b/samples/Cpp/TestCpp/CMakeLists.txt @@ -1,5 +1,15 @@ set(APP_NAME testcpp) +if(WIN32) + set(PLATFORM_SRC + proj.win32/main.cpp + ) +else() + set(PLATFORM_SRC + proj.linux/main.cpp + ) +endif() + set(SAMPLE_SRC Classes/AccelerometerTest/AccelerometerTest.cpp Classes/ActionManagerTest/ActionManagerTest.cpp @@ -136,7 +146,7 @@ set(SAMPLE_SRC Classes/AppDelegate.cpp Classes/BaseTest.cpp Classes/VisibleRect.cpp - proj.linux/main.cpp + ${PLATFORM_SRC} ) include_directories( From 2e4c76a5d7e4d987d5d967a6a7ad898f09ba0e12 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 18:34:04 +0800 Subject: [PATCH 391/428] closed #3644: Keyboard pressed events are being repeatedly fired before keyboard is released. --- cocos/2d/platform/linux/CCEGLView.cpp | 9 ++++++--- cocos/2d/platform/mac/CCEGLView.mm | 9 ++++++--- cocos/2d/platform/win32/CCEGLView.cpp | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/cocos/2d/platform/linux/CCEGLView.cpp b/cocos/2d/platform/linux/CCEGLView.cpp index 2cab145265..ac410b2f74 100644 --- a/cocos/2d/platform/linux/CCEGLView.cpp +++ b/cocos/2d/platform/linux/CCEGLView.cpp @@ -274,9 +274,12 @@ void EGLViewEventHandler::OnGLFWMouseScrollCallback(GLFWwindow* window, double x void EGLViewEventHandler::OnGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) { - EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action || GLFW_REPEAT == action); - auto dispatcher = Director::getInstance()->getEventDispatcher(); - dispatcher->dispatchEvent(&event); + if (GLFW_REPEAT != action) + { + EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action); + auto dispatcher = Director::getInstance()->getEventDispatcher(); + dispatcher->dispatchEvent(&event); + } } void EGLViewEventHandler::OnGLFWCharCallback(GLFWwindow *window, unsigned int character) diff --git a/cocos/2d/platform/mac/CCEGLView.mm b/cocos/2d/platform/mac/CCEGLView.mm index 920212e5f5..afd9c66b92 100644 --- a/cocos/2d/platform/mac/CCEGLView.mm +++ b/cocos/2d/platform/mac/CCEGLView.mm @@ -279,9 +279,12 @@ void EGLViewEventHandler::OnGLFWMouseScrollCallback(GLFWwindow* window, double x void EGLViewEventHandler::OnGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) { - EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action || GLFW_REPEAT == action); - auto dispatcher = Director::getInstance()->getEventDispatcher(); - dispatcher->dispatchEvent(&event); + if (GLFW_REPEAT != action) + { + EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action); + auto dispatcher = Director::getInstance()->getEventDispatcher(); + dispatcher->dispatchEvent(&event); + } } void EGLViewEventHandler::OnGLFWCharCallback(GLFWwindow *window, unsigned int character) diff --git a/cocos/2d/platform/win32/CCEGLView.cpp b/cocos/2d/platform/win32/CCEGLView.cpp index 953dede055..b6a7c5e62b 100644 --- a/cocos/2d/platform/win32/CCEGLView.cpp +++ b/cocos/2d/platform/win32/CCEGLView.cpp @@ -374,9 +374,12 @@ void EGLViewEventHandler::OnGLFWMouseScrollCallback(GLFWwindow* window, double x void EGLViewEventHandler::OnGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) { - EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action || GLFW_REPEAT == action); - auto dispatcher = Director::getInstance()->getEventDispatcher(); - dispatcher->dispatchEvent(&event); + if (GLFW_REPEAT != action) + { + EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action); + auto dispatcher = Director::getInstance()->getEventDispatcher(); + dispatcher->dispatchEvent(&event); + } } void EGLViewEventHandler::OnGLFWCharCallback(GLFWwindow *window, unsigned int character) From c3b7a9645ae805232bba9edfe3bd41d4e6d6adea Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Thu, 9 Jan 2014 19:00:47 +0800 Subject: [PATCH 392/428] Fixed bugs of "anchor point" and "update" --- cocos/gui/UILayout.cpp | 11 +++++++++ cocos/gui/UILayout.h | 2 ++ cocos/gui/UIPageView.cpp | 2 +- cocos/gui/UIScrollView.cpp | 7 +----- cocos/gui/UIScrollView.h | 3 --- cocos/gui/UITextField.cpp | 2 +- cocos/gui/UIWidget.cpp | 49 ++++++++------------------------------ cocos/gui/UIWidget.h | 21 +--------------- 8 files changed, 27 insertions(+), 70 deletions(-) diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index fcdb4fb621..e4c9c1f66f 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -156,6 +156,17 @@ bool Layout::isClippingEnabled() return _clippingEnabled; } +bool Layout::hitTest(const Point &pt) +{ + Point nsp = convertToNodeSpace(pt); + Rect bb = Rect(0.0f, 0.0f, _size.width, _size.height); + if (nsp.x >= bb.origin.x && nsp.x <= bb.origin.x + bb.size.width && nsp.y >= bb.origin.y && nsp.y <= bb.origin.y + bb.size.height) + { + return true; + } + return false; +} + void Layout::visit() { if (!_enabled) diff --git a/cocos/gui/UILayout.h b/cocos/gui/UILayout.h index 2595cf125e..fffb6aaad1 100644 --- a/cocos/gui/UILayout.h +++ b/cocos/gui/UILayout.h @@ -217,6 +217,8 @@ public: virtual void onEnter() override; virtual void onExit() override; + + virtual bool hitTest(const Point &pt); protected: //override "init" method of widget. virtual bool init() override; diff --git a/cocos/gui/UIPageView.cpp b/cocos/gui/UIPageView.cpp index 2ad5a8c533..cc265a7f89 100644 --- a/cocos/gui/UIPageView.cpp +++ b/cocos/gui/UIPageView.cpp @@ -70,7 +70,7 @@ PageView* PageView::create() void PageView::onEnter() { Layout::onEnter(); - setUpdateEnabled(true); + scheduleUpdate(); } bool PageView::init() diff --git a/cocos/gui/UIScrollView.cpp b/cocos/gui/UIScrollView.cpp index 33dee12004..8bb23aae8d 100644 --- a/cocos/gui/UIScrollView.cpp +++ b/cocos/gui/UIScrollView.cpp @@ -97,7 +97,7 @@ ScrollView* ScrollView::create() void ScrollView::onEnter() { Layout::onEnter(); - setUpdateEnabled(true); + scheduleUpdate(); } bool ScrollView::init() @@ -1457,11 +1457,6 @@ void ScrollView::onTouchCancelled(Touch *touch, Event *unusedEvent) handleReleaseLogic(touch->getLocation()); } -void ScrollView::onTouchLongClicked(const Point &touchPoint) -{ - -} - void ScrollView::update(float dt) { if (_autoScroll) diff --git a/cocos/gui/UIScrollView.h b/cocos/gui/UIScrollView.h index 9a0a9f889b..ae49fa02ea 100644 --- a/cocos/gui/UIScrollView.h +++ b/cocos/gui/UIScrollView.h @@ -279,9 +279,6 @@ public: virtual void onTouchEnded(Touch *touch, Event *unusedEvent) override; virtual void onTouchCancelled(Touch *touch, Event *unusedEvent) override; - //override "onTouchLongClicked" method of widget. - virtual void onTouchLongClicked(const Point &touchPoint) override; - virtual void update(float dt) override; void setBounceEnabled(bool enabled); diff --git a/cocos/gui/UITextField.cpp b/cocos/gui/UITextField.cpp index 95f5ccaea6..c463293006 100644 --- a/cocos/gui/UITextField.cpp +++ b/cocos/gui/UITextField.cpp @@ -304,7 +304,7 @@ TextField* TextField::create() void TextField::onEnter() { Widget::onEnter(); - setUpdateEnabled(true); + scheduleUpdate(); } void TextField::initRenderer() diff --git a/cocos/gui/UIWidget.cpp b/cocos/gui/UIWidget.cpp index f0a8c1dba9..e28f4d8db0 100644 --- a/cocos/gui/UIWidget.cpp +++ b/cocos/gui/UIWidget.cpp @@ -37,7 +37,6 @@ _touchEnabled(false), _touchPassedEnabled(false), _focus(false), _brightStyle(BRIGHT_NONE), -_updateEnabled(false), _touchStartPos(Point::ZERO), _touchMovePos(Point::ZERO), _touchEndPos(Point::ZERO), @@ -105,6 +104,7 @@ void Widget::onEnter() void Widget::onExit() { + unscheduleUpdate(); Node::onExit(); } @@ -623,28 +623,6 @@ bool Widget::isTouchEnabled() const return _touchEnabled; } -void Widget::setUpdateEnabled(bool enable) -{ - if (enable == _updateEnabled) - { - return; - } - _updateEnabled = enable; - if (enable) - { - scheduleUpdate(); - } - else - { - unscheduleUpdate(); - } -} - -bool Widget::isUpdateEnabled() -{ - return _updateEnabled; -} - bool Widget::isFocused() const { return _focus; @@ -730,11 +708,15 @@ void Widget::didNotSelectSelf() bool Widget::onTouchBegan(Touch *touch, Event *unusedEvent) { - _touchStartPos = touch->getLocation(); - _hitted = isEnabled() - & isTouchEnabled() - & hitTest(_touchStartPos) - & clippingParentAreaContainPoint(_touchStartPos); + _hitted = false; + if (isEnabled() && isTouchEnabled()) + { + _touchStartPos = touch->getLocation(); + if(hitTest(_touchStartPos) && clippingParentAreaContainPoint(_touchStartPos)) + { + _hitted = true; + } + } if (!_hitted) { return false; @@ -787,11 +769,6 @@ void Widget::onTouchCancelled(Touch *touch, Event *unusedEvent) cancelUpEvent(); } -void Widget::onTouchLongClicked(const Point &touchPoint) -{ - longClickEvent(); -} - void Widget::pushDownEvent() { if (_touchEventListener && _touchEventSelector) @@ -824,11 +801,6 @@ void Widget::cancelUpEvent() } } -void Widget::longClickEvent() -{ - -} - void Widget::addTouchEventListener(Object *target, SEL_TouchEvent selector) { _touchEventListener = target; @@ -1069,7 +1041,6 @@ void Widget::copyProperties(Widget *widget) setTouchEnabled(widget->isTouchEnabled()); _touchPassedEnabled = false; setZOrder(widget->getZOrder()); - setUpdateEnabled(widget->isUpdateEnabled()); setTag(widget->getTag()); setName(widget->getName()); setActionTag(widget->getActionTag()); diff --git a/cocos/gui/UIWidget.h b/cocos/gui/UIWidget.h index c0d664d634..d07bc4bee8 100644 --- a/cocos/gui/UIWidget.h +++ b/cocos/gui/UIWidget.h @@ -550,14 +550,7 @@ public: virtual void onTouchMoved(Touch *touch, Event *unusedEvent); virtual void onTouchEnded(Touch *touch, Event *unusedEvent); virtual void onTouchCancelled(Touch *touch, Event *unusedEvent); - - /** - * A call back function called when widget is selected, and on touch long clicked. - * - * @param touch point - */ - virtual void onTouchLongClicked(const Point &touchPoint); - + /** * Sets a LayoutParameter to widget. * @@ -610,16 +603,6 @@ public: */ virtual Node* getVirtualRenderer(); - /** - * Schedules the "update" method. - */ - void setUpdateEnabled(bool enable); - - /** - * is the "update" method scheduled. - */ - bool isUpdateEnabled(); - /** * Gets the content size of widget. * @@ -664,7 +647,6 @@ protected: void moveEvent(); void releaseUpEvent(); void cancelUpEvent(); - void longClickEvent(); void updateAnchorPoint(); void copyProperties(Widget* model); virtual Widget* createCloneInstance(); @@ -678,7 +660,6 @@ protected: bool _touchPassedEnabled; ///< is the touch event should be passed bool _focus; ///< is the widget on focus BrightStyle _brightStyle; ///< bright style - bool _updateEnabled; ///< is "update" method scheduled Point _touchStartPos; ///< touch began point Point _touchMovePos; ///< touch moved point Point _touchEndPos; ///< touch ended point From f87af9e9986bf4f25305c5a84ce10ad4f0bf201c Mon Sep 17 00:00:00 2001 From: WuHuan Date: Thu, 9 Jan 2014 19:49:11 +0800 Subject: [PATCH 393/428] fix linux build --- cocos/network/CMakeLists.txt | 13 +++++++++++-- samples/Cpp/TestCpp/CMakeLists.txt | 6 +++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cocos/network/CMakeLists.txt b/cocos/network/CMakeLists.txt index ac1088485c..e57b04ccf9 100644 --- a/cocos/network/CMakeLists.txt +++ b/cocos/network/CMakeLists.txt @@ -1,7 +1,16 @@ +if(WIN32) + set(PLATFORM_SRC + WebSocket.cpp + ) + set(PLATFORM_LINK + websockets + ) +endif() + set(NETWORK_SRC HttpClient.cpp SocketIO.cpp - WebSocket.cpp + ${PLATFORM_SRC} ) add_library(network STATIC @@ -10,7 +19,7 @@ add_library(network STATIC target_link_libraries(network curl - websockets + ${PLATFORM_LINK} ) set_target_properties(network diff --git a/samples/Cpp/TestCpp/CMakeLists.txt b/samples/Cpp/TestCpp/CMakeLists.txt index 155ad7a2ae..5f409f7601 100644 --- a/samples/Cpp/TestCpp/CMakeLists.txt +++ b/samples/Cpp/TestCpp/CMakeLists.txt @@ -2,6 +2,9 @@ set(APP_NAME testcpp) if(WIN32) set(PLATFORM_SRC + Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp + Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp + Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp proj.win32/main.cpp ) else() @@ -60,10 +63,7 @@ set(SAMPLE_SRC Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp Classes/ExtensionsTest/ExtensionsTest.cpp Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp - Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp - Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp - Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp From d13612ef32efdaf054d43cb05d4f5c1ee1516447 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 9 Jan 2014 11:38:44 -0800 Subject: [PATCH 394/428] Improves description in camera test --- samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp index 5c2534dee0..8ea66b04b7 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp @@ -852,6 +852,7 @@ public: protected: CustomCommand _customCommand; + }; void MySprite::draw() @@ -928,7 +929,7 @@ std::string CameraTest2::title() const std::string CameraTest2::subtitle() const { - return "Background image should be rotated in 3D"; + return "Both images should look the same"; } void CameraTest2::update(float dt) @@ -948,6 +949,7 @@ void CameraTest2::update(float dt) } /// +/// main /// void CocosNodeTestScene::runThisTest() { From 1dc169b19f170e69c1c28c28b62a903831c1d4c4 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 9 Jan 2014 14:26:22 -0800 Subject: [PATCH 395/428] Camera is working again Projection is passed in the shader. Since P is in the shader, QuadCommand uses `Vec3Transform` instead of `Vec3TransformCoord` since it is faster. --- .../2d/ccShader_PositionTextureColor_noMVP_vert.h | 2 +- cocos/2d/renderer/CCQuadCommand.cpp | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/cocos/2d/ccShader_PositionTextureColor_noMVP_vert.h b/cocos/2d/ccShader_PositionTextureColor_noMVP_vert.h index fb511ba1dd..bae95bcfea 100644 --- a/cocos/2d/ccShader_PositionTextureColor_noMVP_vert.h +++ b/cocos/2d/ccShader_PositionTextureColor_noMVP_vert.h @@ -38,7 +38,7 @@ varying vec2 v_texCoord; \n\ \n\ void main() \n\ { \n\ - gl_Position = a_position; \n\ + gl_Position = CC_PMatrix * a_position; \n\ v_fragmentColor = a_color; \n\ v_texCoord = a_texCoord; \n\ } \n\ diff --git a/cocos/2d/renderer/CCQuadCommand.cpp b/cocos/2d/renderer/CCQuadCommand.cpp index bbb7ba018c..b69fd075d3 100644 --- a/cocos/2d/renderer/CCQuadCommand.cpp +++ b/cocos/2d/renderer/CCQuadCommand.cpp @@ -58,12 +58,6 @@ void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram* _capacity = quadCount; } - kmMat4 p, mvp; - kmGLGetMatrix(KM_GL_PROJECTION, &p); - - kmMat4Multiply(&mvp, &p, &mv); - - _quadCount = quadCount; memcpy(_quad, quad, sizeof(V3F_C4B_T2F_Quad) * quadCount); @@ -74,7 +68,7 @@ void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram* vec1.x = q->bl.vertices.x; vec1.y = q->bl.vertices.y; vec1.z = q->bl.vertices.z; - kmVec3TransformCoord(&out1, &vec1, &mvp); + kmVec3Transform(&out1, &vec1, &mv); q->bl.vertices.x = out1.x; q->bl.vertices.y = out1.y; q->bl.vertices.z = out1.z; @@ -83,7 +77,7 @@ void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram* vec2.x = q->br.vertices.x; vec2.y = q->br.vertices.y; vec2.z = q->br.vertices.z; - kmVec3TransformCoord(&out2, &vec2, &mvp); + kmVec3Transform(&out2, &vec2, &mv); q->br.vertices.x = out2.x; q->br.vertices.y = out2.y; q->br.vertices.z = out2.z; @@ -92,7 +86,7 @@ void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram* vec3.x = q->tr.vertices.x; vec3.y = q->tr.vertices.y; vec3.z = q->tr.vertices.z; - kmVec3TransformCoord(&out3, &vec3, &mvp); + kmVec3Transform(&out3, &vec3, &mv); q->tr.vertices.x = out3.x; q->tr.vertices.y = out3.y; q->tr.vertices.z = out3.z; @@ -101,7 +95,7 @@ void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram* vec4.x = q->tl.vertices.x; vec4.y = q->tl.vertices.y; vec4.z = q->tl.vertices.z; - kmVec3TransformCoord(&out4, &vec4, &mvp); + kmVec3Transform(&out4, &vec4, &mv); q->tl.vertices.x = out4.x; q->tl.vertices.y = out4.y; q->tl.vertices.z = out4.z; From 95b7196a2a26ee71b2424444bc95a86657b7f094 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 9 Jan 2014 14:26:36 -0800 Subject: [PATCH 396/428] Adds more tests cases for Node Adds more tests cases for Node --- .../Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp | 114 +++++++++++++++++- .../Cpp/TestCpp/Classes/NodeTest/NodeTest.h | 27 ++++- 2 files changed, 134 insertions(+), 7 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp index 8ea66b04b7..843b72bbb6 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp @@ -25,6 +25,7 @@ static int sceneIdx = -1; static std::function createFunctions[] = { + CL(CameraTest1), CL(CameraTest2), CL(CameraCenterTest), CL(Test2), @@ -34,6 +35,7 @@ static std::function createFunctions[] = CL(StressTest1), CL(StressTest2), CL(NodeToWorld), + CL(NodeToWorld3D), CL(SchedulerTest1), CL(CameraOrbitTest), CL(CameraZoomTest), @@ -492,6 +494,56 @@ std::string NodeToWorld::title() const return "nodeToParent transform"; } +//------------------------------------------------------------------ +// +// NodeToWorld3D +// +//------------------------------------------------------------------ +NodeToWorld3D::NodeToWorld3D() +{ + // + // This code tests that nodeToParent works OK: + // - It tests different anchor Points + // - It tests different children anchor points + + Size s = Director::getInstance()->getWinSize(); + auto parent = Node::create(); + parent->setContentSize(s); + parent->setAnchorPoint(Point(0.5, 0.5)); + parent->setPosition(s.width/2, s.height/2); + this->addChild(parent); + + auto back = Sprite::create(s_back3); + parent->addChild( back, -10); + back->setAnchorPoint( Point(0,0) ); + auto backSize = back->getContentSize(); + + auto item = MenuItemImage::create(s_PlayNormal, s_PlaySelect); + auto menu = Menu::create(item, NULL); + menu->alignItemsVertically(); + menu->setPosition( Point(backSize.width/2, backSize.height/2)); + back->addChild(menu); + + auto rot = RotateBy::create(5, 360); + auto fe = RepeatForever::create( rot); + item->runAction( fe ); + + auto move = MoveBy::create(3, Point(200,0)); + auto move_back = move->reverse(); + auto seq = Sequence::create( move, move_back, NULL); + auto fe2 = RepeatForever::create(seq); + back->runAction(fe2); + + auto orbit = OrbitCamera::create(10, 0, 1, 0, 360, 0, 90); + parent->runAction(orbit); +} + +std::string NodeToWorld3D::title() const +{ + return "nodeToParent transform in 3D"; +} + + //------------------------------------------------------------------ // // CameraOrbitTest @@ -828,12 +880,10 @@ std::string NodeNonOpaqueTest::subtitle() const return "Node rendered with GL_BLEND enabled"; } -//------------------------------------------------------------------ -// -// CameraTest2 -// -//------------------------------------------------------------------ +// +// MySprite: Used by CameraTest1 and CameraTest2 +// class MySprite : public Sprite { public: @@ -852,7 +902,7 @@ public: protected: CustomCommand _customCommand; - + }; void MySprite::draw() @@ -892,6 +942,58 @@ void MySprite::onDraw() CHECK_GL_ERROR_DEBUG(); CC_INCREMENT_GL_DRAWS(1); } +//------------------------------------------------------------------ +// +// CameraTest1 +// +//------------------------------------------------------------------ + +void CameraTest1::onEnter() +{ + TestCocosNodeDemo::onEnter(); + Director::getInstance()->setProjection(Director::Projection::_3D); + Director::getInstance()->setDepthTest(true); +} + +void CameraTest1::onExit() +{ + Director::getInstance()->setProjection(Director::Projection::_2D); + TestCocosNodeDemo::onExit(); +} + +CameraTest1::CameraTest1() +{ + auto s = Director::getInstance()->getWinSize(); + + _sprite1 = MySprite::create(s_back3); + addChild( _sprite1 ); + _sprite1->setPosition( Point(1*s.width/4, s.height/2) ); + _sprite1->setScale(0.5); + + _sprite2 = Sprite::create(s_back3); + addChild( _sprite2 ); + _sprite2->setPosition( Point(3*s.width/4, s.height/2) ); + _sprite2->setScale(0.5); + + auto camera = OrbitCamera::create(10, 0, 1, 0, 360, 0, 0); + _sprite1->runAction( camera ); + _sprite2->runAction( camera->clone() ); +} + +std::string CameraTest1::title() const +{ + return "Camera Test 1"; +} + +std::string CameraTest1::subtitle() const +{ + return "Both images should rotate with a 3D effect"; +} +//------------------------------------------------------------------ +// +// CameraTest2 +// +//------------------------------------------------------------------ void CameraTest2::onEnter() { TestCocosNodeDemo::onEnter(); diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h index 50959ced5a..7a6a63d7c2 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h @@ -110,6 +110,16 @@ protected: NodeToWorld(); }; +class NodeToWorld3D : public TestCocosNodeDemo +{ +public: + CREATE_FUNC(NodeToWorld3D); + virtual std::string title() const override; + +protected: + NodeToWorld3D(); +}; + class CameraOrbitTest : public TestCocosNodeDemo { public: @@ -148,6 +158,22 @@ protected: CameraCenterTest(); }; +class CameraTest1 : public TestCocosNodeDemo +{ +public: + CREATE_FUNC(CameraTest1); + virtual std::string title() const override; + virtual std::string subtitle() const override; + virtual void onEnter() override; + virtual void onExit() override; + +protected: + CameraTest1(); + + Sprite *_sprite1; + Sprite *_sprite2; +}; + class CameraTest2 : public TestCocosNodeDemo { public: @@ -163,7 +189,6 @@ protected: Sprite *_sprite1; Sprite *_sprite2; - }; class ConvertToNode : public TestCocosNodeDemo From a1629a09e8bfce94399b36b9cfa2b61caf4d94f7 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Fri, 10 Jan 2014 10:03:47 +0800 Subject: [PATCH 397/428] fix layerColor bug for shader change --- cocos/2d/CCLayer.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index b8b69f0976..1bae6e040c 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -569,16 +569,11 @@ void LayerColor::draw() _customCommand.func = CC_CALLBACK_0(LayerColor::onDraw, this); Director::getInstance()->getRenderer()->addCommand(&_customCommand); - kmMat4 p, mvp; - kmGLGetMatrix(KM_GL_PROJECTION, &p); - kmGLGetMatrix(KM_GL_MODELVIEW, &mvp); - kmMat4Multiply(&mvp, &p, &mvp); - for(int i = 0; i < 4; ++i) { kmVec3 pos; pos.x = _squareVertices[i].x; pos.y = _squareVertices[i].y; pos.z = _vertexZ; - kmVec3TransformCoord(&pos, &pos, &mvp); + kmVec3TransformCoord(&pos, &pos, &_modelViewTransform); _noMVPVertices[i] = Vertex3F(pos.x,pos.y,pos.z); } From 8b350cb20ab80c16ad8c86b2d4e8b06c6854a94a Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 10 Jan 2014 03:14:18 +0000 Subject: [PATCH 398/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index f7835c1364..f893f6202c 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit f7835c13644591879f5a995074ccc8faf70c355e +Subproject commit f893f6202c6f249f52660876278a1742ba12aefa From 16367b75944b729543241eed867e3b234c9802a4 Mon Sep 17 00:00:00 2001 From: WuHuan Date: Fri, 10 Jan 2014 14:20:00 +0800 Subject: [PATCH 399/428] solve conflicted with math.h isnan --- cocos/2d/CCActionCamera.cpp | 6 +++--- cocos/2d/platform/win32/CCStdC.h | 5 +++++ extensions/GUI/CCControlExtension/CCControlUtils.cpp | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cocos/2d/CCActionCamera.cpp b/cocos/2d/CCActionCamera.cpp index fc05435e3b..c044bdd21a 100644 --- a/cocos/2d/CCActionCamera.cpp +++ b/cocos/2d/CCActionCamera.cpp @@ -182,11 +182,11 @@ void OrbitCamera::startWithTarget(Node *target) float r, zenith, azimuth; this->sphericalRadius(&r, &zenith, &azimuth); - if( std::isnan(_radius) ) + if( isnan(_radius) ) _radius = r; - if( std::isnan(_angleZ) ) + if( isnan(_angleZ) ) _angleZ = (float)CC_RADIANS_TO_DEGREES(zenith); - if( std::isnan(_angleX) ) + if( isnan(_angleX) ) _angleX = (float)CC_RADIANS_TO_DEGREES(azimuth); _radZ = (float)CC_DEGREES_TO_RADIANS(_angleZ); diff --git a/cocos/2d/platform/win32/CCStdC.h b/cocos/2d/platform/win32/CCStdC.h index b477ec575f..19ea8fda7d 100644 --- a/cocos/2d/platform/win32/CCStdC.h +++ b/cocos/2d/platform/win32/CCStdC.h @@ -109,8 +109,13 @@ NS_CC_END #else +#undef _WINSOCKAPI_ #include +// Conflicted with math.h isnan +#include +using std::isnan; + inline int vsnprintf_s(char *buffer, size_t sizeOfBuffer, size_t count, const char *format, va_list argptr) { return vsnprintf(buffer, sizeOfBuffer, format, argptr); diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.cpp b/extensions/GUI/CCControlExtension/CCControlUtils.cpp index 75d246796d..e660a29d8e 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.cpp +++ b/extensions/GUI/CCControlExtension/CCControlUtils.cpp @@ -92,7 +92,7 @@ RGBA ControlUtils::RGBfromHSV(HSV value) if (value.s <= 0.0) // < is bogus, just shuts up warnings { - if (std::isnan(value.h)) // value.h == NAN + if (isnan(value.h)) // value.h == NAN { out.r = value.v; out.g = value.v; From 4d873edff1018178a1c5b24489581aa69aff2bf5 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 10 Jan 2014 15:15:19 +0800 Subject: [PATCH 400/428] Update AUTHORS [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index f5895c2f29..ac01d86aa8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -711,6 +711,9 @@ Developers: v1ctor ControlSlider supports to set selected thumb sprite. ControlButton supports to set scale ratio of touchdown state + + akof1314 + TestCpp works by using CMake and mingw on Windows. Retired Core Developers: WenSheng Yang From 245fa2efe066634f92f4fec665484c56fcfa6713 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 10 Jan 2014 15:19:32 +0800 Subject: [PATCH 401/428] Update CHANGELOG [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 420e678c08..a16751e56c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ cocos2d-x-3.0final ?.? ? [FIX] ControlButton doesn't support to set scale ratio of touchdown state. [FIX] Websocket doesn't support send/receive data which larger than 4096 bytes. [NEW] DrawNode supports to draw triangle, quad bezier, cubic bezier. + [FIX] TestCpp works by using CMake on Windows. cocos2d-x-3.0beta Jan.7 2014 [All] [NEW] New label: shadow, outline, glow support From b4a4b70e22ee76a7596839928c7f8d81364b2189 Mon Sep 17 00:00:00 2001 From: heliclei Date: Fri, 10 Jan 2014 17:45:28 +0800 Subject: [PATCH 402/428] rename ghprb.py to pull-request-builder.py --- tools/jenkins-scripts/{ghprb.py => pull-request-builder.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/jenkins-scripts/{ghprb.py => pull-request-builder.py} (100%) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/pull-request-builder.py similarity index 100% rename from tools/jenkins-scripts/ghprb.py rename to tools/jenkins-scripts/pull-request-builder.py From 2a6b9fe08e72b5805940098fb6f0a854920f962e Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 10 Jan 2014 17:11:14 -0800 Subject: [PATCH 403/428] Console is a property of Director. By doing this, the console lives as much as the Director. And the Console is not started until the method "listenOnPort" is called. --- cocos/2d/CCDirector.cpp | 53 ++----------------- cocos/2d/CCDirector.h | 25 +++++---- cocos/base/CCConsole.cpp | 18 +++---- cocos/base/CCConsole.h | 20 ++++--- .../Classes/ConsoleTest/ConsoleTest.cpp | 8 +-- 5 files changed, 39 insertions(+), 85 deletions(-) diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index 428772a367..a0c42973e2 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -61,6 +61,7 @@ THE SOFTWARE. #include "CCEventCustom.h" #include "CCFontFreeType.h" #include "CCRenderer.h" +#include "CCConsole.h" #include "renderer/CCFrustum.h" /** Position of the FPS @@ -116,9 +117,6 @@ bool Director::init(void) _scenesStack.reserve(15); - // projection delegate if "Custom" projection is used - _projectionDelegate = nullptr; - // FPS _accumDt = 0.0f; _frameRate = 0.0f; @@ -163,8 +161,8 @@ bool Director::init(void) //init TextureCache initTextureCache(); - // Renderer _renderer = new Renderer; + _console = new Console; // create autorelease pool PoolManager::sharedPoolManager()->push(); @@ -192,6 +190,7 @@ Director::~Director(void) delete _eventProjectionChanged; delete _renderer; + delete _console; // pop the autorelease pool PoolManager::sharedPoolManager()->pop(); @@ -483,9 +482,8 @@ void Director::setProjection(Projection projection) } case Projection::CUSTOM: - if (_projectionDelegate) - _projectionDelegate->updateProjection(); - + // Projection Delegate is no longer needed + // since the event "PROJECTION CHANGED" is emitted break; default: @@ -973,11 +971,6 @@ void Director::createStatsLabel() _FPSLabel->setPosition(CC_DIRECTOR_STATS_POSITION); } -float Director::getContentScaleFactor() const -{ - return _contentScaleFactor; -} - void Director::setContentScaleFactor(float scaleFactor) { if (scaleFactor != _contentScaleFactor) @@ -987,11 +980,6 @@ void Director::setContentScaleFactor(float scaleFactor) } } -Node* Director::getNotificationNode() -{ - return _notificationNode; -} - void Director::setNotificationNode(Node *node) { CC_SAFE_RELEASE(_notificationNode); @@ -999,16 +987,6 @@ void Director::setNotificationNode(Node *node) CC_SAFE_RETAIN(_notificationNode); } -DirectorDelegate* Director::getDelegate() const -{ - return _projectionDelegate; -} - -void Director::setDelegate(DirectorDelegate* delegate) -{ - _projectionDelegate = delegate; -} - void Director::setScheduler(Scheduler* scheduler) { if (_scheduler != scheduler) @@ -1019,11 +997,6 @@ void Director::setScheduler(Scheduler* scheduler) } } -Scheduler* Director::getScheduler() const -{ - return _scheduler; -} - void Director::setActionManager(ActionManager* actionManager) { if (_actionManager != actionManager) @@ -1034,16 +1007,6 @@ void Director::setActionManager(ActionManager* actionManager) } } -ActionManager* Director::getActionManager() const -{ - return _actionManager; -} - -EventDispatcher* Director::getEventDispatcher() const -{ - return _eventDispatcher; -} - void Director::setEventDispatcher(EventDispatcher* dispatcher) { if (_eventDispatcher != dispatcher) @@ -1054,12 +1017,6 @@ void Director::setEventDispatcher(EventDispatcher* dispatcher) } } -Renderer* Director::getRenderer() const -{ - return _renderer; -} - - /*************************************************** * implementation of DisplayLinkDirector **************************************************/ diff --git a/cocos/2d/CCDirector.h b/cocos/2d/CCDirector.h index 10f46bb539..17616ec408 100644 --- a/cocos/2d/CCDirector.h +++ b/cocos/2d/CCDirector.h @@ -60,6 +60,7 @@ class EventListenerCustom; class TextureCache; class Frustum; class Renderer; +class Console; /** @brief Class that creates and handles the main Window and manages how @@ -186,7 +187,7 @@ public: Useful to hook a notification object, like Notifications (http://github.com/manucorporat/CCNotifications) @since v0.99.5 */ - Node* getNotificationNode(); + Node* getNotificationNode() const { return _notificationNode; } void setNotificationNode(Node *node); /** Director delegate. It shall implement the DirectorDelegate protocol @@ -340,7 +341,7 @@ public: @since v0.99.4 */ void setContentScaleFactor(float scaleFactor); - float getContentScaleFactor() const; + float getContentScaleFactor() const { return _contentScaleFactor; } /** Get the Culling Frustum @@ -351,7 +352,7 @@ public: /** Gets the Scheduler associated with this director @since v2.0 */ - Scheduler* getScheduler() const; + Scheduler* getScheduler() const { return _scheduler; } /** Sets the Scheduler associated with this director @since v2.0 @@ -361,7 +362,7 @@ public: /** Gets the ActionManager associated with this director @since v2.0 */ - ActionManager* getActionManager() const; + ActionManager* getActionManager() const { return _actionManager; } /** Sets the ActionManager associated with this director @since v2.0 @@ -371,7 +372,7 @@ public: /** Gets the EventDispatcher associated with this director @since v3.0 */ - EventDispatcher* getEventDispatcher() const; + EventDispatcher* getEventDispatcher() const { return _eventDispatcher; } /** Sets the EventDispatcher associated with this director @since v3.0 @@ -381,7 +382,12 @@ public: /** Returns the Renderer @since v3.0 */ - Renderer* getRenderer() const; + Renderer* getRenderer() const { return _renderer; } + + /** Returns the Console + @since v3.0 + */ + Console* getConsole() const { return _console; } /* Gets delta time since last tick to main loop */ float getDeltaTime() const; @@ -492,10 +498,11 @@ protected: /* This object will be visited after the scene. Useful to hook a notification node */ Node *_notificationNode; - /* Projection protocol delegate */ - DirectorDelegate *_projectionDelegate; - + /* Renderer for the Director */ Renderer *_renderer; + + /* Console for the director */ + Console *_console; // EGLViewProtocol will recreate stats labels to fit visible rect friend class EGLViewProtocol; diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 6eb9256a67..de7af36737 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -112,14 +112,6 @@ static const char* inet_ntop(int af, const void* src, char* dst, int cnt) // Console code // -Console* Console::create() -{ - auto ret = new Console; - - ret->autorelease(); - return ret; -} - Console::Console() : _listenfd(-1) , _running(false) @@ -152,7 +144,7 @@ Console::Console() Console::~Console() { - cancel(); + stop(); } bool Console::listenOnTCP(int port) @@ -226,14 +218,18 @@ bool Console::listenOnTCP(int port) bool Console::listenOnFileDescriptor(int fd) { - CCASSERT(!_running, "already running"); + if(_running) { + cocos2d::log("Console already started. 'stop' it before calling 'listen' again"); + return false; + } + _listenfd = fd; _thread = std::thread( std::bind( &Console::loop, this) ); return true; } -void Console::cancel() +void Console::stop() { if( _running ) { _endThread = true; diff --git a/cocos/base/CCConsole.h b/cocos/base/CCConsole.h index 1334ec9506..7385d184ee 100644 --- a/cocos/base/CCConsole.h +++ b/cocos/base/CCConsole.h @@ -55,17 +55,19 @@ NS_CC_BEGIN scheduler->performFunctionInCocosThread( ... ); ``` */ -class CC_DLL Console : public Object +class CC_DLL Console { public: - struct Command { const char *name; std::function callback; }; - /** creates a new instnace of the Console */ - static Console* create(); + /** Constructor */ + Console(); + + /** Destructor */ + virtual ~Console(); /** starts listening to specifed TCP port */ bool listenOnTCP(int port); @@ -73,18 +75,14 @@ public: /** starts listening to specifed file descriptor */ bool listenOnFileDescriptor(int fd); - /** cancels the Console. Cancel will be called at destruction time as well */ - void cancel(); + /** stops the Console. 'stop' will be called at destruction time as well */ + void stop(); /** sets user tokens */ void setUserCommands( Command* commands, int numberOfCommands); protected: - Console(); - virtual ~Console(); - void loop(); - ssize_t readline(int fd); bool parseCommand(int fd); void sendPrompt(int fd); @@ -108,7 +106,7 @@ protected: char _buffer[512]; - struct Command _commands[15]; + struct Command _commands[64]; int _maxCommands; struct Command *_userCommands; int _maxUserCommands; diff --git a/samples/Cpp/TestCpp/Classes/ConsoleTest/ConsoleTest.cpp b/samples/Cpp/TestCpp/Classes/ConsoleTest/ConsoleTest.cpp index d5827c25cb..c4269ea2e9 100644 --- a/samples/Cpp/TestCpp/Classes/ConsoleTest/ConsoleTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ConsoleTest/ConsoleTest.cpp @@ -133,13 +133,11 @@ void ConsoleTestScene::runThisTest() ConsoleTCP::ConsoleTCP() { - _console = Console::create(); - _console->retain(); + _console = Director::getInstance()->getConsole(); } ConsoleTCP::~ConsoleTCP() { - _console->release(); } void ConsoleTCP::onEnter() @@ -167,8 +165,7 @@ std::string ConsoleTCP::subtitle() const ConsoleCustomCommand::ConsoleCustomCommand() { - _console = Console::create(); - _console->retain(); + _console = Director::getInstance()->getConsole(); static struct Console::Command commands[] = { {"hello", [](int fd, const char* command) { @@ -183,7 +180,6 @@ ConsoleCustomCommand::ConsoleCustomCommand() ConsoleCustomCommand::~ConsoleCustomCommand() { - _console->release(); } void ConsoleCustomCommand::onEnter() From 2316e4d55f3de50cc713ce132dc63c6f4858c02c Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 10 Jan 2014 17:58:54 -0800 Subject: [PATCH 404/428] Debug messages are forward to the console --- cocos/2d/platform/mac/CCCommon.mm | 6 +- cocos/base/CCConsole.cpp | 116 +++++++++++++++++++----------- cocos/base/CCConsole.h | 11 +++ 3 files changed, 90 insertions(+), 43 deletions(-) diff --git a/cocos/2d/platform/mac/CCCommon.mm b/cocos/2d/platform/mac/CCCommon.mm index 3e6cb32295..a9ff158eaf 100644 --- a/cocos/2d/platform/mac/CCCommon.mm +++ b/cocos/2d/platform/mac/CCCommon.mm @@ -29,6 +29,8 @@ THE SOFTWARE. #include #include #import "EAGLView.h" +#include "CCConsole.h" +#include "CCDirector.h" NS_CC_BEGIN @@ -57,9 +59,11 @@ void log(const char * format, ...) va_start(ap, format); vsnprintf(buf, kMaxLogLen, format, ap); va_end(ap); + strcat(buf, "\n"); printf("%s", buf); - printf("\n"); fflush(stdout); + + Director::getInstance()->getConsole()->log(buf); } diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index de7af36737..e065b8b94b 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -116,27 +116,35 @@ Console::Console() : _listenfd(-1) , _running(false) , _endThread(false) -, _maxCommands(5) , _userCommands(nullptr) , _maxUserCommands(0) +, _sendDebugStrings(false) { // VS2012 doesn't support initializer list, so we create a new array and assign its elements to '_command'. Command commands[] = { - { "fps on", [](int fd, const char* command) { - Director *dir = Director::getInstance(); - Scheduler *sched = dir->getScheduler(); - sched->performFunctionInCocosThread( std::bind(&Director::setDisplayStats, dir, true)); - } }, - { "fps off", [](int fd, const char* command) { - Director *dir = Director::getInstance(); - Scheduler *sched = dir->getScheduler(); - sched->performFunctionInCocosThread( std::bind(&Director::setDisplayStats, dir, false)); - } }, - { "scene graph", std::bind(&Console::commandSceneGraph, this, std::placeholders::_1, std::placeholders::_2) }, - { "exit", std::bind(&Console::commandExit, this, std::placeholders::_1, std::placeholders::_2) }, - { "help", std::bind(&Console::commandHelp, this, std::placeholders::_1, std::placeholders::_2) } }; + { "debug msg on", [&](int fd, const char* command) { + _sendDebugStrings = true; + } }, + { "debug msg off", [&](int fd, const char* command) { + _sendDebugStrings = false; + } }, + { "exit", std::bind(&Console::commandExit, this, std::placeholders::_1, std::placeholders::_2) }, + { "fps on", [](int fd, const char* command) { + Director *dir = Director::getInstance(); + Scheduler *sched = dir->getScheduler(); + sched->performFunctionInCocosThread( std::bind(&Director::setDisplayStats, dir, true)); + } }, + { "fps off", [](int fd, const char* command) { + Director *dir = Director::getInstance(); + Scheduler *sched = dir->getScheduler(); + sched->performFunctionInCocosThread( std::bind(&Director::setDisplayStats, dir, false)); + } }, + { "help", std::bind(&Console::commandHelp, this, std::placeholders::_1, std::placeholders::_2) }, + { "scene graph", std::bind(&Console::commandSceneGraph, this, std::placeholders::_1, std::placeholders::_2) }, + }; - for (size_t i = 0; i < sizeof(commands)/sizeof(commands[0]) && i < sizeof(_commands)/sizeof(_commands[0]); ++i) + _maxCommands = sizeof(commands)/sizeof(commands[0]); + for (size_t i = 0; i < _maxCommands; ++i) { _commands[i] = commands[i]; } @@ -198,14 +206,14 @@ bool Console::listenOnTCP(int port) char buf[INET_ADDRSTRLEN] = ""; struct sockaddr_in *sin = (struct sockaddr_in*) res->ai_addr; if( inet_ntop(res->ai_family, &sin->sin_addr, buf, sizeof(buf)) != NULL ) - log("Console: listening on %s : %d", buf, ntohs(sin->sin_port)); + cocos2d::log("Console: listening on %s : %d", buf, ntohs(sin->sin_port)); else perror("inet_ntop"); } else if (res->ai_family == AF_INET6) { char buf[INET6_ADDRSTRLEN] = ""; struct sockaddr_in6 *sin = (struct sockaddr_in6*) res->ai_addr; if( inet_ntop(res->ai_family, &sin->sin6_addr, buf, sizeof(buf)) != NULL ) - log("Console: listening on %s : %d", buf, ntohs(sin->sin6_port)); + cocos2d::log("Console: listening on %s : %d", buf, ntohs(sin->sin6_port)); else perror("inet_ntop"); } @@ -372,6 +380,15 @@ void Console::addClient() } } +void Console::log(const char* buf) +{ + if( _sendDebugStrings ) { + _DebugStringsMutex.lock(); + _DebugStrings.push_back(buf); + _DebugStringsMutex.unlock(); + } +} + // // Main Loop // @@ -398,40 +415,55 @@ void Console::loop() timeout_copy = timeout; int nready = select(_maxfd+1, ©_set, NULL, NULL, &timeout_copy); - if( nready == -1 ) { - /* error ?*/ + if( nready == -1 ) + { + /* error */ if(errno != EINTR) log("Abnormal error in select()\n"); continue; - - } else if( nready == 0 ) { - /* timeout ? */ - continue; } - - // new client - if(FD_ISSET(_listenfd, ©_set)) { - addClient(); - if(--nready <= 0) - continue; + else if( nready == 0 ) + { + /* timeout. do somethig ? */ } - - // data from client - std::vector to_remove; - for(const auto &fd: _fds) { - if(FD_ISSET(fd,©_set)) { - if( ! parseCommand(fd) ) { - to_remove.push_back(fd); - } + else + { + /* new client */ + if(FD_ISSET(_listenfd, ©_set)) { + addClient(); if(--nready <= 0) - break; + continue; + } + + /* data from client */ + std::vector to_remove; + for(const auto &fd: _fds) { + if(FD_ISSET(fd,©_set)) { + if( ! parseCommand(fd) ) { + to_remove.push_back(fd); + } + if(--nready <= 0) + break; + } + } + + /* remove closed conections */ + for(int fd: to_remove) { + FD_CLR(fd, &_read_set); + _fds.erase(std::remove(_fds.begin(), _fds.end(), fd), _fds.end()); } } - // remove closed conections - for(int fd: to_remove) { - FD_CLR(fd, &_read_set); - _fds.erase(std::remove(_fds.begin(), _fds.end(), fd), _fds.end()); + /* Any message for the remote console ? send it! */ + if( !_DebugStrings.empty() ) { + _DebugStringsMutex.lock(); + for(const auto &str : _DebugStrings) { + for(const auto &fd : _fds) { + write(fd, str.c_str(), str.length()); + } + } + _DebugStrings.clear(); + _DebugStringsMutex.unlock(); } } diff --git a/cocos/base/CCConsole.h b/cocos/base/CCConsole.h index 7385d184ee..158ebde7c8 100644 --- a/cocos/base/CCConsole.h +++ b/cocos/base/CCConsole.h @@ -39,6 +39,8 @@ typedef int ssize_t; #include #include #include +#include +#include #include "ccMacros.h" #include "CCObject.h" @@ -81,6 +83,9 @@ public: /** sets user tokens */ void setUserCommands( Command* commands, int numberOfCommands); + /** log something in the console */ + void log(const char *buf); + protected: void loop(); ssize_t readline(int fd); @@ -111,6 +116,12 @@ protected: struct Command *_userCommands; int _maxUserCommands; + + // strings generated by cocos2d sent to the remote console + bool _sendDebugStrings; + std::mutex _DebugStringsMutex; + std::vector _DebugStrings; + private: CC_DISALLOW_COPY_AND_ASSIGN(Console); }; From c68ad76bfe6102ecdfe29cfd39aa7587dac4b4fd Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 10 Jan 2014 18:11:35 -0800 Subject: [PATCH 405/428] don't send "unknown command". ... if the command is an empty command --- cocos/2d/platform/ios/CCCommon.mm | 6 +++++- cocos/base/CCConsole.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cocos/2d/platform/ios/CCCommon.mm b/cocos/2d/platform/ios/CCCommon.mm index 0afbb57e73..0293d79092 100644 --- a/cocos/2d/platform/ios/CCCommon.mm +++ b/cocos/2d/platform/ios/CCCommon.mm @@ -29,6 +29,8 @@ #include #import +#include "CCDirector.h" +#include "CCConsole.h" NS_CC_BEGIN @@ -53,8 +55,10 @@ void log(const char * format, ...) va_start(ap, format); vsnprintf(buf, kMaxLogLen, format, ap); va_end(ap); + strcat(buf, "\n"); printf("%s", buf); - printf("\n"); + + Director::getInstance()->getConsole()->log(buf); } // ios no MessageBox, use log instead diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index e065b8b94b..919d87f678 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -316,7 +316,7 @@ bool Console::parseCommand(int fd) } } - if(!found) { + if(!found && strcmp(_buffer, "\r\n")!=0) { const char err[] = "Unknown command. Type 'help' for options\n"; write(fd, err, sizeof(err)); } From 9386866d5608d4054ff7b04ef4a6e7d2f1b1034a Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 10 Jan 2014 19:04:07 -0800 Subject: [PATCH 406/428] cocos2d::log() moved to CCConsole Unified console code since it is 90% similar to all platforms --- cocos/2d/ccMacros.h | 2 +- cocos/2d/ccUTF8.cpp | 1 + cocos/2d/platform/CCCommon.h | 8 ---- cocos/2d/platform/android/CCCommon.cpp | 22 ----------- cocos/2d/platform/ios/CCCommon.mm | 27 ------------- cocos/2d/platform/linux/CCCommon.cpp | 52 +++----------------------- cocos/2d/platform/mac/CCCommon.mm | 34 ----------------- cocos/2d/platform/win32/CCCommon.cpp | 37 ------------------ cocos/2d/renderer/CCFrustum.cpp | 2 +- cocos/base/CCConsole.cpp | 52 ++++++++++++++++++++++++++ cocos/base/CCConsole.h | 13 ++++++- cocos/base/CCObject.h | 2 + 12 files changed, 74 insertions(+), 178 deletions(-) diff --git a/cocos/2d/ccMacros.h b/cocos/2d/ccMacros.h index 8196fbac0c..e15f4907a3 100644 --- a/cocos/2d/ccMacros.h +++ b/cocos/2d/ccMacros.h @@ -32,7 +32,7 @@ THE SOFTWARE. #define _USE_MATH_DEFINES #endif -#include "platform/CCCommon.h" +#include "CCConsole.h" #include "CCStdC.h" #ifndef CCASSERT diff --git a/cocos/2d/ccUTF8.cpp b/cocos/2d/ccUTF8.cpp index ceb240d2e6..6e70a313d5 100644 --- a/cocos/2d/ccUTF8.cpp +++ b/cocos/2d/ccUTF8.cpp @@ -25,6 +25,7 @@ #include "ccUTF8.h" #include "platform/CCCommon.h" +#include "CCConsole.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/CCCommon.h b/cocos/2d/platform/CCCommon.h index eb4f6fa9cb..fa300cd4fe 100644 --- a/cocos/2d/platform/CCCommon.h +++ b/cocos/2d/platform/CCCommon.h @@ -35,14 +35,6 @@ NS_CC_BEGIN * @{ */ -/// The max length of CCLog message. -static const int kMaxLogLen = 16*1024; - -/** -@brief Output Debug message. -*/ -void CC_DLL log(const char * format, ...) CC_FORMAT_PRINTF(1, 2); - /** * lua can not deal with ... */ diff --git a/cocos/2d/platform/android/CCCommon.cpp b/cocos/2d/platform/android/CCCommon.cpp index a24c002463..b48aff2e5c 100644 --- a/cocos/2d/platform/android/CCCommon.cpp +++ b/cocos/2d/platform/android/CCCommon.cpp @@ -33,28 +33,6 @@ NS_CC_BEGIN #define MAX_LEN (cocos2d::kMaxLogLen + 1) -// XXX deprecated -void CCLog(const char * pszFormat, ...) -{ - va_list args; - va_start(args, pszFormat); - __android_log_vprint(ANDROID_LOG_DEBUG, "cocos2d-x debug info", pszFormat, args); - va_end(args); - -} - -void log(const char * pszFormat, ...) -{ - char buf[MAX_LEN]; - - va_list args; - va_start(args, pszFormat); - vsnprintf(buf, MAX_LEN, pszFormat, args); - va_end(args); - - __android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", "%s", buf); -} - void MessageBox(const char * pszMsg, const char * pszTitle) { showDialogJNI(pszMsg, pszTitle); diff --git a/cocos/2d/platform/ios/CCCommon.mm b/cocos/2d/platform/ios/CCCommon.mm index 0293d79092..28d0dd0e22 100644 --- a/cocos/2d/platform/ios/CCCommon.mm +++ b/cocos/2d/platform/ios/CCCommon.mm @@ -34,33 +34,6 @@ NS_CC_BEGIN -// XXX deprecated -void CCLog(const char * format, ...) -{ - printf("cocos2d: "); - char buf[kMaxLogLen+1] = {0}; - va_list ap; - va_start(ap, format); - vsnprintf(buf, kMaxLogLen, format, ap); - va_end(ap); - printf("%s", buf); - printf("\n"); -} - -void log(const char * format, ...) -{ - printf("cocos2d: "); - char buf[kMaxLogLen+1] = {0}; - va_list ap; - va_start(ap, format); - vsnprintf(buf, kMaxLogLen, format, ap); - va_end(ap); - strcat(buf, "\n"); - printf("%s", buf); - - Director::getInstance()->getConsole()->log(buf); -} - // ios no MessageBox, use log instead void MessageBox(const char * msg, const char * title) { diff --git a/cocos/2d/platform/linux/CCCommon.cpp b/cocos/2d/platform/linux/CCCommon.cpp index 4b94bcd8e0..c48307192b 100644 --- a/cocos/2d/platform/linux/CCCommon.cpp +++ b/cocos/2d/platform/linux/CCCommon.cpp @@ -24,60 +24,18 @@ THE SOFTWARE. ****************************************************************************/ #include "platform/CCCommon.h" #include "CCStdC.h" +#include "CCConsole.h" NS_CC_BEGIN -#define MAX_LEN (cocos2d::kMaxLogLen + 1) - -// XXX deprecated -void CCLog(const char * pszFormat, ...) +void MessageBox(const char * msg, const char * title) { - char szBuf[MAX_LEN]; - - va_list ap; - va_start(ap, pszFormat); - vsnprintf(szBuf, MAX_LEN, pszFormat, ap); - va_end(ap); - - // Strip any trailing newlines from log message. - size_t len = strlen(szBuf); - while (len && szBuf[len-1] == '\n') - { - szBuf[len-1] = '\0'; - len--; - } - - fprintf(stderr, "cocos2d-x debug info [%s]\n", szBuf); + log("%s: %s", title, msg); } -void log(const char * pszFormat, ...) +void LuaLog(const char * format) { - char szBuf[MAX_LEN]; - - va_list ap; - va_start(ap, pszFormat); - vsnprintf(szBuf, MAX_LEN, pszFormat, ap); - va_end(ap); - - // Strip any trailing newlines from log message. - size_t len = strlen(szBuf); - while (len && szBuf[len-1] == '\n') - { - szBuf[len-1] = '\0'; - len--; - } - - fprintf(stderr, "cocos2d-x debug info [%s]\n", szBuf); -} - -void MessageBox(const char * pszMsg, const char * pszTitle) -{ - log("%s: %s", pszTitle, pszMsg); -} - -void LuaLog(const char * pszFormat) -{ - puts(pszFormat); + puts(format); } NS_CC_END diff --git a/cocos/2d/platform/mac/CCCommon.mm b/cocos/2d/platform/mac/CCCommon.mm index a9ff158eaf..52e4fb7beb 100644 --- a/cocos/2d/platform/mac/CCCommon.mm +++ b/cocos/2d/platform/mac/CCCommon.mm @@ -29,44 +29,10 @@ THE SOFTWARE. #include #include #import "EAGLView.h" -#include "CCConsole.h" -#include "CCDirector.h" NS_CC_BEGIN -// XXX deprecated -void CCLog(const char * format, ...) -{ - printf("Cocos2d: "); - char buf[kMaxLogLen]; - - va_list ap; - va_start(ap, format); - vsnprintf(buf, kMaxLogLen, format, ap); - va_end(ap); - printf("%s", buf); - printf("\n"); - fflush(stdout); -} - -void log(const char * format, ...) -{ - printf("Cocos2d: "); - char buf[kMaxLogLen]; - - va_list ap; - va_start(ap, format); - vsnprintf(buf, kMaxLogLen, format, ap); - va_end(ap); - strcat(buf, "\n"); - printf("%s", buf); - fflush(stdout); - - Director::getInstance()->getConsole()->log(buf); -} - - void LuaLog(const char * format) { puts(format); diff --git a/cocos/2d/platform/win32/CCCommon.cpp b/cocos/2d/platform/win32/CCCommon.cpp index 58651989de..3aa3d6458f 100644 --- a/cocos/2d/platform/win32/CCCommon.cpp +++ b/cocos/2d/platform/win32/CCCommon.cpp @@ -29,43 +29,6 @@ NS_CC_BEGIN #define MAX_LEN (cocos2d::kMaxLogLen + 1) -// XXX deprecated -void CCLog(const char * pszFormat, ...) -{ - char szBuf[MAX_LEN]; - - va_list ap; - va_start(ap, pszFormat); - vsnprintf_s(szBuf, MAX_LEN, MAX_LEN, pszFormat, ap); - va_end(ap); - - WCHAR wszBuf[MAX_LEN] = {0}; - MultiByteToWideChar(CP_UTF8, 0, szBuf, -1, wszBuf, sizeof(wszBuf)); - OutputDebugStringW(wszBuf); - OutputDebugStringA("\n"); - - WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), szBuf, sizeof(szBuf), NULL, FALSE); - printf("%s\n", szBuf); -} - -void log(const char * pszFormat, ...) -{ - char szBuf[MAX_LEN]; - - va_list ap; - va_start(ap, pszFormat); - vsnprintf_s(szBuf, MAX_LEN, MAX_LEN, pszFormat, ap); - va_end(ap); - - WCHAR wszBuf[MAX_LEN] = {0}; - MultiByteToWideChar(CP_UTF8, 0, szBuf, -1, wszBuf, sizeof(wszBuf)); - OutputDebugStringW(wszBuf); - OutputDebugStringA("\n"); - - WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), szBuf, sizeof(szBuf), NULL, FALSE); - printf("%s\n", szBuf); -} - void MessageBox(const char * pszMsg, const char * pszTitle) { MessageBoxA(NULL, pszMsg, pszTitle, MB_OK); diff --git a/cocos/2d/renderer/CCFrustum.cpp b/cocos/2d/renderer/CCFrustum.cpp index b03c9771ee..cc26b67cab 100644 --- a/cocos/2d/renderer/CCFrustum.cpp +++ b/cocos/2d/renderer/CCFrustum.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "CCFrustum.h" -#include "platform/CCCommon.h" +#include "CCConsole.h" #include diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 919d87f678..682855e05d 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -49,6 +49,7 @@ #include "CCDirector.h" #include "CCScheduler.h" #include "CCScene.h" +#include "CCPlatformConfig.h" NS_CC_BEGIN @@ -108,6 +109,57 @@ static const char* inet_ntop(int af, const void* src, char* dst, int cnt) } #endif + +// +// Free functions to log +// + +// XXX: Deprecated +void CCLog(const char * format, ...) +{ + va_list args; + va_start(args, format); + log(format, args); + va_end(args); +} + +void log(const char * format, ...) +{ + va_list args; + va_start(args, format); + log(format, args); + va_end(args); +} + +void log(const char *format, va_list args) +{ + char buf[MAX_LOG_LENGTH]; + + vsnprintf(buf, MAX_LOG_LENGTH-3, format, args); + strcat(buf, "\n"); + +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + __android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", "%s", buf); + +#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + WCHAR wszBuf[MAX_LOG_LENGTH] = {0}; + MultiByteToWideChar(CP_UTF8, 0, szBuf, -1, wszBuf, sizeof(wszBuf)); + OutputDebugStringW(wszBuf); + OutputDebugStringA("\n"); + + WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), szBuf, sizeof(szBuf), NULL, FALSE); + printf("%s\n", szBuf); + +#else + // Linux, Mac, iOS, etc + fprintf(stdout, "cocos2d: %s", buf); + fflush(stdout); +#endif + + Director::getInstance()->getConsole()->log(buf); +} + + // // Console code // diff --git a/cocos/base/CCConsole.h b/cocos/base/CCConsole.h index 158ebde7c8..e90dec3c5c 100644 --- a/cocos/base/CCConsole.h +++ b/cocos/base/CCConsole.h @@ -42,12 +42,23 @@ typedef int ssize_t; #include #include +#include + #include "ccMacros.h" -#include "CCObject.h" +#include "ccPlatformMacros.h" NS_CC_BEGIN +/// The max length of CCLog message. +static const int MAX_LOG_LENGTH = 16*1024; + +/** + @brief Output Debug message. + */ +void CC_DLL log(const char * format, ...) CC_FORMAT_PRINTF(1, 2); +void CC_DLL log(const char * format, va_list args); + /** Console is helper class that lets the developer control the game from TCP connection. Console will spawn a new thread that will listen to a specified TCP port. Console has a basic token parser. Each token is associated with an std::function. diff --git a/cocos/base/CCObject.h b/cocos/base/CCObject.h index 28bb7da247..e438ac464f 100644 --- a/cocos/base/CCObject.h +++ b/cocos/base/CCObject.h @@ -28,6 +28,7 @@ THE SOFTWARE. #include "CCDataVisitor.h" #include "ccMacros.h" +#include "CCConsole.h" #ifdef EMSCRIPTEN #include @@ -106,6 +107,7 @@ public: */ inline void release() { + cocos2d::log("carlos"); CCASSERT(_reference > 0, "reference count should greater than 0"); --_reference; From dbcf5021a65e4a5f212f1c2f2c614e4a955bb563 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 10 Jan 2014 19:10:35 -0800 Subject: [PATCH 407/428] Compiles on Linux --- cocos/base/CCConsole.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/base/CCConsole.h b/cocos/base/CCConsole.h index e90dec3c5c..4175395244 100644 --- a/cocos/base/CCConsole.h +++ b/cocos/base/CCConsole.h @@ -45,7 +45,7 @@ typedef int ssize_t; #include #include "ccMacros.h" -#include "ccPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN From c88f81481bb71e54c730529ae7c351e2500f35d8 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 10 Jan 2014 19:22:04 -0800 Subject: [PATCH 408/428] JSB compiles OK --- cocos/scripting/javascript/bindings/ScriptingCore.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/scripting/javascript/bindings/ScriptingCore.cpp b/cocos/scripting/javascript/bindings/ScriptingCore.cpp index 68ad517f8e..6510b90167 100644 --- a/cocos/scripting/javascript/bindings/ScriptingCore.cpp +++ b/cocos/scripting/javascript/bindings/ScriptingCore.cpp @@ -200,12 +200,12 @@ void js_log(const char *format, ...) { if (_js_log_buf == NULL) { - _js_log_buf = (char *)calloc(sizeof(char), kMaxLogLen+1); - _js_log_buf[kMaxLogLen] = '\0'; + _js_log_buf = (char *)calloc(sizeof(char), MAX_LOG_LENGTH+1); + _js_log_buf[MAX_LOG_LENGTH] = '\0'; } va_list vl; va_start(vl, format); - int len = vsnprintf(_js_log_buf, kMaxLogLen, format, vl); + int len = vsnprintf(_js_log_buf, MAX_LOG_LENGTH, format, vl); va_end(vl); if (len > 0) { From b870180af639be284b84362104ab6e248a29b6d4 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 10 Jan 2014 19:26:03 -0800 Subject: [PATCH 409/428] Mmmm... what? removing useless debug message --- cocos/base/CCObject.h | 1 - 1 file changed, 1 deletion(-) diff --git a/cocos/base/CCObject.h b/cocos/base/CCObject.h index e438ac464f..2280508856 100644 --- a/cocos/base/CCObject.h +++ b/cocos/base/CCObject.h @@ -107,7 +107,6 @@ public: */ inline void release() { - cocos2d::log("carlos"); CCASSERT(_reference > 0, "reference count should greater than 0"); --_reference; From f76fcf7f2aaf7a73cd57ddd073ee5bfb07388032 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sat, 11 Jan 2014 04:06:53 +0000 Subject: [PATCH 410/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index f893f6202c..f4f99502dc 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit f893f6202c6f249f52660876278a1742ba12aefa +Subproject commit f4f99502dc30984897d589d6eeecb63bd9ef563b From f4a99d06271d1e6166c8a29e6943e9fbf17cc6ac Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 10 Jan 2014 20:26:15 -0800 Subject: [PATCH 411/428] Removes DirectorDelegate --- cocos/2d/CCDirector.h | 12 ------------ cocos/base/CCConsole.cpp | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/cocos/2d/CCDirector.h b/cocos/2d/CCDirector.h index 17616ec408..23bc8cda42 100644 --- a/cocos/2d/CCDirector.h +++ b/cocos/2d/CCDirector.h @@ -190,18 +190,6 @@ public: Node* getNotificationNode() const { return _notificationNode; } void setNotificationNode(Node *node); - /** Director delegate. It shall implement the DirectorDelegate protocol - @since v0.99.5 - * @js NA - * @lua NA - */ - DirectorDelegate* getDelegate() const; - /** - * @js NA - * @lua NA - */ - void setDelegate(DirectorDelegate* delegate); - // window size /** returns the size of the OpenGL view in points. diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 682855e05d..58636d15cf 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -196,7 +196,7 @@ Console::Console() }; _maxCommands = sizeof(commands)/sizeof(commands[0]); - for (size_t i = 0; i < _maxCommands; ++i) + for (int i = 0; i < _maxCommands; ++i) { _commands[i] = commands[i]; } From 95568648c96fa57b4741f92c302ce0bc9495a0ef Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 10 Jan 2014 20:32:39 -0800 Subject: [PATCH 412/428] Console Enabled by default on TestCpp --- samples/Cpp/TestCpp/Classes/AppDelegate.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp index 3243c8f05c..285d9b17ae 100644 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp +++ b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp @@ -82,6 +82,10 @@ bool AppDelegate::applicationDidFinishLaunching() scene->addChild(layer); director->runWithScene(scene); + // Enable Remote Console + auto console = director->getConsole(); + console->listenOnTCP(5678); + return true; } From b10783972f460bad50040c37c0b589ffd9c6ce67 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sat, 11 Jan 2014 04:39:03 +0000 Subject: [PATCH 413/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index f4f99502dc..74e535d0bd 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit f4f99502dc30984897d589d6eeecb63bd9ef563b +Subproject commit 74e535d0bd9cb4fd53244c46e2011e56367624a4 From d11bfeb8d45389d7f46b3e7afc4f7a015512c52d Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Sun, 12 Jan 2014 11:02:48 +0800 Subject: [PATCH 414/428] fix compiling error on win --- cocos/base/CCConsole.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/base/CCConsole.h b/cocos/base/CCConsole.h index 4175395244..eb27bcfb34 100644 --- a/cocos/base/CCConsole.h +++ b/cocos/base/CCConsole.h @@ -28,6 +28,7 @@ #if defined(_MSC_VER) || defined(__MINGW32__) #include +#include //typedef SSIZE_T ssize_t; // ssize_t was redefined as int in libwebsockets.h. // Therefore, to avoid conflict, we needs the same definition. From 09f23c1bcb12370345d28cff598c23b1a08232cd Mon Sep 17 00:00:00 2001 From: Pisces000221 <1786762946@qq.com> Date: Sun, 12 Jan 2014 14:38:09 +0800 Subject: [PATCH 415/428] Corrected a few mistakes in project-creator README --- tools/project-creator/README.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tools/project-creator/README.md b/tools/project-creator/README.md index a7f888fbfd..7417a3ecdb 100644 --- a/tools/project-creator/README.md +++ b/tools/project-creator/README.md @@ -1,15 +1,19 @@ -#create_project +#Creating A Project -First you need install python environment. +First you need to install the Python environment. -There have double ways create new cocos project. -Notice:The best of generate path is english path. +There are two ways to create a new cocos project. +Notice: The best project path is an English path without spaces. ##1.UI -* Windows: double click "create_project.py" file -* Mac: ./create_project.py -* Linux: The tkinter was not installed in the linux's default python,therefore, in order to use the gui operate, you have to install the tkinter libaray manually. There is another way to create project by command line. see below for details +* Windows: double click the "create_project.py" file +* Mac: use `./create_project.py` +* Linux: The Tkinter library was not installed automatically in Linux, therefore, in order to use the GUI to operate, you have to install Tkinter manually (see http://tkinter.unpythonic.net/wiki/How_to_install_Tkinter). There is another way to create projects by command line. See below for details. + ##2.console +To use this, open the terminal and type: +``` $ cd cocos2d-x/tools/project-creator $ ./project-creator.py --help $ ./project-creator.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame - $ cd /home/mygame \ No newline at end of file + $ cd /home/mygame +``` From 34a79a02e7d4473ec431c1d7e6022db1197340fd Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 13 Jan 2014 10:32:34 +0800 Subject: [PATCH 416/428] fix compiling error when CC_ENABLE_CHIPMUNK_INTEGRATION and CC_ENABLE_BOX2D_INTEGRATION are zero. --- extensions/physics-nodes/CCPhysicsSprite.cpp | 2 ++ extensions/physics-nodes/CCPhysicsSprite.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/extensions/physics-nodes/CCPhysicsSprite.cpp b/extensions/physics-nodes/CCPhysicsSprite.cpp index fa3772fc70..84f60ccb7a 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.cpp +++ b/extensions/physics-nodes/CCPhysicsSprite.cpp @@ -19,6 +19,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) #include "CCPhysicsSprite.h" @@ -406,3 +407,4 @@ const kmMat4& PhysicsSprite::getNodeToParentTransform() const } NS_CC_EXT_END +#endif //(CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) \ No newline at end of file diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index 50eb8a4158..8175a1c6e3 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ b/extensions/physics-nodes/CCPhysicsSprite.h @@ -19,6 +19,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) + #ifndef __PHYSICSNODES_CCPHYSICSSPRITE_H__ #define __PHYSICSNODES_CCPHYSICSSPRITE_H__ @@ -132,3 +134,4 @@ protected: NS_CC_EXT_END #endif // __PHYSICSNODES_CCPHYSICSSPRITE_H__ +#endif //(CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) \ No newline at end of file From fd11791389b794f472c0d4829177fbc1fc5fcfc7 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 13 Jan 2014 10:37:31 +0800 Subject: [PATCH 417/428] add a blank line at the file end. --- extensions/physics-nodes/CCPhysicsSprite.cpp | 2 +- extensions/physics-nodes/CCPhysicsSprite.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/physics-nodes/CCPhysicsSprite.cpp b/extensions/physics-nodes/CCPhysicsSprite.cpp index 84f60ccb7a..7a193a312f 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.cpp +++ b/extensions/physics-nodes/CCPhysicsSprite.cpp @@ -407,4 +407,4 @@ const kmMat4& PhysicsSprite::getNodeToParentTransform() const } NS_CC_EXT_END -#endif //(CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) \ No newline at end of file +#endif //(CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index 8175a1c6e3..fcedfca031 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ b/extensions/physics-nodes/CCPhysicsSprite.h @@ -134,4 +134,4 @@ protected: NS_CC_EXT_END #endif // __PHYSICSNODES_CCPHYSICSSPRITE_H__ -#endif //(CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) \ No newline at end of file +#endif //(CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) From d7593fd0f02494ecba85543bc91a4b5245680e5e Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 13 Jan 2014 11:24:49 +0800 Subject: [PATCH 418/428] fix wrong judgments of conditional compilation. --- extensions/physics-nodes/CCPhysicsSprite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/physics-nodes/CCPhysicsSprite.cpp b/extensions/physics-nodes/CCPhysicsSprite.cpp index 7a193a312f..93ce054384 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.cpp +++ b/extensions/physics-nodes/CCPhysicsSprite.cpp @@ -23,7 +23,7 @@ #include "CCPhysicsSprite.h" -#if defined(CC_ENABLE_CHIPMUNK_INTEGRATION) && defined(CC_ENABLE_BOX2D_INTEGRATION) +#if (CC_ENABLE_CHIPMUNK_INTEGRATION && CC_ENABLE_BOX2D_INTEGRATION) #error "Either Chipmunk or Box2d should be enabled, but not both at the same time" #endif From 2e127f819b512b5e1c881d3584f112f8508ff57e Mon Sep 17 00:00:00 2001 From: Nite Luo Date: Mon, 13 Jan 2014 11:37:44 -0800 Subject: [PATCH 419/428] Add Polish the labels for project creator ui --- tools/project-creator/module/ui.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/project-creator/module/ui.py b/tools/project-creator/module/ui.py index 7ad74f302d..e7646e1cef 100644 --- a/tools/project-creator/module/ui.py +++ b/tools/project-creator/module/ui.py @@ -120,7 +120,7 @@ class TkCocosDialog(Frame): self.rowconfigure(5, weight=1) # project name frame - self.labName = Label(self, text="projectName:") + self.labName = Label(self, text="Project Name:") self.strName = StringVar() self.strName.set("MyGame") self.editName = Entry(self, textvariable=self.strName) @@ -128,7 +128,7 @@ class TkCocosDialog(Frame): self.editName.grid(row=0, column=1, columnspan=3,padx=5, pady=2,sticky=E+W) # package name frame - self.labPackage = Label(self, text="packageName:") + self.labPackage = Label(self, text="Package Name:") self.strPackage=StringVar() self.strPackage.set("com.MyCompany.AwesomeGame") self.editPackage = Entry(self, textvariable=self.strPackage) @@ -136,7 +136,7 @@ class TkCocosDialog(Frame): self.editPackage.grid(row=1, column=1, columnspan=3,padx=5, pady=2,sticky=E+W) # project path frame - self.labPath = Label(self, text="projectPath:") + self.labPath = Label(self, text="Project Path:") self.editPath = Entry(self) self.btnPath = Button(self, text="...", width = 6, command = self.pathCallback) self.labPath.grid(row=2, column=0,sticky=W, pady=4, padx=5) @@ -144,12 +144,12 @@ class TkCocosDialog(Frame): self.btnPath.grid(row=2, column=4,) # language frame - self.labLanguage = Label(self, text="language:") + self.labLanguage = Label(self, text="Language:") self.var=IntVar() self.var.set(1) - self.checkcpp = Radiobutton(self, text="cpp", variable=self.var, value=1) - self.checklua = Radiobutton(self, text="lua", variable=self.var, value=2) - self.checkjs = Radiobutton(self, text="javascript", variable=self.var, value=3) + self.checkcpp = Radiobutton(self, text="C++", variable=self.var, value=1) + self.checklua = Radiobutton(self, text="Lua", variable=self.var, value=2) + self.checkjs = Radiobutton(self, text="JavaScript", variable=self.var, value=3) self.labLanguage.grid(row=3, column=0,sticky=W, padx=5) self.checkcpp.grid(row=3, column=1,sticky=N+W) self.checklua.grid(row=3, column=2,padx=5,sticky=N+W) @@ -164,7 +164,7 @@ class TkCocosDialog(Frame): self.text=Text(self,background = '#d9efff') self.text.bind("", lambda e : "break") self.text.grid(row=5, column=0, columnspan=4, rowspan=1, padx=5, sticky=E+W+S+N) - + self.text.config(state=DISABLED) # new project button self.btnCreate = Button(self, text="create", command = self.createBtnCallback) self.btnCreate.grid(row=7, column=3, columnspan=1, rowspan=1,pady=2,ipadx=15,ipady =10, sticky=W) @@ -176,7 +176,7 @@ class TkCocosDialog(Frame): scnHeight = self.parent.winfo_screenheight() tmpcnf = '%dx%d+%d+%d'%(curWidth, curHeight, int((scnWidth-curWidth)/2), int((scnHeight-curHeight)/2)) self.parent.geometry(tmpcnf) - self.parent.title("CocosCreateProject") + self.parent.title("Cocos Project Creator") #fix size #self.parent.maxsize(curWidth, curHeight) From 37522c61c39567bf3920c6fa2e5f270363626a96 Mon Sep 17 00:00:00 2001 From: Nite Luo Date: Mon, 13 Jan 2014 11:54:33 -0800 Subject: [PATCH 420/428] Make the ui look a bit better --- tools/project-creator/module/ui.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/project-creator/module/ui.py b/tools/project-creator/module/ui.py index e7646e1cef..98d261cbf0 100644 --- a/tools/project-creator/module/ui.py +++ b/tools/project-creator/module/ui.py @@ -125,7 +125,7 @@ class TkCocosDialog(Frame): self.strName.set("MyGame") self.editName = Entry(self, textvariable=self.strName) self.labName.grid(sticky=W, pady=4, padx=5) - self.editName.grid(row=0, column=1, columnspan=3,padx=5, pady=2,sticky=E+W) + self.editName.grid(row=0, column=1, columnspan=4,padx=5, pady=2,sticky=E+W) # package name frame self.labPackage = Label(self, text="Package Name:") @@ -133,7 +133,7 @@ class TkCocosDialog(Frame): self.strPackage.set("com.MyCompany.AwesomeGame") self.editPackage = Entry(self, textvariable=self.strPackage) self.labPackage.grid(row=1, column=0,sticky=W, padx=5) - self.editPackage.grid(row=1, column=1, columnspan=3,padx=5, pady=2,sticky=E+W) + self.editPackage.grid(row=1, column=1, columnspan=4,padx=5, pady=2,sticky=E+W) # project path frame self.labPath = Label(self, text="Project Path:") @@ -158,13 +158,13 @@ class TkCocosDialog(Frame): # show progress self.progress = Scale(self, state= DISABLED, from_=0, to=100, orient=HORIZONTAL) self.progress.set(0) - self.progress.grid(row=4, column=0, columnspan=4,padx=5, pady=2,sticky=E+W+S+N) + self.progress.grid(row=4, column=0, columnspan=5,padx=5, pady=2,sticky=E+W+S+N) # msg text frame self.text=Text(self,background = '#d9efff') self.text.bind("", lambda e : "break") - self.text.grid(row=5, column=0, columnspan=4, rowspan=1, padx=5, sticky=E+W+S+N) - self.text.config(state=DISABLED) + self.text.grid(row=5, column=0, columnspan=5, rowspan=1, padx=5, sticky=E+W+S+N) + # new project button self.btnCreate = Button(self, text="create", command = self.createBtnCallback) self.btnCreate.grid(row=7, column=3, columnspan=1, rowspan=1,pady=2,ipadx=15,ipady =10, sticky=W) From f2c3d2f3aecdab193b78e07d7e2adfb262444313 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 13 Jan 2014 12:52:07 -0800 Subject: [PATCH 421/428] Camera and Node fixes OrbitCamera: added getters (public). Setters moved from `protected` to `public : Improved API. Instead of using "out" parameters for getters, it returns a `kmVec3` : Setters receives `kmVec3` as well. Old API is still supported Node: `setAdditionalTransform` doesn't get `dirty` on the next frame. Instead, once the additional transform is set, in order to remove it the user needs to pass the identity matrix --- cocos/2d/CCActionCamera.cpp | 60 ++++++++----------- cocos/2d/CCActionCamera.h | 41 ++++++------- cocos/2d/CCNode.cpp | 9 ++- cocos/2d/CCNode.h | 11 ++-- .../Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp | 29 ++++----- .../Cpp/TestCpp/Classes/NodeTest/NodeTest.h | 1 - 6 files changed, 67 insertions(+), 84 deletions(-) diff --git a/cocos/2d/CCActionCamera.cpp b/cocos/2d/CCActionCamera.cpp index c044bdd21a..45560f7ede 100644 --- a/cocos/2d/CCActionCamera.cpp +++ b/cocos/2d/CCActionCamera.cpp @@ -33,6 +33,12 @@ NS_CC_BEGIN // // CameraAction // +ActionCamera::ActionCamera() +{ + kmVec3Fill(&_center, 0, 0, 0); + kmVec3Fill(&_eye, 0, 0, FLT_EPSILON); + kmVec3Fill(&_up, 0, 1, 0); +} void ActionCamera::startWithTarget(Node *target) { ActionInterval::startWithTarget(target); @@ -54,53 +60,39 @@ ActionCamera * ActionCamera::reverse() const void ActionCamera::restore() { - _eyeX = _eyeY = 0.0f; - _eyeZ = FLT_EPSILON; + kmVec3Fill(&_center, 0, 0, 0); + kmVec3Fill(&_eye, 0, 0, FLT_EPSILON); + kmVec3Fill(&_up, 0, 1, 0); +} - _centerX = _centerY = _centerZ = 0.0f; - - _upX = 0.0f; - _upY = 1.0f; - _upZ = 0.0f; +void ActionCamera::setEye(const kmVec3& eye) +{ + _eye = eye; + updateTransform(); } void ActionCamera::setEye(float x, float y, float z) { - _eyeX = x; - _eyeY = y; - _eyeZ = z; - + kmVec3Fill(&_eye, x, y, z); updateTransform(); } -void ActionCamera::setCenter(float centerX, float centerY, float centerZ) +void ActionCamera::setCenter(const kmVec3& center) { - _centerX = centerX; - _centerY = centerY; - _centerZ = centerZ; - + _center = center; updateTransform(); } -void ActionCamera::setUp(float upX, float upY, float upZ) +void ActionCamera::setUp(const kmVec3& up) { - _upX = upX; - _upY = upY; - _upZ = upZ; - + _up = up; updateTransform(); } void ActionCamera::updateTransform() { - kmVec3 eye, center, up; - - kmVec3Fill(&eye, _eyeX, _eyeY , _eyeZ); - kmVec3Fill(¢er, _centerX, _centerY, _centerZ); - kmVec3Fill(&up, _upX, _upY, _upZ); - kmMat4 lookupMatrix; - kmMat4LookAt(&lookupMatrix, &eye, ¢er, &up); + kmMat4LookAt(&lookupMatrix, &_eye, &_center, &_up); Point anchorPoint = _target->getAnchorPointInPoints(); @@ -199,9 +191,9 @@ void OrbitCamera::update(float dt) float za = _radZ + _radDeltaZ * dt; float xa = _radX + _radDeltaX * dt; - float i = sinf(za) * cosf(xa) * r + _centerX; - float j = sinf(za) * sinf(xa) * r + _centerY; - float k = cosf(za) * r + _centerZ; + float i = sinf(za) * cosf(xa) * r + _center.x; + float j = sinf(za) * sinf(xa) * r + _center.y; + float k = cosf(za) * r + _center.z; setEye(i,j,k); } @@ -211,9 +203,9 @@ void OrbitCamera::sphericalRadius(float *newRadius, float *zenith, float *azimut float r; // radius float s; - float x = _eyeX - _centerX; - float y = _eyeY - _centerY; - float z = _eyeZ - _centerZ; + float x = _eye.x - _center.x; + float y = _eye.y - _center.y; + float z = _eye.z - _center.z; r = sqrtf( powf(x,2) + powf(y,2) + powf(z,2)); s = sqrtf( powf(x,2) + powf(y,2)); diff --git a/cocos/2d/CCActionCamera.h b/cocos/2d/CCActionCamera.h index c5515dfcff..2c42590080 100644 --- a/cocos/2d/CCActionCamera.h +++ b/cocos/2d/CCActionCamera.h @@ -50,17 +50,7 @@ public: /** * @js ctor */ - ActionCamera() - :_centerX(0) - ,_centerY(0) - ,_centerZ(0) - ,_eyeX(0) - ,_eyeY(0) - ,_eyeZ(FLT_EPSILON) - ,_upX(0) - ,_upY(1) - ,_upZ(0) - {} + ActionCamera(); /** * @js NA * @lua NA @@ -72,23 +62,28 @@ public: virtual ActionCamera * reverse() const override; virtual ActionCamera *clone() const override; + /* sets the Eye value of the Camera */ + void setEye(const kmVec3 &eye); + void setEye(float x, float y, float z); + /* returns the Eye value of the Camera */ + const kmVec3& getEye() const { return _eye; } + /* sets the Center value of the Camera */ + void setCenter(const kmVec3 ¢er); + /* returns the Center value of the Camera */ + const kmVec3& getCenter() const { return _center; } + /* sets the Up value of the Camera */ + void setUp(const kmVec3 &up); + /* Returns the Up value of the Camera */ + const kmVec3& getUp() const { return _up; } + protected: void restore(); - void setEye(float x, float y, float z); - void setCenter(float x, float y, float z); - void setUp(float x, float y, float z); void updateTransform(); - float _centerX; - float _centerY; - float _centerZ; - float _eyeX; - float _eyeY; - float _eyeZ; - float _upX; - float _upY; - float _upZ; + kmVec3 _center; + kmVec3 _eye; + kmVec3 _up; }; /** diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 6e38937d19..3b7ce1c47c 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -103,7 +103,7 @@ Node::Node(void) , _anchorPointInPoints(Point::ZERO) , _anchorPoint(Point::ZERO) , _contentSize(Size::ZERO) -, _additionalTransformDirty(false) +, _useAdditionalTransform(false) , _transformDirty(true) , _inverseDirty(true) // children (lazy allocs) @@ -1189,10 +1189,9 @@ const kmMat4& Node::getNodeToParentTransform() const // vertex Z _transform.mat[14] = _vertexZ; - if (_additionalTransformDirty) + if (_useAdditionalTransform) { kmMat4Multiply(&_transform, &_transform, &_additionalTransform); - _additionalTransformDirty = false; } _transformDirty = false; @@ -1211,14 +1210,14 @@ void Node::setAdditionalTransform(const AffineTransform& additionalTransform) { CGAffineToGL(additionalTransform, _additionalTransform.mat); _transformDirty = true; - _additionalTransformDirty = true; + _useAdditionalTransform = true; } void Node::setAdditionalTransform(const kmMat4& additionalTransform) { _additionalTransform = additionalTransform; _transformDirty = true; - _additionalTransformDirty = true; + _useAdditionalTransform = true; } diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 09da015dd6..3069fb0a84 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -1266,7 +1266,9 @@ public: Point convertTouchToNodeSpaceAR(Touch * touch) const; /** - * Sets the additional transform. + * Sets an additional transform matrix to the node. + * + * In order to remove it, set the Identity Matrix to the additional transform. * * @note The additional transform will be concatenated at the end of getNodeToParentTransform. * It could be used to simulate `parent-child` relationship between two nodes (e.g. one is in BatchNode, another isn't). @@ -1289,7 +1291,7 @@ public: spriteA->setPosition(Point(200, 200)); // Gets the spriteA's transform. - AffineTransform t = spriteA->getNodeToParentTransform(); + auto t = spriteA->getNodeToParentTransform(); // Sets the additional transform to spriteB, spriteB's postion will based on its pseudo parent i.e. spriteA. spriteB->setAdditionalTransform(t); @@ -1421,12 +1423,13 @@ protected: Size _contentSize; ///< untransformed size of the node + kmMat4 _modelViewTransform; ///< ModelView transform of the Node. + // "cache" variables are allowed to be mutable mutable kmMat4 _additionalTransform; ///< transform mutable kmMat4 _transform; ///< transform mutable kmMat4 _inverse; ///< inverse transform - kmMat4 _modelViewTransform; ///< ModelView transform of the Node. - mutable bool _additionalTransformDirty; ///< The flag to check whether the additional transform is dirty + bool _useAdditionalTransform; ///< The flag to check whether the additional transform is dirty mutable bool _transformDirty; ///< transform dirty flag mutable bool _inverseDirty; ///< inverse transform dirty flag diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp index 843b72bbb6..aefe6a83e4 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp @@ -1021,7 +1021,18 @@ CameraTest2::CameraTest2() _sprite2->setPosition( Point(3*s.width/4, s.height/2) ); _sprite2->setScale(0.5); - scheduleUpdate(); + kmVec3 eye, center, up; + + kmVec3Fill(&eye, 150, 0, 200); + kmVec3Fill(¢er, 0, 0, 0); + kmVec3Fill(&up, 0, 1, 0); + + kmMat4 lookupMatrix; + kmMat4LookAt(&lookupMatrix, &eye, ¢er, &up); + + _sprite1->setAdditionalTransform(lookupMatrix); + _sprite2->setAdditionalTransform(lookupMatrix); + } std::string CameraTest2::title() const @@ -1034,22 +1045,6 @@ std::string CameraTest2::subtitle() const return "Both images should look the same"; } -void CameraTest2::update(float dt) -{ - kmVec3 eye, center, up; - - kmVec3Fill(&eye, 150, 0, 200); - kmVec3Fill(¢er, 0, 0, 0); - kmVec3Fill(&up, 0, 1, 0); - - - kmMat4 lookupMatrix; - kmMat4LookAt(&lookupMatrix, &eye, ¢er, &up); - - _sprite1->setAdditionalTransform(lookupMatrix); - _sprite2->setAdditionalTransform(lookupMatrix); -} - /// /// main /// diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h index 7a6a63d7c2..157d029a49 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h @@ -184,7 +184,6 @@ public: virtual void onExit() override; protected: - virtual void update(float dt) override; CameraTest2(); Sprite *_sprite1; From 6eed3a2b27dda1d541db4f600a31de3c023b8fe5 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 13 Jan 2014 14:48:12 -0800 Subject: [PATCH 422/428] Adds missing copyright headers in some files --- cocos/2d/CCDirector.cpp | 58 +++++++++---------- .../ActionsEaseTest/ActionsEaseTest.cpp | 25 ++++++++ .../Classes/ActionsEaseTest/ActionsEaseTest.h | 25 ++++++++ .../ActionsProgressTest.cpp | 25 ++++++++ .../ActionsProgressTest/ActionsProgressTest.h | 25 ++++++++ .../Classes/ActionsTest/ActionsTest.cpp | 25 ++++++++ .../TestCpp/Classes/ActionsTest/ActionsTest.h | 25 ++++++++ .../Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp | 25 ++++++++ .../Cpp/TestCpp/Classes/MenuTest/MenuTest.h | 25 ++++++++ .../Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp | 25 ++++++++ .../Cpp/TestCpp/Classes/NodeTest/NodeTest.h | 25 ++++++++ .../SpriteTest/SpriteTest.cpp.REMOVED.git-id | 2 +- .../Classes/Texture2dTest/Texture2dTest.cpp | 25 ++++++++ .../Classes/Texture2dTest/Texture2dTest.h | 25 ++++++++ .../TransitionsTest/TransitionsTest.cpp | 25 ++++++++ .../Classes/TransitionsTest/TransitionsTest.h | 25 ++++++++ 16 files changed, 380 insertions(+), 30 deletions(-) diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index a0c42973e2..d3c53b6f3e 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -129,16 +129,16 @@ bool Director::init(void) // paused ? _paused = false; - + // purge ? _purgeDirectorInNextLoop = false; - _winSizeInPoints = Size::ZERO; + _winSizeInPoints = Size::ZERO; _openGLView = nullptr; - + _cullingFrustum = new Frustum(); - + _contentScaleFactor = 1.0f; // scheduler @@ -169,7 +169,7 @@ bool Director::init(void) return true; } - + Director::~Director(void) { CCLOGINFO("deallocing Director: %p", this); @@ -177,7 +177,7 @@ Director::~Director(void) CC_SAFE_RELEASE(_FPSLabel); CC_SAFE_RELEASE(_SPFLabel); CC_SAFE_RELEASE(_drawsLabel); - + CC_SAFE_RELEASE(_runningScene); CC_SAFE_RELEASE(_notificationNode); CC_SAFE_RELEASE(_scheduler); @@ -283,17 +283,17 @@ void Director::drawScene() } kmGLPushMatrix(); - + //construct the frustum { kmMat4 view; kmMat4 projection; kmGLGetMatrix(KM_GL_PROJECTION, &projection); kmGLGetMatrix(KM_GL_MODELVIEW, &view); - + _cullingFrustum->setupFromMatrix(view, projection); } - + // draw the scene if (_runningScene) { @@ -306,7 +306,7 @@ void Director::drawScene() { _notificationNode->visit(); } - + if (_displayStats) { showStats(); @@ -324,7 +324,7 @@ void Director::drawScene() { _openGLView->swapBuffers(); } - + if (_displayStats) { calculateMPF(); @@ -385,16 +385,16 @@ void Director::setOpenGLView(EGLView *openGLView) // set size _winSizeInPoints = _openGLView->getDesignResolutionSize(); - + createStatsLabel(); - + if (_openGLView) { setGLDefaultValues(); - } - + } + _renderer->initGLView(); - + CHECK_GL_ERROR_DEBUG(); // _touchDispatcher->setDispatchEvents(true); @@ -480,12 +480,12 @@ void Director::setProjection(Projection projection) kmGLMultMatrix(&matrixLookup); break; } - + case Projection::CUSTOM: // Projection Delegate is no longer needed // since the event "PROJECTION CHANGED" is emitted break; - + default: CCLOG("cocos2d: Director: unrecognized projection"); break; @@ -547,10 +547,10 @@ static void GLToClipTransform(kmMat4 *transformOut) { kmMat4 projection; kmGLGetMatrix(KM_GL_PROJECTION, &projection); - + kmMat4 modelview; kmGLGetMatrix(KM_GL_MODELVIEW, &modelview); - + kmMat4Multiply(transformOut, &projection, &modelview); } @@ -558,19 +558,19 @@ Point Director::convertToGL(const Point& uiPoint) { kmMat4 transform; GLToClipTransform(&transform); - + kmMat4 transformInv; kmMat4Inverse(&transformInv, &transform); - + // Calculate z=0 using -> transform*[0, 0, 0, 1]/w kmScalar zClip = transform.mat[14]/transform.mat[15]; - + Size glSize = _openGLView->getDesignResolutionSize(); kmVec3 clipCoord = {2.0f*uiPoint.x/glSize.width - 1.0f, 1.0f - 2.0f*uiPoint.y/glSize.height, zClip}; - + kmVec3 glCoord; kmVec3TransformCoord(&glCoord, &clipCoord, &transformInv); - + return Point(glCoord.x, glCoord.y); } @@ -578,12 +578,12 @@ Point Director::convertToUI(const Point& glPoint) { kmMat4 transform; GLToClipTransform(&transform); - + kmVec3 clipCoord; // Need to calculate the zero depth from the transform. kmVec3 glCoord = {glPoint.x, glPoint.y, 0.0}; kmVec3TransformCoord(&clipCoord, &glCoord, &transform); - + Size glSize = _openGLView->getDesignResolutionSize(); return Point(glSize.width*(clipCoord.x*0.5 + 0.5), glSize.height*(-clipCoord.y*0.5 + 0.5)); } @@ -604,7 +604,7 @@ Size Director::getVisibleSize() const { return _openGLView->getVisibleSize(); } - else + else { return Size::ZERO; } @@ -616,7 +616,7 @@ Point Director::getVisibleOrigin() const { return _openGLView->getVisibleOrigin(); } - else + else { return Point::ZERO; } diff --git a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp index 3cf942b540..c05bb831cd 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #include "ActionsEaseTest.h" #include "../testResource.h" diff --git a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h index 7751439668..443c532f32 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h +++ b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #ifndef _ACTIONS__EASE_TEST_H_ #define _ACTIONS__EASE_TEST_H_ diff --git a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp index e6c552db69..42f3774e3b 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #include "ActionsProgressTest.h" #include "../testResource.h" diff --git a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h index 1d63fea276..9e16818164 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h +++ b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #ifndef _ACTIONS__PROGRESS_TEST_H_ #define _ACTIONS_PROGRESS_TEST_H_ diff --git a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp index 229d6f11e6..fa40b74f0a 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #include "ActionsTest.h" #include "../testResource.h" #include "cocos2d.h" diff --git a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h index b5be2b348b..949ad43a38 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h +++ b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #ifndef _ActionsTest_H_ #define _ActionsTest_H_ diff --git a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp index e91fcdb3f6..f4da9b94c8 100644 --- a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp +++ b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #include "MenuTest.h" #include "../testResource.h" diff --git a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h index db6e0a918d..1910968546 100644 --- a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h +++ b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #ifndef _MENU_TEST_H_ #define _MENU_TEST_H_ diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp index aefe6a83e4..4d69c14542 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #include "NodeTest.h" #include "../testResource.h" diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h index 157d029a49..2207c65f7c 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #ifndef _NODE_TEST_H_ #define _NODE_TEST_H_ diff --git a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id index d3578f7962..8f885e907c 100644 --- a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id +++ b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id @@ -1 +1 @@ -e14a3c9f23fccd862ac2ffcba41ee7094ab54981 \ No newline at end of file +689b357d7acda141d13a3dfc4cb52aabb274f6cd \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp index 7a096c25cb..95bcb47323 100644 --- a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp +++ b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + // local import #include "Texture2dTest.h" #include "../testResource.h" diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h index cafc812e77..c331e0d254 100644 --- a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h +++ b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #ifndef __TEXTURE2D_TEST_H__ #define __TEXTURE2D_TEST_H__ diff --git a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp index 728901b809..7c71d0799e 100644 --- a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #include "TransitionsTest.h" #include "../testResource.h" #include "CCConfiguration.h" diff --git a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h index ccf7ba3100..c923409816 100644 --- a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h +++ b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #ifndef _TRANSITIONS_TEST_H_ #define _TRANSITIONS_TEST_H_ From c49aa1f12504e7cb92397a9af217ae9fc84d2a44 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Mon, 13 Jan 2014 23:07:44 +0000 Subject: [PATCH 423/428] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 74e535d0bd..f41186e7ef 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 74e535d0bd9cb4fd53244c46e2011e56367624a4 +Subproject commit f41186e7ef4209597d8c81952c3535b02305a79c From a1d8e8bdb1b7acd0c1ebd346db7d4783b31bb24e Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 14 Jan 2014 12:28:24 +0800 Subject: [PATCH 424/428] fix compiling error cause by macro define on window platform. --- cocos/2d/CCTMXTiledMap.cpp | 2 ++ cocos/2d/renderer/CCFrustum.cpp | 18 +++++++++--------- cocos/base/CCConsole.cpp | 9 ++++++--- cocos/base/CCGeometry.cpp | 2 ++ cocos/network/WebSocket.cpp | 2 ++ .../PerformanceTest/PerformanceLabelTest.cpp | 3 +++ .../PerformanceTest/PerformanceSpriteTest.cpp | 3 +++ .../Classes/TileMapTest/TileMapTest.cpp | 3 +++ 8 files changed, 30 insertions(+), 12 deletions(-) diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 33a4b77519..2a85788b53 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -30,6 +30,8 @@ THE SOFTWARE. #include "CCSprite.h" #include +#undef min +#undef max NS_CC_BEGIN // implementation TMXTiledMap diff --git a/cocos/2d/renderer/CCFrustum.cpp b/cocos/2d/renderer/CCFrustum.cpp index cc26b67cab..e02236e3b0 100644 --- a/cocos/2d/renderer/CCFrustum.cpp +++ b/cocos/2d/renderer/CCFrustum.cpp @@ -173,7 +173,7 @@ Frustum::~Frustum() { } -void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, float width, float height, float near, float far) +void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, float width, float height, float nearPlane, float farPlane) { kmVec3 cc = view.getPosition(); kmVec3 cDir = view.getDirection(); @@ -189,7 +189,7 @@ void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, floa kmVec3 point; kmVec3 normal; normal = cDir; - kmVec3Scale(&point, &cDir, near); + kmVec3Scale(&point, &cDir, nearPlane); kmVec3Add(&point, &point, &cc); kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_NEAR], &point, &normal); } @@ -199,7 +199,7 @@ void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, floa kmVec3 point; kmVec3 normal; kmVec3Scale(&normal, &cDir, -1); - kmVec3Scale(&point, &cDir, far); + kmVec3Scale(&point, &cDir, farPlane); kmVec3Add(&point, &point, &cc); kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_FAR], &point, &normal); } @@ -245,7 +245,7 @@ void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, floa } } -void Frustum::setupProjectionPerspective(const ViewTransform& view, float left, float right, float top, float bottom, float near, float far) +void Frustum::setupProjectionPerspective(const ViewTransform& view, float left, float right, float top, float bottom, float nearPlane, float farPlane) { kmVec3 cc = view.getPosition(); kmVec3 cDir = view.getDirection(); @@ -259,10 +259,10 @@ void Frustum::setupProjectionPerspective(const ViewTransform& view, float left, kmVec3 nearCenter; kmVec3 farCenter; - kmVec3Scale(&nearCenter, &cDir, near); + kmVec3Scale(&nearCenter, &cDir, nearPlane); kmVec3Add(&nearCenter, &nearCenter, &cc); - kmVec3Scale(&farCenter, &cDir, far); + kmVec3Scale(&farCenter, &cDir, farPlane); kmVec3Add(&farCenter, &farCenter, &cc); //near @@ -335,11 +335,11 @@ void Frustum::setupProjectionPerspective(const ViewTransform& view, float left, } -void Frustum::setupProjectionPerspectiveFov(const ViewTransform& view, float fov, float ratio, float near, float far) +void Frustum::setupProjectionPerspectiveFov(const ViewTransform& view, float fov, float ratio, float nearPlane, float farPlane) { - float width = 2 * near * tan(fov * 0.5); + float width = 2 * nearPlane * tan(fov * 0.5); float height = width/ratio; - setupProjectionPerspective(view, -width/2, width/2, height/2, -height/2, near, far); + setupProjectionPerspective(view, -width/2, width/2, height/2, -height/2, nearPlane, farPlane); } void Frustum::setupFromMatrix(const kmMat4 &view, const kmMat4 &projection) diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 58636d15cf..7505ab585e 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -51,6 +51,9 @@ #include "CCScene.h" #include "CCPlatformConfig.h" +#undef min +#undef max + NS_CC_BEGIN @@ -143,12 +146,12 @@ void log(const char *format, va_list args) #elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 WCHAR wszBuf[MAX_LOG_LENGTH] = {0}; - MultiByteToWideChar(CP_UTF8, 0, szBuf, -1, wszBuf, sizeof(wszBuf)); + MultiByteToWideChar(CP_UTF8, 0, buf, -1, wszBuf, sizeof(wszBuf)); OutputDebugStringW(wszBuf); OutputDebugStringA("\n"); - WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), szBuf, sizeof(szBuf), NULL, FALSE); - printf("%s\n", szBuf); + WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), buf, sizeof(buf), NULL, FALSE); + printf("%s\n", buf); #else // Linux, Mac, iOS, etc diff --git a/cocos/base/CCGeometry.cpp b/cocos/base/CCGeometry.cpp index 4be119ff6b..968ff8e0ba 100644 --- a/cocos/base/CCGeometry.cpp +++ b/cocos/base/CCGeometry.cpp @@ -27,6 +27,8 @@ THE SOFTWARE. #include "ccMacros.h" #include +#undef min +#undef max // implementation of Point NS_CC_BEGIN diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 5e17487567..01432c033e 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -39,6 +39,8 @@ #define WS_WRITE_BUFFER_SIZE 2048 +#undef min +#undef max NS_CC_BEGIN namespace network { diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.cpp index 317bbb8a60..3efe4d3993 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.cpp @@ -1,5 +1,8 @@ #include "PerformanceLabelTest.h" +#undef min +#undef max + enum { kMaxNodes = 200, kNodesIncrease = 10, diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp index a9e6f78c94..e1b150278f 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp @@ -1,5 +1,8 @@ #include "PerformanceSpriteTest.h" +#undef min +#undef max + enum { kMaxNodes = 50000, kNodesIncrease = 250, diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp index 75f0fd6eee..fcde928c1e 100644 --- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp @@ -3,6 +3,9 @@ #include "renderer/CCRenderer.h" #include "renderer/CCCustomCommand.h" +#undef min +#undef max + enum { kTagTileMap = 1, From 83a42dc760739b01ca679150e367d39ea9c5a8d5 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 14 Jan 2014 13:59:00 +0800 Subject: [PATCH 425/428] closed #3698: Wrong display when dragging window through retina and non-retina screen. --- cocos/2d/platform/mac/CCEGLView.h | 6 +- cocos/2d/platform/mac/CCEGLView.mm | 107 +++++++++++++++++++---------- 2 files changed, 76 insertions(+), 37 deletions(-) diff --git a/cocos/2d/platform/mac/CCEGLView.h b/cocos/2d/platform/mac/CCEGLView.h index 6b7495f5d0..5b72a9b66f 100644 --- a/cocos/2d/platform/mac/CCEGLView.h +++ b/cocos/2d/platform/mac/CCEGLView.h @@ -74,6 +74,9 @@ public: /** @deprecated Use getInstance() instead */ CC_DEPRECATED_ATTRIBUTE static EGLView* sharedOpenGLView(); + + inline bool isRetina() { return _isRetina; }; + protected: /* * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. @@ -82,8 +85,8 @@ protected: private: bool _captured; bool _supportTouch; + bool _isRetina; - int _frameBufferSize[2]; float _frameZoomFactor; static EGLView* s_pEglView; public: @@ -93,6 +96,7 @@ public: GLFWwindow* getWindow() const { return _mainWindow; } private: GLFWwindow* _mainWindow; + friend class EGLViewEventHandler; }; NS_CC_END // end of namespace cocos2d diff --git a/cocos/2d/platform/mac/CCEGLView.mm b/cocos/2d/platform/mac/CCEGLView.mm index afd9c66b92..cad82ee6c1 100644 --- a/cocos/2d/platform/mac/CCEGLView.mm +++ b/cocos/2d/platform/mac/CCEGLView.mm @@ -178,25 +178,26 @@ public: static float s_mouseX; static float s_mouseY; - static void OnGLFWError(int errorID, const char* errorDesc); - static void OnGLFWMouseCallBack(GLFWwindow* window, int button, int action, int modify); - static void OnGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y); - static void OnGLFWMouseScrollCallback(GLFWwindow* window, double x, double y); - static void OnGLFWKeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); - static void OnGLFWCharCallback(GLFWwindow* window, unsigned int character); - static void OnGLFWWindowPosCallback(GLFWwindow* windows, int x, int y); + static void onGLFWError(int errorID, const char* errorDesc); + static void onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int modify); + static void onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y); + static void onGLFWMouseScrollCallback(GLFWwindow* window, double x, double y); + static void onGLFWKeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); + static void onGLFWCharCallback(GLFWwindow* window, unsigned int character); + static void onGLFWWindowPosCallback(GLFWwindow* windows, int x, int y); + static void onGLFWframebuffersize(GLFWwindow* window, int w, int h); }; bool EGLViewEventHandler::s_captured = false; float EGLViewEventHandler::s_mouseX = 0; float EGLViewEventHandler::s_mouseY = 0; -void EGLViewEventHandler::OnGLFWError(int errorID, const char* errorDesc) +void EGLViewEventHandler::onGLFWError(int errorID, const char* errorDesc) { CCLOGERROR("GLFWError #%d Happen, %s\n", errorID, errorDesc); } -void EGLViewEventHandler::OnGLFWMouseCallBack(GLFWwindow* window, int button, int action, int modify) +void EGLViewEventHandler::onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int modify) { EGLView* eglView = EGLView::getInstance(); if(nullptr == eglView) return; @@ -240,10 +241,16 @@ void EGLViewEventHandler::OnGLFWMouseCallBack(GLFWwindow* window, int button, in } } -void EGLViewEventHandler::OnGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y) +void EGLViewEventHandler::onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y) { EGLView* eglView = EGLView::getInstance(); if(nullptr == eglView) return; + + if (eglView->isRetina()) { + x *= 2; + y *= 2; + } + s_mouseX = (float)x; s_mouseY = (float)y; @@ -265,7 +272,7 @@ void EGLViewEventHandler::OnGLFWMouseMoveCallBack(GLFWwindow* window, double x, Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } -void EGLViewEventHandler::OnGLFWMouseScrollCallback(GLFWwindow* window, double x, double y) +void EGLViewEventHandler::onGLFWMouseScrollCallback(GLFWwindow* window, double x, double y) { EGLView* eglView = EGLView::getInstance(); if(nullptr == eglView) return; @@ -277,7 +284,7 @@ void EGLViewEventHandler::OnGLFWMouseScrollCallback(GLFWwindow* window, double x Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } -void EGLViewEventHandler::OnGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) +void EGLViewEventHandler::onGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) { if (GLFW_REPEAT != action) { @@ -287,19 +294,40 @@ void EGLViewEventHandler::OnGLFWKeyCallback(GLFWwindow *window, int key, int sca } } -void EGLViewEventHandler::OnGLFWCharCallback(GLFWwindow *window, unsigned int character) +void EGLViewEventHandler::onGLFWCharCallback(GLFWwindow *window, unsigned int character) { IMEDispatcher::sharedDispatcher()->dispatchInsertText((const char*) &character, 1); } -void EGLViewEventHandler::OnGLFWWindowPosCallback(GLFWwindow *windows, int x, int y) +void EGLViewEventHandler::onGLFWWindowPosCallback(GLFWwindow *windows, int x, int y) { - if(Director::getInstance()) + Director::getInstance()->setViewport(); +} + +void EGLViewEventHandler::onGLFWframebuffersize(GLFWwindow* window, int w, int h) +{ + auto view = EGLView::getInstance(); + + float frameSizeW = view->getFrameSize().width; + float frameSizeH = view->getFrameSize().height; + float factorX = frameSizeW / w * view->getFrameZoomFactor(); + float factorY = frameSizeH / h * view->getFrameZoomFactor();; + + if (fabs(factorX - 0.5f) < FLT_MIN && fabs(factorY - 0.5f) < FLT_MIN ) { - Director::getInstance()->setViewport(); + view->_isRetina = true; + view->setFrameZoomFactor(2.0f * view->getFrameZoomFactor()); + glfwSetWindowSize(window, static_cast(frameSizeW * 0.5f * view->getFrameZoomFactor()) , static_cast(frameSizeH * 0.5f * view->getFrameZoomFactor())); + } + else if(fabs(factorX - 2.0f) < FLT_MIN && fabs(factorY - 2.0f) < FLT_MIN) + { + view->_isRetina = false; + view->setFrameZoomFactor(0.5f * view->getFrameZoomFactor()); + glfwSetWindowSize(window, static_cast(frameSizeW * view->getFrameZoomFactor()), static_cast(frameSizeH * view->getFrameZoomFactor())); } } + //end EGLViewEventHandler @@ -313,12 +341,13 @@ EGLView::EGLView() : _captured(false) , _frameZoomFactor(1.0f) , _supportTouch(false) +, _isRetina(false) , _mainWindow(nullptr) { CCASSERT(nullptr == s_pEglView, "EGLView is singleton, Should be inited only one time\n"); _viewName = "cocos2dx"; s_pEglView = this; - glfwSetErrorCallback(EGLViewEventHandler::OnGLFWError); + glfwSetErrorCallback(EGLViewEventHandler::onGLFWError); glfwInit(); } @@ -341,15 +370,25 @@ bool EGLView::init(const std::string& viewName, float width, float height, float _mainWindow = glfwCreateWindow(_screenSize.width * _frameZoomFactor, _screenSize.height * _frameZoomFactor, _viewName.c_str(), nullptr, nullptr); glfwMakeContextCurrent(_mainWindow); - glfwGetFramebufferSize(_mainWindow, &_frameBufferSize[0], &_frameBufferSize[1]); + int w, h; + glfwGetWindowSize(_mainWindow, &w, &h); + int frameBufferW, frameBufferH; + glfwGetFramebufferSize(_mainWindow, &frameBufferW, &frameBufferH); - glfwSetMouseButtonCallback(_mainWindow,EGLViewEventHandler::OnGLFWMouseCallBack); - glfwSetCursorPosCallback(_mainWindow,EGLViewEventHandler::OnGLFWMouseMoveCallBack); - glfwSetScrollCallback(_mainWindow, EGLViewEventHandler::OnGLFWMouseScrollCallback); - glfwSetCharCallback(_mainWindow, EGLViewEventHandler::OnGLFWCharCallback); - glfwSetKeyCallback(_mainWindow, EGLViewEventHandler::OnGLFWKeyCallback); - glfwSetWindowPosCallback(_mainWindow, EGLViewEventHandler::OnGLFWWindowPosCallback); + if (frameBufferW == 2 * w && frameBufferH == 2 * h) + { + _isRetina = true; + setFrameZoomFactor(frameZoomFactor * 2); + glfwSetWindowSize(_mainWindow, width/2 * _frameZoomFactor, height/2 * _frameZoomFactor); + } + glfwSetMouseButtonCallback(_mainWindow,EGLViewEventHandler::onGLFWMouseCallBack); + glfwSetCursorPosCallback(_mainWindow,EGLViewEventHandler::onGLFWMouseMoveCallBack); + glfwSetScrollCallback(_mainWindow, EGLViewEventHandler::onGLFWMouseScrollCallback); + glfwSetCharCallback(_mainWindow, EGLViewEventHandler::onGLFWCharCallback); + glfwSetKeyCallback(_mainWindow, EGLViewEventHandler::onGLFWKeyCallback); + glfwSetWindowPosCallback(_mainWindow, EGLViewEventHandler::onGLFWWindowPosCallback); + glfwSetFramebufferSizeCallback(_mainWindow, EGLViewEventHandler::onGLFWframebuffersize); // check OpenGL version at first const GLubyte* glVersion = glGetString(GL_VERSION); @@ -453,22 +492,18 @@ void EGLView::setFrameSize(float width, float height) void EGLView::setViewPortInPoints(float x , float y , float w , float h) { - float frameZoomFactorX = _frameBufferSize[0]/_screenSize.width; - float frameZoomFactorY = _frameBufferSize[1]/_screenSize.height; - glViewport((GLint)(x * _scaleX * frameZoomFactorX + _viewPortRect.origin.x * frameZoomFactorX), - (GLint)(y * _scaleY * frameZoomFactorY + _viewPortRect.origin.y * frameZoomFactorY), - (GLsizei)(w * _scaleX * frameZoomFactorX), - (GLsizei)(h * _scaleY * frameZoomFactorY)); + glViewport((GLint)(x * _scaleX * _frameZoomFactor + _viewPortRect.origin.x * _frameZoomFactor), + (GLint)(y * _scaleY * _frameZoomFactor + _viewPortRect.origin.y * _frameZoomFactor), + (GLsizei)(w * _scaleX * _frameZoomFactor), + (GLsizei)(h * _scaleY * _frameZoomFactor)); } void EGLView::setScissorInPoints(float x , float y , float w , float h) { - float frameZoomFactorX = _frameBufferSize[0]/_screenSize.width; - float frameZoomFactorY = _frameBufferSize[1]/_screenSize.height; - glScissor((GLint)(x * _scaleX * frameZoomFactorX + _viewPortRect.origin.x * frameZoomFactorX), - (GLint)(y * _scaleY * frameZoomFactorY + _viewPortRect.origin.y * frameZoomFactorY), - (GLsizei)(w * _scaleX * frameZoomFactorX), - (GLsizei)(h * _scaleY * frameZoomFactorY)); + glScissor((GLint)(x * _scaleX * _frameZoomFactor + _viewPortRect.origin.x * _frameZoomFactor), + (GLint)(y * _scaleY * _frameZoomFactor + _viewPortRect.origin.y * _frameZoomFactor), + (GLsizei)(w * _scaleX * _frameZoomFactor), + (GLsizei)(h * _scaleY * _frameZoomFactor)); } EGLView* EGLView::getInstance() From 92d345156b093a12f5f8812ec6e215ee3f2fdc69 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 14 Jan 2014 14:20:22 +0800 Subject: [PATCH 426/428] un-define clash with the existing macro definition in platform/win32/CCStdC.h --- cocos/2d/CCTMXTiledMap.cpp | 2 -- cocos/2d/platform/win32/CCStdC.h | 3 +++ cocos/base/CCConsole.cpp | 3 --- cocos/base/CCGeometry.cpp | 2 -- cocos/network/WebSocket.cpp | 2 -- .../TestCpp/Classes/PerformanceTest/PerformanceLabelTest.cpp | 3 --- .../TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp | 3 --- samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp | 3 --- 8 files changed, 3 insertions(+), 18 deletions(-) diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 2a85788b53..33a4b77519 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -30,8 +30,6 @@ THE SOFTWARE. #include "CCSprite.h" #include -#undef min -#undef max NS_CC_BEGIN // implementation TMXTiledMap diff --git a/cocos/2d/platform/win32/CCStdC.h b/cocos/2d/platform/win32/CCStdC.h index 19ea8fda7d..47677d29c9 100644 --- a/cocos/2d/platform/win32/CCStdC.h +++ b/cocos/2d/platform/win32/CCStdC.h @@ -148,5 +148,8 @@ inline errno_t strcpy_s(char *strDestination, size_t numberOfElements, #undef DELETE #endif +#undef min +#undef max + #endif // __CC_STD_C_H__ diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 7505ab585e..69c44c4494 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -51,9 +51,6 @@ #include "CCScene.h" #include "CCPlatformConfig.h" -#undef min -#undef max - NS_CC_BEGIN diff --git a/cocos/base/CCGeometry.cpp b/cocos/base/CCGeometry.cpp index 968ff8e0ba..4be119ff6b 100644 --- a/cocos/base/CCGeometry.cpp +++ b/cocos/base/CCGeometry.cpp @@ -27,8 +27,6 @@ THE SOFTWARE. #include "ccMacros.h" #include -#undef min -#undef max // implementation of Point NS_CC_BEGIN diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 01432c033e..5e17487567 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -39,8 +39,6 @@ #define WS_WRITE_BUFFER_SIZE 2048 -#undef min -#undef max NS_CC_BEGIN namespace network { diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.cpp index 3efe4d3993..317bbb8a60 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.cpp @@ -1,8 +1,5 @@ #include "PerformanceLabelTest.h" -#undef min -#undef max - enum { kMaxNodes = 200, kNodesIncrease = 10, diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp index e1b150278f..a9e6f78c94 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp @@ -1,8 +1,5 @@ #include "PerformanceSpriteTest.h" -#undef min -#undef max - enum { kMaxNodes = 50000, kNodesIncrease = 250, diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp index fcde928c1e..75f0fd6eee 100644 --- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp @@ -3,9 +3,6 @@ #include "renderer/CCRenderer.h" #include "renderer/CCCustomCommand.h" -#undef min -#undef max - enum { kTagTileMap = 1, From 7e1fd18f76009b9e8b7cc317bf853d8a5a308b28 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 14 Jan 2014 14:38:34 +0800 Subject: [PATCH 427/428] =?UTF-8?q?FLT=5FMIN=20=E2=80=94>=20FTL=5FEPSILON.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/2d/platform/mac/CCEGLView.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/2d/platform/mac/CCEGLView.mm b/cocos/2d/platform/mac/CCEGLView.mm index cad82ee6c1..a3635be8ed 100644 --- a/cocos/2d/platform/mac/CCEGLView.mm +++ b/cocos/2d/platform/mac/CCEGLView.mm @@ -313,13 +313,13 @@ void EGLViewEventHandler::onGLFWframebuffersize(GLFWwindow* window, int w, int h float factorX = frameSizeW / w * view->getFrameZoomFactor(); float factorY = frameSizeH / h * view->getFrameZoomFactor();; - if (fabs(factorX - 0.5f) < FLT_MIN && fabs(factorY - 0.5f) < FLT_MIN ) + if (fabs(factorX - 0.5f) < FLT_EPSILON && fabs(factorY - 0.5f) < FLT_EPSILON ) { view->_isRetina = true; view->setFrameZoomFactor(2.0f * view->getFrameZoomFactor()); glfwSetWindowSize(window, static_cast(frameSizeW * 0.5f * view->getFrameZoomFactor()) , static_cast(frameSizeH * 0.5f * view->getFrameZoomFactor())); } - else if(fabs(factorX - 2.0f) < FLT_MIN && fabs(factorY - 2.0f) < FLT_MIN) + else if(fabs(factorX - 2.0f) < FLT_EPSILON && fabs(factorY - 2.0f) < FLT_EPSILON) { view->_isRetina = false; view->setFrameZoomFactor(0.5f * view->getFrameZoomFactor()); From 11d290ab134ba06629a50e953ecdb7db75db4ac8 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 14 Jan 2014 14:54:19 +0800 Subject: [PATCH 428/428] Update AUTHORS [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index ac01d86aa8..27723850a3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -714,6 +714,9 @@ Developers: akof1314 TestCpp works by using CMake and mingw on Windows. + + Pisces000221 + Corrected a few mistakes in the README file of project-creator. Retired Core Developers: WenSheng Yang