--- cfmaps/cfmap2html 2007/02/14 03:00:33 1.26 +++ cfmaps/cfmap2html 2007/06/21 00:14:50 1.27 @@ -17,12 +17,9 @@ # along with cfmaps; if not, write to the Free Software # Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -our $VERSION = '1.212'; +our $VERSION = '2.001'; -use Storable; - -my $LIBDIR = $ENV{CROSSFIRE_LIBDIR} - or die "\$CROSSFIRE_LIBDIR must be set\n"; +use Crossfire 1.0; my $T = 32; @@ -34,6 +31,8 @@ $_ } +my @cfmap2png; + for my $path (@ARGV) { (my $base = $path) =~ s/\.map//; # print STDERR "$path\n"; @@ -43,13 +42,21 @@ || -M "$base.pst" > -M $path || -M "$base.png" > -M $path) { # regenerate png and metainfo - - system "cfmap2png", $path; + push @cfmap2png, $path; }; +} + +system "cfmap2png", @cfmap2png + if @cfmap2png; +for my $path (@ARGV) { + (my $base = $path) =~ s/\.map//; if (!-e "$base.xhtml" || -M "$base.xhtml" > -M "$base.pst") { - $arch ||= Storable::retrieve "$LIBDIR/archetypes.pst"; + + Crossfire::load_archetypes + unless %ARCH; + my $meta = Storable::retrieve "$base.pst"; open my $fh, ">:utf8", "$base.xhtml"