Rewrite find_ray to use precomputed cellrays.

During precomputation, we store the minimal cellrays by target and sort them according to niceness.

find_ray now simply picks the first non-blocked ray to a target, which means looping through the 10 or so minimal cellrays with that target – this should be a lot more efficient. (An extended findray test went from 150s to 40s (debug) and 40s to 26s (profile)).

The interface to find_ray has changed: cycle_dir=-1,0,1 was changed to cyle=false/true since we never cycle in the other direction anyway. find_shortest was removed: all rays to a target had the same length all along, but now we also return the straightest one automatically.

The change also eliminates the duplicate corner-cutting code between ray_def::advance and find_ray as imbalance calculation now relies on ray_def::advance.

Created by  Robert Vollmert  on October 16, 2009
DTLSPUE47XI4YC3QWKTBWJOWBU52GXPGXFEEBG374I4JAYVM7KZAC
Dependencies
In channels
main
Change contents