1 | #!/opt/bin/perl |
1 | #!/opt/bin/perl |
|
|
2 | |
|
|
3 | # cfarch2png - convert crossfire maps to png+metadata |
|
|
4 | # Copyright (C) 2005 Marc Lehmann <gvpe@schmorp.de> |
|
|
5 | # |
|
|
6 | # CFARCH2PNG 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 |
2 | |
19 | |
3 | # tower of stars: missing craters? |
20 | # tower of stars: missing craters? |
4 | |
21 | |
5 | use strict; |
22 | use strict; |
6 | |
23 | |
… | |
… | |
262 | } |
279 | } |
263 | } |
280 | } |
264 | |
281 | |
265 | my $map_pb = new Gtk2::Gdk::Pixbuf "rgb", 1, 8, $mapx * T, $mapy * T |
282 | my $map_pb = new Gtk2::Gdk::Pixbuf "rgb", 1, 8, $mapx * T, $mapy * T |
266 | or die; |
283 | or die; |
267 | $map_pb->fill (0x00000000); |
284 | $map_pb->fill (0xffffff00); |
268 | |
285 | |
269 | # second pass, render all the stuff |
286 | # second pass, render all the stuff |
270 | for my $level (sort { $a <=> $b } keys %draw_info) { |
287 | for my $level (sort { $a <=> $b } keys %draw_info) { |
271 | my $v = $draw_info{$level}; |
288 | my $v = $draw_info{$level}; |
272 | while (my ($sface, $info) = each %$v) { |
289 | while (my ($sface, $info) = each %$v) { |