/[maps]/stich.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /stich.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3 by dpavlin, Mon Oct 15 21:15:26 2007 UTC revision 4 by dpavlin, Mon Oct 15 21:57:50 2007 UTC
# Line 95  my $y_size = $y_tiles * $tile_size->{y}; Line 95  my $y_size = $y_tiles * $tile_size->{y};
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();
# Line 113  foreach my $tile_file ( @files ) { Line 113  foreach my $tile_file ( @files ) {
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();

Legend:
Removed from v.3  
changed lines
  Added in v.4

  ViewVC Help
Powered by ViewVC 1.1.26