changeset 241:f0a36bb9a334 gmap2

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 17 Mar 2014 02:11:08 +0200
parents 0a719f1dbf01
children 72aea6651857
files tools/makegmaps.php
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/tools/makegmaps.php	Mon Mar 17 02:05:37 2014 +0200
+++ b/tools/makegmaps.php	Mon Mar 17 02:11:08 2014 +0200
@@ -575,7 +575,7 @@
  */
 function createTile($scale, $zoom, $x, $y, $mapData, $mapMtime)
 {
-  global $continentList, $worldMap, $pathImageCache, $pathTileData, $tileDim;
+  global $continentList, $worldMap, $cfg, $tileDim;
 
   $outFilename = $cfg["pathTileData"].$zoom."/".$y."/".$x.".png";
   if (file_exists($outFilename) && filemtime($outFilename) >= $mapMtime)
@@ -584,7 +584,7 @@
     return;
   }
 
-  $drawn = 0;
+  $drawn = false;
   $im = false;
 
   foreach ($continentList as $continent => $data)
@@ -605,7 +605,7 @@
         ($cx * $scale)     < ($x+1)*$tileDim && 
         ($cy * $scale)     < ($y+1)*$tileDim)
     {
-      if ($drawn == 0)
+      if (!$drawn)
       {
         if ($zoom < 9)
         {
@@ -650,12 +650,12 @@
       if ($im !== false)
       {
         imagecopy($im, $mapData[$continent], $xx, $yy, $tx, $ty, $dx, $dy);
-        $drawn++;
+        $drawn = TRUE;
       }
     }
   }
 
-  if ($drawn > 0)
+  if ($drawn)
   {
     stMakeDir($cfg["pathTileData"].$zoom."/".$y, 0755);
     imagepng($im, $outFilename);