From 36f319a881c09a1e310a71c402f8c2063f198360 Mon Sep 17 00:00:00 2001 From: gered Date: Sat, 20 Jul 2013 23:00:38 -0400 Subject: [PATCH] combine addMesh and copyVertex. we weren't gaining anything with them separate --- .../gdx/tilemap3d/ChunkVertexGenerator.java | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/com/blarg/gdx/tilemap3d/ChunkVertexGenerator.java b/src/com/blarg/gdx/tilemap3d/ChunkVertexGenerator.java index bc220fc..67145b1 100644 --- a/src/com/blarg/gdx/tilemap3d/ChunkVertexGenerator.java +++ b/src/com/blarg/gdx/tilemap3d/ChunkVertexGenerator.java @@ -166,23 +166,20 @@ public class ChunkVertexGenerator { // copy vertices for (int i = 0; i < numVertices; ++i) { - copyVertex(builder, sourceMesh, sourceVertices, tmpOffset, transform, color, chunk); + 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) + if (transform != null) { + vertex.position.mul(transform); + vertex.normal.mul(transform); + } + + // translate vertex into "world/tilemap space" + vertex.position.add(tmpOffset); + + builder.vertex(vertex); sourceVertices.moveNext(); } } - - protected void copyVertex(MeshBuilder builder, TileMesh sourceMesh, Vertices sourceVertices, Vector3 positionOffset, Matrix4 transform, Color color, TileChunk chunk) { - sourceVertices.getVertex(vertex); - - // transform if applicable... (this will probably just be per-tile rotation) - if (transform != null) { - vertex.position.mul(transform); - vertex.normal.mul(transform); - } - - // translate vertex into "world/tilemap space" - vertex.position.add(positionOffset); - - builder.vertex(vertex); - } }