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

This commit is contained in:
Ben Staddon 2018-08-01 21:35:56 +01:00 committed by LexManos
parent 682a867a91
commit 889fa4da7e

View file

@ -52,12 +52,15 @@ public abstract class QuadGatheringTransformer implements IVertexConsumer
public void put(int element, float... data) public void put(int element, float... data)
{ {
System.arraycopy(data, 0, quadData[element][vertices], 0, data.length); 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; dataLength[element] = (byte)data.length;
} }
else if(vertices == 4) if (element == getVertexFormat().getElementCount() - 1)
{
vertices++;
}
if (vertices == 4)
{ {
vertices = 0; vertices = 0;
processQuad(); processQuad();