ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cfmaps/cfworldmap
Revision: 1.8
Committed: Thu Oct 22 03:02:00 2009 UTC (14 years, 7 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +3 -2 lines
Log Message:
better error reporting, cf-extended hacks

File Contents

# User Rev Content
1 root 1.1 #!/opt/bin/perl
2    
3 root 1.7 # cfworldmap - create a deliantra world map
4     # Copyright (C) 2005,2007,2008 Marc Lehmann <cfmaps@schmorp.de>
5 root 1.1 #
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
8     # the Free Software Foundation; either version 2 of the License, or
9     # (at your option) any later version.
10     #
11     # This program is distributed in the hope that it will be useful,
12     # but WITHOUT ANY WARRANTY; without even the implied warranty of
13     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     # GNU General Public License for more details.
15     #
16     # You should have received a copy of the GNU General Public License
17     # along with gvpe; if not, write to the Free Software
18     # Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19    
20 root 1.5 our $VERSION = '1.032';
21 root 1.1
22     use Storable;
23    
24     my $T = 50;
25    
26     my @W = (100..129);
27     my @H = (100..129);
28    
29 root 1.8 my $DIR = $ARGV[0] || "world";
30     my $BASE = $DIR;
31 root 1.4
32     open my $fh, ">:utf8", "$DIR/index.xhtml"
33 root 1.1 or die "index.xhtml: $!";
34    
35     select $fh;
36    
37     print "<?xml version='1.0' encoding='utf-8'?>",
38 root 1.2 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
39 root 1.1 "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>",
40     "<head>",
41 root 1.6 "<title>Deliantra Worldmap</title>",
42 root 1.1 "<link rel='stylesheet' type='text/css' media='all' href='/common.css'/>\n",
43     "</head>",
44 root 1.6 "<body><h1>Deliantra Worldmap</h1><table class='tilemap'>";
45 root 1.1
46     for my $y (@H) {
47     print "<tr>";
48     for my $x (@W) {
49 root 1.8 print "<td><a href='${BASE}_$x\_$y.xhtml'><img src='${BASE}_$x\_$y.jpg'/></a></td>";
50 root 1.1 }
51     print "</tr>";
52     }
53    
54 root 1.5 print "</table><p class='footer'>created by <a href='http://software.schmorp.de/pkg/cfmaps'>cfworldmap</a> version $VERSION</p></body></html>";
55 root 1.1
56     close $fh;
57    
58 root 1.4 #system "gzip", "-7f", "$DIR/index.xhtml";
59 root 1.1