Mercurial > hg > batmud > gmap2
changeset 109:9e0b9c708a9d gmap2
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 15 Feb 2014 18:30:06 +0200 |
parents | 2da133cb76d6 |
children | 3dec73b1dc7f |
files | tools/makegmaps.php |
diffstat | 1 files changed, 16 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/makegmaps.php Tue May 07 21:20:31 2013 +0300 +++ b/tools/makegmaps.php Sat Feb 15 18:30:06 2014 +0200 @@ -228,11 +228,14 @@ if ($zoom == 1) { imagesetpixel($im, $x, $y, $colors[$data[$x]]); - } else + } + else if ($zoom < 6) { imagefilledrectangle($im, $x*$zoom, $y*$zoom, ($x+1)*$zoom-1, ($y+1)*$zoom-1, $colors[$data[$x]]); - } else { + } + else + { imagettftext($im, $fontsize[$zoom], 0, $x*$zoom + $fontsize[$zoom]/4, @@ -283,10 +286,9 @@ { $res = makeMap($inFilename, $outFilename, $zoom, $data); echo ($res ? "OK" : "FAIL")."\n"; - } else - { + } + else echo "SKIPPED\n"; - } } } @@ -319,10 +321,9 @@ $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"; - } } } @@ -454,7 +455,9 @@ $im = @imagecreate($tileDim, $tileDim); $sea = imagecolorallocate($im, 51, 51, 170); imagefilledrectangle($im, 0, 0, $tileDim, $tileDim, $sea); - } else { + } + else + { $inFilename = $tilePath.$zoom."/sea.png"; $im = @imagecreatefrompng($inFilename); if ($im === false) @@ -482,14 +485,10 @@ } if ($dx > $cw*$scale-$tx) - { $dx = $cw*$scale - $tx; - } if ($dy > $ch*$scale-$ty) - { $dy = $ch*$scale - $ty; - } if ($im !== false) { @@ -554,8 +553,10 @@ // Free image data for each continent foreach($continentList as $continent => $data) - if ($data[4] && $data[7]) - imagedestroy($mapData[$continent]); + { + if ($data[4] && $data[7]) + imagedestroy($mapData[$continent]); + } } ?> \ No newline at end of file