summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2afdd90)
Split out summation of each color channel, similar to col().
This is quite significant (can easily save over a second to run for all
tiles in a map).
$info->{walk} = sum(@{ $tile->{subtype} }) >> 4;
my @rgb;
for my $subcol (@{ $tile->{subcol} }) {
$info->{walk} = sum(@{ $tile->{subtype} }) >> 4;
my @rgb;
for my $subcol (@{ $tile->{subcol} }) {
- $rgb[$_] += $subcol->[$_] for 0 .. 2;
+ $rgb[0] += $subcol->[0];
+ $rgb[1] += $subcol->[1]; # seperate for speed
+ $rgb[2] += $subcol->[2];
}
$info->{col} = [ map {$_ >> 4} @rgb ];
return $info;
}
$info->{col} = [ map {$_ >> 4} @rgb ];
return $info;