improve scmap color coding to tile function
authorShiar <shiar@shiar.org>
Fri, 11 Jul 2008 22:35:05 +0000 (00:35 +0200)
committerShiar <shiar@shiar.org>
Sun, 20 Jul 2008 11:35:57 +0000 (13:35 +0200)
Figure out some specific bitmask values of Data::StarCraft::Tileset
->tileavg->{walk} (besides for &1 for obvious walkability, and ignoring
anything above the random pick of 10).

Ramps (height transfers) are always &16 at some point, so mark those
with green because they're usually very significant control points.

&2 and 4 seem to indicate ground level.  Not highlighted yet because
tile color usually gives a good clue already.  Maybe a special mode
later.

&8 appears to be high level, but never for ground, but only sole objects
like statues (blocking vision?). Don't know what to do with those
exactly, but set a bright red color for now to identify them.

scmap

diff --git a/scmap b/scmap
index 5167e01484b48202cf1178361035c8b4657d7d5e..28ade8c9a0945d22353816ac28a8f969c89d4586 100755 (executable)
--- a/scmap
+++ b/scmap
@@ -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;