changeset 24:f74739f637cf gmap2

Updates.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 08 Jan 2011 15:47:11 +0200
parents 72c78e1e2b3c
children ca7fcd808108
files tools/makegmaps.php
diffstat 1 files changed, 8 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/tools/makegmaps.php	Sat Jan 08 15:43:47 2011 +0200
+++ b/tools/makegmaps.php	Sat Jan 08 15:47:11 2011 +0200
@@ -2,8 +2,10 @@
 <?php
 
 $locPath = "maputils/maps/";
-$outPath = "./";
+$outPath = "../";
 $mkloc = "maputils/mkloc";
+$map2ppm = "maputils/map2ppm";
+
 
 $modes = array(
   "xml"     => "markers.xml",
@@ -11,18 +13,7 @@
   "labels"  => "overlaylabels.txt",
 );
 
-
-$continentList = array(
-  // ID                   Name           Xoffs   Yoffs  spec    hasmap
-  "laenor"      => array("Laenor",       1    ,  1    , FALSE , TRUE ),
-  "rothikgen"   => array("Rothikgen",    1311 , -1255 , FALSE , TRUE ),
-  "lucentium"   => array("Lucentium",   -634  ,  2345 , FALSE , TRUE ),
-  "furnachia"   => array("Furnachia",    1211 ,  1155 , FALSE , TRUE ),
-  "desolathya"  => array("Desolathya",  -1210 ,  820  , FALSE , TRUE ),
-
-  "renardy"     => array("Renardy",      2068 , -910  , TRUE  , TRUE  ),
-  "limbo"       => array("Limbo",           0 ,  0    , TRUE  , FALSE ),
-);
+require "world.php";
 
 
 $args = "";
@@ -31,15 +22,15 @@
     $args .=
     "-l ".escapeshellarg($locPath.$name.".loc")." ".
     "-c ".escapeshellarg($t[0])." ".
-    "-x ".escapeshellarg(8192 + $t[1])." ".
-    "-y ".escapeshellarg(8192 + $t[2])." ";
+    "-x ".escapeshellarg($worldMap["ox"] + $t[1])." ".
+    "-y ".escapeshellarg($worldMap["oy"] + $t[2])." ";
   }
 }
 
 foreach ($modes as $mode => $file) {
   $tmp = escapeshellcmd($mkloc)." -v -o ".escapeshellarg($outPath.$file)." -G ".$mode." ".$args;
-  passthru(escapeshellcmd($mkloc)." -v -o ".escapeshellarg($outPath.$file)." -G ".$mode." ".$args) == 0 or
-  die("Error executing ".$mkloc.".\n");
+  passthru($tmp) == 0 or die("Error executing: ".$tmp."\n");
 }
 
+
 ?>
\ No newline at end of file