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

Comparing cfmaps/cfmap2png (file contents):
Revision 1.3 by root, Fri Nov 18 06:57:15 2005 UTC vs.
Revision 1.4 by root, Fri Nov 18 12:04:12 2005 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2 2
3# bugs: http://cfmaps.schmorp.de/brest/apartments/brest_town_house.html <- walls
4# whaling... icecaves... water is red?
5# tower of stars: missing craters? 3# tower of stars: missing craters?
6# http://cfmaps.schmorp.de/pup_land/raffle/raffle3_u2.html <-> yellow "doors" show as grey stone as surrounding
7 4
8use strict; 5use strict;
9 6
10use Storable; 7use Storable;
11use List::Util qw(max); 8use List::Util qw(max);
12 9
13use Gtk2; 10use Gtk2;
11
12our $VERSION = '1.0';
14 13
15#init Gtk2::Gdk; 14#init Gtk2::Gdk;
16 15
17my $LIB = $ENV{CROSSFIRE_LIBDIR} 16my $LIB = $ENV{CROSSFIRE_LIBDIR}
18 or die "\$CROSSFIRE_LIBDIR must be set\n"; 17 or die "\$CROSSFIRE_LIBDIR must be set\n";
86 s/\s+$//; 85 s/\s+$//;
87 if (/^end$/i) { 86 if (/^end$/i) {
88 last; 87 last;
89 } elsif (/^arch (\S+)$/) { 88 } elsif (/^arch (\S+)$/) {
90 push @{ $arc{inventory} }, $parse_block->(_name => $1); 89 push @{ $arc{inventory} }, $parse_block->(_name => $1);
90 } elsif (/^lore$/) {
91 while (<$fh>) {
92 last if /^endlore\s*$/i;
93 $arc{lore} .= $_;
94 }
91 } elsif (/^msg$/) { 95 } elsif (/^msg$/) {
92 while (<$fh>) { 96 while (<$fh>) {
93 last if /^endmsg\s*$/i; 97 last if /^endmsg\s*$/i;
94 $arc{msg} .= $_; 98 $arc{msg} .= $_;
95 } 99 }
111 $more = $prev; 115 $more = $prev;
112 } elsif (/^object (\S+)$/i) { 116 } elsif (/^object (\S+)$/i) {
113 my $name = $1; 117 my $name = $1;
114 my $arc = $parse_block->(_name => $name); 118 my $arc = $parse_block->(_name => $name);
115 119
120 if ($more) {
121 $more->{more} = $arc;
122 } else {
116 $arc{$name} = $arc; 123 $arc{$name} = $arc;
117 $more->{more} = $arc if $more; 124 }
118 125
119 $prev = $arc; 126 $prev = $arc;
120 $more = undef; 127 $more = undef;
121 } elsif (/^arch (\S+)$/i) { 128 } elsif (/^arch (\S+)$/i) {
122 push @{ $arc{arch} }, $parse_block->(_name => $1); 129 push @{ $arc{arch} }, $parse_block->(_name => $1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines