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

Comparing cfmaps/cfmap2png (file contents):
Revision 1.6 by root, Fri Nov 18 12:50:24 2005 UTC vs.
Revision 1.9 by root, Sun Nov 20 01:05:34 2005 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2 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
19
3# tower of stars: missing craters? 20# tower of stars: missing craters?
21
22our $VERSION = '1.01';
4 23
5use strict; 24use strict;
6 25
7use Storable; 26use Storable;
8use List::Util qw(max); 27use List::Util qw(max);
9 28
10use Gtk2; 29use Gtk2;
11
12our $VERSION = '1.0';
13 30
14#init Gtk2::Gdk; 31#init Gtk2::Gdk;
15 32
16my $LIB = $ENV{CROSSFIRE_LIBDIR} 33my $LIB = $ENV{CROSSFIRE_LIBDIR}
17 or die "\$CROSSFIRE_LIBDIR must be set\n"; 34 or die "\$CROSSFIRE_LIBDIR must be set\n";
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) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines