use same quad indices in Texture- and LineTexRenderer

This commit is contained in:
Hannes Janetzek
2013-03-16 07:46:51 +01:00
parent 2538ed8eb7
commit b0c02e0c56
5 changed files with 69 additions and 109 deletions

View File

@@ -33,8 +33,8 @@ public final class SymbolLayer extends TextureLayer {
SymbolItem symbols;
private Canvas mCanvas;
private Rect mRect = new Rect();
private final Canvas mCanvas;
private final Rect mRect = new Rect();
public SymbolLayer() {
type = Layer.SYMBOL;
@@ -210,6 +210,13 @@ public final class SymbolLayer extends TextureLayer {
buf[pos++] = y1;
buf[pos++] = u1;
buf[pos++] = v2;
// bot-left
buf[pos++] = tx;
buf[pos++] = ty;
buf[pos++] = x1;
buf[pos++] = y2;
buf[pos++] = u1;
buf[pos++] = v1;
// top-right
buf[pos++] = tx;
buf[pos++] = ty;
@@ -224,13 +231,6 @@ public final class SymbolLayer extends TextureLayer {
buf[pos++] = y2;
buf[pos++] = u2;
buf[pos++] = v1;
// bot-left
buf[pos++] = tx;
buf[pos++] = ty;
buf[pos++] = x1;
buf[pos++] = y2;
buf[pos++] = u1;
buf[pos++] = v1;
// six elements used to draw the four vertices
curIndices += TextureRenderer.INDICES_PER_SPRITE;

View File

@@ -246,6 +246,13 @@ public final class TextLayer extends TextureLayer {
buf[pos++] = y1;
buf[pos++] = u1;
buf[pos++] = v2;
// bot-left
buf[pos++] = tx;
buf[pos++] = ty;
buf[pos++] = x3;
buf[pos++] = y3;
buf[pos++] = u1;
buf[pos++] = v1;
// top-right
buf[pos++] = tx;
buf[pos++] = ty;
@@ -260,13 +267,7 @@ public final class TextLayer extends TextureLayer {
buf[pos++] = y4;
buf[pos++] = u2;
buf[pos++] = v1;
// bot-left
buf[pos++] = tx;
buf[pos++] = ty;
buf[pos++] = x3;
buf[pos++] = y3;
buf[pos++] = u1;
buf[pos++] = v1;
// six indices to draw the four vertices
numIndices += TextureRenderer.INDICES_PER_SPRITE;