diff --git a/src/renderer/webgl/pipelines/TextureTintPipeline.js b/src/renderer/webgl/pipelines/TextureTintPipeline.js index 9ebaccbc6..e1cf65f8f 100644 --- a/src/renderer/webgl/pipelines/TextureTintPipeline.js +++ b/src/renderer/webgl/pipelines/TextureTintPipeline.js @@ -401,7 +401,6 @@ var TextureTintPipeline = new Class({ var vertexCapacity = this.vertexCapacity; var texture = emitterManager.defaultFrame.source.glTexture; var pca, pcb, pcc, pcd, pce, pcf; - var vertexCount = this.vertexCount; if (parentMatrix) { @@ -446,12 +445,10 @@ var TextureTintPipeline = new Class({ renderer.setBlendMode(emitter.blendMode); - if (vertexCount >= vertexCapacity) + if (this.vertexCount >= vertexCapacity) { - this.vertexCount = vertexCount; this.flush(); this.setTexture2D(texture, 0); - vertexCount = 0; } for (var batchIndex = 0; batchIndex < batchCount; ++batchIndex) @@ -496,7 +493,7 @@ var TextureTintPipeline = new Class({ var ty2 = xw * mvb + yh * mvd + mvf; var tx3 = xw * mva + y * mvc + mve; var ty3 = xw * mvb + y * mvd + mvf; - var vertexOffset = vertexCount * vertexComponentCount; + var vertexOffset = this.vertexCount * vertexComponentCount; if (roundPixels) { @@ -541,13 +538,12 @@ var TextureTintPipeline = new Class({ vertexViewF32[vertexOffset + 28] = uvs.y3; vertexViewU32[vertexOffset + 29] = color; - vertexCount += 6; + this.vertexCount += 6; - if (vertexCount >= vertexCapacity) + if (this.vertexCount >= vertexCapacity) { - this.vertexCount = vertexCount; this.flush(); - vertexCount = 0; + this.setTexture2D(texture, 0); } } @@ -555,17 +551,14 @@ var TextureTintPipeline = new Class({ particleOffset += batchSize; aliveLength -= batchSize; - if (vertexCount >= vertexCapacity) + if (this.vertexCount >= vertexCapacity) { - this.vertexCount = vertexCount; this.flush(); this.setTexture2D(texture, 0); - vertexCount = 0; } } } - this.vertexCount = vertexCount; this.setTexture2D(texture, 0); },