aboutsummaryrefslogtreecommitdiff
path: root/renderlevels.pl
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-09-05 05:16:16 -0400
committerB. Watson <yalhcru@gmail.com>2016-09-05 05:16:16 -0400
commitdbd902a52a742563abac281778c92b5ef5ccd4c7 (patch)
tree81c52944756d64f6bae5edba623ffff7bf38c8f9 /renderlevels.pl
parenteb9c8f2cf6d47c2495f36aeef638a4e1d2c35f4b (diff)
downloadjumpmanjr-dbd902a52a742563abac281778c92b5ef5ccd4c7.tar.gz
now I know what the all-black shapes are
Diffstat (limited to 'renderlevels.pl')
-rw-r--r--renderlevels.pl13
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);
}
}