summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/losparam.h
Commit message (Collapse)AuthorAgeFilesLines
* Make disintegration splatter not end up behind actors.Robert Vollmert2009-11-101-0/+10
| | | | | | | | Also not at actors' feet. Might be even nicer to have them thrown as missiles: You are hit by a piece of orc flesh. The giant bat is hit by a chunk of yak flesh. The giant bat dies.
* Get rid of los_param::appearance.Robert Vollmert2009-11-081-3/+0
| | | | | This is not required anymore since we just store bools in los_grid.
* Add opc_no_trans and use that for see_cell_no_trans.Robert Vollmert2009-11-081-1/+9
| | | | | | | | | The difference between no_trans and solid is whether granite statues are considered opaque. Granite statues are somewhat weird in that they behave completely differently from other statues: You can't shoot missiles at or past them, no items can be in their cell, etc.
* Replace bounds_func with circle_def.Robert Vollmert2009-11-081-43/+0
| | | | | | | The various LOS objects and functions now accept a circle_def instead of a bounds_func. This is a little less generic, but should eventually help with iterating over coordinates in any los_def.
* Remove debugging code from losparam.h.Robert Vollmert2009-11-081-12/+0
|
* Rewrite los_def to handle function parameters sensibly.Robert Vollmert2009-10-261-1/+25
| | | | | | | | | | | | | Previously, it was holding on to pointers to objects it didn't own, causing various bugs. los_def now copies the opacity_func and bounds_func parameters. Making them copyable required introducing opacity_func::clone(). Also implement los_def copy constructor and copy assignment operator. Finally, update travel exclusions and monster patrolling to these changes.
* Method alternatives to losparam operators.Robert Vollmert2009-10-251-0/+12
| | | | | | This adds variants bounds_func::call(p) of bounds_func::operator()(p) and similar which I know how to call from gdb.
* Replace monster_los by calls to losight.Robert Vollmert2009-10-171-2/+25
| | | | | | | | | los_param got a new opacity_monmove to help. The change compiles and the game runs, but I'm unsure how to test monster pathfinding. Please tell me if anything went wrong! Removes mon-los.{cc,h}, so I'm afraid I may have broken the non-Unix builds again.
* Clean up LOS precalculation settings.Robert Vollmert2009-10-171-3/+4
| | | | | | The maximal boundary within which losight/find_ray will work is now clearly defined at the start of los.cc. By default, it's the circle with radius LOS_MAX_RADIUS == LOS_RADIUS.
* Remove chain-lightning specific LOS test from beam.cc.Robert Vollmert2009-10-171-0/+1
| | | | | | There's now a spell-specific _lightning_los which may require some fine-tuning -- I'm not quite sure of the intention of the original check.
* Rewrite cell_see_cell using exists_ray.Robert Vollmert2009-10-161-3/+11
| | | | For this, add new opacity_func that disregards half-opaque things.
* Generalize find_ray to accept opacity_func and bounds_func parameters.Robert Vollmert2009-10-161-3/+5
|
* Get rid of los_param outside of los.cc/losparam.cc.Robert Vollmert2009-10-161-53/+41
| | | | | | | | | | | The nicer interface to losight is now void losight(env_show_grid& sh, const coord_def& center, const opacity_func &opc = opc_default, const bounds_func &bds = bds_default); bounds_func provides the LOS boundary (usually just a circle with radius the current LOS radius). opacity_func is a mapping of grid coordinates to opacity values.
* On the way to a simplified losight interface.Robert Vollmert2009-10-161-0/+6
| | | | | | | | | | Added a function void losight(env_show_grid& sh, const coord_def& center, opacity_func opc, bounds_func bounds) with sensible defaults for opc and bounds. It's not necessary to abstract away the geometry as I initially did with los_param.
* los: provide explicit access specifiers for inherited structsSteven Noonan2009-10-131-5/+5
| | | | Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Add whitespace fixes.David Lawrence Ramsey2009-10-121-1/+1
|
* Move losight radius check into los_param.Robert Vollmert2009-10-081-4/+5
|
* Split and correct grid_see_grid.Robert Vollmert2009-10-081-4/+11
| | | | | | | | | | | | | | | 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-16/+0
| | | | Also remove an obsoleted variant of grid_appearance.
* Convert remaining uses of losight to los_param-style.Robert Vollmert2009-10-081-0/+9
|
* Add los_param_permissive.Robert Vollmert2009-10-081-0/+9
| | | | This was intended for the arena; keeping as example or test case.
* A rewrite of losight() to allow future generalization.Robert Vollmert2009-10-081-0/+76
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.