mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-11 09:20:17 +01:00
Fixed tile offset.
This commit is contained in:
parent
ba301372f1
commit
8c29975d27
@ -26,10 +26,10 @@ func main() {
|
|||||||
flag.IntVar(&port, "port", 6379, "port to of mtredisalize server")
|
flag.IntVar(&port, "port", 6379, "port to of mtredisalize server")
|
||||||
flag.IntVar(&port, "p", 6379, "port to of mtredisalize server (shorthand)")
|
flag.IntVar(&port, "p", 6379, "port to of mtredisalize server (shorthand)")
|
||||||
flag.StringVar(&host, "host", "localhost", "host to mtredisalize server")
|
flag.StringVar(&host, "host", "localhost", "host to mtredisalize server")
|
||||||
flag.IntVar(&xMin, "xmin", -1936, "x min of the area to tile")
|
flag.IntVar(&xMin, "xmin", -1933, "x min of the area to tile")
|
||||||
flag.IntVar(&xMax, "xmax", 1920, "x max of the area to tile")
|
flag.IntVar(&xMax, "xmax", 1932, "x max of the area to tile")
|
||||||
flag.IntVar(&zMin, "zmin", -1936, "z min of the area to tile")
|
flag.IntVar(&zMin, "zmin", -1933, "z min of the area to tile")
|
||||||
flag.IntVar(&zMax, "zmax", 1920, "z max 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(&colorsFile, "colors", "colors.txt", "definition of colors")
|
||||||
flag.StringVar(&outDir, "output-dir", "map", "directory with the resulting image tree")
|
flag.StringVar(&outDir, "output-dir", "map", "directory with the resulting image tree")
|
||||||
flag.StringVar(&outDir, "o", "map", "directory with the resulting image tree")
|
flag.StringVar(&outDir, "o", "map", "directory with the resulting image tree")
|
||||||
|
@ -30,7 +30,7 @@ type xz struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c xz) quantize() xz {
|
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 {
|
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) {
|
func updateBaseTiles(jobs chan xz, btc *common.BaseTileCreator, done *sync.WaitGroup) {
|
||||||
for job := range jobs {
|
for job := range jobs {
|
||||||
x := job.X*16 + -1936 - 1
|
x := job.X*16 + -1933 - 1
|
||||||
z := job.Z*16 + -1936 - 1
|
z := job.Z*16 + -1933 - 1
|
||||||
log.Printf("%d/%d %d/%d", x, z, job.X, job.Z)
|
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 {
|
if err := btc.CreateTile(x, z, int(job.X), int(job.Z)); err != nil {
|
||||||
log.Printf("WARN: create tile failed: %s", err)
|
log.Printf("WARN: create tile failed: %s", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user