From 1b339a46352b0302c8dd799dce82e5cb5bd504c8 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Thu, 9 Jan 2014 14:50:29 +0800 Subject: [PATCH 1/6] Add Test Case: LayerColor should not occlude sprites and labels when depth test is true --- .../TestCpp/Classes/LayerTest/LayerTest.cpp | 25 +++++++++++++++++++ .../Cpp/TestCpp/Classes/LayerTest/LayerTest.h | 13 ++++++++++ 2 files changed, 38 insertions(+) diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp index 1c1ae1084a..0bbb8cc63a 100644 --- a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp +++ b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp @@ -25,6 +25,7 @@ static std::function createFunctions[] = { CL(LayerExtendedBlendOpacityTest), CL(LayerBug3162A), CL(LayerBug3162B), + CL(LayerColorOccludeBug), }; static int sceneIdx=-1; @@ -954,3 +955,27 @@ std::string LayerBug3162B::subtitle() const { return "u and m layer color is effected/diseffected with b layer"; } + +std::string LayerColorOccludeBug::title() const +{ + return "Layer Color Occlude Bug Test"; +} + +std::string LayerColorOccludeBug::subtitle() const +{ + return "Layer Color Should not occlude titles and any sprites"; +} + +void LayerColorOccludeBug::onEnter() +{ + LayerTest::onEnter(); + Director::getInstance()->setDepthTest(true); + _layer = LayerColor::create(Color4B(0, 80, 95, 255)); + addChild(_layer); +} + +void LayerColorOccludeBug::onExit() +{ + LayerTest::onExit(); + Director::getInstance()->setDepthTest(false); +} diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h index 61a8602200..61b4f6fc2c 100644 --- a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h +++ b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h @@ -202,6 +202,19 @@ private: LayerColor* _layer[3]; }; +class LayerColorOccludeBug : public LayerTest +{ +public: + CREATE_FUNC(LayerColorOccludeBug); + virtual void onEnter() override; + virtual void onExit() override; + virtual std::string title() const override; + virtual std::string subtitle() const override; + +private: + LayerColor* _layer; +}; + class LayerTestScene : public TestScene { public: From f14bbd59c95cb3df06b7a4c30b553433856b978b Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 17:16:09 +0800 Subject: [PATCH 2/6] Adding clang build for travis ci. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 1e67e468bf..d46929bd03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ env: matrix: - GEN_JSB=YES - PLATFORM=linux DEBUG=1 + - PLATFORM=linux DEBUG=1 CLANG=1 # Since switching to C++11 only the ARM version of the nactive client # port currently builds. TODO(sbc): Re-enable all architectures. # Disabled travis-ci build for native client port since it doesn't support std::thread, std::mutex. From c60681c556cac9093ed6ca9e3efe752e4c75c9cf Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 9 Jan 2014 09:17:11 +0000 Subject: [PATCH 3/6] [AUTO] : updating submodule reference to latest autogenerated bindings --- cocos/scripting/auto-generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 17d3f11698..f7835c1364 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 17d3f116985b86a820a648927ea1fc5cfe5951d3 +Subproject commit f7835c13644591879f5a995074ccc8faf70c355e From 2cbe502113bd8f972c1811062eb4e651b5fc74a9 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 9 Jan 2014 17:23:22 +0800 Subject: [PATCH 4/6] issue #3643:Lua websocket can't receive more than 64 bytes of data --- .../scripting/lua/bindings/Lua_web_socket.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/cocos/scripting/lua/bindings/Lua_web_socket.cpp b/cocos/scripting/lua/bindings/Lua_web_socket.cpp index 8301c75d8f..4d3b8ae715 100644 --- a/cocos/scripting/lua/bindings/Lua_web_socket.cpp +++ b/cocos/scripting/lua/bindings/Lua_web_socket.cpp @@ -102,18 +102,22 @@ void LuaWebSocket::onMessage(WebSocket* ws, const WebSocket::Data& data) LuaWebSocket* luaWs = dynamic_cast(ws); if (NULL != luaWs) { if (data.isBinary) { - int nHandler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE); - if (0 != nHandler) { - SendBinaryMessageToLua(nHandler, (const unsigned char*)data.bytes, data.len); + int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE); + if (0 != handler) { + SendBinaryMessageToLua(handler, (const unsigned char*)data.bytes, data.len); } } else{ - int nHandler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE); - if (0 != nHandler) { - CommonScriptData commonData(nHandler,data.bytes); - ScriptEvent event(kCommonEvent,(void*)&commonData); - ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE); + if (0 != handler) + { + LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); + if (nullptr != stack) + { + stack->pushString(data.bytes,data.len); + stack->executeFunctionByHandler(handler, 1); + } } } } From c0195015c3aa82cadfdf267dac0b4eddc1cd978c Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 17:26:33 +0800 Subject: [PATCH 5/6] updates CC and CCX env variables --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d46929bd03..bf21d1dcef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ env: matrix: - GEN_JSB=YES - PLATFORM=linux DEBUG=1 - - PLATFORM=linux DEBUG=1 CLANG=1 + - PLATFORM=linux DEBUG=1 CC=/usr/bin/clang CXX=/usr/bin/clang++ # Since switching to C++11 only the ARM version of the nactive client # port currently builds. TODO(sbc): Re-enable all architectures. # Disabled travis-ci build for native client port since it doesn't support std::thread, std::mutex. From 4b4dc160309ac083c6ef89f1406bd3c6c05b354e Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 9 Jan 2014 17:48:08 +0800 Subject: [PATCH 6/6] Exports CC and CXX for gcc and clang. --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bf21d1dcef..762cbcbf06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ language: cpp env: matrix: - GEN_JSB=YES - - PLATFORM=linux DEBUG=1 - - PLATFORM=linux DEBUG=1 CC=/usr/bin/clang CXX=/usr/bin/clang++ + - PLATFORM=linux DEBUG=1 CC_COMPILER=gcc CXX_COMPILER=g++ + - PLATFORM=linux DEBUG=1 CC_COMPILER=clang CXX_COMPILER=clang++ # Since switching to C++11 only the ARM version of the nactive client # port currently builds. TODO(sbc): Re-enable all architectures. # Disabled travis-ci build for native client port since it doesn't support std::thread, std::mutex. @@ -24,6 +24,8 @@ env: 9lV+vgJQDRcFe7dKwtC86vk10EU7Ym2bhVmhMxi/AlmJXgavjmPVdizRT7rh X2Ry/Nb6hGRkH3WS0T3D/KG1+e7lP/TMB9bvo6/locLJ2A6Z1YI= script: +- export CC=$CC_COMPILER +- export CXX=$CXX_COMPILER - tools/travis-scripts/run-script.sh before_install: - tools/travis-scripts/before-install.sh