--- cfmaps/cfmap2html 2005/11/22 17:54:41 1.19 +++ cfmaps/cfmap2html 2007/02/14 02:58:58 1.25 @@ -1,7 +1,7 @@ #!/opt/bin/perl # cfmap2html - convert crossfire maps to html -# Copyright (C) 2005 Marc Lehmann +# Copyright (C) 2005,2007 Marc Lehmann # # CFMAP2HTML is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,10 +14,10 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with gvpe; if not, write to the Free Software +# 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.2'; +our $VERSION = '1.212'; use Storable; @@ -35,153 +35,158 @@ } for my $path (@ARGV) { + (my $base = $path) =~ s/\.map//; # print STDERR "$path\n"; - if (!-e "$path.png" - || !-e "$path.pst" - || -M "$path.pst" > -M $path - || -M "$path.png" > -M $path) { + warn "$base.png\n"; + if (!-e "$base.png" + || !-e "$base.pst" + || -M "$base.pst" > -M $path + || -M "$base.png" > -M $path) { # regenerate png and metainfo system "cfmap2png", $path; }; - $arch ||= Storable::retrieve "$LIBDIR/archetypes.pst"; - my $meta = Storable::retrieve "$path.pst"; - - open my $fh, ">:utf8", "$path.xhtml" - or die "$path.xhtml: $!"; - - select $fh; - - my $W = $meta->{width} * $T; - my $H = $meta->{height} * $T; - - my $W2 = $W + 600; - - my (@path) = split /\//, $path; - - print "", - '', - "", - "", - "Crossfire Map \"$path\"", - "\n", - "\n", - "\n", - "", - "", - ""; - - print "", - "", + "

"; - close $fh; + close $fh; - #system "gzip", "-7f", "$path.xhtml"; + #system "gzip", "-7f", "$path.xhtml"; + } }