From ff1731eded71f09bb3db970b8b1defb87abde8c0 Mon Sep 17 00:00:00 2001 From: G17hao <670788361@qq.com> Date: Tue, 20 Jan 2015 19:27:01 +0800 Subject: [PATCH 01/11] Update CCGroupCommand.h add a vector container for save unused id. traversal unordered_map is too slow, use vector to replace it --- cocos/renderer/CCGroupCommand.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos/renderer/CCGroupCommand.h b/cocos/renderer/CCGroupCommand.h index 96fa8f70da..c261234ed8 100644 --- a/cocos/renderer/CCGroupCommand.h +++ b/cocos/renderer/CCGroupCommand.h @@ -26,6 +26,7 @@ #ifndef _CC_GROUPCOMMAND_H_ #define _CC_GROUPCOMMAND_H_ +#include #include #include "base/CCRef.h" @@ -45,6 +46,7 @@ protected: ~GroupCommandManager(); bool init(); std::unordered_map _groupMapping; + std::vector _unusedIDs; }; class CC_DLL GroupCommand : public RenderCommand From 29c4f83fd8b738f05492aa7bd3011d3ed1d22f27 Mon Sep 17 00:00:00 2001 From: G17hao <670788361@qq.com> Date: Tue, 20 Jan 2015 19:28:30 +0800 Subject: [PATCH 02/11] Update CCGroupCommand.cpp add a vector container for save unused id. traversal unordered_map is too slow, use vector to replace it --- cocos/renderer/CCGroupCommand.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos/renderer/CCGroupCommand.cpp b/cocos/renderer/CCGroupCommand.cpp index 576dab111e..24874f4351 100644 --- a/cocos/renderer/CCGroupCommand.cpp +++ b/cocos/renderer/CCGroupCommand.cpp @@ -49,13 +49,12 @@ bool GroupCommandManager::init() int GroupCommandManager::getGroupID() { //Reuse old id - for(auto it = _groupMapping.begin(); it != _groupMapping.end(); ++it) + if (!_unusedIDs.empty()) { - if(!it->second) - { - _groupMapping[it->first] = true; - return it->first; - } + int groupID = *_unusedIDs.rbegin(); + _unusedIDs.pop_back(); + _groupMapping[groupID] = true; + return groupID; } //Create new ID @@ -69,6 +68,7 @@ int GroupCommandManager::getGroupID() void GroupCommandManager::releaseGroupID(int groupID) { _groupMapping[groupID] = false; + _unusedIDs.push_back(groupID); } GroupCommand::GroupCommand() From 4f782e23305d15cd7a76af6b9b5d4b0e19406cff Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 30 Jan 2015 11:03:47 +0800 Subject: [PATCH 03/11] Fix z-fighting error by using setDepthTest of cc.Director --- tests/lua-tests/src/BugsTest/BugsTest.lua | 3 --- tests/lua-tests/src/ParallaxTest/ParallaxTest.lua | 1 - 2 files changed, 4 deletions(-) diff --git a/tests/lua-tests/src/BugsTest/BugsTest.lua b/tests/lua-tests/src/BugsTest/BugsTest.lua index 648697281c..e20eeddbe6 100644 --- a/tests/lua-tests/src/BugsTest/BugsTest.lua +++ b/tests/lua-tests/src/BugsTest/BugsTest.lua @@ -356,8 +356,6 @@ end --BugTest1159 local function BugTest1159() local pLayer = cc.Layer:create() - - cc.Director:getInstance():setDepthTest(true) local background = cc.LayerColor:create(cc.c4b(255, 0, 255, 255)) pLayer:addChild(background) @@ -398,7 +396,6 @@ local function BugTest1159() scheduler:unscheduleScriptEntry(schedulerEntry) end ]]-- - cc.Director:getInstance():setDepthTest(false) end end diff --git a/tests/lua-tests/src/ParallaxTest/ParallaxTest.lua b/tests/lua-tests/src/ParallaxTest/ParallaxTest.lua index af6d1c160f..c0b834755a 100644 --- a/tests/lua-tests/src/ParallaxTest/ParallaxTest.lua +++ b/tests/lua-tests/src/ParallaxTest/ParallaxTest.lua @@ -145,7 +145,6 @@ end function ParallaxTestMain() cclog("ParallaxMain") Helper.index = 1 - cc.Director:getInstance():setDepthTest(true) local scene = cc.Scene:create() Helper.createFunctionTable = { From 897416eb4e7422f100ec623939aaa22ff3a8ff10 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Fri, 30 Jan 2015 11:12:35 +0800 Subject: [PATCH 04/11] cocos2d/cocos2d-js#1313: Remove dangerous code in AssetsManagerEx::setStoragePath --- extensions/assets-manager/AssetsManagerEx.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/extensions/assets-manager/AssetsManagerEx.cpp b/extensions/assets-manager/AssetsManagerEx.cpp index 1b6d7a660f..18798a1feb 100644 --- a/extensions/assets-manager/AssetsManagerEx.cpp +++ b/extensions/assets-manager/AssetsManagerEx.cpp @@ -264,9 +264,6 @@ const std::string& AssetsManagerEx::getStoragePath() const void AssetsManagerEx::setStoragePath(const std::string& storagePath) { - if (_storagePath.size() > 0) - _fileUtils->removeDirectory(_storagePath); - _storagePath = storagePath; adjustPath(_storagePath); _fileUtils->createDirectory(_storagePath); From 1fa09a3af81d1046431b5a0c54878fb93a73a527 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 30 Jan 2015 11:27:08 +0800 Subject: [PATCH 05/11] [ci skip]update CHANGELOG --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index df221d2202..fa834df3ff 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -cocos2d-x-3.4 xxx +cocos2d-x-3.4 Jan.30 2015 [FIX] Animate3D: `setSpeed` has not effect if `Animate3D` is used in Sequence [FIX] C++: will crash if built with armeabi-v7a enabled on Android devices that with armeabi-v7a architecture but doesn't support NEON instructions [FIX] C++: may crash if VAO is not supported From 7b5b1557ff336fda02717f7caf27a7fd07f5ef55 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Fri, 30 Jan 2015 14:25:26 +0800 Subject: [PATCH 06/11] [ci skip] update releasenotes --- docs/RELEASE_NOTES.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 54838904b9..1b7e437e4d 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -13,6 +13,8 @@ - [Windows](#windows) - [Linux](#linux) - [How to start a new game](#how-to-start-a-new-game) +- [v3.4](#v34) + - [Bugs fixed in v3.4](#bugs-fixed-in-v34) - [v3.4rc1](#v34rc1) - [Highlights of v3.4rc1](#highlights-of-v34rc1) - [Features in detail](#features-in-detail) @@ -39,7 +41,7 @@ # Misc Information -* Full Changelog: https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.4rc0/CHANGELOG +* [Full Changelog](https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.4/CHANGELOG) * v3.0 Release Notes can be found here: [v3.0 Release Notes](https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.0/docs/RELEASE_NOTES.md) # Requirements @@ -124,6 +126,13 @@ Run ## How to start a new game Please refer to this document: [ReadMe](../README.md) +# v3.4 +##Bugs fixed in v3.4 +* C++: crash on armeabi-v7a arch device which do not support NEON instructions +* GLProgram: crash on low end device with no more than 8 attributes support +* New audio: game freeze if audio played two many times on android +* Node: anchor point has no effects on rotation +* More bugs fixed # v3.4rc1 From f4266c9ae3388d0a168ace114247011907cfc835 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 30 Jan 2015 14:58:20 +0800 Subject: [PATCH 07/11] update console submodule --- tools/cocos2d-console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 53130d3397..35b57041d2 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 53130d33970b5d9b15a8f0e4c2632e352a6ade9f +Subproject commit 35b57041d22f246c0f0c4996e4e7d26945301134 From 49489ba3ad377c1f95c8e6206d25c242db7fe77d Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 30 Jan 2015 20:06:43 +0800 Subject: [PATCH 08/11] update console --- tools/cocos2d-console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 35b57041d2..cd05722966 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 35b57041d22f246c0f0c4996e4e7d26945301134 +Subproject commit cd05722966edde6116a6096b810a7a5598fe7c0a From e6d50d708668b2a27ed5652c2d70965a408322aa Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Sat, 31 Jan 2015 14:31:24 +0800 Subject: [PATCH 09/11] Fix the error that the binary data would be truncated --- cocos/network/HttpClient-ios.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/network/HttpClient-ios.mm b/cocos/network/HttpClient-ios.mm index 5be5271ffc..8d1def8dd7 100644 --- a/cocos/network/HttpClient-ios.mm +++ b/cocos/network/HttpClient-ios.mm @@ -164,6 +164,7 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:HttpClient::getInstance()->getTimeoutForConnect()]; + //set request type [nsrequest setHTTPMethod:requestType]; @@ -190,8 +191,7 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream char* requestDataBuffer = request->getRequestData(); if (nullptr != requestDataBuffer && 0 != strlen(requestDataBuffer)) { - NSString* requestData = [NSString stringWithUTF8String:requestDataBuffer]; - NSData *postData = [requestData dataUsingEncoding:NSUTF8StringEncoding]; + NSData *postData = [NSData dataWithBytes:requestDataBuffer length:request->getRequestDataSize()]; [nsrequest setHTTPBody:postData]; } } From 75dc45bfea6981ce5596e03bab6b9fdc5c8f0f38 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Sat, 31 Jan 2015 15:21:03 +0800 Subject: [PATCH 10/11] Remove useless blank line --- cocos/network/HttpClient-ios.mm | 1 - 1 file changed, 1 deletion(-) diff --git a/cocos/network/HttpClient-ios.mm b/cocos/network/HttpClient-ios.mm index 8d1def8dd7..3561367d29 100644 --- a/cocos/network/HttpClient-ios.mm +++ b/cocos/network/HttpClient-ios.mm @@ -164,7 +164,6 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:HttpClient::getInstance()->getTimeoutForConnect()]; - //set request type [nsrequest setHTTPMethod:requestType]; From fec0d9c41d16a4e70639e5677d6f5d95b5f9aac0 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Sat, 31 Jan 2015 22:15:15 +0800 Subject: [PATCH 11/11] Set default value for `Content-Type` of headfield in `PUT` method --- cocos/network/HttpClient-ios.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/network/HttpClient-ios.mm b/cocos/network/HttpClient-ios.mm index 3561367d29..9a63e5e265 100644 --- a/cocos/network/HttpClient-ios.mm +++ b/cocos/network/HttpClient-ios.mm @@ -170,6 +170,10 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream //if request type is post or put,set header and data if([requestType isEqual: @"POST"] || [requestType isEqual: @"PUT"]) { + if ([requestType isEqual: @"PUT"]) + { + [nsrequest setValue: @"application/x-www-form-urlencoded" forHTTPHeaderField: @"Content-Type"]; + } /* get custom header data (if set) */ std::vector headers=request->getHeaders(); if(!headers.empty())