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

Comparing cfmaps/cfworldmap (file contents):
Revision 1.1 by root, Tue Nov 22 17:20:21 2005 UTC vs.
Revision 1.8 by root, Thu Oct 22 03:02:00 2009 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2 2
3# cfworldmap - create a crossfire world map 3# cfworldmap - create a deliantra world map
4# Copyright (C) 2005 Marc Lehmann <gvpe@schmorp.de> 4# Copyright (C) 2005,2007,2008 Marc Lehmann <cfmaps@schmorp.de>
5# 5#
6# CFARCH2HTML is free software; you can redistribute it and/or modify 6# CFARCH2HTML is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by 7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or 8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version. 9# (at your option) any later version.
15# 15#
16# You should have received a copy of the GNU General Public License 16# You should have received a copy of the GNU General Public License
17# along with gvpe; if not, write to the Free Software 17# along with gvpe; if not, write to the Free Software
18# Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18# Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
20our $VERSION = '1.03'; 20our $VERSION = '1.032';
21 21
22use Storable; 22use Storable;
23 23
24my $T = 50; 24my $T = 50;
25 25
26my @W = (100..129); 26my @W = (100..129);
27my @H = (100..129); 27my @H = (100..129);
28 28
29my $DIR = $ARGV[0] || "world";
30my $BASE = $DIR;
31
29open my $fh, ">:utf8", "world/index.xhtml" 32open my $fh, ">:utf8", "$DIR/index.xhtml"
30 or die "index.xhtml: $!"; 33 or die "index.xhtml: $!";
31 34
32select $fh; 35select $fh;
33 36
34print "<?xml version='1.0' encoding='utf-8'?>", 37print "<?xml version='1.0' encoding='utf-8'?>",
38 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
35 "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>", 39 "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>",
36 "<head>", 40 "<head>",
37 "<title>Crossfire Worldmap</title>", 41 "<title>Deliantra Worldmap</title>",
38 "<link rel='stylesheet' type='text/css' media='all' href='/common.css'/>\n", 42 "<link rel='stylesheet' type='text/css' media='all' href='/common.css'/>\n",
39 "</head>", 43 "</head>",
40 "<body><h1>Crossfire Worldmap</h1><table class='tilemap'>"; 44 "<body><h1>Deliantra Worldmap</h1><table class='tilemap'>";
41 45
42for my $y (@H) { 46for my $y (@H) {
43 print "<tr>"; 47 print "<tr>";
44 for my $x (@W) { 48 for my $x (@W) {
45 print "<td><a href='world_$x\_$y.xhtml'><img src='world_$x\_$y.jpg'/></a></td>"; 49 print "<td><a href='${BASE}_$x\_$y.xhtml'><img src='${BASE}_$x\_$y.jpg'/></a></td>";
46 } 50 }
47 print "</tr>"; 51 print "</tr>";
48} 52}
49 53
50print "</table><p class='footer'>created by <a href='http://software.schmorp.de/#crossfire'>cfworldmap</a> version $VERSION</p></body></html>"; 54print "</table><p class='footer'>created by <a href='http://software.schmorp.de/pkg/cfmaps'>cfworldmap</a> version $VERSION</p></body></html>";
51 55
52close $fh; 56close $fh;
53 57
54system "gzip", "-7f", "world/index.xhtml"; 58#system "gzip", "-7f", "$DIR/index.xhtml";
55 59

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines