summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util/rotate-tile.pl
blob: 66a7b4fa354c97fcace8c03b1a6301b79544799a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env perl
use warnings;
use strict;

use File::Basename;

die "usage: $0 tile.png\n" unless @ARGV == 1;

my $TILE  = shift;

die "Couldn't find $TILE: $!\n" unless -f $TILE;

my %orient =
(
     90 => "w",
    180 => "n",
    270 => "e",
);

my ($name,$path) = fileparse($TILE, ".png");

for my $deg (90, 180, 270)
{
    print `convert -rotate $deg $TILE $path/${name}_$orient{$deg}.png\n`
        or die "$!\n";
}

rename $TILE, "$path/${name}_s.png";