ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cfmaps/cfmap2html
(Generate patch)

Comparing cfmaps/cfmap2html (file contents):
Revision 1.27 by root, Thu Jun 21 00:14:50 2007 UTC vs.
Revision 1.29 by root, Thu Jun 21 12:30:10 2007 UTC

36for my $path (@ARGV) { 36for my $path (@ARGV) {
37 (my $base = $path) =~ s/\.map//; 37 (my $base = $path) =~ s/\.map//;
38# print STDERR "$path\n"; 38# print STDERR "$path\n";
39 39
40 if (!-e "$base.png" 40 if (!-e "$base.png"
41 || !-e "$base.pst"
42 || -M "$base.pst" > -M $path
43 || -M "$base.png" > -M $path) { 41 || -M "$base.png" > -M "$base.map") {
44 # regenerate png and metainfo 42 # regenerate png and metainfo
45 push @cfmap2png, $path; 43 push @cfmap2png, $path;
46 }; 44 };
47} 45}
48 46
50 if @cfmap2png; 48 if @cfmap2png;
51 49
52for my $path (@ARGV) { 50for my $path (@ARGV) {
53 (my $base = $path) =~ s/\.map//; 51 (my $base = $path) =~ s/\.map//;
54 if (!-e "$base.xhtml" 52 if (!-e "$base.xhtml"
55 || -M "$base.xhtml" > -M "$base.pst") { 53 || -M "$base.xhtml" > -M "$base.map") {
56 54
57 Crossfire::load_archetypes 55 Crossfire::load_archetypes
58 unless %ARCH; 56 unless %ARCH;
59 57
60 my $meta = Storable::retrieve "$base.pst"; 58 my $meta = read_arch "$base.map";
61 59
62 open my $fh, ">:utf8", "$base.xhtml" 60 open my $fh, ">:utf8", "$base.xhtml"
63 or die "$base.xhtml: $!"; 61 or die "$base.xhtml: $!";
64 62
65 select $fh; 63 select $fh;
120 escape_html $meta->{info}{msg}, 118 escape_html $meta->{info}{msg},
121 "</p>"; 119 "</p>";
122 120
123 print "<table class='map'>"; 121 print "<table class='map'>";
124 122
125 my %ignore = map +($_ => 1), qw(name _name x y); 123 my %ignore = map +($_ => 1), qw(name _name _atype x y);
126 my %is_exit = map +($_ => 1), 41, 57, 66; 124 my %is_exit = map +($_ => 1), 41, 57, 66;
127 125
128 for my $y (0.. $meta->{height} - 1) { 126 for my $y (0.. $meta->{height} - 1) {
129 print "<tr>"; 127 print "<tr>";
130 for my $x (0.. $meta->{width} - 1) { 128 for my $x (0.. $meta->{width} - 1) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines