diff --git a/cmd/mtwebmapper/tilesupdater.go b/cmd/mtwebmapper/tilesupdater.go index 8b09a0e..5150394 100644 --- a/cmd/mtwebmapper/tilesupdater.go +++ b/cmd/mtwebmapper/tilesupdater.go @@ -54,7 +54,7 @@ type xzc struct { } type xzm struct { - P xz + xz Mask uint16 } @@ -70,8 +70,8 @@ func (c xz) parent() xzm { xp, xr := c.X>>1, uint16(c.X&1) zp, zr := c.Z>>1, uint16(c.Z&1) return xzm{ - P: xz{X: xp, Z: zp}, - Mask: 1 << (zr<<1 | xr)} + xz{X: xp, Z: zp}, + 1 << (zr<<1 | xr)} } func newTileUpdater( @@ -224,7 +224,7 @@ func (tu *tileUpdater) doUpdates() { parentJobs := make(map[xz]uint16) for i := range actChs { pxz := actChs[i].parent() - parentJobs[pxz.P] |= pxz.Mask + parentJobs[pxz.xz] |= pxz.Mask } for level := 7; level >= 0; level-- { @@ -235,9 +235,9 @@ func (tu *tileUpdater) doUpdates() { } ppJobs := make(map[xz]uint16) for c, mask := range parentJobs { - pJobs <- xzm{P: c, Mask: mask} + pJobs <- xzm{c, mask} pxz := c.parent() - ppJobs[pxz.P] |= pxz.Mask + ppJobs[pxz.xz] |= pxz.Mask } close(pJobs) done.Wait() @@ -291,8 +291,8 @@ func (tu *tileUpdater) updatePyramidTile(scratch, resized *image.RGBA, level int origPath := filepath.Join( tu.mapDir, strconv.Itoa(level), - strconv.Itoa(int(j.P.X)), - strconv.Itoa(int(j.P.Z))+".png") + strconv.Itoa(int(j.X)), + strconv.Itoa(int(j.Z))+".png") sr := resized.Bounds() levelDir := strconv.Itoa(level + 1) @@ -300,7 +300,7 @@ func (tu *tileUpdater) updatePyramidTile(scratch, resized *image.RGBA, level int if j.Mask&(1<