From 605710e6364f9256d6b3bf8b6370083a571e3330 Mon Sep 17 00:00:00 2001 From: Shiar Date: Sat, 12 Jul 2008 00:35:05 +0200 Subject: [PATCH] improve scmap color coding to tile function 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scmap b/scmap index 5167e01..28ade8c 100755 --- 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; -- 2.30.0