X-Git-Url: http://git.shiar.net/perl/schtarr.git/blobdiff_plain/57fafa2775781b86f0c6703853b0a8d0180d2f6b..11ca89eec765302e50eec7595b65382b04d16e6b:/scmap diff --git a/scmap b/scmap index 596a835..06b5ebe 100755 --- a/scmap +++ b/scmap @@ -49,7 +49,7 @@ sub world { my $self = shift; # ERA: 0 1 2 3 4 5 6 7 my @worlds = qw(badlands platform install ashworld jungle desert ice twilight); - return $worlds[$self->era] || "?"; + return $worlds[$self->era & 7] || "?"; } # MTXM TILE @@ -83,7 +83,13 @@ if (defined $mapsep{$SHOWMAP}) { my $tile = $tileset->tileavg($_); my $div = 1;#$tile->{walk} > 1 ? 1 : 1.8; my @rgb = map {int($_ / $div)} @{ $tile->{col} }; - if (($tile->{walk} & 1) == 0 and $tile->{walk} < 10) { + if ($tile->{walk} & 16) { + $rgb[1] += 48; # green for ramps + } + elsif ($tile->{walk} & 8) { + $rgb[0] = 255; # red for obstructions + } + elsif (($tile->{walk} & 1) == 0) { # $rgb[2] += 128; $rgb[0] *= 3; $rgb[1] *= 3; @@ -101,3 +107,15 @@ if (defined $mapsep{$SHOWMAP}) { } } +=head1 scmap + +From replay: + + old/screptomap somereplay.rep | ./scmap -m=ppm > map.ppm + +From map: + + ./scmtomap starcraft/maps/ladder/'(4)Lost Temple.scm' + ./scmap -m=ppm < file000001.xxx > map.ppm + +=cut