-our $app_rect = SDL::Rect->new( -x => 0, -y => 0, -width => $w, -height => $h );
-$mask->blit( $mask->rect, $app, $app_rect );
-
-my @landing;
-
-my $mask_step = 10;
-
-my $y = 0;
-foreach ( 0 .. $mask->height / $mask_step ) {
- printf "%3d: ", $_;
- my $x = 0;
- foreach ( 0 .. $mask->width / $mask_step ) {
- my $col = $mask->pixel( $x, $y );
- my $nr = 0;
- $nr += 4 if $col->r;
- $nr += 2 if $col->g;
- $nr += 1 if $col->b;
- $landing[$nr] = [ $x, $y ] unless defined $landing[$nr];
- printf "%02x%02x%02x:%d ", $col->r, $col->g, $col->b, $nr;
- $x += $mask_step;
+our @masks;
+our @landings;
+foreach my $path ( glob 'artwork/world1/*mask*.png' ) {
+
+ warn "mask $path ", -s $path, " bytes\n";
+
+ my $mask = SDL::Surface->new(
+ -name => $path,
+ -depth => 24,
+ );
+ push @masks, $mask;
+
+ $mask->blit( $mask->rect, $app );
+ $app->sync;
+
+ my @landing;
+ my $mask_step = 10;
+
+ my $y = 0;
+ foreach ( 0 .. $mask->height / $mask_step ) {
+ printf "%3d: ", $_;
+ my $x = 0;
+ foreach ( 0 .. $mask->width / $mask_step ) {
+ my $col = $mask->pixel( $x, $y );
+ my $nr = 0;
+ $nr += 4 if $col->r;
+ $nr += 2 if $col->g;
+ $nr += 1 if $col->b;
+ $landing[$nr] = [ $x, $y ] unless defined $landing[$nr];
+ printf "%02x%02x%02x:%d ", $col->r, $col->g, $col->b, $nr;
+ $x += $mask_step;
+ }
+ print "\n";
+ $y += $mask_step;