summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/coordit.h
Commit message (Collapse)AuthorAgeFilesLines
* Don't crash when sanctuary shrinks near the map edgeNeil Moore2014-02-231-1/+2
| | | | | | | | | | See for example: http://crawl.lantea.net/crawl/morgue/letownia/crash-letownia-20140224-004021.txt Introduced by 0.14-a0-622-g0c137b5, which replaced radius_iterator with C_SQUARE by rectangle_iterator. Unfortunately, the latter did not clip the iterator to the map. Add a flag to do so: false by default because iterated rectangles are not always in map coordinates.
* Drop the now unused circle_iterator.Adam Borowski2013-12-021-15/+0
| | | | It turns out it was only an implementation detail of radius_iterator.
* Rewrite the radius_iterator.Adam Borowski2013-12-021-12/+9
| | | | | | | | | | No rectangle_iterator, no circle_iterator nor circle_def, no los_glob with an internal radius_iterator then los_base; not even a single multiplication inside a loop (although the last part is negligibly small compared to a typical user). And lookie at this such simple code. It is simple, without nothing naughty behind these macros, right? Right???
* Implement adjacent_iterator on its own, rather than via radius_iterator.Adam Borowski2013-11-251-4/+14
| | | | | | | | | | This hardly speeds up things, which I did not know as profile runs did not help to tell these two apart and it turns out adjacent_iterator is not that prominent... but hey, a 0.1% speedup for two pages of code might still be better committed than not. This speedup might disappear when I get around to the actual rewrite of radius_iterator, though.
* Regression tests for radius_iterator (w/o LOS checks).Adam Borowski2013-11-051-0/+3
|
* Get rid of the radius_iterator "legacy" constructor.Adam Borowski2013-11-051-9/+1
| | | | | | | | | | It was really weird: working on a square, but in almost all cases restricting it to your view (a circle). Note this is _your_ view rather than from the iterator's center -- which hasn't been used once in the obvious interesting way. As usual, this commit fixes a load of "act through glass" bugs, ando/or using los modes that don't make sense in the context.
* Squares are rectangles, not circles.Adam Borowski2013-11-051-1/+1
| | | | So use the correct iterator. No functional changes.
* Remove radius_iterator(coord, r, c_type, los_base).Adam Borowski2013-11-051-3/+2
|
* Remove radius_iterator(los_base).Adam Borowski2013-11-051-3/+0
|
* Update the whole arena.Adam Borowski2013-11-051-0/+1
| | | | It was the only user of non-standard get_los().
* Implement a prototype for a new version of radius_iterator.Adam Borowski2013-11-051-0/+6
| | | | | | | | | | | | | | During conversion, use the old code. My target will have only two types of functionality: * iterating over a circle of a given radius * as above, with a LOS check towards the center The current radius_iterator/circle_def/los_base tangle either takes a majority of CPU time or at least a sizeable chunk in profile runs, due to a bad case of OOP abuse in tight loops. This badly needs a rewrite. The ability to pass it a square or someone else's los can be done using a different iterator or checking los manually later, respectively.
* Added dgn_connect_adjacent_rooms LUA functioninfiniplex2013-04-261-0/+29
|
* More PURE, and introduce REALLYPURE as well.Samuel Bronson2013-03-241-20/+22
|
* Eliminate LOS checks from one of radius_iterators.Adam Borowski2012-11-181-2/+1
|
* Use std namespace.Raphael Langella2012-08-261-7/+4
| | | | | | | | | | | | | I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
* Typo.Raphael Langella2012-07-191-1/+1
|
* Don't let iterator++ return a value.Adam Borowski2011-05-241-4/+4
| | | | This is costly (the whole iterator is copied every time!) and we never use this.
* Give magic mapping an uniform shape.Adam Borowski2011-04-141-1/+1
| | | | | | | | | For the scroll, it makes no sense to not affect the whole map when you happen to stand just near an edge. Ashenzari and the mutation were fine. For decks and the ball, it makes no sense to see further diagonally.
* Add orth_adjacent_iterator, and use it instead of using radius_iterator ↵Vsevolod Kozlov2010-12-221-0/+8
| | | | directly.
* The Tornado spell, first stab.Adam Borowski2010-11-121-1/+1
| | | | | | | | There's no separate cloud type yet (I want greyish but not blocking LOS ones), and moving monsters/items is not implemented yet. Pushing so people can suggest an improvement to visual effects which suck currently.
* Fix max_radius in distance_iterator, rename it again, allow querying current ↵Adam Borowski2010-11-091-6/+7
| | | | radius.
* s/spiral_iterator/equidistant_iterator/g (dpeg)Adam Borowski2010-11-041-5/+5
|
* Give the spiral_iterator an argument, max_radius.Adam Borowski2010-10-311-2/+3
|
* A "spiral_iterator" that produces coords around a starting point.Adam Borowski2010-10-311-0/+28
| | | | | It's not an actual spiral; rather, squares at equal distances are returned in either a random or arbitrary order.
* Update actor::get_los to use global LOS.Robert Vollmert2010-03-221-5/+5
| | | | | | | | | | | | This is all not very nice. los_base is now an abstract base class for both los_def and los_glob (global LOS-backed los_def variant), and interators now take a *los_base. actor::update_los is gone. Arena LOS is quite probably broken again at the moment.
* Make Yred's gifts follow through stairways even if behind zombies.Johanna Ploog2010-01-311-1/+1
| | | | | | | | | | | | | | | Monsters that would qualify as followers but are incapable of using stairs now also get the MF_TAKING_STAIRS flag. In files.cc, _grab_follower_at() they get filtered out from transit, but this way followers not adjacent to the player, but connected via other allies can be considered anyway. Tested for Beogh and Yredelemnul, without problems. In practise this currently only matters for Yredelemnul if your gifted undead are not adjacent to you, but rather standing behind some zombies or skeletons. However, I am certain we'll find quickly other applications, too. :)
* Fix bug in adjacent_iterator.Robert Vollmert2009-11-131-1/+1
|
* Convert adjacent_iterator to new radius_iterator constructor.Robert Vollmert2009-11-131-3/+3
|
* Some radius_iterator documentation.Robert Vollmert2009-11-131-2/+14
|
* Reimplement radius_iterator on the basis of circle_def.Robert Vollmert2009-11-131-9/+31
|
* Move see_cell_no_trans into player.Robert Vollmert2009-11-081-6/+7
| | | | Also collect actor/player LOS code in actor-los.cc.
* Formatting.Robert Vollmert2009-11-081-2/+2
|
* Remove player.h dependency from coordit.h.Robert Vollmert2009-11-081-3/+1
| | | | | | | | | adjacent_iterator had a default center of you.pos(), which is now gone (also the uses of). I was running into circular header dependencies with actor.h including los_def.h including coordit.h including player.h including actor.h.
* Remove bidirectionality from radius_iterator.Robert Vollmert2009-11-031-5/+1
| | | | | This wasn't used anywhere and could easily be restored if required.
* Splitting up stuff.cc.Robert Vollmert2009-10-301-0/+62
New: colour.cc, coord.cc, coordit.cc, random.cc, rng.cc.