95 |
|
|
96 |
print "final map size: $x_size x $y_size from $x_tiles x $y_tiles tiles\n"; |
print "final map size: $x_size x $y_size from $x_tiles x $y_tiles tiles\n"; |
97 |
|
|
98 |
my $map = Imager->new( xsize => $x_size, ysize => $y_size ); |
my $map = Imager->new( xsize => $x_size, ysize => $y_size ) or $img->errstr(); |
99 |
|
|
100 |
foreach my $tile_file ( @files ) { |
foreach my $tile_file ( @files ) { |
101 |
$img->read( file => "$path/$tile_file" ) or die $img->errstr(); |
$img->read( file => "$path/$tile_file" ) or die $img->errstr(); |
113 |
); |
); |
114 |
} |
} |
115 |
|
|
116 |
$map->write( file => 'dump.png' ) or die $img->errstr(); |
$path =~ s/\W+/_/g; |
117 |
|
$path =~ s/^_+//; |
118 |
|
$path =~ s/_+$//; |
119 |
|
|
120 |
|
$map->write( file => "$path.png" ) or die $img->errstr(); |