diff --git a/.travis.yml b/.travis.yml index 1e67e468bf..762cbcbf06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,8 @@ language: cpp env: matrix: - GEN_JSB=YES - - PLATFORM=linux DEBUG=1 + - 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. @@ -23,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 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 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); + } } } } 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: