diff --git a/src/main/java/com/watabou/gltextures/TextureCache.java b/src/main/java/com/watabou/gltextures/TextureCache.java index 7b71d5a..88f52e8 100644 --- a/src/main/java/com/watabou/gltextures/TextureCache.java +++ b/src/main/java/com/watabou/gltextures/TextureCache.java @@ -64,7 +64,7 @@ public static SmartTexture createSolid( int color ) { public static SmartTexture createGradient( int width, int height, int... colors ) { - final String key = "" + width + "x" + height + ":" + colors; + final String key = width + "x" + height + ":" + colors; if (all.containsKey( key )) { diff --git a/src/main/java/com/watabou/noosa/Tilemap.java b/src/main/java/com/watabou/noosa/Tilemap.java index 16674bb..e8829af 100644 --- a/src/main/java/com/watabou/noosa/Tilemap.java +++ b/src/main/java/com/watabou/noosa/Tilemap.java @@ -76,6 +76,10 @@ public void map( int[] data, int cols ) { updated.set( 0, 0, mapWidth, mapHeight ); } + protected int getTile( int pos ) { + return data[pos]; + } + protected void updateVertices() { float y1 = cellH * updated.top; @@ -91,7 +95,7 @@ protected void updateVertices() { for (int j=updated.left; j < updated.right; j++) { - RectF uv = tileset.get( data[pos++] ); + RectF uv = tileset.get( getTile( pos++ ) ); vertices[0] = x1; vertices[1] = y1; diff --git a/src/main/java/com/watabou/utils/PointF.java b/src/main/java/com/watabou/utils/PointF.java index 89ef1fb..ff7fc37 100644 --- a/src/main/java/com/watabou/utils/PointF.java +++ b/src/main/java/com/watabou/utils/PointF.java @@ -145,6 +145,6 @@ public static float angle( PointF start, PointF end ) { @Override public String toString() { - return "" + x + ", " + y; + return x + ", " + y; } }