Mercurial > hg > batmud > gmap2
changeset 17:7444639be2ef gmap2
Added script for generating marker data.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 08 Jan 2011 12:49:52 +0200 |
parents | ec4f7f015123 |
children | ee245e1b5908 |
files | makegmaps.php |
diffstat | 1 files changed, 45 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/makegmaps.php Sat Jan 08 12:49:52 2011 +0200 @@ -0,0 +1,45 @@ +#!/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"); +} + +?> \ No newline at end of file