diff options
Diffstat (limited to 'renderlevels.pl')
-rw-r--r-- | renderlevels.pl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/renderlevels.pl b/renderlevels.pl index 8d0140c..e967991 100644 --- a/renderlevels.pl +++ b/renderlevels.pl @@ -8,6 +8,9 @@ $verbose = 0; # 0 = quiet, 2 = very chatty +$black_is_white = 0; # 1 = draw all-black shapes in white. only affects + # level09.png (the bombs are invisible there). + use Image::Magick; use bytes; @@ -35,6 +38,13 @@ sub getdelta { sub draw { my ($img, $shape, $dx, $dy, $xpos, $ypos, $copies) = @_; warn sprintf "drawing shape %04x at $xpos, $ypos, $copies copies, delta ($dx, $dy)\n", $shape if $verbose > 1; + my $white = 0; + if($black_is_white && ($shape == 0x9c89 || $shape == 0x9ceb || $shape == 0x9c49)) { + warn "drawing all-black shape in white\n"; + $white = 1; + #$shape = 0x9c89; # see the other black shapes in level09.png + #$shape = 0x9ceb; + } while($copies--) { my $width; my $addr = $shape; @@ -44,6 +54,9 @@ sub draw { for(my $p = 0; $p < $width; $p++) { my $pixel = getbyte($addr++); my $color = $palette{$pixel}; + if($white) { + $color = [ 0xffff, 0xffff, 0xffff]; # make invisible stuff show up white + } $img->SetPixel(x => $xpos + $xoffs + $p, y => $ypos + $yoffs, color => $color); } } |