mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
refine code
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user