view tools/makegmaps.php @ 22:2ca80ace5172 gmap2

Move things.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 08 Jan 2011 13:05:38 +0200
parents makegmaps.php@7444639be2ef
children f74739f637cf
line wrap: on
line source

#!/usr/bin/php
<?php

$locPath = "maputils/maps/";
$outPath = "./";
$mkloc = "maputils/mkloc";

$modes = array(
  "xml"     => "markers.xml",
  "overlay" => "overlay.txt",
  "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 ),
);


$args = "";
foreach ($continentList as $name => $t) {
  if ($t[4]) { // has a map
    $args .=
    "-l ".escapeshellarg($locPath.$name.".loc")." ".
    "-c ".escapeshellarg($t[0])." ".
    "-x ".escapeshellarg(8192 + $t[1])." ".
    "-y ".escapeshellarg(8192 + $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");
}

?>