From e8d853934b56bee6c9b2c37e5b74087efdd1037f Mon Sep 17 00:00:00 2001 From: yangxiao Date: Mon, 23 Nov 2015 14:33:39 +0800 Subject: [PATCH 1/2] terrain lua bindings --- .../lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp b/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp index 4a2d049931..1fae2d5b69 100644 --- a/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/3d/lua_cocos2dx_3d_manual.cpp @@ -319,10 +319,10 @@ void terraindata_to_luaval(lua_State* L,const cocos2d::Terrain::TerrainData& inV lua_rawset(L, -3); } - if (nullptr != inValue._alphaMapSrc) + if (!inValue._alphaMapSrc.empty()) { lua_pushstring(L, "_alphaMapSrc"); - lua_pushstring(L, inValue._alphaMapSrc); + lua_pushstring(L, inValue._alphaMapSrc.c_str()); lua_rawset(L, -3); } From aa38dfba89439812d59adfc76cc2f9081d63674b Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 24 Nov 2015 18:11:16 +0800 Subject: [PATCH 2/2] release default fbo --- cocos/renderer/CCFrameBuffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cocos/renderer/CCFrameBuffer.cpp b/cocos/renderer/CCFrameBuffer.cpp index 7d679261bd..fbff5ed432 100644 --- a/cocos/renderer/CCFrameBuffer.cpp +++ b/cocos/renderer/CCFrameBuffer.cpp @@ -397,7 +397,6 @@ FrameBuffer::FrameBuffer() FrameBuffer::~FrameBuffer() { - if(!isDefaultFBO()) { CC_SAFE_RELEASE_NULL(_rt); CC_SAFE_RELEASE_NULL(_rtDepthStencil); @@ -407,6 +406,8 @@ FrameBuffer::~FrameBuffer() #if CC_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_dirtyFBOListener); #endif + if (isDefaultFBO()) + _defaultFBO = nullptr; } }