fix overflow: use int offsets in TextureItem

should fix #144

- using quad-indices the offsets are not limited to max vertex ids
This commit is contained in:
Hannes Janetzek 2015-03-19 13:50:47 +01:00
parent 35c22e68dc
commit 00ceb9f359
3 changed files with 7 additions and 7 deletions

View File

@ -68,7 +68,7 @@ public final class SymbolBucket extends TextureBucket {
/* offset of layer data in vbo */ /* offset of layer data in vbo */
this.vertexOffset = vboData.position() * 2; //SHORT_BYTES; this.vertexOffset = vboData.position() * 2; //SHORT_BYTES;
short numIndices = 0; int numIndices = 0;
prevTextures = textures; prevTextures = textures;
textures = null; textures = null;

View File

@ -83,8 +83,8 @@ public class TextBucket extends TextureBucket {
@Override @Override
public void prepare() { public void prepare() {
short numIndices = 0; int numIndices = 0;
short offsetIndices = 0; int offsetIndices = 0;
int advanceY = 0; int advanceY = 0;
float x = 0; float x = 0;
@ -113,7 +113,7 @@ public class TextBucket extends TextureBucket {
if (y + height > TEXTURE_HEIGHT) { if (y + height > TEXTURE_HEIGHT) {
t.offset = offsetIndices; t.offset = offsetIndices;
t.indices = (short) (numIndices - offsetIndices); t.indices = (numIndices - offsetIndices);
offsetIndices = numIndices; offsetIndices = numIndices;
t.next = pool.get(); t.next = pool.get();
@ -155,7 +155,7 @@ public class TextBucket extends TextureBucket {
} }
t.offset = offsetIndices; t.offset = offsetIndices;
t.indices = (short) (numIndices - offsetIndices); t.indices = (numIndices - offsetIndices);
} }
protected void addItem(TextItem it, protected void addItem(TextItem it,

View File

@ -48,8 +48,8 @@ public class TextureItem extends Inlist<TextureItem> {
/** vertex offset from which this texture is referenced */ /** vertex offset from which this texture is referenced */
/* FIXME dont put this here! */ /* FIXME dont put this here! */
public short offset; public int offset;
public short indices; public int indices;
/** temporary Bitmap */ /** temporary Bitmap */
public Bitmap bitmap; public Bitmap bitmap;