mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 19:25:15 +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 zoomprefix;
|
||||||
String fnprefix;
|
String fnprefix;
|
||||||
String zfnprefix;
|
String zfnprefix;
|
||||||
|
int bigworldshift;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void freshenZoomOutFilesByLevel(int zoomlevel) {
|
public void freshenZoomOutFilesByLevel(int zoomlevel) {
|
||||||
@ -143,6 +144,7 @@ public class DynmapWorld {
|
|||||||
for(MapType mt : maps) {
|
for(MapType mt : maps) {
|
||||||
List<String> pfx = mt.baseZoomFilePrefixes();
|
List<String> pfx = mt.baseZoomFilePrefixes();
|
||||||
int stepsize = mt.baseZoomFileStepSize();
|
int stepsize = mt.baseZoomFileStepSize();
|
||||||
|
int bigworldshift = mt.getBigWorldShift();
|
||||||
boolean neg_step_x = false;
|
boolean neg_step_x = false;
|
||||||
if(stepsize < 0) {
|
if(stepsize < 0) {
|
||||||
stepsize = -stepsize;
|
stepsize = -stepsize;
|
||||||
@ -157,6 +159,7 @@ public class DynmapWorld {
|
|||||||
pd.baseprefix = p;
|
pd.baseprefix = p;
|
||||||
pd.zoomlevel = zoomlevel;
|
pd.zoomlevel = zoomlevel;
|
||||||
pd.zoomprefix = "zzzzzzzzzzzz".substring(0, zoomlevel);
|
pd.zoomprefix = "zzzzzzzzzzzz".substring(0, zoomlevel);
|
||||||
|
pd.bigworldshift = bigworldshift;
|
||||||
if(bigworld) {
|
if(bigworld) {
|
||||||
if(zoomlevel > 0) {
|
if(zoomlevel > 0) {
|
||||||
pd.zoomprefix += "_";
|
pd.zoomprefix += "_";
|
||||||
@ -186,7 +189,7 @@ public class DynmapWorld {
|
|||||||
|
|
||||||
private String makeFilePath(PrefixData pd, int x, int y, boolean zoomed) {
|
private String makeFilePath(PrefixData pd, int x, int y, boolean zoomed) {
|
||||||
if(bigworld)
|
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
|
else
|
||||||
return (zoomed?pd.zfnprefix:pd.fnprefix) + "_" + x + "_" + y + ".png";
|
return (zoomed?pd.zfnprefix:pd.fnprefix) + "_" + x + "_" + y + ".png";
|
||||||
}
|
}
|
||||||
@ -194,7 +197,6 @@ public class DynmapWorld {
|
|||||||
private int processZoomDirectory(File dir, PrefixData pd) {
|
private int processZoomDirectory(File dir, PrefixData pd) {
|
||||||
Debug.debug("processZoomDirectory(" + dir.getPath() + "," + pd.baseprefix + ")");
|
Debug.debug("processZoomDirectory(" + dir.getPath() + "," + pd.baseprefix + ")");
|
||||||
HashMap<String, ProcessTileRec> toprocess = new HashMap<String, ProcessTileRec>();
|
HashMap<String, ProcessTileRec> toprocess = new HashMap<String, ProcessTileRec>();
|
||||||
int step = pd.stepsize << pd.zoomlevel;
|
|
||||||
String[] files = dir.list(new PNGFileFilter(pd.fnprefix));
|
String[] files = dir.list(new PNGFileFilter(pd.fnprefix));
|
||||||
if(files == null)
|
if(files == null)
|
||||||
return 0;
|
return 0;
|
||||||
@ -265,6 +267,7 @@ public class DynmapWorld {
|
|||||||
rec.x = x;
|
rec.x = x;
|
||||||
rec.y = y;
|
rec.y = y;
|
||||||
rec.zfname = zfname;
|
rec.zfname = zfname;
|
||||||
|
Debug.debug("Process " + zf.getPath() + " due to " + f.getPath());
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,9 @@ public abstract class MapType {
|
|||||||
|
|
||||||
public abstract List<String> baseZoomFilePrefixes();
|
public abstract List<String> baseZoomFilePrefixes();
|
||||||
public abstract int baseZoomFileStepSize();
|
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
|
* 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)
|
* 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; }
|
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 {
|
public static class FlatMapTile extends MapTile {
|
||||||
FlatMap map;
|
FlatMap map;
|
||||||
public int x;
|
public int x;
|
||||||
|
@ -341,6 +341,8 @@ public class KzedMap extends MapType {
|
|||||||
private static final int[] stepseq = { 0, 2, 1, 3 };
|
private static final int[] stepseq = { 0, 2, 1, 3 };
|
||||||
|
|
||||||
public int[] zoomFileStepSequence() { return stepseq; }
|
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() {
|
public String getName() {
|
||||||
return "KzedMap";
|
return "KzedMap";
|
||||||
|
Loading…
Reference in New Issue
Block a user