#!/usr/bin/perl

my %dir = ("gnome-1-foot" => "throbber-1",
	   "gnome-2-foot" => "throbber-2",
	   "gnome-2-foot-b" => "throbber-2-b");

print keys(%dir);

foreach my $loop ("gnome-1-foot", "gnome-2-foot", "gnome-2-foot-b") {
  my $dir = $dir{$loop};
  print "Dir: $dir\n";
  my $foot = "${loop}.png";
  my $shadow =
    sub {
      my ($n) = @_;
      return (15 * $n) % 90;
    };
  
  foreach my $n (1 .. 6) {
    print "making 00$n from shadow-" .
      $shadow->($n) . "deg.png\n";
    system("composite",
	   $foot,
	   "shadow-".$shadow->($n)."deg.png",
	   "$dir/00$n.png");
  }
  
  system("cp", "$dir/006.png", "$dir/rest.png");
}
