diff --git a/vtm/src/org/oscim/renderer/elements/BitmapLayer.java b/vtm/src/org/oscim/renderer/elements/BitmapLayer.java index f44c843c..6f180a0f 100644 --- a/vtm/src/org/oscim/renderer/elements/BitmapLayer.java +++ b/vtm/src/org/oscim/renderer/elements/BitmapLayer.java @@ -75,7 +75,7 @@ public class BitmapLayer extends TextureLayer { } TextureItem t = textures; - t.vertices = TextureLayer.INDICES_PER_SPRITE; + t.indices = TextureLayer.INDICES_PER_SPRITE; } private void setVertices(ShortBuffer sbuf) { @@ -215,10 +215,10 @@ public class BitmapLayer extends TextureLayer { t.bind(); - int maxVertices = MapRenderer.maxQuads * INDICES_PER_SPRITE; + int maxIndices = MapRenderer.maxQuads * INDICES_PER_SPRITE; // draw up to maxVertices in each iteration - for (int i = 0; i < t.vertices; i += maxVertices) { + for (int i = 0; i < t.indices; i += maxIndices) { // to.offset * (24(shorts) * 2(short-bytes) / 6(indices) == 8) int off = (t.offset + i) * 8 + tl.offset; @@ -228,11 +228,11 @@ public class BitmapLayer extends TextureLayer { GL.glVertexAttribPointer(s.aTexCoord, 2, GL20.GL_SHORT, false, 12, off + 8); - int numVertices = t.vertices - i; - if (numVertices > maxVertices) - numVertices = maxVertices; + int numIndices = t.indices - i; + if (numIndices > maxIndices) + numIndices = maxIndices; - GL.glDrawElements(GL20.GL_TRIANGLES, numVertices, + GL.glDrawElements(GL20.GL_TRIANGLES, numIndices, GL20.GL_UNSIGNED_SHORT, 0); } } diff --git a/vtm/src/org/oscim/renderer/elements/SymbolLayer.java b/vtm/src/org/oscim/renderer/elements/SymbolLayer.java index 7e5201c5..06187488 100644 --- a/vtm/src/org/oscim/renderer/elements/SymbolLayer.java +++ b/vtm/src/org/oscim/renderer/elements/SymbolLayer.java @@ -112,7 +112,7 @@ public final class SymbolLayer extends TextureLayer { t.upload(); t.offset = numIndices; - t.vertices = 0; + t.indices = 0; } width = t.width; height = t.height; @@ -176,9 +176,9 @@ public final class SymbolLayer extends TextureLayer { pos += TextLayer.VERTICES_PER_SPRITE * 6; /* six elements used to draw the four vertices */ - t.vertices += TextureLayer.INDICES_PER_SPRITE; + t.indices += TextureLayer.INDICES_PER_SPRITE; } - numIndices += t.vertices; + numIndices += t.indices; } if (pos > 0) @@ -199,7 +199,7 @@ public final class SymbolLayer extends TextureLayer { textures = Inlist.appendItem(textures, t); t.offset = 0; - t.vertices = 0; + t.indices = 0; return t; } } diff --git a/vtm/src/org/oscim/renderer/elements/TextLayer.java b/vtm/src/org/oscim/renderer/elements/TextLayer.java index aa20b99e..afff4dc1 100644 --- a/vtm/src/org/oscim/renderer/elements/TextLayer.java +++ b/vtm/src/org/oscim/renderer/elements/TextLayer.java @@ -112,7 +112,7 @@ public final class TextLayer extends TextureLayer { if (y + height > TEXTURE_HEIGHT) { t.offset = offsetIndices; - t.vertices = (short) (numIndices - offsetIndices); + t.indices = (short) (numIndices - offsetIndices); offsetIndices = numIndices; t.next = pool.get(); @@ -167,7 +167,7 @@ public final class TextLayer extends TextureLayer { vi.used = pos; t.offset = offsetIndices; - t.vertices = (short) (numIndices - offsetIndices); + t.indices = (short) (numIndices - offsetIndices); return true; } diff --git a/vtm/src/org/oscim/renderer/elements/TextureItem.java b/vtm/src/org/oscim/renderer/elements/TextureItem.java index ae79677a..09ceeeae 100644 --- a/vtm/src/org/oscim/renderer/elements/TextureItem.java +++ b/vtm/src/org/oscim/renderer/elements/TextureItem.java @@ -44,7 +44,7 @@ public class TextureItem extends Inlist { /** vertex offset from which this texture is referenced */ public short offset; - public short vertices; + public short indices; /** temporary Bitmap */ public Bitmap bitmap; diff --git a/vtm/src/org/oscim/renderer/elements/TextureLayer.java b/vtm/src/org/oscim/renderer/elements/TextureLayer.java index c39ee970..cdfe8849 100644 --- a/vtm/src/org/oscim/renderer/elements/TextureLayer.java +++ b/vtm/src/org/oscim/renderer/elements/TextureLayer.java @@ -172,10 +172,10 @@ public abstract class TextureLayer extends RenderElement { 1f / (t.height * COORD_SCALE)); t.bind(); - int maxVertices = MapRenderer.maxQuads * INDICES_PER_SPRITE; + int maxIndices = MapRenderer.maxQuads * INDICES_PER_SPRITE; /* draw up to maxVertices in each iteration */ - for (int i = 0; i < t.vertices; i += maxVertices) { + for (int i = 0; i < t.indices; i += maxIndices) { /* to.offset * (24(shorts) * 2(short-bytes) * / 6(indices) == 8) */ int off = (t.offset + i) * 8 + tl.offset; @@ -198,11 +198,11 @@ public abstract class TextureLayer extends RenderElement { 2, GL20.GL_SHORT, false, 12, layers.vertexArrayBuffer); } - int numVertices = t.vertices - i; - if (numVertices > maxVertices) - numVertices = maxVertices; + int numIndices = t.indices - i; + if (numIndices > maxIndices) + numIndices = maxIndices; - GL.glDrawElements(GL20.GL_TRIANGLES, numVertices, + GL.glDrawElements(GL20.GL_TRIANGLES, numIndices, GL20.GL_UNSIGNED_SHORT, 0); }