mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Merge pull request #2165 from knoxHuang/v1.7-release
fix CCTilemap bug for cocos-creator/engine/issues/2046
This commit is contained in:
@@ -67,14 +67,15 @@ var proto = _ccsg.TMXLayer.WebGLRenderCmd.prototype = Object.create(_ccsg.Node.W
|
||||
proto.constructor = _ccsg.TMXLayer.WebGLRenderCmd;
|
||||
|
||||
proto.uploadData = function (f32buffer, ui32buffer, vertexDataOffset) {
|
||||
// enable Depth Test
|
||||
cc.renderer.setDepthTest(true);
|
||||
|
||||
var node = this._node,
|
||||
layerOrientation = node.layerOrientation,
|
||||
tiles = node.tiles,
|
||||
alpha = node._opacity / 255;
|
||||
|
||||
// enable Depth Test (fix cocos-creator/engine/issues/2046,
|
||||
// but it's not perfect, and the follow-up needs to be improved)
|
||||
cc.renderer.setDepthTest(node.layerOrientation === Orientation.ORTHO);
|
||||
|
||||
if (!tiles || alpha <= 0 || !node.tileset) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user