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

Comparing cfmaps/cfmap2html (file contents):
Revision 1.1 by root, Thu Nov 17 11:51:08 2005 UTC vs.
Revision 1.4 by root, Fri Nov 18 11:15:53 2005 UTC

16 s/([<>&])/sprintf "&#%d;", ord $1/ge; 16 s/([<>&])/sprintf "&#%d;", ord $1/ge;
17 $_ 17 $_
18} 18}
19 19
20for my $path (@ARGV) { 20for my $path (@ARGV) {
21 print "$path\n";
22
21 if (!-e "$path.png" 23 if (!-e "$path.png"
22 || !-e "$path.pst" 24 || !-e "$path.pst"
23 || -M "$path.pst" > -M $path 25 || -M "$path.pst" > -M $path
24 || -M "$path.png" > -M $path) { 26 || -M "$path.png" > -M $path) {
25 # regenerate png and metainfo 27 # regenerate png and metainfo
26 28
27 $ENV{CROSSFIRE_LIBDIR} = $LIBDIR;
28 system "cfmap2png", $path; 29 system "cfmap2png", $path;
29 system "convert", "$path.png", -filter => "lanczos", -geometry => "3.125%", -quality => 85, "$path.jpg";
30 system "pngcrush", -m => 7, -reduce, "$path.png", "$path.png~";
31 rename "$path.png~", "$path.png";
32 }; 30 };
33 31
34 $arch ||= Storable::retrieve "$LIBDIR/archetypes.pst"; 32 $arch ||= Storable::retrieve "$LIBDIR/archetypes.pst";
35 my $meta = Storable::retrieve "$path.pst"; 33 my $meta = Storable::retrieve "$path.pst";
36 34
75 "-->\n</style>", 73 "-->\n</style>",
76 "</head>", 74 "</head>",
77 "<body>"; 75 "<body>";
78 76
79 print "<table id='nav'>", 77 print "<table id='nav'>",
80 "<tr><td rowspan='3'><span style='font-height: 20pt; font-style: bold;'>"; 78 "<tr><td rowspan='3'><h1>";
81 print "<a href='/'>/</a> "; 79 print "<a href='/'>/</a> ";
82 for (0 .. $#path - 1) { 80 for (0 .. $#path - 1) {
83 print "<a href='/", (join "/", @path[0..$_]), "/'>$path[$_]</a> / "; 81 print "<a href='/", (join "/", @path[0..$_]), "/'>$path[$_]</a> / ";
84 } 82 }
85 83
88 ? "<a href='$meta->{info}{\"tile_path_$_\"}.html'><img style='border: 2px solid blue;' src='$meta->{info}{\"tile_path_$_\"}.jpg'/></a>" 86 ? "<a href='$meta->{info}{\"tile_path_$_\"}.html'><img style='border: 2px solid blue;' src='$meta->{info}{\"tile_path_$_\"}.jpg'/></a>"
89 : "" 87 : ""
90 } 1..4; 88 } 1..4;
91 89
92 print "$path[-1] "; 90 print "$path[-1] ";
93 print "</span></td>", 91 print "</h1></td>",
94 "<td/><td>$tile[0]</td><td/></tr>", 92 "<td/><td>$tile[0]</td><td/></tr>",
95 "<tr><td>$tile[3]</td>"; 93 "<tr><td>$tile[3]</td>";
96 print "<td><img id='thumb' src='@path[-1].jpg'/></td>", 94 print "<td><img id='thumb' src='@path[-1].jpg'/></td>",
97 "<td>$tile[1]</td>", 95 "<td>$tile[1]</td>",
98 "<tr><td/><td>$tile[2]</td><td/></tr>"; 96 "<tr><td/><td>$tile[2]</td><td/></tr>";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines