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:
parent
35c22e68dc
commit
00ceb9f359
@ -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;
|
||||||
|
@ -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,
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user