mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-08 03:29:43 +01:00
Another bigworld+isomaps+zoom-out fix - directory name inconsistency
This commit is contained in:
parent
5bb3249dfe
commit
f3ac3d9be4
@ -106,6 +106,7 @@ public class DynmapWorld {
|
||||
String zoomprefix;
|
||||
String fnprefix;
|
||||
String zfnprefix;
|
||||
int bigworldshift;
|
||||
}
|
||||
|
||||
public void freshenZoomOutFilesByLevel(int zoomlevel) {
|
||||
@ -143,6 +144,7 @@ public class DynmapWorld {
|
||||
for(MapType mt : maps) {
|
||||
List<String> pfx = mt.baseZoomFilePrefixes();
|
||||
int stepsize = mt.baseZoomFileStepSize();
|
||||
int bigworldshift = mt.getBigWorldShift();
|
||||
boolean neg_step_x = false;
|
||||
if(stepsize < 0) {
|
||||
stepsize = -stepsize;
|
||||
@ -157,6 +159,7 @@ public class DynmapWorld {
|
||||
pd.baseprefix = p;
|
||||
pd.zoomlevel = zoomlevel;
|
||||
pd.zoomprefix = "zzzzzzzzzzzz".substring(0, zoomlevel);
|
||||
pd.bigworldshift = bigworldshift;
|
||||
if(bigworld) {
|
||||
if(zoomlevel > 0) {
|
||||
pd.zoomprefix += "_";
|
||||
@ -186,7 +189,7 @@ public class DynmapWorld {
|
||||
|
||||
private String makeFilePath(PrefixData pd, int x, int y, boolean zoomed) {
|
||||
if(bigworld)
|
||||
return pd.baseprefix + "/" + ((x/pd.stepsize) >> 5) + "_" + ((y/pd.stepsize) >> 5) + "/" + (zoomed?pd.zfnprefix:pd.fnprefix) + x + "_" + y + ".png";
|
||||
return pd.baseprefix + "/" + (x >> pd.bigworldshift) + "_" + (y >> pd.bigworldshift) + "/" + (zoomed?pd.zfnprefix:pd.fnprefix) + x + "_" + y + ".png";
|
||||
else
|
||||
return (zoomed?pd.zfnprefix:pd.fnprefix) + "_" + x + "_" + y + ".png";
|
||||
}
|
||||
@ -194,7 +197,6 @@ public class DynmapWorld {
|
||||
private int processZoomDirectory(File dir, PrefixData pd) {
|
||||
Debug.debug("processZoomDirectory(" + dir.getPath() + "," + pd.baseprefix + ")");
|
||||
HashMap<String, ProcessTileRec> toprocess = new HashMap<String, ProcessTileRec>();
|
||||
int step = pd.stepsize << pd.zoomlevel;
|
||||
String[] files = dir.list(new PNGFileFilter(pd.fnprefix));
|
||||
if(files == null)
|
||||
return 0;
|
||||
@ -265,6 +267,7 @@ public class DynmapWorld {
|
||||
rec.x = x;
|
||||
rec.y = y;
|
||||
rec.zfname = zfname;
|
||||
Debug.debug("Process " + zf.getPath() + " due to " + f.getPath());
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,9 @@ public abstract class MapType {
|
||||
|
||||
public abstract List<String> baseZoomFilePrefixes();
|
||||
public abstract int baseZoomFileStepSize();
|
||||
/* How many bits of coordinate are shifted off to make big world directory name */
|
||||
public abstract int getBigWorldShift();
|
||||
|
||||
/**
|
||||
* Step sequence for creating zoomed file: first index is top-left, second top-right, third bottom-left, forth bottom-right
|
||||
* Values correspond to tile X,Y (0), X+step,Y (1), X,Y+step (2), X+step,Y+step (3)
|
||||
|
@ -422,6 +422,9 @@ public class FlatMap extends MapType {
|
||||
|
||||
public int[] zoomFileStepSequence() { return stepseq; }
|
||||
|
||||
/* How many bits of coordinate are shifted off to make big world directory name */
|
||||
public int getBigWorldShift() { return 5; }
|
||||
|
||||
public static class FlatMapTile extends MapTile {
|
||||
FlatMap map;
|
||||
public int x;
|
||||
|
@ -341,6 +341,8 @@ public class KzedMap extends MapType {
|
||||
private static final int[] stepseq = { 0, 2, 1, 3 };
|
||||
|
||||
public int[] zoomFileStepSequence() { return stepseq; }
|
||||
/* How many bits of coordinate are shifted off to make big world directory name */
|
||||
public int getBigWorldShift() { return 12; }
|
||||
|
||||
public String getName() {
|
||||
return "KzedMap";
|
||||
|
Loading…
Reference in New Issue
Block a user