summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/los.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove fallback calculation from find_ray.Robert Vollmert2009-10-151-30/+18
| | | | | | | | | | There is now a separate fallback_ray() that needs to be called explicitly. I've manually converted uses of find_ray with allow_fallback == true. find_ray with allow_fallback set always returned true, yet there were a number of places that used the return value, in particular in directn.cc. I'll check these later.
* Log find_ray fallback in debug mode.Robert Vollmert2009-10-151-0/+7
|
* Further find_ray simplification.Robert Vollmert2009-10-151-31/+17
| | | | | Ray length doesn't actually need to be computed; confirmed by the assert introduced in the previous commit not triggering.
* Assert invariant in find_ray.Robert Vollmert2009-10-151-0/+6
|
* Fix beams not being show when targetting.Robert Vollmert2009-10-141-1/+4
| | | | | This was because directn.cc silently assumes find_ray returns true when source == target...
* Replace quadrants by signs.Robert Vollmert2009-10-141-14/+9
|
* Clean up.Robert Vollmert2009-10-141-1/+1
| | | | Made some functions "static" and improved quadrant flipping.
* Split find_ray into positive quadrant part.Robert Vollmert2009-10-141-36/+66
| | | | | This is a working but temporary state, eventually to be integrated with los_params or something derived.
* Fix bug with find_ray always falling back.Robert Vollmert2009-10-141-3/+3
| | | | | | | This was caused by an incorrectly inverted test. Also update the find_ray binding so the findray test would have found the bug.
* Some find_ray cleanup.Robert Vollmert2009-10-141-79/+75
|
* Fix bug in find_ray that made 'f' targetting pass through walls.Robert Vollmert2009-10-131-3/+2
|
* Move imbalance calculation into separate function.Robert Vollmert2009-10-131-28/+34
|
* Rewrite cellray comparison; parametrize precomputations.Robert Vollmert2009-10-131-44/+49
| | | | | | | | There are now defines LOS_MAX_ANGLE and LOS_INTERCEPT_MULT that determine what rays are cast in the precomputation. Current values should be the minimal correct ones. Also check subray relationship both directions at once.
* Improved detection of duplicate cellrays.Robert Vollmert2009-10-131-45/+83
| | | | | | | | | | | Before Cellrays: 3709 Fullrays: 399 Compressed: 441 After Cellrays: 3709 Fullrays: 399 Minimal cellrays: 266 Slight speed up in both precomputation and LOS computation: before after all los tests 14s 12s just los_maps test 1.7s 1.5s
* More explanation and some renames.Robert Vollmert2009-10-131-56/+48
|
* Introductory definitions and explanation.Robert Vollmert2009-10-131-6/+40
|
* Convert LOS code to iterate through quadrants with iterator.Robert Vollmert2009-10-131-38/+44
|
* los: provide explicit access specifiers for inherited structsSteven Noonan2009-10-131-1/+1
| | | | Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Fix complete LOS failure.Robert Vollmert2009-10-121-0/+1
| | | | Rays weren't actually being registered; no idea how this got through.
* Fix debug compile.Robert Vollmert2009-10-121-1/+1
|
* Further cleanup of los.cc.Robert Vollmert2009-10-111-94/+104
| | | | | | Don't store ray lengths in a second array, instead store them in the rays. Also store their starting index, which makes the ray_coords indexing a little cleaner.
* Make advance direction and quadrants explicit as enums.Robert Vollmert2009-10-111-5/+5
|
* Move _find_next_intercept into ray_def.Robert Vollmert2009-10-111-1/+1
|
* Convert LOS algorithm to use coord_def instead of separate x,y.Robert Vollmert2009-10-111-48/+30
|
* Further cleanup by converting to bit_array.Robert Vollmert2009-10-101-68/+33
|
* Cleanup of raycasting code.Robert Vollmert2009-10-101-75/+63
| | | | | | | Notably, the 3D bit arrays are now recognizable as such. Also various formatting fixes, and removed some "unsigned"'s that were cluttering up the code.
* More comments and formatting.Robert Vollmert2009-10-101-9/+25
|
* Comment.Robert Vollmert2009-10-101-0/+2
|
* Remove unused return value from _register_ray.Robert Vollmert2009-10-101-5/+2
|
* Formatting.Robert Vollmert2009-10-101-19/+19
|
* Move shoot_ray into ray_def.Robert Vollmert2009-10-101-7/+7
|
* Remove a lot of unneccessary includes.Robert Vollmert2009-10-091-1/+0
| | | | | | | The console version still compiles on Linux; both console and tiles version compile in OS X. I haven't been able to test the DOS and Windows compiles -- please fix or tell me about any errors that show up.
* Initialize ray.full_idx to -1 and remove outdated(?) valgrind intialization ↵Robert Vollmert2009-10-091-3/+1
| | | | lines.
* Move losight radius check into los_param.Robert Vollmert2009-10-081-4/+2
|
* Move can_go_straight from los.cc to monstuff.cc.Robert Vollmert2009-10-081-19/+0
|
* Split and correct grid_see_grid.Robert Vollmert2009-10-081-9/+19
| | | | | | | | | | | | | | | There's now cell_see_cell which tests for visibility correctly, albeit slowly. That's only used for placing features in the abyss currently, but needs to be improved if it gets used more. The second function used in monster movement was left as is, but renamed to can_go_straight. This remains unreliable but probably serves its purpose. The grid_see_grid test is adapted to cell_see_cell; the grid_see_grid lua binding is now actually useful. Also reduce the number of tests in los_csc and los_symm.
* Remove legacy losight() function.Robert Vollmert2009-10-081-7/+0
| | | | Also remove an obsoleted variant of grid_appearance.
* Convert remaining uses of losight to los_param-style.Robert Vollmert2009-10-081-2/+2
|
* A rewrite of losight() to allow future generalization.Robert Vollmert2009-10-081-92/+87
| | | | | | | | | | | | | Parameters relevant to the LOS calculation are now passed as an object los_param that takes care of coordinate translation, bounds checking, opacity of cells and what is written to the output array. A check for in_bounds was changed to map_bounds for simlicity; this should not have any effect. Special casing for arena was removed from losight; instead calc_show_los now calls the new losight_permissive.
* Fix compilation.David Lawrence Ramsey2009-10-081-0/+1
|
* Split LOS code from view.cc.Robert Vollmert2009-10-081-0/+908
los.cc: basic raycasting algorithm; losight(), see_grid() etc. ray.cc: ray_def implementation. mon-los.cc: monster_los This includes adding a bunch of #includes; there's probably some obsolete includes of view.h now.