Fixed issue on particle emitter rendering not writing directly to the vertex count property

This commit is contained in:
Felipe Alfonso 2018-04-17 13:20:08 -03:00
parent 89c9da54ac
commit eceb43584b

View file

@ -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);
},