Fix received data for last vertex format element not being recorded (#5074)

This commit is contained in:
Ben Staddon authored and LexManos committed 2018-08-01 13:35:56 -07:00
1 parent 682a867a91
commit 889fa4da7e
1 file changed
+6 -3
@@ -52,12 +52,15 @@ public abstract class QuadGatheringTransformer implements IVertexConsumer
public void put(int element, float... data)
{
System.arraycopy(data, 0, quadData[element][vertices], 0, data.length);
if(element == getVertexFormat().getElementCount() - 1) vertices++;
if(vertices == 0)
if (vertices == 0)
{
dataLength[element] = (byte)data.length;
}
else if(vertices == 4)
if (element == getVertexFormat().getElementCount() - 1)
{
vertices++;
}
if (vertices == 4)
{
vertices = 0;
processQuad();