Mercurial > hg > batmud > gmap2
changeset 65:b30043f6c2e3 gmap2
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 21 Feb 2011 17:26:28 +0200 |
parents | 6a267fe394b0 |
children | f7a55c9d126b |
files | tools/makegmaps.php |
diffstat | 1 files changed, 16 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/makegmaps.php Mon Feb 21 17:17:18 2011 +0200 +++ b/tools/makegmaps.php Mon Feb 21 17:26:28 2011 +0200 @@ -204,10 +204,12 @@ $outFilename = $cachePath.$name."_".($zoom + 4).".png"; $outMtime = file_exists($outFilename) ? filemtime($outFilename) : -1; echo "- ".$name." (".$data[0]."): "; - if ($inMtime > $outMtime) { + if ($inMtime > $outMtime) + { $res = makeMap($inFilename, $outFilename, $zoom, $data); echo ($res ? "OK" : "FAIL")."\n"; - } else { + } else + { echo "SKIPPED\n"; } } @@ -237,11 +239,13 @@ $outMtime = file_exists($outFilename) ? filemtime($outFilename) : -1; echo "* ".$inFilename." -> ".$outFilename.": "; - if ($inMtime > $outMtime) { + if ($inMtime > $outMtime) + { $tmp = escapeshellcmd($convert)." ".escapeshellarg($inFilename)." -scale ".escapeshellarg($scale."%")." -type Palette ".escapeshellarg($outFilename); passthru($tmp) == 0 or die("Error executing: ".$tmp."\n"); echo "OK\n"; - } else { + } else + { echo "SKIPPED\n"; } } @@ -365,10 +369,12 @@ if (($cx + $cw)*$scale > $x*$tileDim && ($cy + $ch)*$scale > $y*$tileDim && ($cx * $scale) < ($x+1)*$tileDim && - ($cy * $scale) < ($y+1)*$tileDim) { - - if ($drawn == 0) { - if ($zoom < 9) { + ($cy * $scale) < ($y+1)*$tileDim) + { + if ($drawn == 0) + { + if ($zoom < 9) + { $im = @imagecreate($tileDim, $tileDim); $sea = imagecolorallocate($im, 51, 51, 170); imagefilledrectangle($im, 0, 0, $tileDim, $tileDim, $sea); @@ -437,7 +443,8 @@ $mapData = array(); -for ($zoom = 1; $zoom <= 10; $zoom++) { +for ($zoom = 1; $zoom <= 10; $zoom++) +{ $zoom2 = $zoom - 1; $scale = pow(2, $zoom2 - 5);