| 1 |
root |
1.1 |
#!/opt/bin/perl |
| 2 |
|
|
|
| 3 |
|
|
# cfworldmap - create a crossfire world map |
| 4 |
|
|
# Copyright (C) 2005 Marc Lehmann <gvpe@schmorp.de> |
| 5 |
|
|
# |
| 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 |
|
|
our $VERSION = '1.03'; |
| 21 |
|
|
|
| 22 |
|
|
use Storable; |
| 23 |
|
|
|
| 24 |
|
|
my $T = 50; |
| 25 |
|
|
|
| 26 |
|
|
my @W = (100..129); |
| 27 |
|
|
my @H = (100..129); |
| 28 |
|
|
|
| 29 |
|
|
open my $fh, ">:utf8", "world/index.xhtml" |
| 30 |
|
|
or die "index.xhtml: $!"; |
| 31 |
|
|
|
| 32 |
|
|
select $fh; |
| 33 |
|
|
|
| 34 |
|
|
print "<?xml version='1.0' encoding='utf-8'?>", |
| 35 |
|
|
"<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>", |
| 36 |
|
|
"<head>", |
| 37 |
|
|
"<title>Crossfire Worldmap</title>", |
| 38 |
|
|
"<link rel='stylesheet' type='text/css' media='all' href='/common.css'/>\n", |
| 39 |
|
|
"</head>", |
| 40 |
|
|
"<body><h1>Crossfire Worldmap</h1><table class='tilemap'>"; |
| 41 |
|
|
|
| 42 |
|
|
for my $y (@H) { |
| 43 |
|
|
print "<tr>"; |
| 44 |
|
|
for my $x (@W) { |
| 45 |
|
|
print "<td><a href='world_$x\_$y.xhtml'><img src='world_$x\_$y.jpg'/></a></td>"; |
| 46 |
|
|
} |
| 47 |
|
|
print "</tr>"; |
| 48 |
|
|
} |
| 49 |
|
|
|
| 50 |
|
|
print "</table><p class='footer'>created by <a href='http://software.schmorp.de/#crossfire'>cfworldmap</a> version $VERSION</p></body></html>"; |
| 51 |
|
|
|
| 52 |
|
|
close $fh; |
| 53 |
|
|
|
| 54 |
|
|
system "gzip", "-7f", "world/index.xhtml"; |
| 55 |
|
|
|