From d4a9640a5e19f0377c00e007b8f1e7f1b7282ff4 Mon Sep 17 00:00:00 2001 From: heliclei Date: Tue, 10 Jun 2014 16:29:06 +0800 Subject: [PATCH 01/24] [ccconsole]Add version command. --- cocos/base/CCConsole.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index d289c6669e..744d31ac80 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -65,6 +65,7 @@ #include "base/base64.h" NS_CC_BEGIN +extern const char* cocos2dVersion(void); //TODO: these general utils should be in a seperate class // // Trimming functions were taken from: http://stackoverflow.com/a/217605 @@ -295,6 +296,9 @@ Console::Console() { "director", "director commands, type -h or [director help] to list supported directives", std::bind(&Console::commandDirector, this, std::placeholders::_1, std::placeholders::_2) }, { "touch", "simulate touch event via console, type -h or [touch help] to list supported directives", std::bind(&Console::commandTouch, this, std::placeholders::_1, std::placeholders::_2) }, { "upload", "upload file. Args: [filename base64_encoded_data]", std::bind(&Console::commandUpload, this, std::placeholders::_1) }, + { "version", "print version string ", [](int fd, const std::string& args) { + mydprintf(fd, "%s\n", cocos2dVersion()); + } }, }; ; From 2e73f631568aef097cdb8c1741936cd30321f189 Mon Sep 17 00:00:00 2001 From: elsanide Date: Tue, 10 Jun 2014 18:15:07 +0900 Subject: [PATCH 02/24] #5506 bug fix when Director->convertToUI() called, returned wrong value. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit kazmath code (under 3.0 version.) //******************************************************** kmVec3* kmVec3TransformCoord(kmVec3* pOut, const kmVec3* pV, const kmMat4* pM) { /* a = (Vx, Vy, Vz, 1) b = (a×M)T Out = 1 ⁄ bw(bx, by, bz) */ kmVec4 v; kmVec4 inV; kmVec4Fill(&inV, pV->x, pV->y, pV->z, 1.0); kmVec4Transform(&v, &inV,pM); pOut->x = v.x / v.w; pOut->y = v.y / v.w; pOut->z = v.z / v.w; return pOut; } //******************************************************** Mat4.h & MathUtil version (3.1 or later) //******************************************************** inline void MathUtil::transformVec4(const float* m, const float* v, float* dst) { // Handle case where v == dst. float x = v[0] * m[0] + v[1] * m[4] + v[2] * m[8] + v[3] * m[12]; float y = v[0] * m[1] + v[1] * m[5] + v[2] * m[9] + v[3] * m[13]; float z = v[0] * m[2] + v[1] * m[6] + v[2] * m[10] + v[3] * m[14]; float w = v[0] * m[3] + v[1] * m[7] + v[2] * m[11] + v[3] * m[15]; dst[0] = x; dst[1] = y; dst[2] = z; dst[3] = w; } //**************************************************** Transforms 3-D vector or an array of 3-D vectors using a given matrix, projecting the result back into w = 1. but, it is not apply w = 1. --- cocos/base/CCDirector.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index 9d1e02f187..ac7519a062 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -1,4 +1,4 @@ -/**************************************************************************** +/**************************************************************************** Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2013 cocos2d-x.org Copyright (c) 2011 Zynga Inc. @@ -763,6 +763,18 @@ Vec2 Director::convertToUI(const Vec2& glPoint) Vec4 glCoord(glPoint.x, glPoint.y, 0.0, 1); transform.transformVector(glCoord, &clipCoord); + /* + BUG-FIX #5506 + + a = (Vx, Vy, Vz, 1) + b = (a×M)T + Out = 1 ⁄ bw(bx, by, bz) + */ + + clipCoord.x = clipCoord.x / clipCoord.w; + clipCoord.y = clipCoord.y / clipCoord.w; + clipCoord.z = clipCoord.z / clipCoord.w; + Size glSize = _openGLView->getDesignResolutionSize(); float factor = 1.0/glCoord.w; return Vec2(glSize.width*(clipCoord.x*0.5 + 0.5) * factor, glSize.height*(-clipCoord.y*0.5 + 0.5) * factor); From 8ba4c7a083426e42122d263799b3d1476d249dc1 Mon Sep 17 00:00:00 2001 From: Sachin Garg Date: Tue, 10 Jun 2014 17:59:15 +0530 Subject: [PATCH 03/24] GLProgram should not abort() if shader compilation fails, returning false will allow app to show custom error message to user (or use other simple shaders if a complicated shader fails to compile on some device). --- cocos/renderer/CCGLProgram.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index e198cfa2c4..a95e7e714a 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -138,9 +138,17 @@ GLProgram::~GLProgram() { CCLOGINFO("%s %d deallocing GLProgram: %p", __FUNCTION__, __LINE__, this); - // there is no need to delete the shaders. They should have been already deleted. - CCASSERT(_vertShader == 0, "Vertex Shaders should have been already deleted"); - CCASSERT(_fragShader == 0, "Fragment Shaders should have been already deleted"); + if (_vertShader) + { + glDeleteShader(_vertShader); + } + + if (_fragShader) + { + glDeleteShader(_fragShader); + } + + _vertShader = _fragShader = 0; if (_program) { @@ -436,7 +444,7 @@ bool GLProgram::compileShader(GLuint * shader, GLenum type, const GLchar* source } free(src); - abort(); + return false;; } return (status == GL_TRUE); } From 4ce2d7f1931913c999805a8b8a048358a8987dfa Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Wed, 11 Jun 2014 10:10:11 +0800 Subject: [PATCH 04/24] Update values of KeyCode used in the Lua to fix related error --- .../lua-bindings/script/Cocos2dConstants.lua | 332 +++++++++--------- tests/lua-tests/src/KeypadTest/KeypadTest.lua | 2 +- .../NewEventDispatcherTest.lua | 8 +- 3 files changed, 181 insertions(+), 161 deletions(-) diff --git a/cocos/scripting/lua-bindings/script/Cocos2dConstants.lua b/cocos/scripting/lua-bindings/script/Cocos2dConstants.lua index e07724a7ba..059cccc32c 100644 --- a/cocos/scripting/lua-bindings/script/Cocos2dConstants.lua +++ b/cocos/scripting/lua-bindings/script/Cocos2dConstants.lua @@ -383,165 +383,183 @@ cc.LabelEffect = GLOW = 3, } +cc.KeyCodeKey = +{ + "KEY_NONE", + "KEY_PAUSE", + "KEY_SCROLL_LOCK", + "KEY_PRINT", + "KEY_SYSREQ", + "KEY_BREAK", + "KEY_ESCAPE", + "KEY_BACKSPACE", + "KEY_TAB", + "KEY_BACK_TAB", + "KEY_RETURN", + "KEY_CAPS_LOCK", + "KEY_SHIFT", + "KEY_CTRL", + "KEY_ALT", + "KEY_MENU", + "KEY_HYPER", + "KEY_INSERT", + "KEY_HOME", + "KEY_PG_UP", + "KEY_DELETE", + "KEY_END", + "KEY_PG_DOWN", + "KEY_LEFT_ARROW", + "KEY_RIGHT_ARROW", + "KEY_UP_ARROW", + "KEY_DOWN_ARROW", + "KEY_NUM_LOCK", + "KEY_KP_PLUS", + "KEY_KP_MINUS", + "KEY_KP_MULTIPLY", + "KEY_KP_DIVIDE", + "KEY_KP_ENTER", + "KEY_KP_HOME", + "KEY_KP_UP", + "KEY_KP_PG_UP", + "KEY_KP_LEFT", + "KEY_KP_FIVE", + "KEY_KP_RIGHT", + "KEY_KP_END", + "KEY_KP_DOWN", + "KEY_KP_PG_DOWN", + "KEY_KP_INSERT", + "KEY_KP_DELETE", + "KEY_F1", + "KEY_F2", + "KEY_F3", + "KEY_F4", + "KEY_F5", + "KEY_F6", + "KEY_F7", + "KEY_F8", + "KEY_F9", + "KEY_F10", + "KEY_F11", + "KEY_F12", + "KEY_SPACE", + "KEY_EXCLAM", + "KEY_QUOTE", + "KEY_NUMBER", + "KEY_DOLLAR", + "KEY_PERCENT", + "KEY_CIRCUMFLEX", + "KEY_AMPERSAND", + "KEY_APOSTROPHE", + "KEY_LEFT_PARENTHESIS", + "KEY_RIGHT_PARENTHESIS", + "KEY_ASTERISK", + "KEY_PLUS", + "KEY_COMMA", + "KEY_MINUS", + "KEY_PERIOD", + "KEY_SLASH", + "KEY_0", + "KEY_1", + "KEY_2", + "KEY_3", + "KEY_4", + "KEY_5", + "KEY_6", + "KEY_7", + "KEY_8", + "KEY_9", + "KEY_COLON", + "KEY_SEMICOLON", + "KEY_LESS_THAN", + "KEY_EQUAL", + "KEY_GREATER_THAN", + "KEY_QUESTION", + "KEY_AT", + "KEY_CAPITAL_A", + "KEY_CAPITAL_B", + "KEY_CAPITAL_C", + "KEY_CAPITAL_D", + "KEY_CAPITAL_E", + "KEY_CAPITAL_F", + "KEY_CAPITAL_G", + "KEY_CAPITAL_H", + "KEY_CAPITAL_I", + "KEY_CAPITAL_J", + "KEY_CAPITAL_K", + "KEY_CAPITAL_L", + "KEY_CAPITAL_M", + "KEY_CAPITAL_N", + "KEY_CAPITAL_O", + "KEY_CAPITAL_P", + "KEY_CAPITAL_Q", + "KEY_CAPITAL_R", + "KEY_CAPITAL_S", + "KEY_CAPITAL_T", + "KEY_CAPITAL_U", + "KEY_CAPITAL_V", + "KEY_CAPITAL_W", + "KEY_CAPITAL_X", + "KEY_CAPITAL_Y", + "KEY_CAPITAL_Z", + "KEY_LEFT_BRACKET", + "KEY_BACK_SLASH", + "KEY_RIGHT_BRACKET", + "KEY_UNDERSCORE", + "KEY_GRAVE", + "KEY_A", + "KEY_B", + "KEY_C", + "KEY_D", + "KEY_E", + "KEY_F", + "KEY_G", + "KEY_H", + "KEY_I", + "KEY_J", + "KEY_K", + "KEY_L", + "KEY_M", + "KEY_N", + "KEY_O", + "KEY_P", + "KEY_Q", + "KEY_R", + "KEY_S", + "KEY_T", + "KEY_U", + "KEY_V", + "KEY_W", + "KEY_X", + "KEY_Y", + "KEY_Z", + "KEY_LEFT_BRACE", + "KEY_BAR", + "KEY_RIGHT_BRACE", + "KEY_TILDE", + "KEY_EURO", + "KEY_POUND", + "KEY_YEN", + "KEY_MIDDLE_DOT", + "KEY_SEARCH", + "KEY_DPAD_LEFT", + "KEY_DPAD_RIGHT", + "KEY_DPAD_UP", + "KEY_DPAD_DOWN", + "KEY_DPAD_CENTER", + "KEY_ENTER", + "KEY_PLAY", +} + cc.KeyCode = { - KEY_NONE = 0, - KEY_PAUSE = 0x0013, - KEY_SCROLL_LOCK = 0x1014, - KEY_PRINT = 0x1061, - KEY_SYSREQ = 0x106A, - KEY_BREAK = 0x106B, - KEY_ESCAPE = 0x001B, - KEY_BACKSPACE = 0x0008, - KEY_TAB = 0x0009, - KEY_BACK_TAB = 0x0089, - KEY_RETURN = 0x000D, - KEY_CAPS_LOCK = 0x00E5, - KEY_SHIFT = 0x00E1, - KEY_CTRL = 0x00E3, - KEY_ALT = 0x00E9, - KEY_MENU = 0x1067, - KEY_HYPER = 0x10ED, - KEY_INSERT = 0x1063, - KEY_HOME = 0x1050, - KEY_PG_UP = 0x1055, - KEY_DELETE = 0x10FF, - KEY_END = 0x1057, - KEY_PG_DOWN = 0x1056, - KEY_LEFT_ARROW = 0x1051, - KEY_RIGHT_ARROW = 0x1053, - KEY_UP_ARROW = 0x1052, - KEY_DOWN_ARROW = 0x1054, - KEY_NUM_LOCK = 0x107F, - KEY_KP_PLUS = 0x10AB, - KEY_KP_MINUS = 0x10AD, - KEY_KP_MULTIPLY = 0x10AA, - KEY_KP_DIVIDE = 0x10AF, - KEY_KP_ENTER = 0x108D, - KEY_KP_HOME = 0x10B7, - KEY_KP_UP = 0x10B8, - KEY_KP_PG_UP = 0x10B9, - KEY_KP_LEFT = 0x10B4, - KEY_KP_FIVE = 0x10B5, - KEY_KP_RIGHT = 0x10B6, - KEY_KP_END = 0x10B1, - KEY_KP_DOWN = 0x10B2, - KEY_KP_PG_DOWN = 0x10B3, - KEY_KP_INSERT = 0x10B0, - KEY_KP_DELETE = 0x10AE, - KEY_F1 = 0x00BE, - KEY_F2 = 0x00BF, - KEY_F3 = 0x00C0, - KEY_F4 = 0x00C1, - KEY_F5 = 0x00C2, - KEY_F6 = 0x00C3, - KEY_F7 = 0x00C4, - KEY_F8 = 0x00C5, - KEY_F9 = 0x00C6, - KEY_F10 = 0x00C7, - KEY_F11 = 0x00C8, - KEY_F12 = 0x00C9, - KEY_SPACE = ' ', - KEY_EXCLAM = '!', - KEY_QUOTE = '"', - KEY_NUMBER = '#', - KEY_DOLLAR = '$', - KEY_PERCENT = '%', - KEY_CIRCUMFLEX = '^', - KEY_AMPERSAND = '&', - KEY_APOSTROPHE = '\'', - KEY_LEFT_PARENTHESIS = '(', - KEY_RIGHT_PARENTHESIS = ')', - KEY_ASTERISK = '*', - KEY_PLUS = '+', - KEY_COMMA = ',', - KEY_MINUS = '-', - KEY_PERIOD = '.', - KEY_SLASH = '/', - KEY_0 = '0', - KEY_1 = '1', - KEY_2 = '2', - KEY_3 = '3', - KEY_4 = '4', - KEY_5 = '5', - KEY_6 = '6', - KEY_7 = '7', - KEY_8 = '8', - KEY_9 = '9', - KEY_COLON = ':', - KEY_SEMICOLON = ';', - KEY_LESS_THAN = '<', - KEY_EQUAL = '=', - KEY_GREATER_THAN = '>', - KEY_QUESTION = '?', - KEY_AT = '@', - KEY_CAPITAL_A = 'A', - KEY_CAPITAL_B = 'B', - KEY_CAPITAL_C = 'C', - KEY_CAPITAL_D = 'D', - KEY_CAPITAL_E = 'E', - KEY_CAPITAL_F = 'F', - KEY_CAPITAL_G = 'G', - KEY_CAPITAL_H = 'H', - KEY_CAPITAL_I = 'I', - KEY_CAPITAL_J = 'J', - KEY_CAPITAL_K = 'K', - KEY_CAPITAL_L = 'L', - KEY_CAPITAL_M = 'M', - KEY_CAPITAL_N = 'N', - KEY_CAPITAL_O = 'O', - KEY_CAPITAL_P = 'P', - KEY_CAPITAL_Q = 'Q', - KEY_CAPITAL_R = 'R', - KEY_CAPITAL_S = 'S', - KEY_CAPITAL_T = 'T', - KEY_CAPITAL_U = 'U', - KEY_CAPITAL_V = 'V', - KEY_CAPITAL_W = 'W', - KEY_CAPITAL_X = 'X', - KEY_CAPITAL_Y = 'Y', - KEY_CAPITAL_Z = 'Z', - KEY_LEFT_BRACKET = '[', - KEY_BACK_SLASH = '\\', - KEY_RIGHT_BRACKET = ']', - KEY_UNDERSCORE = '_', - KEY_GRAVE = '`', - KEY_A = 'a', - KEY_B = 'b', - KEY_C = 'c', - KEY_D = 'd', - KEY_E = 'e', - KEY_F = 'f', - KEY_G = 'g', - KEY_H = 'h', - KEY_I = 'i', - KEY_J = 'j', - KEY_K = 'k', - KEY_L = 'l', - KEY_M = 'm', - KEY_N = 'n', - KEY_O = 'o', - KEY_P = 'p', - KEY_Q = 'q', - KEY_R = 'r', - KEY_S = 's', - KEY_T = 't', - KEY_U = 'u', - KEY_V = 'v', - KEY_W = 'w', - KEY_X = 'x', - KEY_Y = 'y', - KEY_Z = 'z', - KEY_LEFT_BRACE = '{', - KEY_BAR = '|', - KEY_RIGHT_BRACE = '}', - KEY_TILDE = '~', - KEY_EURO = 0x20AC, - KEY_POUND = 0x00A3, - KEY_YEN = 0x00A5, - KEY_MIDDLE_DOT = 0x0095, - KEY_SEARCH = 0xFFAA, -}; + +} + +for k,v in ipairs(cc.KeyCodeKey) do + cc.KeyCode[v] = k - 1 +end + +cc.KeyCode.KEY_BACK = cc.KeyCode.KEY_ESCAPE diff --git a/tests/lua-tests/src/KeypadTest/KeypadTest.lua b/tests/lua-tests/src/KeypadTest/KeypadTest.lua index b7e36aefcd..2437595c46 100644 --- a/tests/lua-tests/src/KeypadTest/KeypadTest.lua +++ b/tests/lua-tests/src/KeypadTest/KeypadTest.lua @@ -16,7 +16,7 @@ local function KeypadMainLayer() local function onKeyReleased(keyCode, event) local label = event:getCurrentTarget() - if keyCode == cc.KeyCode.KEY_BACKSPACE then + if keyCode == cc.KeyCode.KEY_BACK then label:setString("BACK clicked!") elseif keyCode == cc.KeyCode.KEY_MENU then label:setString("MENU clicked!") diff --git a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua index 0637edd403..09b158bd38 100644 --- a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua +++ b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua @@ -665,13 +665,15 @@ function LabelKeyboardEventTest:onEnter() self:addChild(statusLabel) local function onKeyPressed(keyCode, event) - local buf = string.format("Key %s was pressed!",string.char(keyCode)) + print("come in keyCode is ",keyCode) + local buf = string.format("Key %d was pressed!",keyCode) local label = event:getCurrentTarget() - label:setString(buf) + label:setString(buf..keyCode) end local function onKeyReleased(keyCode, event) - local buf = string.format("Key %s was released!",string.char(keyCode)) + print("come in keyCode is ", keyCode) + local buf = string.format("Key %s was released!",keyCode) local label = event:getCurrentTarget() label:setString(buf) end From 2252bc271b3e22914c30ac87eeb0b8f23a42feff Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Wed, 11 Jun 2014 10:14:24 +0800 Subject: [PATCH 05/24] Update the KeyCodeTest in the NewEventDispatcherTest --- .../src/NewEventDispatcherTest/NewEventDispatcherTest.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua index 09b158bd38..f280aa8036 100644 --- a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua +++ b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua @@ -668,7 +668,7 @@ function LabelKeyboardEventTest:onEnter() print("come in keyCode is ",keyCode) local buf = string.format("Key %d was pressed!",keyCode) local label = event:getCurrentTarget() - label:setString(buf..keyCode) + label:setString(buf) end local function onKeyReleased(keyCode, event) From d200dd83a457fea1d4478c73815b3295da5e70bf Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Wed, 11 Jun 2014 10:15:38 +0800 Subject: [PATCH 06/24] Update the KeyCodeTest in the NewEventDispatcherTest --- .../src/NewEventDispatcherTest/NewEventDispatcherTest.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua index f280aa8036..cfd93216b7 100644 --- a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua +++ b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua @@ -665,14 +665,12 @@ function LabelKeyboardEventTest:onEnter() self:addChild(statusLabel) local function onKeyPressed(keyCode, event) - print("come in keyCode is ",keyCode) local buf = string.format("Key %d was pressed!",keyCode) local label = event:getCurrentTarget() label:setString(buf) end local function onKeyReleased(keyCode, event) - print("come in keyCode is ", keyCode) local buf = string.format("Key %s was released!",keyCode) local label = event:getCurrentTarget() label:setString(buf) From 2d50df8b01a01ea1679ae4150dc351f3efacc613 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Wed, 11 Jun 2014 10:19:07 +0800 Subject: [PATCH 07/24] Update the KeyCodeTest in the NewEventDispatcherTest --- .../src/NewEventDispatcherTest/NewEventDispatcherTest.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua index cfd93216b7..5664f938eb 100644 --- a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua +++ b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua @@ -671,7 +671,7 @@ function LabelKeyboardEventTest:onEnter() end local function onKeyReleased(keyCode, event) - local buf = string.format("Key %s was released!",keyCode) + local buf = string.format("Key %d was released!",keyCode) local label = event:getCurrentTarget() label:setString(buf) end From 818c4782242dec063ce1f9ec01b77026fbf6d66e Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 11 Jun 2014 02:30:38 +0000 Subject: [PATCH 08/24] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/SpriteFrame.lua | 34 +--- .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 190 ++---------------- .../lua-bindings/auto/lua_cocos2dx_auto.hpp | 2 - 3 files changed, 22 insertions(+), 204 deletions(-) diff --git a/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua b/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua index 57b9051eaa..145e82f645 100644 --- a/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua +++ b/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua @@ -19,19 +19,10 @@ -- @param #cc.Texture2D texture2d -------------------------------- --- overload function: initWithTexture(cc.Texture2D, rect_table, bool, vec2_table, size_table) --- --- overload function: initWithTexture(cc.Texture2D, rect_table) --- --- @function [parent=#SpriteFrame] initWithTexture +-- @function [parent=#SpriteFrame] getOffset -- @param self --- @param #cc.Texture2D texture2d --- @param #rect_table rect --- @param #bool bool --- @param #vec2_table vec2 --- @param #size_table size --- @return bool#bool ret (retunr value: bool) - +-- @return vec2_table#vec2_table ret (return value: vec2_table) + -------------------------------- -- @function [parent=#SpriteFrame] setRectInPixels -- @param self @@ -77,30 +68,11 @@ -- @param self -- @param #vec2_table vec2 --------------------------------- --- @function [parent=#SpriteFrame] getOffset --- @param self --- @return vec2_table#vec2_table ret (return value: vec2_table) - -------------------------------- -- @function [parent=#SpriteFrame] isRotated -- @param self -- @return bool#bool ret (return value: bool) --------------------------------- --- overload function: initWithTextureFilename(string, rect_table, bool, vec2_table, size_table) --- --- overload function: initWithTextureFilename(string, rect_table) --- --- @function [parent=#SpriteFrame] initWithTextureFilename --- @param self --- @param #string str --- @param #rect_table rect --- @param #bool bool --- @param #vec2_table vec2 --- @param #size_table size --- @return bool#bool ret (retunr value: bool) - -------------------------------- -- @function [parent=#SpriteFrame] setRect -- @param self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index e44234a6f5..8f264e16eb 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -18065,77 +18065,46 @@ int lua_cocos2dx_SpriteFrame_setTexture(lua_State* tolua_S) return 0; } -int lua_cocos2dx_SpriteFrame_initWithTexture(lua_State* tolua_S) +int lua_cocos2dx_SpriteFrame_getOffset(lua_State* tolua_S) { int argc = 0; cocos2d::SpriteFrame* cobj = nullptr; bool ok = true; + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; #endif + #if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"cc.SpriteFrame",0,&tolua_err)) goto tolua_lerror; #endif + cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) + if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_initWithTexture'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOffset'", nullptr); return 0; } #endif + argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 5) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1); - - if (!ok) { break; } - bool arg2; - ok &= luaval_to_boolean(tolua_S, 4,&arg2); - - if (!ok) { break; } - cocos2d::Vec2 arg3; - ok &= luaval_to_vec2(tolua_S, 5, &arg3); - - if (!ok) { break; } - cocos2d::Size arg4; - ok &= luaval_to_size(tolua_S, 6, &arg4); - - if (!ok) { break; } - bool ret = cobj->initWithTexture(arg0, arg1, arg2, arg3, arg4); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1); - - if (!ok) { break; } - bool ret = cobj->initWithTexture(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "initWithTexture",argc, 2); + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::Vec2& ret = cobj->getOffset(); + vec2_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOffset",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_initWithTexture'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getOffset'.",&tolua_err); #endif return 0; @@ -18546,50 +18515,6 @@ int lua_cocos2dx_SpriteFrame_setOffset(lua_State* tolua_S) return 0; } -int lua_cocos2dx_SpriteFrame_getOffset(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SpriteFrame* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.SpriteFrame",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOffset'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - const cocos2d::Vec2& ret = cobj->getOffset(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOffset",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getOffset'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_SpriteFrame_isRotated(lua_State* tolua_S) { int argc = 0; @@ -18634,81 +18559,6 @@ int lua_cocos2dx_SpriteFrame_isRotated(lua_State* tolua_S) return 0; } -int lua_cocos2dx_SpriteFrame_initWithTextureFilename(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SpriteFrame* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.SpriteFrame",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_initWithTextureFilename'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 5) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1); - - if (!ok) { break; } - bool arg2; - ok &= luaval_to_boolean(tolua_S, 4,&arg2); - - if (!ok) { break; } - cocos2d::Vec2 arg3; - ok &= luaval_to_vec2(tolua_S, 5, &arg3); - - if (!ok) { break; } - cocos2d::Size arg4; - ok &= luaval_to_size(tolua_S, 6, &arg4); - - if (!ok) { break; } - bool ret = cobj->initWithTextureFilename(arg0, arg1, arg2, arg3, arg4); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1); - - if (!ok) { break; } - bool ret = cobj->initWithTextureFilename(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "initWithTextureFilename",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_initWithTextureFilename'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_SpriteFrame_setRect(lua_State* tolua_S) { int argc = 0; @@ -18984,7 +18834,7 @@ int lua_register_cocos2dx_SpriteFrame(lua_State* tolua_S) tolua_function(tolua_S,"clone",lua_cocos2dx_SpriteFrame_clone); tolua_function(tolua_S,"setRotated",lua_cocos2dx_SpriteFrame_setRotated); tolua_function(tolua_S,"setTexture",lua_cocos2dx_SpriteFrame_setTexture); - tolua_function(tolua_S,"initWithTexture",lua_cocos2dx_SpriteFrame_initWithTexture); + tolua_function(tolua_S,"getOffset",lua_cocos2dx_SpriteFrame_getOffset); tolua_function(tolua_S,"setRectInPixels",lua_cocos2dx_SpriteFrame_setRectInPixels); tolua_function(tolua_S,"getTexture",lua_cocos2dx_SpriteFrame_getTexture); tolua_function(tolua_S,"getRect",lua_cocos2dx_SpriteFrame_getRect); @@ -18994,9 +18844,7 @@ int lua_register_cocos2dx_SpriteFrame(lua_State* tolua_S) tolua_function(tolua_S,"getOriginalSizeInPixels",lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels); tolua_function(tolua_S,"setOriginalSizeInPixels",lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels); tolua_function(tolua_S,"setOffset",lua_cocos2dx_SpriteFrame_setOffset); - tolua_function(tolua_S,"getOffset",lua_cocos2dx_SpriteFrame_getOffset); tolua_function(tolua_S,"isRotated",lua_cocos2dx_SpriteFrame_isRotated); - tolua_function(tolua_S,"initWithTextureFilename",lua_cocos2dx_SpriteFrame_initWithTextureFilename); tolua_function(tolua_S,"setRect",lua_cocos2dx_SpriteFrame_setRect); tolua_function(tolua_S,"getOffsetInPixels",lua_cocos2dx_SpriteFrame_getOffsetInPixels); tolua_function(tolua_S,"getOriginalSize",lua_cocos2dx_SpriteFrame_getOriginalSize); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index 9c0e2da3c7..2a7aac6379 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -1612,8 +1612,6 @@ int register_all_cocos2dx(lua_State* tolua_S); - - From 54379f48a9fea6ca9f6a4faf812cf9ee2b16e3cf Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Wed, 11 Jun 2014 11:24:17 +0800 Subject: [PATCH 09/24] =?UTF-8?q?Fix=20the=20crash=20of=20Texture2dTest=20?= =?UTF-8?q?when=20`=E2=80=94ndk-mode`=20is=20`release`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp | 4 ++-- tests/lua-tests/src/Texture2dTest/Texture2dTest.lua | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp index 3954f9c8b3..8df33583ba 100644 --- a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp +++ b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp @@ -1986,10 +1986,10 @@ void TextureMemoryAlloc::updateImage(cocos2d::Ref *sender) file = "Images/fire_rgba8888.pvr"; break; case 2: - file = "Images/grossini_prv_rgba8888.pvr"; + file = "Images/grossini_pvr_rgba8888.pvr"; break; case 3: - file = "Images/grossini_prv_rgba4444.pvr"; + file = "Images/grossini_pvr_rgba4444.pvr"; break; case 4: file = "Images/test_image_a8.pvr"; diff --git a/tests/lua-tests/src/Texture2dTest/Texture2dTest.lua b/tests/lua-tests/src/Texture2dTest/Texture2dTest.lua index 85e27af590..680d3e77b1 100644 --- a/tests/lua-tests/src/Texture2dTest/Texture2dTest.lua +++ b/tests/lua-tests/src/Texture2dTest/Texture2dTest.lua @@ -1263,19 +1263,18 @@ local function TextureMemoryAlloc() end cc.Director:getInstance():getTextureCache():removeUnusedTextures() + local targetPlatform = cc.Application:getInstance():getTargetPlatform() local file = "" - local targetPlatform = cc.Application:getInstance():getTargetPlatform() - - if cc.PLATFORM_OS_ANDROID == targetPlatform then + if targetPlatform == cc.PLATFORM_OS_ANDROID then if tag == 0 then file = "Images/background.png" elseif tag == 1 then file = "Images/fire_rgba8888.pvr" elseif tag == 2 then - file = "Images/grossini_prv_rgba8888.pvr" + file = "Images/grossini_pvr_rgba8888.pvr" elseif tag == 3 then - file = "Images/grossini_prv_rgba4444.pvr" + file = "Images/grossini_pvr_rgba4444.pvr" elseif tag == 4 then file = "Images/test_image_a8.pvr" end From 0ad57bdde7ccd1d38e694bc963f77c5c589de857 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 11 Jun 2014 14:50:33 +0800 Subject: [PATCH 10/24] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 715e491627..9b745809d9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ cocos2d-x-3.2 ??? + [NEW] Console: add a command to show engine version [NEW] Node: added setter/getter for NormalizedPosition(). Allows to set positions in normalized values (between 0 and 1) [NEW] Scene: Added createWithSize() method [NEW] TextField: added getStringLength() From 63a68632a5b97a2d2292cff7a70a809564d3d7c0 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Wed, 11 Jun 2014 21:49:08 +0800 Subject: [PATCH 11/24] fixed calculating height of multi-line string was incorrect on IOS. --- cocos/platform/ios/CCDevice.mm | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/cocos/platform/ios/CCDevice.mm b/cocos/platform/ios/CCDevice.mm index 5eeaf7ccaa..9246327882 100644 --- a/cocos/platform/ios/CCDevice.mm +++ b/cocos/platform/ios/CCDevice.mm @@ -215,26 +215,14 @@ static inline void lazyCheckIOS7() static CGSize _calculateStringSize(NSString *str, id font, CGSize *constrainSize) { - NSArray *listItems = [str componentsSeparatedByString: @"\n"]; - CGSize dim = CGSizeZero; CGSize textRect = CGSizeZero; textRect.width = constrainSize->width > 0 ? constrainSize->width : 0x7fffffff; textRect.height = constrainSize->height > 0 ? constrainSize->height : 0x7fffffff; - for (NSString *s in listItems) - { - CGSize tmp = [s sizeWithFont:font constrainedToSize:textRect]; - - if (tmp.width > dim.width) - { - dim.width = tmp.width; - } - - dim.height += tmp.height; - } - + CGSize dim = [s sizeWithFont:font constrainedToSize:textRect]; + dim.width = ceilf(dim.width); dim.height = ceilf(dim.height); From 7cc38792578df1b49bece114ea73ca8812144d85 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Wed, 11 Jun 2014 22:03:10 +0800 Subject: [PATCH 12/24] Ensuring release cache texture in timely. --- cocos/2d/CCLabel.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 39ef02f014..d01925bbd0 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -392,16 +392,12 @@ void Label::setFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled /* = false * if (_reusedLetter == nullptr) { - _reusedLetter = Sprite::createWithTexture(_fontAtlas->getTexture(0)); + _reusedLetter = Sprite::create(); _reusedLetter->setOpacityModifyRGB(_isOpacityModifyRGB); _reusedLetter->retain(); _reusedLetter->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT); - _reusedLetter->setBatchNode(this); - } - else - { - _reusedLetter->setTexture(_fontAtlas->getTexture(0)); } + _reusedLetter->setBatchNode(this); if (_fontAtlas) { From 775832a710e24788e4b1748caf23cd5abc3c006f Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Wed, 11 Jun 2014 13:18:10 -0700 Subject: [PATCH 13/24] added missing files --- cocos/2d/cocos2d_wp8.vcxproj | 2 ++ cocos/2d/cocos2d_wp8.vcxproj.filters | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index af64540683..37a477357f 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -280,6 +280,7 @@ + @@ -476,6 +477,7 @@ + diff --git a/cocos/2d/cocos2d_wp8.vcxproj.filters b/cocos/2d/cocos2d_wp8.vcxproj.filters index e7f75c3fd6..010792145b 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj.filters +++ b/cocos/2d/cocos2d_wp8.vcxproj.filters @@ -593,6 +593,9 @@ renderer + + base + @@ -1205,6 +1208,9 @@ renderer + + base + From b26853638540ed8ad8dd8e4bc156f51cf6547b37 Mon Sep 17 00:00:00 2001 From: LinWenhai Date: Thu, 12 Jun 2014 09:46:18 +0800 Subject: [PATCH 14/24] fixed typo. --- cocos/platform/ios/CCDevice.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/platform/ios/CCDevice.mm b/cocos/platform/ios/CCDevice.mm index 9246327882..fb14b01f71 100644 --- a/cocos/platform/ios/CCDevice.mm +++ b/cocos/platform/ios/CCDevice.mm @@ -221,7 +221,7 @@ static CGSize _calculateStringSize(NSString *str, id font, CGSize *constrainSize textRect.height = constrainSize->height > 0 ? constrainSize->height : 0x7fffffff; - CGSize dim = [s sizeWithFont:font constrainedToSize:textRect]; + CGSize dim = [str sizeWithFont:font constrainedToSize:textRect]; dim.width = ceilf(dim.width); dim.height = ceilf(dim.height); From d755b7ffcb7b29ee0e2d31479ca1e85571b9e967 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Thu, 12 Jun 2014 11:21:42 +0800 Subject: [PATCH 15/24] issue #3341:fix TextureCache::addImageAsync repeatedly generate Image for the same image file. --- cocos/renderer/CCTextureCache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/renderer/CCTextureCache.cpp b/cocos/renderer/CCTextureCache.cpp index 16643adeb9..d7db2feaa8 100644 --- a/cocos/renderer/CCTextureCache.cpp +++ b/cocos/renderer/CCTextureCache.cpp @@ -206,11 +206,11 @@ void TextureCache::loadImage() for (; pos < infoSize; pos++) { imageInfo = (*_imageInfoQueue)[pos]; - if(imageInfo->asyncStruct->filename.compare(asyncStruct->filename)) + if(imageInfo->asyncStruct->filename.compare(asyncStruct->filename) == 0) break; } _imageInfoMutex.unlock(); - if(infoSize == 0 || pos < infoSize) + if(infoSize == 0 || pos == infoSize) generateImage = true; } From 87ac4c660dddc5ee35542b4ee0bf22c757203dd0 Mon Sep 17 00:00:00 2001 From: heliclei Date: Thu, 12 Jun 2014 11:30:37 +0800 Subject: [PATCH 16/24] [ci skip] Set github commit status context & description --- tools/jenkins-scripts/job-comment-trigger.py | 2 +- tools/jenkins-scripts/job-trigger.py | 2 +- tools/jenkins-scripts/post-build.py | 5 +++-- tools/jenkins-scripts/pull-request-builder.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/jenkins-scripts/job-comment-trigger.py b/tools/jenkins-scripts/job-comment-trigger.py index 8ba9d710af..b425040948 100644 --- a/tools/jenkins-scripts/job-comment-trigger.py +++ b/tools/jenkins-scripts/job-comment-trigger.py @@ -79,7 +79,7 @@ def main(): print 'pull request #' + str(pr_num) + ' is '+action+', no build triggered' return(0) - data = {"state":"pending", "target_url":target_url} + data = {"state":"pending", "target_url":target_url, "context":"Jenkins CI", "description":"Wait available build machine..."} access_token = os.environ['GITHUB_ACCESS_TOKEN'] Headers = {"Authorization":"token " + access_token} diff --git a/tools/jenkins-scripts/job-trigger.py b/tools/jenkins-scripts/job-trigger.py index 54e566e94c..fbdcf0c3e1 100755 --- a/tools/jenkins-scripts/job-trigger.py +++ b/tools/jenkins-scripts/job-trigger.py @@ -90,7 +90,7 @@ def main(): print 'skip build for pull request #' + str(pr_num) return(0) - data = {"state":"pending", "target_url":target_url} + data = {"state":"pending", "target_url":target_url, "context":"Jenkins CI", "description":"Waiting available build machine..."} access_token = os.environ['GITHUB_ACCESS_TOKEN'] Headers = {"Authorization":"token " + access_token} diff --git a/tools/jenkins-scripts/post-build.py b/tools/jenkins-scripts/post-build.py index 78f7ddf735..fb99727de8 100644 --- a/tools/jenkins-scripts/post-build.py +++ b/tools/jenkins-scripts/post-build.py @@ -18,7 +18,7 @@ statuses_url = payload['statuses_url'] J = Jenkins(os.environ['JENKINS_URL']) target_url = os.environ['BUILD_URL'] build_number = int(os.environ['BUILD_NUMBER']) -data = {"state":"pending", "target_url":target_url} +data = {"state":"pending", "target_url":target_url, "context":"Jenkins CI", "description":"Build finished!"} access_token = os.environ['GITHUB_ACCESS_TOKEN'] Headers = {"Authorization":"token " + access_token} @@ -26,9 +26,10 @@ result = J[os.environ['JOB_NAME']].get_build(build_number).get_status() if(result == STATUS_SUCCESS): data['state'] = "success" + data['description'] = "Build successfully!" else: data['state'] = "failure" - + data['description'] = "Build failed!" http_proxy = '' if(os.environ.has_key('HTTP_PROXY')): http_proxy = os.environ['HTTP_PROXY'] diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index d506bb0df5..eb36154c49 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -104,7 +104,7 @@ def main(): set_description(pr_desc, target_url) - data = {"state":"pending", "target_url":target_url} + data = {"state":"pending", "target_url":target_url, "context":"Jenkins CI", "description":"Build started..."} access_token = os.environ['GITHUB_ACCESS_TOKEN'] Headers = {"Authorization":"token " + access_token} From 70147e9a20b18222dcae4829bbc7bd6365ecd49d Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 12 Jun 2014 11:38:28 +0800 Subject: [PATCH 17/24] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 9b745809d9..c17a53bf37 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -27,6 +27,7 @@ cocos2d-x-3.2 ??? [FIX] Schedule: schedulePerFrame() can not be called twice [FIX] SpriteFrameCache: fix memory leak [FIX] Texture2D: use image's pixel format to create texture + [FIX] TextureCache: addImageAsync() may repeatedly generate Image for the same image file [FIX] WP8: will restart if app goes to background, then touches icon to go to foreground [FIX] WP8: will be black if: 1. 3rd pops up a view; 2. go to background; 3. come to foreground [FIX] WP8: project name of new project created by console is wrong From cc683ff00f60afaf1f75708981bc2dfb3f10e10e Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 12 Jun 2014 11:40:41 +0800 Subject: [PATCH 18/24] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index c17a53bf37..f9a3fc15cb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,6 +16,7 @@ cocos2d-x-3.2 ??? [FIX] Image: premultiply alpha when loading png file to resolve black border issue [FIX] Label: label is unsharp if it's created by smaller font [FIX] Label: Label's display may go bonkers if invoking Label::setString() with outline feature enabled + [FIX] Label: don't release cached texture in time [FIX] Lua-binding: compiling error on release mode [FIX] Lua-binding: Add xxtea encrypt support [FIX] Node: setPhysicsBody() can not work correctly if it is added to a Node From 22f445d56f86ff925c71a6f5291e602792422950 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 12 Jun 2014 14:47:42 +0800 Subject: [PATCH 19/24] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index f9a3fc15cb..223dd5bb51 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,7 @@ cocos2d-x-3.2 ??? [FIX] Label: label is unsharp if it's created by smaller font [FIX] Label: Label's display may go bonkers if invoking Label::setString() with outline feature enabled [FIX] Label: don't release cached texture in time + [FIX] Label: calculated height of multi-line string was incorrect on iOS [FIX] Lua-binding: compiling error on release mode [FIX] Lua-binding: Add xxtea encrypt support [FIX] Node: setPhysicsBody() can not work correctly if it is added to a Node From 77fdd124a1497a9801ff6168a084e9dcde23d6fa Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 12 Jun 2014 15:05:31 +0800 Subject: [PATCH 20/24] [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 6beee8bf55..90e96f068e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -841,6 +841,7 @@ Developers: sachingarg05 Re-added orientation change callback in java activity + GLProgram should not abort() if shader compilation fails, returning false is better. dplusic Fixed that cc.pGetAngle may return wrong value From bb5471ca8b8ce625fc68da26065ca3ff60c5b6ee Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 12 Jun 2014 15:07:29 +0800 Subject: [PATCH 21/24] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 223dd5bb51..166f24f723 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,7 @@ cocos2d-x-3.2 ??? [FIX] Android: 3d model will be black when coming from background [FIX] Android: don't trigger EVENT_COME_TO_BACKGROUND event when go to background [FIX] Cocos2dxGLSurfaceView.java: prevent flickering when opening another activity + [FIX] GLProgram: not abort if shader compilation fails, just retuan false. [FIX] GLProgramState: sampler can not be changed [FIX] Image: Set jpeg save quality to 90 [FIX] Image: premultiply alpha when loading png file to resolve black border issue From f6913fc9314773a701bb066b440fa0969dd39578 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 12 Jun 2014 16:12:03 +0800 Subject: [PATCH 22/24] [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 90e96f068e..4ac6ffa9c4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -882,6 +882,9 @@ Developers: zhouxiaoxiaoxujian Added TextField::getStringLength() Add shadow, outline, glow filter support for UIText + + QiuleiWang + Fix the bug that calculated height of multi-line string was incorrect on iOS Retired Core Developers: WenSheng Yang From d1ca81634aa111644ca2ce838bf1c0a5271a32d3 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 12 Jun 2014 16:18:22 +0800 Subject: [PATCH 23/24] [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 4ac6ffa9c4..52009d3146 100644 --- a/AUTHORS +++ b/AUTHORS @@ -885,6 +885,9 @@ Developers: QiuleiWang Fix the bug that calculated height of multi-line string was incorrect on iOS + + Rumist + Fix the bug that the result of Director->convertToUI() is error. Retired Core Developers: WenSheng Yang From 1187cfff6d5bd26316327ccefe168474ced89c07 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 12 Jun 2014 16:19:05 +0800 Subject: [PATCH 24/24] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 166f24f723..b42ad6f8ac 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,7 @@ cocos2d-x-3.2 ??? [FIX] Android: 3d model will be black when coming from background [FIX] Android: don't trigger EVENT_COME_TO_BACKGROUND event when go to background [FIX] Cocos2dxGLSurfaceView.java: prevent flickering when opening another activity + [FIX] Director: Director->convertToUI() returns wrong value. [FIX] GLProgram: not abort if shader compilation fails, just retuan false. [FIX] GLProgramState: sampler can not be changed [FIX] Image: Set jpeg save quality to 90