git.shiar.nl
/
perl
/
schtarr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
scmap: correct tileset detection
[perl/schtarr.git]
/
Data-StarCraft
/
lib
/
Data
/
StarCraft
/
Tileset.pm
diff --git
a/Data-StarCraft/lib/Data/StarCraft/Tileset.pm
b/Data-StarCraft/lib/Data/StarCraft/Tileset.pm
index 891c12b93c5ae96f48792f06ae6b27ea17f81018..f1fcd3e2ce0182c404b220b594dcdb49cefe63a4 100644
(file)
--- a/
Data-StarCraft/lib/Data/StarCraft/Tileset.pm
+++ b/
Data-StarCraft/lib/Data/StarCraft/Tileset.pm
@@
-169,7
+169,9
@@
sub tileavg {
$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;