Tilly's code is missing a few \s and ${}s to be able to work.
Also, thank you, the counter for the tile actually got it down to .046 over the .048 from GF. :)
As for storing it linearly ... Honestly i don't think it's worth the effort. This stuff is already difficult enough to understand and keep in my mind as it is and i'm not *that* desperate for performance. ^^
If you're curious, here's a
flow diagram.
*Update*: These things actually reduced performance:
my $rx = $bxScaled[$x];
my $ry = $byScaled[$y];
I guess the simple additions there are faster than array lookups.