X-Git-Url: http://git.shiar.nl/perl/schtarr.git/blobdiff_plain/0a557bf17404e1de43f7fdd5085a7612a781fdad..3cf62787f6c8f6d7a7972bc3f09e5e3ddc92447e:/scmap diff --git a/scmap b/scmap index e5a2798..f636b25 100755 --- a/scmap +++ b/scmap @@ -70,7 +70,7 @@ if (defined $mapsep{$SHOWMAP}) { if ($SHOWMAP eq "ppm") { use Imager; - my $img = Imager->new(xsize => $map->width * 4, ysize => $map->width * 4); + my $img = Imager->new(xsize => $map->width * 4, ysize => $map->height * 4); use Data::StarCraft::Tileset; my $era = world($map); @@ -89,11 +89,7 @@ if (defined $mapsep{$SHOWMAP}) { # 512x512 ~ 7s my $tile = $tileset->tile($_); - $img->setscanline( - x => $x*4, y => $y*4 + $_, pixels => pack('(CCCx)*', - map { @$_ } @{ $tile->{subcol} }[$_*4 .. $_*4 + 3] - ), - ) for 0..3; + $img->paste(src => $tile->{sprite}, left => $x*4, top => $y*4); # 4096x4096 ~ 75s # my $tile = $tileset->sprite($tileset->{map}->[$_]);