--- cfmaps/cfmap2html 2005/11/18 23:20:26 1.7 +++ cfmaps/cfmap2html 2005/11/23 09:07:21 1.21 @@ -1,5 +1,24 @@ #!/opt/bin/perl +# cfmap2html - convert crossfire maps to html +# Copyright (C) 2005 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 +# Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +our $VERSION = '1.21'; + use Storable; my $LIBDIR = $ENV{CROSSFIRE_LIBDIR} @@ -9,10 +28,6 @@ my $arch; -umask 022; - -our $VERSION = '1.01'; - sub escape_html($) { local $_ = shift; s/([<>&])/sprintf "&#%d;", ord $1/ge; @@ -34,112 +49,111 @@ $arch ||= Storable::retrieve "$LIBDIR/archetypes.pst"; my $meta = Storable::retrieve "$path.pst"; - open my $fh, ">:utf8", "$path.html" - or die "$path.html: $!"; + 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 "", - "", + print "", + '', + "", "", "Crossfire Map \"$path\"", - "", + "\n", + "\n", + "\n", + "", "", ""; - print "", - "", + "

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