X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/FreeShisen/blobdiff_plain/45abc54753baba4f2114c97cfd11a70058c2c6b6..07fd4c9f7cc4b5ba98994f9c153213adf7c01a44:/src/de/cwde/freeshisen/ShisenShoView.java diff --git a/src/de/cwde/freeshisen/ShisenShoView.java b/src/de/cwde/freeshisen/ShisenShoView.java index 6f567ce..9207d3d 100644 --- a/src/de/cwde/freeshisen/ShisenShoView.java +++ b/src/de/cwde/freeshisen/ShisenShoView.java @@ -108,10 +108,10 @@ class ShisenShoView extends SurfaceView implements SurfaceHolder.Callback { this.cstate=cstate; } - private void loadTileset() { + public void loadTileset() { BitmapFactory.Options ops = new BitmapFactory.Options(); ops.inScaled = false; - Bitmap tileset = BitmapFactory.decodeResource(getResources(), R.drawable.tileset, ops); + Bitmap tileset = BitmapFactory.decodeResource(getResources(), app.tilesetid, ops); tileset.setDensity(Bitmap.DENSITY_NONE); // The tile set has 4 rows x 9 columns @@ -124,8 +124,8 @@ class ShisenShoView extends SurfaceView implements SurfaceHolder.Callback { // align to screen: // "large" is 16x6, and we want to have a nice border, so we use 17x7 and // choose the lowest scale so everything fits - float scalex = ((float) screenWidth/17) / loadedtileWidth; - float scaley = ((float) screenHeight/7) / loadedtileHeight; + float scalex = ((float) (screenWidth - 2)/17) / loadedtileWidth; + float scaley = ((float) (screenHeight - 2)/7) / loadedtileHeight; if (scaley < scalex) { scalex = scaley; } else {