From c8bd7bc3a87d6957dc603d7c994e86f3d6aaf3d8 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 27 Jan 2014 10:28:11 +0800 Subject: [PATCH 1/8] update changelog --- CHANGELOG | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e9812a19a6..8fed711081 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -cocos2d-x-3.0beta2 ?.? ? +cocos2d-x-3.0beta2 Jan.24 2014 [All] [NEW] Full screen support for desktop platforms. [NEW] Adds performance test for EventDispatcher. @@ -10,13 +10,7 @@ cocos2d-x-3.0beta2 ?.? ? [NEW] Label: Integrates LabelAtlas into new Label. [NEW] Node: Added `setGlobalZOrder()`. Useful to change the Node's render order. Node::setZOrder() -> Node::setLocalZOrder() [NEW] Renderer: Added BatchCommand. This command is not "batchable" with other commands, but improves performance in about 10% - [NEW] LuaBindings: Bindings-generator supports to bind namespace for lua. - [FIX] Lua: sp.SkeletonAnimation:registerScriptHandler should not override cc.Node:registerScriptHandler. - [FIX] JSB: Pure JS class which is inherited from cc.Class will trigger an irrelevant log. - [FIX] JSB: Mac and iOS Simulator should also use SpiderMonkey which was built in RELEASE mode. - [FIX] JSB: Crash when running JSB projects on iOS device in DEBUG mode. - [FIX] JSB: Crash when Firefox connects to JSB application on Mac platform. [FIX] Uses EventDispatcher to access event in LUA testcase. [FIX] Exposes SAXParser class to JS, it is used for parsing XML in JS. [FIX] Uses unified `desktop/CCEGLView.h/cpp` for desktop platforms (windows, mac, linux). @@ -30,7 +24,9 @@ cocos2d-x-3.0beta2 ?.? ? [FIX] Label: Memory leak in FontFreeType::createFontAtlas(). [FIX] Label: Crash when using unknown characters. [FIX] Label: Missing line breaks and wrong alignment. - [FIX] Label: Color and opacity settings aren't applied when invoking Label::alignText. + [FIX] Label: Corrupt looking characters and incorrect spacing between characters + [FIX] Label: Label:color and opacity settings are invalid afeter these these properties changed: 1)text content changed 2)align style changed 3)max line width limited + [FIX] Label: Crash when using unknown characters [FIX] Console: log(format, va_args) is private to prevent possible resolution errors [FIX] Configuration: dumpInfo() -> getInfo() [FIX] ControlSlider doesn't support to set selected thumb sprite. @@ -42,12 +38,39 @@ cocos2d-x-3.0beta2 ?.? ? [FIX] Renderer Performance Fix: When note using VAO, call glBufferData() instead of glBufferSubData(). [FIX] Renderer Performance Fix: Doesn't sort z=0 elements. It also uses sort() instead of stable_sort() for z!=0. [FIX] Sprite: removed _hasChildren optimization. It uses !_children.empty() now which is super fast as well - [FIX] Tests: TestCpp works with CMake on Windows. [FIX] Tests: Sprites Performance Test has 4 new tests [FIX] TextureCache: getTextureForKey and removeTextureForKey work as expected [FIX] TextureCache: dumpCachedTextureInfo() -> getCachedTextureInfo() [FIX] Websocket doesn't support send/receive data which larger than 4096 bytes. - [FIX] Windows: There will be some compilation errors when using x64 target on Windows. + [FIX] Object: Remove _retainCount + [FIX] ParallaxNode: Coordinate of Sprite may be wrong after being added into ParallaxNode + [FIX] Crash if there is not `textureFileName`section in particle plist file + [FIX] Websocket cannot send/receive more than 4096 bytes data + [FIX] TextureCache::addImageAsync can't load first image + [FIX] ControlSlider: Can not set "selected thumb sprite" + [FIX] ControlSlider: Can not set "scale ratio" + [FIX] Crash when loading tga format image + [FIX] Keyboard pressed events are being repeatedly fired before keyboard is released +[Android] + [FIX] Background music can't be resumed when back from foreground +[lua binding] + [NEW] Can bind classes that have the same class names but different namesapces + [FIX] Use EventDispatcher to update some test cases + [FIX] sp.SkeletonAnimation:registerScriptHandler should not override cc.Node:registerScriptHandler +[javascript binding] + [NEW] Bind SAXParser + [FIX] Pure JS class that wants to inherite from cc.Class will trigger an irrelevant log + [FIX] Mac and iOS Simulator should also use SpiderMonkey which was built in RELEASE mode + [FIX] Crash when running JSB projects on iOS device in DEBUG mode + [FIX] Crash when Firefox connects to JSB application on Mac platform. +[Desktop] + [NEW] Support fullscreen +[Mac] + [FIX] Removes unused files after using glfw3 to create opengl context +[Win32] + [FIX] Compiling error when using x64 target + [FIX] Tests: TestCpp works with CMake + [FIX] Bindings-generator supports Windows again and remove dependency of LLVM since it only needs binary of libclang cocos2d-x-3.0beta Jan.7 2014 [All] From 6c69626a4f53f734c09fb61d4f4727d3bae9c7e7 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 27 Jan 2014 10:31:24 +0800 Subject: [PATCH 2/8] closed #3867: "Testing empty labels" in LabelTest crashes on Linux platform. --- cocos/2d/platform/linux/CCImage.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/cocos/2d/platform/linux/CCImage.cpp b/cocos/2d/platform/linux/CCImage.cpp index 0d53db0c19..9e1579f304 100644 --- a/cocos/2d/platform/linux/CCImage.cpp +++ b/cocos/2d/platform/linux/CCImage.cpp @@ -450,23 +450,21 @@ static BitmapDC& sharedBitmapDC() } bool Image::initWithString( - const char * pText, - int nWidth/* = 0*/, - int nHeight/* = 0*/, - TextAlign eAlignMask/* = kAlignCenter*/, - const char * pFontName/* = nil*/, - int nSize/* = 0*/) + const char * text, + int width/* = 0*/, + int height/* = 0*/, + TextAlign alignMask/* = kAlignCenter*/, + const char * fontName/* = nil*/, + int size/* = 0*/) { - bool bRet = false; + bool ret = false; do { - CC_BREAK_IF(! pText); + CC_BREAK_IF(!text || 0 == strlen(text)); BitmapDC &dc = sharedBitmapDC(); - //const char* pFullFontName = FileUtils::getInstance()->fullPathFromRelativePath(pFontName); - - CC_BREAK_IF(! dc.getBitmap(pText, nWidth, nHeight, eAlignMask, pFontName, nSize)); + CC_BREAK_IF(! dc.getBitmap(text, width, height, alignMask, fontName, size)); // assign the dc._data to _data in order to save time _data = dc._data; @@ -478,13 +476,13 @@ bool Image::initWithString( _preMulti = true; _dataLen = _width * _height * 4; - bRet = true; + ret = true; dc.reset(); }while (0); //do nothing - return bRet; + return ret; } NS_CC_END From 0cc8050b73591c311e40cd93df2dc4645476fe85 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 27 Jan 2014 10:34:57 +0800 Subject: [PATCH 3/8] Update CHANGELOG [ci skip] --- CHANGELOG | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 8fed711081..6d3f9d1a82 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -65,8 +65,10 @@ cocos2d-x-3.0beta2 Jan.24 2014 [FIX] Crash when Firefox connects to JSB application on Mac platform. [Desktop] [NEW] Support fullscreen +[Linux] + [FIX] "Testing empty labels" in LabelTest crashes. [Mac] - [FIX] Removes unused files after using glfw3 to create opengl context + [FIX] Removes unused files after using glfw3 to create opengl context [Win32] [FIX] Compiling error when using x64 target [FIX] Tests: TestCpp works with CMake From 471263678384090f9aacc9b8d0d5a9dd91ef4a90 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 27 Jan 2014 11:22:19 +0800 Subject: [PATCH 4/8] Updates JS-Test: fix ArmatureTest/ChangeMounttest fails. --- samples/Javascript/Shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index 68e023e91b..67ef9b611f 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit 68e023e91b697c461fe986099189bc594ecab6c2 +Subproject commit 67ef9b611f26a3da00d907b0a36903a929730baa From 6239dadff6d148067b513b34e07f4a7e85aee54a Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 27 Jan 2014 13:39:11 +0800 Subject: [PATCH 5/8] issue #3401: add bit operation for lua physics test --- .../luaScript/PhysicsTest/PhysicsTest.lua | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua b/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua index 7bfffa2c24..b009a1e7eb 100644 --- a/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua @@ -16,6 +16,88 @@ local function range(from, to, step) end, nil, from - step end +-- bit operation + +bit.data32 = {} +for i=1,32 do + bit.data32[i]=2^(32-i) +end + +function bit._b2d(arg) + local nr=0 + for i=1,32 do + if arg[i] ==1 then + nr=nr+bit.data32[i] + end + end + return nr +end + +function bit._d2b(arg) + arg = arg >= 0 and arg or (0xFFFFFFFF + arg + 1) + local tr={} + for i=1,32 do + if arg >= bit.data32[i] then + tr[i]=1 + arg=arg-bit.data32[i] + else + tr[i]=0 + end + end + return tr +end + +function bit._and(a,b) + local op1=bit._d2b(a) + local op2=bit._d2b(b) + local r={} + + for i=1,32 do + if op1[i]==1 and op2[i]==1 then + r[i]=1 + else + r[i]=0 + end + end + return bit._b2d(r) + +end + +function bit._rshift(a,n) + local op1=bit._d2b(a) + n = n <= 32 and n or 32 + n = n >= 0 and n or 0 + + for i=32, n+1, -1 do + op1[i] = op1[i-n] + end + for i=1, n do + op1[i] = 0 + end + + return bit._b2d(op1) +end + +function bit._not(a) + local op1=bit._d2b(a) + local r={} + + for i=1,32 do + if op1[i]==1 then + r[i]=0 + else + r[i]=1 + end + end + return bit._b2d(r) +end + +bit.band = bit.band or bit._and +bit.rshift = bit.rshift or bit._rshift +bit.bnot = bit.bnot or bot._not + +-- bit operation end + local function initWithLayer(layer, callback) curLayer = layer layer.spriteTexture = cc.SpriteBatchNode:create("Images/grossini_dance_atlas.png", 100):getTexture() From e68db23f7a189881beb7e34f1a111320693543ca Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 27 Jan 2014 13:52:29 +0800 Subject: [PATCH 6/8] issue #3401: bug fix --- .../Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua b/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua index b009a1e7eb..433101b64d 100644 --- a/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua @@ -18,6 +18,7 @@ end -- bit operation +bit = bit or {} bit.data32 = {} for i=1,32 do bit.data32[i]=2^(32-i) From cb9330dfd6fe7d2ca4d50cf5319152602c25ef8f Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 27 Jan 2014 13:53:57 +0800 Subject: [PATCH 7/8] close #3869:fixed Font::setCurrentGlyphCollection not saved the settings --- cocos/2d/CCFont.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/2d/CCFont.cpp b/cocos/2d/CCFont.cpp index 2f97fe1d76..9951ad92c1 100644 --- a/cocos/2d/CCFont.cpp +++ b/cocos/2d/CCFont.cpp @@ -85,6 +85,7 @@ void Font::setCurrentGlyphCollection(GlyphCollection glyphs, const char *customG break; } + _usedGlyphs = glyphs; } const char * Font::getCurrentGlyphCollection() const From c0765c9a771d7d7b4e2a8f383b6436f7e2ea65c0 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 27 Jan 2014 14:10:23 +0800 Subject: [PATCH 8/8] issue #3401: bug fix --- .../Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua b/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua index 433101b64d..0cff427b7f 100644 --- a/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua @@ -95,7 +95,7 @@ end bit.band = bit.band or bit._and bit.rshift = bit.rshift or bit._rshift -bit.bnot = bit.bnot or bot._not +bit.bnot = bit.bnot or bit._not -- bit operation end