summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/losparam.cc
Commit message (Collapse)AuthorAgeFilesLines
* Use grid_appearance instead of env.grid for LOS calculation.Robert Vollmert2009-11-111-1/+3
| | | | | Previously, undetected secret doors in clear rock walls were blocking LOS. Now they don't but do once you detect them...
* Remove a few obsolete includes.Robert Vollmert2009-11-101-1/+0
| | | | Also add a few previously indirect includes.
* Make disintegration splatter not end up behind actors.Robert Vollmert2009-11-101-0/+8
| | | | | | | | 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.
* Add opc_no_trans and use that for see_cell_no_trans.Robert Vollmert2009-11-081-1/+17
| | | | | | | | | 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-12/+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 an unnecessary header env.h include.Robert Vollmert2009-11-081-0/+1
|
* Make many checks for monster (non)existence on squares use monster_at().David Lawrence Ramsey2009-11-051-4/+3
| | | | | | | Not all are changed yet, as there are several index checks still needed for debugging purposes. Also, make many checks for player/monster (non)existence use actor_at().
* Clean up some unused #includesAdam Borowski2009-10-221-1/+0
|
* versioning: remove SVN-specific revision data, add Git versioningSteven Noonan2009-10-181-1/+0
| | | | Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Replace monster_los by calls to losight.Robert Vollmert2009-10-171-0/+9
| | | | | | | | | 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.
* Make default LOS configurable.Robert Vollmert2009-10-171-1/+1
| | | | | | Setting LOS_RADIUS in defines.h now works. Fixed a couple of things to allow this, including an apparent off-by-one error in crawl_view -- not quite sure this doesn't break anything.
* Clean up LOS precalculation settings.Robert Vollmert2009-10-171-1/+1
| | | | | | 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.
* Naming consistency.Robert Vollmert2009-10-171-3/+3
| | | | | Mostly rename functions from terrain.h that accept features of typ dgn_feature_type from grid_is_* to feat_is_*.
* Rewrite cell_see_cell using exists_ray.Robert Vollmert2009-10-161-0/+8
| | | | For this, add new opacity_func that disregards half-opaque things.
* Get rid of los_param outside of los.cc/losparam.cc.Robert Vollmert2009-10-161-99/+14
| | | | | | | | | | | 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/+20
| | | | | | | | | | 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.
* Merge branch 'trees'.Adam Borowski2009-10-131-0/+5
|\ | | | | | | | | There's still the issue of glyph choice, and cutting them down with an axe is not coded yet.
| * Fix an use of uninitialized menv[].Adam Borowski2009-10-121-1/+1
| |
| * Bushes -- tree-like monsters than can be destroyed with any means of damage,Adam Borowski2009-10-121-0/+3
| | | | | | | | and are much easier to set on fire than trees.
| * Trees -- a new wall type, can be seen through (2nd square blocks LOS).Adam Borowski2009-10-091-0/+2
| | | | | | | | | | Available as 't' for vault builders. Can be ignited using wands of fire, but the fire can't be controlled.
* | Add whitespace fixes.David Lawrence Ramsey2009-10-121-1/+1
|/
* Move losight radius check into los_param.Robert Vollmert2009-10-081-3/+4
|
* Split and correct grid_see_grid.Robert Vollmert2009-10-081-4/+21
| | | | | | | | | | | | | | | 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-31/+0
| | | | Also remove an obsoleted variant of grid_appearance.
* Convert remaining uses of losight to los_param-style.Robert Vollmert2009-10-081-0/+19
|
* Add los_param_permissive.Robert Vollmert2009-10-081-0/+27
| | | | 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/+88
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.