From 538c01e76ee8035a1183a95493ea3fcd1e79fdc5 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 24 Mar 2014 14:16:27 +0800 Subject: [PATCH 01/12] label:support clip blank of upper and lower margin. --- cocos/2d/CCFontAtlas.cpp | 4 +++ cocos/2d/CCFontAtlas.h | 2 ++ cocos/2d/CCLabel.cpp | 2 ++ cocos/2d/CCLabel.h | 6 ++++ cocos/2d/CCLabelTextFormatter.cpp | 50 ++++++++++++++++++++++++++++++- 5 files changed, 63 insertions(+), 1 deletion(-) diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index 3e40e41419..11f9998d6c 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -231,6 +231,8 @@ bool FontAtlas::prepareLetterDefinitions(unsigned short *utf16String) auto pixelFormat = fontTTf->getOutlineSize() > 0 ? Texture2D::PixelFormat::AI88 : Texture2D::PixelFormat::A8; bool existNewLetter = false; + int bottomHeight = _commonLineHeight - _fontAscender; + for (int i = 0; i < length; ++i) { auto outIterator = _fontLetterDefinitions.find(utf16String[i]); @@ -248,6 +250,7 @@ bool FontAtlas::prepareLetterDefinitions(unsigned short *utf16String) tempDef.height = tempRect.size.height + _letterPadding; tempDef.offsetX = tempRect.origin.x + offsetAdjust; tempDef.offsetY = _fontAscender + tempRect.origin.y - offsetAdjust; + tempDef.clipBottom = bottomHeight - (tempDef.height + tempRect.origin.y + offsetAdjust); if (_currentPageOrigX + tempDef.width > CacheTextureWidth) { @@ -290,6 +293,7 @@ bool FontAtlas::prepareLetterDefinitions(unsigned short *utf16String) tempDef.offsetX = 0; tempDef.offsetY = 0; tempDef.textureID = 0; + tempDef.clipBottom = 0; _currentPageOrigX += 1; } diff --git a/cocos/2d/CCFontAtlas.h b/cocos/2d/CCFontAtlas.h index 2d3eb615a3..a10fe9eb9f 100644 --- a/cocos/2d/CCFontAtlas.h +++ b/cocos/2d/CCFontAtlas.h @@ -50,6 +50,8 @@ struct FontLetterDefinition int textureID; bool validDefinition; int xAdvance; + + int clipBottom; }; class CC_DLL FontAtlas : public Ref diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 3d6bc68508..644ceeec06 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -339,6 +339,8 @@ void Label::reset() _textColor = Color4B::WHITE; _textColorF = Color4F::WHITE; setColor(Color3B::WHITE); + + _clipEnabled = false; } void Label::updateShaderProgram() diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index 93130c4e10..dc9271d8ab 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -217,6 +217,10 @@ public: virtual Sprite * getLetter(int lettetIndex); + /** clip upper and lower margin for reduce height of label. + */ + void setClipMarginEnabled(bool clipEnabled) { _clipEnabled = clipEnabled; } + // font related stuff int getCommonLineHeight() const; @@ -365,6 +369,8 @@ protected: Color4B _textColor; Color4F _textColorF; + bool _clipEnabled; + private: CC_DISALLOW_COPY_AND_ASSIGN(Label); diff --git a/cocos/2d/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp index 9f0efe1eaa..119456caa6 100644 --- a/cocos/2d/CCLabelTextFormatter.cpp +++ b/cocos/2d/CCLabelTextFormatter.cpp @@ -321,6 +321,16 @@ bool LabelTextFormatter::createStringSprites(Label *theLabel) FontLetterDefinition tempDefinition; Point letterPosition; const auto& kernings = theLabel->_horizontalKernings; + + float clipTop = 0; + float clipBottom = 0; + int lineIndex = 0; + bool lineStart = true; + bool clip = false; + if (theLabel->_currentLabelType == Label::LabelType::TTF && theLabel->_clipEnabled) + { + clip = true; + } for (unsigned int i = 0; i < stringLen; i++) { @@ -337,9 +347,10 @@ bool LabelTextFormatter::createStringSprites(Label *theLabel) charYOffset = -1; charAdvance = -1; } - + if (c == '\n') { + lineIndex++; nextFontPositionX = 0; nextFontPositionY -= theLabel->_commonLineHeight; @@ -347,8 +358,30 @@ bool LabelTextFormatter::createStringSprites(Label *theLabel) if(nextFontPositionY < theLabel->_commonLineHeight) break; + lineStart = true; continue; } + else if (clip && tempDefinition.height > 0.0f) + { + if (lineStart) + { + if (lineIndex == 0) + { + clipTop = charYOffset; + } + lineStart = false; + clipBottom = tempDefinition.clipBottom; + } + else if(tempDefinition.clipBottom < clipBottom) + { + clipBottom = tempDefinition.clipBottom; + } + + if (lineIndex == 0 && charYOffset < clipTop) + { + clipTop = charYOffset; + } + } letterPosition.x = (nextFontPositionX + charXOffset + kernings[i]) / contentScaleFactor; letterPosition.y = (nextFontPositionY - charYOffset) / contentScaleFactor; @@ -382,11 +415,26 @@ bool LabelTextFormatter::createStringSprites(Label *theLabel) } tmpSize.height = totalHeight; + if (theLabel->_labelHeight > 0) { tmpSize.height = theLabel->_labelHeight * contentScaleFactor; } + + if (clip) + { + int clipTotal = (clipTop + clipBottom) / contentScaleFactor; + tmpSize.height -= clipTotal * contentScaleFactor; + clipBottom /= contentScaleFactor; + + for (int i = 0; i < theLabel->_limitShowCount; i++) + { + theLabel->_lettersInfo[i].position.y -= clipBottom; + } + } + theLabel->setContentSize(CC_SIZE_PIXELS_TO_POINTS(tmpSize)); + return true; } From 19341ceaf42fe3bbb8fed7e9ca8a6f08d58bab8c Mon Sep 17 00:00:00 2001 From: LinWenhai Date: Tue, 25 Mar 2014 14:54:42 +0800 Subject: [PATCH 02/12] add getter of ClipMarginEnabled. --- cocos/2d/CCLabel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index dc9271d8ab..c453112cb4 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -220,7 +220,7 @@ public: /** clip upper and lower margin for reduce height of label. */ void setClipMarginEnabled(bool clipEnabled) { _clipEnabled = clipEnabled; } - + bool getClipMarginEnabled() const { return _clipEnabled; } // font related stuff int getCommonLineHeight() const; From c37584ee5c4b568598f5ff11298a7019399d887b Mon Sep 17 00:00:00 2001 From: koowolf <450928375@qq.com> Date: Tue, 25 Mar 2014 16:14:21 +0800 Subject: [PATCH 03/12] closed #4542: fix crash in win32(delete mutex while still lock) --- cocos/network/WebSocket.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 4ba4b708a0..4e98591d24 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -187,16 +187,19 @@ void WsThreadHelper::update(float dt) WsMessage *msg = nullptr; // Returns quickly if no message - std::lock_guard lk(_UIWsMessageQueueMutex); + _UIWsMessageQueueMutex.lock(); if (0 == _UIWsMessageQueue->size()) { + _UIWsMessageQueueMutex.unlock(); return; } // Gets message msg = *(_UIWsMessageQueue->begin()); _UIWsMessageQueue->pop_front(); + + _UIWsMessageQueueMutex.unlock(); if (_ws) { From d6ad9274c4341fac0f7581cfd10853dca026b3f7 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Tue, 25 Mar 2014 16:19:34 +0800 Subject: [PATCH 04/12] closed #2880, Generate mipmap for the texture has mipmaps when reload textures. --- cocos/2d/CCTexture2D.cpp | 3 +++ cocos/2d/CCTextureCache.cpp | 9 +++++++++ cocos/2d/CCTextureCache.h | 2 ++ tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp | 1 + 4 files changed, 15 insertions(+) diff --git a/cocos/2d/CCTexture2D.cpp b/cocos/2d/CCTexture2D.cpp index a43563d862..564298eca3 100644 --- a/cocos/2d/CCTexture2D.cpp +++ b/cocos/2d/CCTexture2D.cpp @@ -1199,6 +1199,9 @@ void Texture2D::generateMipmap() GL::bindTexture2D( _name ); glGenerateMipmap(GL_TEXTURE_2D); _hasMipmaps = true; +#if CC_ENABLE_CACHE_TEXTURE_DATA + VolatileTextureMgr::setHasMipmaps(this, _hasMipmaps); +#endif } bool Texture2D::hasMipmaps() const diff --git a/cocos/2d/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp index 0e7bd4f647..38ef71f31a 100644 --- a/cocos/2d/CCTextureCache.cpp +++ b/cocos/2d/CCTextureCache.cpp @@ -635,6 +635,12 @@ void VolatileTextureMgr::addStringTexture(Texture2D *tt, const char* text, const vt->_fontDefinition = fontDefinition; } +void VolatileTextureMgr::setHasMipmaps(Texture2D *t, bool hasMipmaps) +{ + VolatileTexture *vt = findVolotileTexture(t); + vt->_hasMipmaps = hasMipmaps; +} + void VolatileTextureMgr::setTexParameters(Texture2D *t, const Texture2D::TexParams &texParams) { VolatileTexture *vt = findVolotileTexture(t); @@ -717,6 +723,9 @@ void VolatileTextureMgr::reloadAllTextures() default: break; } + if (vt->_hasMipmaps) { + vt->_texture->generateMipmap(); + } vt->_texture->setTexParameters(vt->_texParams); } diff --git a/cocos/2d/CCTextureCache.h b/cocos/2d/CCTextureCache.h index 8ebd4821b5..39b1a8e957 100644 --- a/cocos/2d/CCTextureCache.h +++ b/cocos/2d/CCTextureCache.h @@ -251,6 +251,7 @@ protected: std::string _fileName; + bool _hasMipmaps; Texture2D::TexParams _texParams; std::string _text; FontDefinition _fontDefinition; @@ -264,6 +265,7 @@ public: static void addDataTexture(Texture2D *tt, void* data, int dataLen, Texture2D::PixelFormat pixelFormat, const Size& contentSize); static void addImage(Texture2D *tt, Image *image); + static void setHasMipmaps(Texture2D *t, bool hasMipmaps); static void setTexParameters(Texture2D *t, const Texture2D::TexParams &texParams); static void removeTexture(Texture2D *t); static void reloadAllTextures(); diff --git a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp index 4f80334657..05e2fc128a 100644 --- a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp +++ b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp @@ -38,6 +38,7 @@ static std::function createFunctions[] = { CL(TexturePVRv3Premult), + CL(TextureMipMap), CL(TextureMemoryAlloc), CL(TextureAlias), CL(TexturePVRMipMap), From e65315d01e2617653afb177dfe61ba3a4c7ab004 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 25 Mar 2014 08:22:13 +0000 Subject: [PATCH 05/12] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cocos2dx_files.json.REMOVED.git-id b/templates/cocos2dx_files.json.REMOVED.git-id index 1c31d78c7e..089a8e7561 100644 --- a/templates/cocos2dx_files.json.REMOVED.git-id +++ b/templates/cocos2dx_files.json.REMOVED.git-id @@ -1 +1 @@ -9be9de64b36c123c9aba99c3149937136749b712 \ No newline at end of file +d53bc7d6e68a49984c5971344f59bba8414d142b \ No newline at end of file From bb190fe78ac2fdb7343f0cadfe7dcfcda9d92724 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 25 Mar 2014 16:24:08 +0800 Subject: [PATCH 06/12] [ci] Updates travis scripts. --- tools/travis-scripts/generate-bindings.sh | 7 +++++-- tools/travis-scripts/generate-cocosfiles.sh | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/travis-scripts/generate-bindings.sh b/tools/travis-scripts/generate-bindings.sh index 19978804e3..d586e61d09 100755 --- a/tools/travis-scripts/generate-bindings.sh +++ b/tools/travis-scripts/generate-bindings.sh @@ -23,6 +23,7 @@ ELAPSEDSECS=`date +%s` COCOS_BRANCH="update_lua_bindings_$ELAPSEDSECS" COCOS_ROBOT_REMOTE="https://${GH_USER}:${GH_PASSWORD}@github.com/${GH_USER}/cocos2d-x.git" PULL_REQUEST_REPO="https://api.github.com/repos/cocos2d/cocos2d-x/pulls" +FETCH_REMOTE_BRANCH="develop" # Exit on error set -e @@ -88,12 +89,14 @@ pushd "$PROJECT_ROOT" git status echo -echo Comparing with HEAD ... +echo Comparing with origin HEAD ... echo +git fetch origin ${FETCH_REMOTE_BRANCH} + # Don't exit on non-zero return value set +e -git diff --stat --exit-code +git diff FETCH_HEAD --stat --exit-code DIFF_RETVAL=$? if [ $DIFF_RETVAL -eq 0 ] diff --git a/tools/travis-scripts/generate-cocosfiles.sh b/tools/travis-scripts/generate-cocosfiles.sh index 1014bc303e..ec43dc8300 100755 --- a/tools/travis-scripts/generate-cocosfiles.sh +++ b/tools/travis-scripts/generate-cocosfiles.sh @@ -6,6 +6,7 @@ PROJECT_ROOT="$DIR"/../.. COMMITTAG="[AUTO][ci skip]: updating cocos2dx_files.json" PUSH_REPO="https://api.github.com/repos/cocos2d/cocos2d-x/pulls" OUTPUT_FILE_PATH="${PROJECT_ROOT}/templates/cocos2dx_files.json" +FETCH_REMOTE_BRANCH="develop" # Exit on error set -e @@ -51,12 +52,14 @@ pushd "$PROJECT_ROOT" git status echo -echo Comparing with HEAD ... +echo Comparing with origin HEAD ... echo +git fetch origin ${FETCH_REMOTE_BRANCH} + # Don't exit on non-zero return value set +e -git diff --stat --exit-code +git diff FETCH_HEAD --stat --exit-code DIFF_RETVAL=$? if [ $DIFF_RETVAL -eq 0 ] From 81cc05729c28eb492c58f1b28a4624efbc0b704c Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 25 Mar 2014 08:26:13 +0000 Subject: [PATCH 07/12] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/RichText.lua | 5 + .../lua-bindings/auto/api/ScrollView.lua | 86 +++------- .../lua-bindings/auto/api/Widget.lua | 159 +++--------------- .../lua_cocos2dx_ui_auto.cpp.REMOVED.git-id | 2 +- .../auto/lua_cocos2dx_ui_auto.hpp | 6 - 5 files changed, 57 insertions(+), 201 deletions(-) diff --git a/cocos/scripting/lua-bindings/auto/api/RichText.lua b/cocos/scripting/lua-bindings/auto/api/RichText.lua index 3c181b3a2d..b14dcddf9e 100644 --- a/cocos/scripting/lua-bindings/auto/api/RichText.lua +++ b/cocos/scripting/lua-bindings/auto/api/RichText.lua @@ -52,6 +52,11 @@ -- @param self -- @return RichText#RichText ret (return value: ccui.RichText) +-------------------------------- +-- @function [parent=#RichText] getDescription +-- @param self +-- @return string#string ret (return value: string) + -------------------------------- -- @function [parent=#RichText] RichText -- @param self diff --git a/cocos/scripting/lua-bindings/auto/api/ScrollView.lua b/cocos/scripting/lua-bindings/auto/api/ScrollView.lua index 66b3f739f6..b5532e0192 100644 --- a/cocos/scripting/lua-bindings/auto/api/ScrollView.lua +++ b/cocos/scripting/lua-bindings/auto/api/ScrollView.lua @@ -187,58 +187,22 @@ -- @param #int int -- @param #int int +-------------------------------- +-- @function [parent=#ScrollView] getChildByName +-- @param self +-- @param #char char +-- @return Widget#Widget ret (return value: ccui.Widget) + -------------------------------- -- @function [parent=#ScrollView] getDescription -- @param self -- @return string#string ret (return value: string) -------------------------------- --- @function [parent=#ScrollView] removeAllChildren +-- @function [parent=#ScrollView] update -- @param self +-- @param #float float --------------------------------- --- overload function: getChildren() --- --- overload function: getChildren() --- --- @function [parent=#ScrollView] getChildren --- @param self --- @return array_table#array_table ret (retunr value: array_table) - --------------------------------- --- @function [parent=#ScrollView] getNodes --- @param self --- @return array_table#array_table ret (return value: array_table) - --------------------------------- --- @function [parent=#ScrollView] getChildByTag --- @param self --- @param #int int --- @return Node#Node ret (return value: cc.Node) - --------------------------------- --- @function [parent=#ScrollView] removeNode --- @param self --- @param #cc.Node node - --------------------------------- --- @function [parent=#ScrollView] removeNodeByTag --- @param self --- @param #int int - --------------------------------- --- overload function: addNode(cc.Node, int) --- --- overload function: addNode(cc.Node) --- --- overload function: addNode(cc.Node, int, int) --- --- @function [parent=#ScrollView] addNode --- @param self --- @param #cc.Node node --- @param #int int --- @param #int int - -------------------------------- -- @function [parent=#ScrollView] getLayoutType -- @param self @@ -250,24 +214,7 @@ -- @param #bool bool -------------------------------- --- @function [parent=#ScrollView] update --- @param self --- @param #float float - --------------------------------- --- @function [parent=#ScrollView] getNodeByTag --- @param self --- @param #int int --- @return Node#Node ret (return value: cc.Node) - --------------------------------- --- @function [parent=#ScrollView] getChildByName --- @param self --- @param #char char --- @return Widget#Widget ret (return value: ccui.Widget) - --------------------------------- --- @function [parent=#ScrollView] removeAllNodes +-- @function [parent=#ScrollView] removeAllChildren -- @param self -------------------------------- @@ -276,6 +223,21 @@ -- @param #cc.Node node -- @param #bool bool +-------------------------------- +-- overload function: getChildren() +-- +-- overload function: getChildren() +-- +-- @function [parent=#ScrollView] getChildren +-- @param self +-- @return array_table#array_table ret (retunr value: array_table) + +-------------------------------- +-- @function [parent=#ScrollView] getChildByTag +-- @param self +-- @param #int int +-- @return Node#Node ret (return value: cc.Node) + -------------------------------- -- @function [parent=#ScrollView] getChildrenCount -- @param self diff --git a/cocos/scripting/lua-bindings/auto/api/Widget.lua b/cocos/scripting/lua-bindings/auto/api/Widget.lua index 5bea038c34..1f97832c9f 100644 --- a/cocos/scripting/lua-bindings/auto/api/Widget.lua +++ b/cocos/scripting/lua-bindings/auto/api/Widget.lua @@ -1,18 +1,13 @@ -------------------------------- -- @module Widget --- @extend Node +-- @extend ProtectedNode -------------------------------- -- @function [parent=#Widget] setSizePercent -- @param self -- @param #point_table point --------------------------------- --- @function [parent=#Widget] isFlippedX --- @param self --- @return bool#bool ret (return value: bool) - -------------------------------- -- @function [parent=#Widget] getCustomSize -- @param self @@ -29,10 +24,9 @@ -- @param #bool bool -------------------------------- --- @function [parent=#Widget] getNodeByTag +-- @function [parent=#Widget] getLeftInParent -- @param self --- @param #int int --- @return Node#Node ret (return value: cc.Node) +-- @return float#float ret (return value: float) -------------------------------- -- @function [parent=#Widget] getTouchEndPos @@ -44,11 +38,6 @@ -- @param self -- @param #point_table point --------------------------------- --- @function [parent=#Widget] getNodes --- @param self --- @return array_table#array_table ret (return value: array_table) - -------------------------------- -- @function [parent=#Widget] getLayoutSize -- @param self @@ -69,15 +58,6 @@ -- @param self -- @return bool#bool ret (return value: bool) --------------------------------- --- overload function: updateSizeAndPosition(size_table) --- --- overload function: updateSizeAndPosition() --- --- @function [parent=#Widget] updateSizeAndPosition --- @param self --- @param #size_table size - -------------------------------- -- @function [parent=#Widget] getBottomInParent -- @param self @@ -100,9 +80,9 @@ -- @return PositionType#PositionType ret (return value: ccui.PositionType) -------------------------------- --- @function [parent=#Widget] setName +-- @function [parent=#Widget] getWidgetType -- @param self --- @param #char char +-- @return WidgetType#WidgetType ret (return value: ccui.WidgetType) -------------------------------- -- @function [parent=#Widget] getChildByName @@ -116,9 +96,9 @@ -- @return bool#bool ret (return value: bool) -------------------------------- --- @function [parent=#Widget] removeNodeByTag +-- @function [parent=#Widget] isFocused -- @param self --- @param #int int +-- @return bool#bool ret (return value: bool) -------------------------------- -- @function [parent=#Widget] isTouchEnabled @@ -175,18 +155,10 @@ -- @param #ccui.BrightStyle brightstyle -------------------------------- --- overload function: addNode(cc.Node, int) --- --- overload function: addNode(cc.Node) --- --- overload function: addNode(cc.Node, int, int) --- --- @function [parent=#Widget] addNode +-- @function [parent=#Widget] setName -- @param self --- @param #cc.Node node --- @param #int int --- @param #int int - +-- @param #char char + -------------------------------- -- @function [parent=#Widget] setLayoutParameter -- @param self @@ -202,21 +174,11 @@ -- @param self -- @return point_table#point_table ret (return value: point_table) --------------------------------- --- @function [parent=#Widget] getLeftInParent --- @param self --- @return float#float ret (return value: float) - -------------------------------- -- @function [parent=#Widget] setActionTag -- @param self -- @param #int int --------------------------------- --- @function [parent=#Widget] ignoreContentAdaptWithSize --- @param self --- @param #bool bool - -------------------------------- -- @function [parent=#Widget] isBright -- @param self @@ -234,10 +196,14 @@ -- @return float#float ret (return value: float) -------------------------------- --- @function [parent=#Widget] getWidgetType +-- overload function: updateSizeAndPosition(size_table) +-- +-- overload function: updateSizeAndPosition() +-- +-- @function [parent=#Widget] updateSizeAndPosition -- @param self --- @return WidgetType#WidgetType ret (return value: ccui.WidgetType) - +-- @param #size_table size + -------------------------------- -- @function [parent=#Widget] getSize -- @param self @@ -254,13 +220,9 @@ -- @return SizeType#SizeType ret (return value: ccui.SizeType) -------------------------------- --- @function [parent=#Widget] removeNode --- @param self --- @param #cc.Node node - --------------------------------- --- @function [parent=#Widget] removeAllNodes +-- @function [parent=#Widget] ignoreContentAdaptWithSize -- @param self +-- @param #bool bool -------------------------------- -- @function [parent=#Widget] getPositionPercent @@ -274,7 +236,7 @@ -- @return bool#bool ret (return value: bool) -------------------------------- --- @function [parent=#Widget] isFocused +-- @function [parent=#Widget] isFlippedX -- @param self -- @return bool#bool ret (return value: bool) @@ -310,72 +272,11 @@ -- @param self -- @return Widget#Widget ret (return value: ccui.Widget) --------------------------------- --- overload function: addChild(cc.Node, int) --- --- overload function: addChild(cc.Node) --- --- overload function: addChild(cc.Node, int, int) --- --- @function [parent=#Widget] addChild --- @param self --- @param #cc.Node node --- @param #int int --- @param #int int - -------------------------------- -- @function [parent=#Widget] setColor -- @param self -- @param #color3B_table color3b --------------------------------- --- @function [parent=#Widget] removeFromParent --- @param self - --------------------------------- --- @function [parent=#Widget] removeAllChildrenWithCleanup --- @param self --- @param #bool bool - --------------------------------- --- @function [parent=#Widget] removeAllChildren --- @param self - --------------------------------- --- @function [parent=#Widget] sortAllChildren --- @param self - --------------------------------- --- @function [parent=#Widget] removeChild --- @param self --- @param #cc.Node node --- @param #bool bool - --------------------------------- --- overload function: getChildren() --- --- overload function: getChildren() --- --- @function [parent=#Widget] getChildren --- @param self --- @return array_table#array_table ret (retunr value: array_table) - --------------------------------- --- @function [parent=#Widget] getDescription --- @param self --- @return string#string ret (return value: string) - --------------------------------- --- @function [parent=#Widget] getChildByTag --- @param self --- @param #int int --- @return Node#Node ret (return value: cc.Node) - --------------------------------- --- @function [parent=#Widget] removeFromParentAndCleanup --- @param self --- @param #bool bool - -------------------------------- -- @function [parent=#Widget] getColor -- @param self @@ -386,26 +287,20 @@ -- @param self -- @param #unsigned char char --------------------------------- --- @function [parent=#Widget] setPosition --- @param self --- @param #point_table point - --------------------------------- --- @function [parent=#Widget] removeChildByTag --- @param self --- @param #int int --- @param #bool bool - -------------------------------- -- @function [parent=#Widget] getOpacity -- @param self -- @return unsigned char#unsigned char ret (return value: unsigned char) -------------------------------- --- @function [parent=#Widget] getChildrenCount +-- @function [parent=#Widget] setPosition -- @param self --- @return long#long ret (return value: long) +-- @param #point_table point + +-------------------------------- +-- @function [parent=#Widget] getDescription +-- @param self +-- @return string#string ret (return value: string) -------------------------------- -- @function [parent=#Widget] Widget diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp.REMOVED.git-id b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp.REMOVED.git-id index 104c65729e..e024e99b59 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp.REMOVED.git-id +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp.REMOVED.git-id @@ -1 +1 @@ -11bba6be0cebc89eb4c7195a61d021e51719468f \ No newline at end of file +19adb2eb5a08b20b670b77975f7e30c08bbac2d6 \ No newline at end of file diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index 1e576402ce..3a1b0bb858 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -362,12 +362,6 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); - - - - - - From f672f3153ec3ef93aa8f2ad16ae32ce2a579e6ab Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 25 Mar 2014 16:30:00 +0800 Subject: [PATCH 08/12] Update CHANGELOG [ci skip] --- CHANGELOG.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.REMOVED.git-id b/CHANGELOG.REMOVED.git-id index af31d79c6e..f99513ccea 100644 --- a/CHANGELOG.REMOVED.git-id +++ b/CHANGELOG.REMOVED.git-id @@ -1 +1 @@ -819b72559f8be48c41958b0afb4c6513207b453a \ No newline at end of file +f25c155ba7b72acabb5314391df45df00f582ca3 \ No newline at end of file From 4b454fe7bbb5a067dda9d4305912d4d8a078d183 Mon Sep 17 00:00:00 2001 From: LinWenhai Date: Tue, 25 Mar 2014 16:37:34 +0800 Subject: [PATCH 09/12] Update getter of ClipMarginEnabled. --- cocos/2d/CCLabel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index c453112cb4..c2e2be23b8 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -220,7 +220,7 @@ public: /** clip upper and lower margin for reduce height of label. */ void setClipMarginEnabled(bool clipEnabled) { _clipEnabled = clipEnabled; } - bool getClipMarginEnabled() const { return _clipEnabled; } + bool isClipMarginEnabled() const { return _clipEnabled; } // font related stuff int getCommonLineHeight() const; From fe89291be64450e24ec1956956bac3a854c574c1 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 25 Mar 2014 16:47:59 +0800 Subject: [PATCH 10/12] Update CHANGELOG [ci skip] --- CHANGELOG.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.REMOVED.git-id b/CHANGELOG.REMOVED.git-id index f99513ccea..04713d44d3 100644 --- a/CHANGELOG.REMOVED.git-id +++ b/CHANGELOG.REMOVED.git-id @@ -1 +1 @@ -f25c155ba7b72acabb5314391df45df00f582ca3 \ No newline at end of file +185679986c46f4ecc4cb98f4fc014a8e9a42a88f \ No newline at end of file From dda53f26d487e4621594cac51a5f58fe31137800 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 25 Mar 2014 16:50:36 +0800 Subject: [PATCH 11/12] [ci skip] --- CHANGELOG.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.REMOVED.git-id b/CHANGELOG.REMOVED.git-id index 04713d44d3..73a33eb03f 100644 --- a/CHANGELOG.REMOVED.git-id +++ b/CHANGELOG.REMOVED.git-id @@ -1 +1 @@ -185679986c46f4ecc4cb98f4fc014a8e9a42a88f \ No newline at end of file +5b8d2ae9f19e1ca958245cf11e144d18d6ee3f89 \ No newline at end of file From b8eee8e1a4a2b26d312070e408a1096f7e511b86 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 25 Mar 2014 17:07:15 +0800 Subject: [PATCH 12/12] [ci] Updates travis scripts. only commit relevant folder. --- tools/travis-scripts/generate-bindings.sh | 3 ++- tools/travis-scripts/generate-cocosfiles.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/travis-scripts/generate-bindings.sh b/tools/travis-scripts/generate-bindings.sh index d586e61d09..0a2b428b57 100755 --- a/tools/travis-scripts/generate-bindings.sh +++ b/tools/travis-scripts/generate-bindings.sh @@ -24,6 +24,7 @@ COCOS_BRANCH="update_lua_bindings_$ELAPSEDSECS" COCOS_ROBOT_REMOTE="https://${GH_USER}:${GH_PASSWORD}@github.com/${GH_USER}/cocos2d-x.git" PULL_REQUEST_REPO="https://api.github.com/repos/cocos2d/cocos2d-x/pulls" FETCH_REMOTE_BRANCH="develop" +COMMIT_PATH="cocos/scripting/lua-bindings/auto" # Exit on error set -e @@ -96,7 +97,7 @@ git fetch origin ${FETCH_REMOTE_BRANCH} # Don't exit on non-zero return value set +e -git diff FETCH_HEAD --stat --exit-code +git diff FETCH_HEAD --stat --exit-code ${COMMIT_PATH} DIFF_RETVAL=$? if [ $DIFF_RETVAL -eq 0 ] diff --git a/tools/travis-scripts/generate-cocosfiles.sh b/tools/travis-scripts/generate-cocosfiles.sh index ec43dc8300..82837b2a6d 100755 --- a/tools/travis-scripts/generate-cocosfiles.sh +++ b/tools/travis-scripts/generate-cocosfiles.sh @@ -7,6 +7,7 @@ COMMITTAG="[AUTO][ci skip]: updating cocos2dx_files.json" PUSH_REPO="https://api.github.com/repos/cocos2d/cocos2d-x/pulls" OUTPUT_FILE_PATH="${PROJECT_ROOT}/templates/cocos2dx_files.json" FETCH_REMOTE_BRANCH="develop" +COMMIT_PATH="templates/cocos2dx_files.json" # Exit on error set -e @@ -59,7 +60,7 @@ git fetch origin ${FETCH_REMOTE_BRANCH} # Don't exit on non-zero return value set +e -git diff FETCH_HEAD --stat --exit-code +git diff FETCH_HEAD --stat --exit-code ${COMMIT_PATH} DIFF_RETVAL=$? if [ $DIFF_RETVAL -eq 0 ]