Fixed zoomed tile/player not fitting unzoomed.
This commit is contained in:
parent
2b2891bd0a
commit
a08edc3fa9
3 changed files with 6 additions and 13 deletions
|
|
@ -7,7 +7,7 @@ import org.dynmap.MapTile;
|
|||
public class KzedZoomedMapTile extends MapTile {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "z" + originalTile.renderer.getName() + "_" + ztilex(originalTile.px) + "_" + ztiley(originalTile.py);
|
||||
return "z" + originalTile.renderer.getName() + "_" + getTileX() + "_" + getTileY();
|
||||
}
|
||||
public BufferedImage unzoomedImage;
|
||||
public KzedMapTile originalTile;
|
||||
|
|
@ -18,14 +18,14 @@ public class KzedZoomedMapTile extends MapTile {
|
|||
}
|
||||
|
||||
public int getTileX() {
|
||||
return ztilex(originalTile.px);
|
||||
return ztilex(originalTile.px+KzedMap.tileWidth);
|
||||
}
|
||||
|
||||
public int getTileY() {
|
||||
return ztiley(originalTile.py);
|
||||
}
|
||||
|
||||
static int ztilex(int x) {
|
||||
private static int ztilex(int x) {
|
||||
if(x < 0)
|
||||
return x + (x % (KzedMap.tileWidth*2));
|
||||
else
|
||||
|
|
@ -33,11 +33,10 @@ public class KzedZoomedMapTile extends MapTile {
|
|||
}
|
||||
|
||||
/* zoomed-out tile Y for tile position y */
|
||||
static int ztiley(int y)
|
||||
private static int ztiley(int y)
|
||||
{
|
||||
if(y < 0)
|
||||
return y + (y % (KzedMap.tileHeight*2));
|
||||
//return y - (zTileHeight + (y % zTileHeight));
|
||||
else
|
||||
return y - (y % (KzedMap.tileHeight*2));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ public class ZoomedTileRenderer {
|
|||
int sch = KzedMap.tileHeight / 2;
|
||||
|
||||
/* origin in zoomed-out tile */
|
||||
int ox = scw;
|
||||
int ox = 0;
|
||||
int oy = 0;
|
||||
|
||||
if(zpx != px) ox = 0;
|
||||
if(zpx != px) ox = scw;
|
||||
if(zpy != py) oy = sch;
|
||||
|
||||
/* blit scaled rendered tile onto zoom-out tile */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue