combine addMesh and copyVertex. we weren't gaining anything with them separate

This commit is contained in:
Gered 2013-07-20 23:00:38 -04:00
parent 6bfbf66c4c
commit 36f319a881

View file

@ -166,13 +166,8 @@ public class ChunkVertexGenerator {
// copy vertices // copy vertices
for (int i = 0; i < numVertices; ++i) { for (int i = 0; i < numVertices; ++i) {
copyVertex(builder, sourceMesh, sourceVertices, tmpOffset, transform, color, chunk);
sourceVertices.moveNext();
}
}
protected void copyVertex(MeshBuilder builder, TileMesh sourceMesh, Vertices sourceVertices, Vector3 positionOffset, Matrix4 transform, Color color, TileChunk chunk) {
sourceVertices.getVertex(vertex); sourceVertices.getVertex(vertex);
vertex.color.set(color); // TODO: the getVertex() call above sets this, we're just overriding here... kind of wasteful .. ?
// transform if applicable... (this will probably just be per-tile rotation) // transform if applicable... (this will probably just be per-tile rotation)
if (transform != null) { if (transform != null) {
@ -181,8 +176,10 @@ public class ChunkVertexGenerator {
} }
// translate vertex into "world/tilemap space" // translate vertex into "world/tilemap space"
vertex.position.add(positionOffset); vertex.position.add(tmpOffset);
builder.vertex(vertex); builder.vertex(vertex);
sourceVertices.moveNext();
}
} }
} }