Fixed tile offset.

This commit is contained in:
Sascha L. Teichmann 2014-09-20 21:57:01 +02:00
parent ba301372f1
commit 8c29975d27
2 changed files with 7 additions and 7 deletions

View File

@ -26,10 +26,10 @@ func main() {
flag.IntVar(&port, "port", 6379, "port to of mtredisalize server")
flag.IntVar(&port, "p", 6379, "port to of mtredisalize server (shorthand)")
flag.StringVar(&host, "host", "localhost", "host to mtredisalize server")
flag.IntVar(&xMin, "xmin", -1936, "x min of the area to tile")
flag.IntVar(&xMax, "xmax", 1920, "x max of the area to tile")
flag.IntVar(&zMin, "zmin", -1936, "z min of the area to tile")
flag.IntVar(&zMax, "zmax", 1920, "z max of the area to tile")
flag.IntVar(&xMin, "xmin", -1933, "x min of the area to tile")
flag.IntVar(&xMax, "xmax", 1932, "x max of the area to tile")
flag.IntVar(&zMin, "zmin", -1933, "z min of the area to tile")
flag.IntVar(&zMax, "zmax", 1932, "z max of the area to tile")
flag.StringVar(&colorsFile, "colors", "colors.txt", "definition of colors")
flag.StringVar(&outDir, "output-dir", "map", "directory with the resulting image tree")
flag.StringVar(&outDir, "o", "map", "directory with the resulting image tree")

View File

@ -30,7 +30,7 @@ type xz struct {
}
func (c xz) quantize() xz {
return xz{X: (c.X - -1936) / 16, Z: (c.Z - -1936) / 16}
return xz{X: (c.X - -1933) / 16, Z: (c.Z - -1933) / 16}
}
func newTileUpdater(mapDir, redisAddress string, colors *common.Colors, workers int) *tileUpdater {
@ -106,8 +106,8 @@ func (tu *tileUpdater) doUpdates() {
func updateBaseTiles(jobs chan xz, btc *common.BaseTileCreator, done *sync.WaitGroup) {
for job := range jobs {
x := job.X*16 + -1936 - 1
z := job.Z*16 + -1936 - 1
x := job.X*16 + -1933 - 1
z := job.Z*16 + -1933 - 1
log.Printf("%d/%d %d/%d", x, z, job.X, job.Z)
if err := btc.CreateTile(x, z, int(job.X), int(job.Z)); err != nil {
log.Printf("WARN: create tile failed: %s", err)