refine code

This commit is contained in:
knoxHuang
2017-08-17 13:42:10 +08:00
parent cdff857443
commit c3c69a588d
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -296,7 +296,7 @@ _ccsg.TMXLayer = _ccsg.Node.extend(/** @lends _ccsg.TMXLayer# */{
}
if(cc._renderType === cc.game.RENDER_TYPE_WEBGL) {
renderer.pushRenderCommand(this._renderCmd._depthTestVisitCmd);
renderer.pushRenderCommand(this._renderCmd._disableDepthTestCmd);
}
cmd._dirtyFlag = 0;
+4 -4
View File
@@ -55,11 +55,11 @@ _ccsg.TMXLayer.WebGLRenderCmd = function(renderableObject){
StaggerIndex = cc.TiledMap.StaggerIndex;
}
// close DepthTest, local use DepthTest;
this._depthTestVisitCmd = new cc.CustomRenderCmd(this, _closeDepthTest);
// disable DepthTest, local use DepthTest;
this._disableDepthTestCmd = new cc.CustomRenderCmd(this, _disableDepthTest);
};
function _closeDepthTest () {
function _disableDepthTest () {
cc.renderer.setDepthTest(false);
}
@@ -67,7 +67,7 @@ var proto = _ccsg.TMXLayer.WebGLRenderCmd.prototype = Object.create(_ccsg.Node.W
proto.constructor = _ccsg.TMXLayer.WebGLRenderCmd;
proto.uploadData = function (f32buffer, ui32buffer, vertexDataOffset) {
// open Depth Test
// enable Depth Test
cc.renderer.setDepthTest(true);
var node = this._node, hasRotation = (node._rotationX || node._rotationY),